Merhaba arkadaşlar tl tl cinsinden banla plugini atarmsiniz çok teşekkülteş
Bazıları yavaş yürür ama asla geri adım atmaz.
#include < amxmodx >
#include < amxmisc >
#include < nvault >
new anavault;
new g_IslemUcreti;
new username[33][200],password[33][200],g_username[33][200],g_password[33][200],k_username[33][200],k_password[33][200];
public plugin_init(){
anavault = nvault_open("Banka")
register_clcmd("Hesap_Ismi","Giris_ID")
register_clcmd("Hesap_Ismi_Secin","Kayit_ID")
register_clcmd("Vereceginiz_Miktar","Ammo_Yatir")
register_clcmd("Alacaginiz_Miktar","Ammo_Cek")
register_clcmd("Sifreniz","Giris_Pw")
register_clcmd("Sifre_Secin","Kayit_Pw")
register_clcmd("say /tlbanka","login_menusu")
register_clcmd("say /banka","login_menusu")
register_clcmd("say /tlbank","login_menusu")
register_clcmd("say /bank","login_menusu")
g_IslemUcreti = register_cvar("banka_islem_ucreti","5")
set_task(60.0,"tanit_beni",3476,"",0,"b")
}
public client_connected(id)
{
copy(username[id],199,"")
copy(password[id],199,"")
copy(g_username[id],199,"")
copy(g_password[id],199,"")
copy(k_username[id],199,"")
copy(k_password[id],199,"")
}
public client_disconnected(id)
{
copy(username[id],199,"")
copy(password[id],199,"")
copy(g_username[id],199,"")
copy(g_password[id],199,"")
copy(k_username[id],199,"")
copy(k_password[id],199,"")
}
public login_menusu(id)
{
if(!is_user_connected(id) || !is_user_alive(id)) return PLUGIN_HANDLED
new banka_ismi[128]
formatex(banka_ismi,127,"\r%s \wBanka")
new menu = menu_create(banka_ismi,"login_devam")
if(equal(username[id],""))
{
menu_additem(menu,"Giris Yap","1",0)
menu_additem(menu,"Kayit Ol","2",0)
}
else
{
menu_additem(menu,"TL Yatir","3",0)
menu_additem(menu,"TL Cek","4",0)
menu_additem(menu,"TL Hesap Durumu","5",0)
menu_additem(menu,"Cikis Yap","6",0)
}
menu_setprop(menu,MPROP_EXIT,MEXIT_ALL)
menu_display(id,menu,0)
return PLUGIN_HANDLED
}
public login_devam(id,menu,item)
{
if(!is_user_connected(id) || !is_user_alive(id)) return PLUGIN_HANDLED
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new acces,data2[24],iname[64],callback,data
menu_item_getinfo(menu,item,acces,data2,23,iname,63,callback)
data = str_to_num(data2)
switch(data)
{
case 1:
{
client_cmd(id,"messagemode Hesap_Ismi")
}
case 2:
{
client_cmd(id,"messagemode Hesap_Ismi_Secin")
}
case 3:
{
client_cmd(id,"messagemode Vereceginiz_Miktar")
}
case 4:
{
client_cmd(id,"messagemode Alacaginiz_Miktar")
}
case 5:
{
set_hudmessage(255, 255, 255, 0.29, 0.30, 0, 6.0, 5.0,_,_,-1)
show_hudmessage(id, "Hesabinizdaki TL Miktari : %d TL",get_hesap_ammo(username[id]))
client_print(id,print_chat,"Hesabinizdaki TL Miktari : %d TL",get_hesap_ammo(username[id]))
}
case 6:
{
copy(username[id],199,"")
copy(password[id],199,"")
client_print(id,print_center,"Bankadan Cikis yaptiniz..")
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
public Giris_ID(id)
{
new say[300]
read_args(say, charsmax(say))
remove_quotes(say)
if(equal(say, "") || !equal(username[id],"") || strlen(say) > 12)
{
copy(g_username[id],199,"")
copy(g_password[id],199,"")
copy(k_username[id],199,"")
copy(k_password[id],199,"")
return PLUGIN_HANDLED
}
copy(g_password[id],199,"")
copy(k_username[id],199,"")
copy(k_password[id],199,"")
copy(g_username[id],199,say)
client_cmd(id,"messagemode Sifreniz")
return PLUGIN_CONTINUE
}
public Giris_Pw(id)
{
new say[300]
read_args(say, charsmax(say))
remove_quotes(say)
if(equal(say, "") || !equal(username[id],"") || equal(g_username[id],"") || strlen(say) > 12)
{
copy(g_username[id],199,"")
copy(g_password[id],199,"")
copy(k_username[id],199,"")
copy(k_password[id],199,"")
return PLUGIN_HANDLED
}
copy(g_password[id],199,say)
giris_yap(id,g_username[id], g_password[id])
copy(g_password[id],199,"")
copy(g_username[id],199,"")
copy(k_password[id],199,"")
copy(k_username[id],199,"")
return PLUGIN_CONTINUE
}
/////////////////////////
////#Kayit Islemleri#////
/////////////////////////
public Kayit_ID(id)
{
new say[300]
read_args(say, charsmax(say))
remove_quotes(say)
if(equal(say, "") || !equal(username[id],"") || strlen(say) > 12)
{
copy(g_username[id],199,"")
copy(g_password[id],199,"")
copy(k_username[id],199,"")
copy(k_password[id],199,"")
return PLUGIN_HANDLED
}
copy(k_password[id],199,"")
copy(g_username[id],199,"")
copy(g_password[id],199,"")
copy(k_username[id],199,say)
client_cmd(id,"messagemode Sifre_Secin")
return PLUGIN_CONTINUE
}
public Kayit_Pw(id)
{
new say[300]
read_args(say, charsmax(say))
remove_quotes(say)
if(equal(say, "") || !equal(username[id],"") || equal(k_username[id],"") || strlen(say) > 12)
{
copy(g_username[id],199,"")
copy(g_password[id],199,"")
copy(k_username[id],199,"")
copy(k_password[id],199,"")
return PLUGIN_HANDLED
}
copy(k_password[id],199,say)
kayit_yap(id,k_username[id], k_password[id])
copy(g_password[id],199,"")
copy(g_username[id],199,"")
copy(k_password[id],199,"")
copy(k_username[id],199,"")
return PLUGIN_CONTINUE
}
///////////////////////////
///////////////////////////
public giris_yap(id,userid[],psw[])
{
if(!is_user_connected(id) || equal(userid,"") || equal(psw,"") || !equal(username[id],""))
return PLUGIN_HANDLED
new getPw[32], IDFormat[64]
formatex(IDFormat,63,"%s-ID",userid)
nvault_get(anavault,IDFormat,getPw,31)
if(equali(psw,getPw))
{
copy(username[id],199,userid)
copy(password[id],199,psw)
client_print(id,print_chat,"Hesabiniza basariyla giris yapildi. Su anda %d TL depoluyorsunuz!",get_hesap_ammo(userid))
}
else
{
client_print(id,print_center,"Yanlis hesap ismi veya sifre !")
}
return PLUGIN_HANDLED
}
public kayit_yap(id,userid[],psw[])
{
if(!is_user_connected(id) || equal(userid,"") || equal(psw,"") || !equal(username[id],""))
return PLUGIN_HANDLED
new getPw[32], IDFormat[64]
formatex(IDFormat,63,"%s-ID",userid)
nvault_get(anavault,IDFormat,getPw,31)
if(equali(getPw,""))
{
copy(username[id],199,userid)
copy(password[id],199,psw)
new ammoKey[64], hesapKey[64]
formatex(hesapKey,63,"%s-ID",userid)
formatex(ammoKey,63,"%s-Ammo",userid)
nvault_set(anavault,hesapKey,psw)
nvault_set(anavault,ammoKey,"0")
client_print(id,print_chat,"Hesabinizi kaydettik.Islemler icin ^"/tlbanka^" yazin..")
client_print(id,print_chat,"Hesap adi = %s Sifreniz = %s",userid,psw)
}
else
{
client_print(id,print_center,"Bu hesap zaten kayitlarda var..")
}
return PLUGIN_HANDLED
}
public Ammo_Yatir(id)
{
new say[300]
read_args(say, charsmax(say))
remove_quotes(say)
if(!is_str_num(say) || equal(say, "") || equal(username[id],"") || strlen(say) > 12)
{
client_print(id,print_center,"O kadar TL var mi ? ( Islem ucreti = %d TL )",get_pcvar_num(g_IslemUcreti))
return PLUGIN_HANDLED
}
set_hesap_ammo(username[id],get_hesap_ammo(username[id]) + str_to_num(say))
client_print(id,print_center,"Hesabiniza %d TL transfer edildi..",str_to_num(say))
return PLUGIN_HANDLED
}
public Ammo_Cek(id)
{
new say[300]
read_args(say, charsmax(say))
remove_quotes(say)
if(!is_str_num(say) || equal(say, "") || equal(username[id],"") || strlen(say) > 12)
return PLUGIN_HANDLED
if(get_hesap_ammo(username[id]) < str_to_num(say))
{
client_print(id,print_center,"Hesabinizda yeterli TL yok..!")
return PLUGIN_HANDLED
}
set_hesap_ammo(username[id],get_hesap_ammo(username[id]) - str_to_num(say))
client_print(id,print_center,"Hesabinizdan %d TL cektiniz..",str_to_num(say))
return PLUGIN_HANDLED
}
public get_hesap_ammo(userid[])
{
new gData[64], gAmmoKey[64]
formatex(gAmmoKey,63,"%s-Ammo",userid)
nvault_get(anavault,gAmmoKey,gData,63)
return str_to_num(gData)
}
public set_hesap_ammo(userid[],miktar)
{
new gAmmoKey[64], miktar2[128]
num_to_str(miktar,miktar2,127)
formatex(gAmmoKey,63,"%s-Ammo",userid)
nvault_set(anavault,gAmmoKey,miktar2)
return 1
}
public tanit_beni(TaskID)
{
set_hudmessage(255, 255, 255, 0.01, 0.30, 0, 6.0, 6.0)
show_hudmessage(0, "Bankaya ulasmak icin^n/tlbanka yazin ! ")
client_print(0,print_chat,"Size en yakin bankaya ulasmak icin ^"/tlbanka^" yazin !")
}
Konu ile Alakalı Benzer Konular | |||||
Konular | Yazar | Yorumlar | Okunma | Son Yorum | |
Silinmiş Konu | CT HASAR GÖRDÜ PLUGİNİ #enesfındık | Enes Fındık | 1 | 213 |
14-09-2020, Saat: 10:32 Son Yorum: By.KinG |
|
Silinmiş Konu | Dust2 Texture Fixed Plugini | soldier.arda | 12 | 1,290 |
14-09-2020, Saat: 10:18 Son Yorum: By.KinG |
|
Silinmiş Konu | Art arda bomba alamama plugini | exortek | 2 | 396 |
03-03-2020, Saat: 14:59 Son Yorum: MawiLarq |
|
Silinmiş Konu | En Çok Aranan Enfeksiyon Plugini [Ze/Zp/Bio] | Furkangs1905 | 2 | 463 |
07-01-2020, Saat: 12:25 Son Yorum: By.KinG |
|
Silinmiş Konu | DEATHMATCH PLUGINI | raxes1950 | 1 | 306 |
13-12-2019, Saat: 16:44 Son Yorum: By.KinG |