PHP Kod:
////////// ////////// /////////// * CSAilesi.com Forum Kullanicisi *
// // // // * Berk Tarafindan Codlanip Paylsldı *
// ////////// /////////// * Eklentiyi Satmak YASAKTIR *
// // // // * www.csailesi.com Paylaşım Platfor *
// // // // * Sattığınız Anda Cezai İşlem *
////////// ////////// // // * Uygulanacaktır Emeğe Saygı Lütfen *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <hlsdk_const>
#include <fakemeta>
#include <fun>
#include <engine>
#include <nvault>
#define PLUGIN "Adi Sey"
#define VERSION "v1.0"
#define AUTHOR "Berk"
#define TAG "Berk"
new const yasakli_semboller[][] = {
"@",
"*",
"/",
"%",
",",
".",
"ü",
"?",
"+"
}
new g_BILGI[ 33 ]
new BILGI;
new szIp[22];
new g_login, g_register , g_vault,g_szName[33][32];
new g_username[ 33 ][ 50 ], k_username[ 33 ][ 50 ], sifre[ 33 ][ 50 ], g_sifre[ 33 ][ 50 ],username[ 33 ][ 50], k_sifre[ 33 ][ 50 ];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd( "KullaniciAdi_Sec", "user_name2" );
register_clcmd( "Sifre_Yaz", "sifre_sec" );
register_clcmd( "Kullanici_Adi", "user_name" );
register_clcmd( "Sifreni_Gir", "sifrexd" );
register_clcmd("say /kayitol","CSA_BilgiVer")
register_clcmd("say /hesap","CSA_BilgiVer")
}
public client_connect(id)
{
for( new i; i < BILGI; i++ )
{
g_BILGI[ id ][ i ] = 0
}
}
public client_disconnected(id)
{
kaydet( id )
set_task(0.5,"sifirla",id)
}
public CSA_BilgiVer( id ) {
new menu, Menuz[512]
if( equali( username[ id ], "" ) )
{
formatex(Menuz, charsmax(Menuz), "\y(\wOM\y)\rMetot Seciniz^n\y[\wKAYITLI DEGIL\y]")
}
else
{
formatex(Menuz, charsmax(Menuz), "\y(\wOM\y)\rPanelim^n\y[\wKAYITLI\y]")
}
get_user_ip(id, szIp, charsmax(szIp), 0);
menu = menu_create(Menuz, "CSA_BilgiVer_devam")
if( equali( username[ id ], "" ) )
{
formatex(Menuz, charsmax(Menuz), "\wGiris Yap")
menu_additem(menu, Menuz, "23", 0)
formatex(Menuz, charsmax(Menuz), "\wKayit OL^nHesabinizin 7/24 Takip Edilmektedir")
menu_additem(menu, Menuz, "24", 0)
}
else
{
formatex(Menuz, charsmax(Menuz), "\rNesne \yMarket")
menu_additem(menu, Menuz, "1", 0)
formatex(Menuz, charsmax(Menuz), "\wCIKIS YAP")
menu_additem(menu, Menuz, "25", 0)
}
formatex(Menuz, charsmax(Menuz), "\rCikis")
menu_setprop(menu,MPROP_EXITNAME,Menuz)
menu_setprop(menu,MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
return PLUGIN_HANDLED;
}
public CSA_BilgiVer_devam(id, menu ,item) {
if(item == MENU_EXIT) {
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64], access, callback
menu_item_getinfo(menu,item,access,data,charsmax(data),iName,charsmax(iName),callback)
new key = str_to_num(data)
switch(key) {
case 1:{
renkli_yazi(id,"!n[!t%s!n] !gSeceneklere Bastigin Icin Ana Menuye gonderildin",TAG)
CSA_BilgiVer( id )
}
case 3:{
//
}
case 23:
{
client_cmd( id, "messagemode Kullanici_Adi" );
}
case 24:
{
client_cmd( id, "messagemode KullaniciAdi_Sec" );
}
case 25:
{
kaydet( id );
remove_task( id );
copy( username[ id ], 49, "" );
copy( sifre[ id ], 49, "" );
copy( g_username[ id ], 49, "" );
copy( g_sifre[ id ], 49, "" );
copy( k_username[ id ], 49, "" );
copy( k_sifre[ id ], 49, "" );
g_login &= ~( 1 << id );
g_register &= ~( 1 << id );
set_task(1.0,"sifirla",id);
renkli_yazi( id, "!n[ !t%s !n] !gButun bilgileriniz kaydedilip hesabinizdan cikis yapilmistir.", TAG );
}
}
return PLUGIN_HANDLED
}
public plugin_cfg( )
{
g_vault = nvault_open( "YetkiVerKayit" );
if( g_vault == INVALID_HANDLE )
{
set_fail_state( "Vault dosyasi acilamadi" );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public plugin_end( )
{
nvault_close( g_vault );
}
public kaydet( id )
{
if( g_login & ( 1 << id ) )
{
new key1[ 64 ], data1[ 256 ],iPos1;
formatex( key1, 63, "%s-Bilgiler", g_username[ id ] )
for( new i = 0; i < 7; i++ )
{
iPos1 += formatex( data1[ iPos1 ], 255 - iPos1, "%i ", g_BILGI[ id ][ i ] )
}
nvault_set( g_vault, key1, data1 );
}
if( g_register & ( 1 << id ) )
{
new key1[ 64 ], data1[ 256 ],iPos1;
formatex( key1, 63, "%s-Bilgiler", k_username[ id ] )
for( new i = 0; i < 7; i++ )
{
iPos1 += formatex( data1[ iPos1 ], 255 - iPos1, "%i ", g_BILGI[ id ][ i ] )
}
nvault_set( g_vault, key1, data1 );
}
}
public user_name2( id )
{
new say[ 192 ]
read_args( say, 191 );
remove_quotes( say )
new len = strlen( say )
if( len < 5 || len > 32 )
{
renkli_yazi( id, "!n[ !t%s !n] !gKullanici Adi !n[ !t5 !n] !gkarakterden buyuk ve !n[ !t32 !n] !gkarakterden kucuk olmalidir.", TAG );
client_cmd( id, "messagemode KullaniciAdi_Sec" );
return PLUGIN_HANDLED;
}
for( new i; i < sizeof yasakli_semboller; i++ )
{
if( containi( say, yasakli_semboller[ i ] ) != -1 )
{
renkli_yazi( id, "!n[ !t%s !n] !gKullanici Adi Sembol Iceremez.", TAG );
client_cmd( id, "messagemode KullaniciAdi_Sec" );
return PLUGIN_HANDLED;
}
}
if( !equali( username[ id ], "" ) )
{
copy( g_username[ id ], 49, "" );
copy( g_sifre[ id ], 49, "" );
copy( k_username[ id ], 49, "" );
copy( k_sifre[ id ], 49, "" );
return PLUGIN_HANDLED;
}
copy( g_username[ id ], 49, "" );
copy( g_sifre[ id ], 49, "" );
copy( k_username[ id ], 49, say );
copy( k_sifre[ id ], 49, "" );
client_cmd( id, "messagemode Sifre_Yaz" );
return PLUGIN_HANDLED;
}
public sifre_sec( id )
{
new say[ 192 ]
read_args( say, 191 );
remove_quotes( say )
new len = strlen( say )
if( len < 5 || len > 32 )
{
renkli_yazi( id, "!n[ !t%s !n] !gSifre !n[ !t5 !n] !gkarakterden buyuk ve !n[ !t32 !n] !gkarakterden kucuk olmalidir.", TAG );
client_cmd( id, "messagemode Sifre_Yaz" );
return PLUGIN_HANDLED;
}
for( new i; i < sizeof yasakli_semboller; i++ )
{
if( containi( say, yasakli_semboller[ i ] ) != -1 )
{
renkli_yazi( id, "!n[ !t%s !n] !gSifre Sembol Iceremez.", TAG );
client_cmd( id, "messagemode Sifre_Yaz" );
return PLUGIN_HANDLED;
}
}
if( !equali( username[ id ], "" ) || equali( k_username[ id ], "" ) )
{
copy( g_username[ id ], 49, "" );
copy( g_sifre[ id ], 49, "" );
copy( k_username[ id ], 49, "" );
copy( k_sifre[ id ], 49, "" );
return PLUGIN_HANDLED;
}
copy( k_sifre[ id ], 49, say );
kayit_yap( id, k_username[ id ], k_sifre[ id ] );
copy( g_username[ id ], 49, "" );
copy( g_sifre[ id ], 49, "" );
copy( k_sifre[ id ], 49, "" );
return PLUGIN_HANDLED;
}
public kayit_yap( id, szName[ ], szSifre[ ] )
{
new getPw[32], IDFormat[64]
formatex( IDFormat, 63,"%s-Bilgiler-Kayit", szName );
nvault_get( g_vault, IDFormat, getPw,31 );
if( equali( getPw, "" ) )
{
new key[ 64 ];
copy( username[ id ], 49, szName );
copy( sifre[ id ], 49, szSifre );
formatex( key, 63, "%s-Bilgiler-Kayit", szName );
nvault_set( g_vault, key, szSifre )
g_register |= ( 1 << id )
new text[64];
read_args(text,63)
remove_quotes(text)
copy(g_szName[id],31,text)
renkli_yazi( id, "!n[ !t%s !n] !gBasarili bir sekilde hesabiniz acilmistir.", TAG );
renkli_yazi( id, "!n[ !t%s !n] !gKullanici Adiniz !n[ !t%s !n] !gSifreniz !n[ !t%s !n].", TAG, szName, szSifre );
}
else
{
renkli_yazi( id, "!n[ !g%s !n] !tBu Kullanici Adinda Zaten Hesap Var.", TAG );
}
return PLUGIN_HANDLED;
}
public user_name( id )
{
new say[ 192 ]
read_args( say, 191 );
remove_quotes( say )
new len = strlen( say )
if( len < 5 || len > 32 )
{
renkli_yazi( id, "!n[ !t%s !n] !gKullanici Adi !n[ !t5 !n] !tkarakterden buyuk ve !n[ !t32 !n] !gkarakterden kucuk olmalidir.", TAG );
client_cmd( id, "messagemode Kullanici_Adi" );
return PLUGIN_HANDLED;
}
for( new i; i < sizeof yasakli_semboller; i++ )
{
if( containi( say, yasakli_semboller[ i ] ) != -1 )
{
renkli_yazi( id, "!n[ !t%s !n] !gKullanici Adi Sembol Iceremez.", TAG );
client_cmd( id, "messagemode Kullanici_Adi" );
return PLUGIN_HANDLED;
}
}
if( !equali( username[ id ], "" ) )
{
copy( g_username[ id ], 49, "" );
copy( g_sifre[ id ], 49, "" );
copy( k_username[ id ], 49, "" );
copy( k_sifre[ id ], 49, "" );
return PLUGIN_HANDLED;
}
copy( g_username[ id ], 49, say );
copy( g_sifre[ id ], 49, "" );
copy( k_username[ id ], 49, "" );
copy( k_sifre[ id ], 49, "" );
client_cmd( id, "messagemode Sifreni_Gir" );
return PLUGIN_HANDLED;
}
public sifrexd( id )
{
new say[ 192 ]
read_args( say, 191 );
remove_quotes( say )
new len = strlen( say )
if( len < 5 || len > 32 )
{
renkli_yazi( id, "!n[ !t%s !n] !gSifre !n[ !t5 !n] !gkarakterden buyuk ve !n[ !t32 !n] !gkarakterden kucuk olmalidir.", TAG );
client_cmd( id, "messagemode Sifreni_Gir" );
return PLUGIN_HANDLED;
}
for( new i; i < sizeof yasakli_semboller; i++ )
{
if( containi( say, yasakli_semboller[ i ] ) != -1 )
{
renkli_yazi( id, "!n[ !t%s !n] !gSifre Sembol Iceremez.", TAG );
client_cmd( id, "messagemode Sifreni_Gir" );
return PLUGIN_HANDLED;
}
}
if( !equali( username[ id ], "" ) || equali( g_username[ id ], "" ) )
{
copy( g_username[ id ], 49, "" );
copy( g_sifre[ id ], 49, "" );
copy( k_username[ id ], 49, "" );
copy( k_sifre[ id ], 49, "" );
return PLUGIN_HANDLED;
}
copy( g_sifre[ id ], 49, say );
giris_yap( id, g_username[ id ], g_sifre[ id ] );
copy( g_sifre[ id ], 49, "" );
copy( k_username[ id ], 49, "" );
copy( k_sifre[ id ], 49, "" );
return PLUGIN_HANDLED;
}
public giris_yap( id, szName[ ], szSifre[ ] )
{
new getPw[32], IDFormat[64]
formatex( IDFormat, 63,"%s-Bilgiler-Kayit", szName );
nvault_get( g_vault, IDFormat, getPw,31 );
if( equali( getPw, szSifre ) )
{
new key1[ 64 ], data1[ 256 ], szVal1[ 6 ];
copy( username[ id ], 49, szName );
copy( sifre[ id ], 49, szSifre );
formatex( key1, 63, "%s-Bilgiler", szName );
nvault_get( g_vault, key1, data1, 255 );
for( new i; i < 7; i++ )
{
strbreak( data1, szVal1, 5, data1, 255 );
g_BILGI[ id ][ i ] = str_to_num( szVal1 );
}
g_login |= ( 1 << id );
renkli_yazi( id, "!n[ !t%s !n] !gBasarili bir sekilde hesabiniza giris yaptiniz.", TAG );
}
else
{
renkli_yazi( id, "!n[ !t%s !n] !gYanlis !n[ !tKullanici Adi !n] !gya da !n[ !tSifre !n] !ggirdin.", TAG );
}
return PLUGIN_HANDLED;
}
public sifirla( id )
{
for( new i; i < BILGI; i++ )
{
g_BILGI[ id ][ i ] = 0
}
}
stock renkli_yazi(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!n", "^x01"); // Default Renk(Sarı)
replace_all(msg, 190, "!g", "^x04"); // Yeşil Renk
replace_all(msg, 190, "!t", "^x03"); // Takım Renk( CT mavi , T kırmızı )
if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}