Código:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <dhudmessage>
#include <nvault>
#include <fvault>
#include <zombieplague>
#include <client_printcolor>
#define ADMIN_LIST_ACC ADMIN_IMMUNITY
#define ADMIN_ADD_ACC ADMIN_IMMUNITY
#define ADMIN_REMOVE_ACC ADMIN_IMMUNITY
#define ADMIN_GETAP ADMIN_IMMUNITY
#define ADMIN_SETAP ADMIN_IMMUNITY
#define is_valid_player(%1) (1 <= %1 <= 32)
new name[33][100]
new password[33][100]
new name_log[33][100]
new password2[33][100]
new n_vault, n_vault2, n_vault3
new g_name[33][100]
new bool:loggedin[33]
new bool:opendmenu[33]
new g_hunterlevel[33]
new g_killcount[33]
new g_zmhunterlevel[33]
new g_zmkillcount[33]
new g_zmkiller[33]
new g_zmkillercount[33]
new g_nemelevel[33]
new donateid
new cvar_autosave, cvar_achvs
new szText[555 char]
public plugin_init()
{
register_plugin("[ZP] Banco + registro + conquistas", "1.5.1", "Mottzi/GuhRDS")
register_dictionary("zp_rba.txt")
// Cvars
cvar_achvs = register_cvar("zp_achvs_enabled", "0") // Desativado Recomendado
cvar_autosave = register_cvar("zp_bank_autosave", "1") // Não Desative
// Contact
register_clcmd("say contato", "cmdCon")
register_clcmd("say contact", "cmdCon")
register_clcmd("say suporte", "cmdCon")
register_clcmd("say holder", "cmdCon")
register_clcmd("say msn", "cmdCon")
register_clcmd("say skype", "cmdCon")
// Account Menu
register_clcmd("say /conta", "show_menu1")
register_clcmd("say /account", "show_menu1")
register_clcmd("say /registro", "show_menu1")
register_clcmd("say /register", "show_menu1")
register_clcmd("say /login", "show_menu1")
// Create Account
register_clcmd("[Registrar]Login_Nick", "cmdnewname")
register_clcmd("[Registrar]Login_Senha", "cmdnewpassword")
// Login Account
register_clcmd("[Logar]Login_Nick", "cmdnewname2")
register_clcmd("[Logar]Login_Senha", "cmdnewpassword2")
// Bank Menu
register_clcmd("say /banco", "show_menu2")
register_clcmd("say /bank", "show_menu2")
register_clcmd("say_team /banco", "show_menu2")
register_clcmd("say_team /bank", "show_menu2")
// Take Amout
register_clcmd("[Banco]Sacar_Quantidade", "cmdtakeamout")
// Save Amout
register_clcmd("[Banco]Depositar_Quantidade", "cmdsaveamout")
register_clcmd("say /save", "cmdsave")
// Donate Amount
register_clcmd("[Banco]Doar_Quantidade", "cmdDonate")
// Archivments
register_clcmd("say /conquistas", "archivments_menu")
register_clcmd("say /conquista", "archivments_menu")
register_clcmd("say /achievements", "archivments_menu")
register_clcmd("say /achvs", "archivments_menu")
// Commands
register_concmd("zp_reg_account_list", "cmdShowList", ADMIN_LIST_ACC, "zp_reg_account_list")
register_concmd("zp_reg_account_add", "cmdAdd", ADMIN_ADD_ACC, "zp_reg_account_add <Nome da Conta> <Senha da Conta> <Ammo Packs da Conta>")
register_concmd("zp_reg_account_remove", "cmdRemove", ADMIN_REMOVE_ACC, "zp_reg_account_remove <Nome da Conta>")
register_concmd("zp_reg_account_getap", "cmdGetAp", ADMIN_GETAP, "zp_reg_account_getap <Nome da Conta>")
register_concmd("zp_reg_account_setap", "cmdSetAp", ADMIN_SETAP, "zp_reg_account_setap <Nome da Conta> <Quantiade de Ammo Packs>")
// Hooks
register_clcmd("jointeam", "Event_JoinTeam")
register_clcmd("chooseteam", "Event_JoinTeam")
// Events
register_event("DeathMsg", "DeathMsg", "a")
register_logevent("round_start", 2, "1=Round_Start")
set_task(60.0, "check_login", _,_,_, "b")
// Nvaults
n_vault = nvault_open("zp_rba_register")
n_vault2 = nvault_open("zp_rba_bank")
n_vault3 = nvault_open("zp_rba_achivments")
}
public client_disconnect(id)
{
cmdSaveAll(id)
new string[20]; formatex(string, 19, "%i %i %i %i", g_hunterlevel[id], g_zmhunterlevel[id], g_zmkiller[id], g_nemelevel[id])
nvault_set(n_vault3, g_name[id], string)
opendmenu[id] = false
loggedin[id] = false
g_name[id] = "Nao esta Logado"
g_killcount[id] = 0
g_hunterlevel[id] = 0
g_zmhunterlevel[id] = 0
g_zmkillcount[id] = 0
g_zmkiller[id] = 0
g_zmkillercount[id] = 0
g_nemelevel[id] = 0
}
public plugin_end()
{
nvault_close(n_vault)
nvault_close(n_vault2)
nvault_close(n_vault3)
}
public cmdCon(id)
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "INFO_EMAIL")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "INFO_SKYPE")
}
public check_login()
{
new players[32], pnum, tempid;
get_players(players, pnum);
for( new i; i<pnum; i++ )
{
tempid = players[i];
if(!loggedin[tempid])
{
client_printcolor(tempid, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "INFO_RBA")
client_printcolor(tempid, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "YOU_ARE_NOT_LOGGED")
client_cmd(tempid, "say /conta")
}
if(get_pcvar_num(cvar_autosave) == 1)
{
client_printcolor(tempid, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "INFO_AUTOSAVE_AP")
}
}
}
///////////////////////////////////////////////////////////////////////
///////////////////////// Sistema de Registro /////////////////////////
///////////////////////////////////////////////////////////////////////
public Event_JoinTeam(id)
{
if(!loggedin[id])
{
formatex(szText, charsmax(szText), "%L", id, "MENU_REGISTER_SYSTEM")
new menu = menu_create(szText, "show_menu1")
formatex(szText, charsmax(szText), "%L", id, "REGS_REGISTER")
menu_additem(menu, szText, "1", 0)
formatex(szText, charsmax(szText), "%L", id, "REGS_LOGAR")
menu_additem(menu, szText, "2", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public show_menu1(id)
{
formatex(szText, charsmax(szText), "%L", id, "MENU_REGISTER_SYSTEM")
new menu = menu_create(szText, "menu_handler")
formatex(szText, charsmax(szText), "%L", id, "REGS_REGISTER")
menu_additem(menu, szText, "1", 0)
formatex(szText, charsmax(szText), "%L", id, "REGS_LOGAR")
menu_additem(menu, szText, "2", 0)
if(!loggedin[id])
{
menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)
menu_display(id, menu, 0)
}
else
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "YOU_ARE_LOGGED")
}
return PLUGIN_HANDLED;
}
public menu_handler(id, menu, item)
{
new data[6], iName[64], access, callback
menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
client_cmd(id, "messagemode [Registrar]Login_Nick")
opendmenu[id] = true
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "Digite um Login para sua Conta...")
}
case 2:
{
client_cmd(id, "messagemode [Logar]Login_Nick")
opendmenu[id] = true
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "Digite o Login da Conta...")
}
}
if(key != 1 && key != 2)
{
show_menu1(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public cmdnewname(id)
{
read_args(name[id], 99)
remove_quotes(name[id])
new name2[33][100]
new time2
if(nvault_lookup(n_vault, name[id], name2[id], 99, time2) == 0 && containi(name[id], " ") == -1)
{
client_cmd(id, "messagemode [Registrar]Login_Senha")
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "Digite uma Senha para sua Conta...")
}
else if(nvault_lookup(n_vault, name[id], name2[id], 99, time2) == 1)
{
client_cmd(id, "messagemode [Registrar]Login_Nick")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "REGS_REGISTER_LOGIN_INVALID")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "TRY_AGAIN")
}
}
public cmdnewpassword(id)
{
read_args(password[id], 99)
remove_quotes(password[id])
if(containi(password[id], " ") == -1)
{
nvault_set(n_vault, name[id], password[id])
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_CREATED")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_LOGIN", name[id])
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_PASSWORD", password[id])
loggedin[id] = true
g_name[id] = name[id]
client_cmd(id, "jointeam 2")
g_hunterlevel[id] = 0
g_zmhunterlevel[id] = 0
g_zmkiller[id] = 0
g_nemelevel[id] = 0
}
else
{
client_cmd(id, "messagemode [Registrar]Login_Senha")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "REGS_REGISTER_PASS_INVALID")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "TRY_AGAIN")
}
}
public cmdnewname2(id)
{
read_args(name_log[id], 99)
remove_quotes(name_log[id])
new name2[33][100]
new time2
if(nvault_lookup(n_vault, name_log[id], name2[id], 99, time2) == 0)
{
client_cmd(id, "messagemode [Logar]Login_Nick")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "REGS_LOGIN_NAME_INVALID")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "TRY_AGAIN")
}
else
{
client_cmd(id, "messagemode [Logar]Login_Senha")
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "Digite a Senha da Conta...")
}
}
public cmdnewpassword2(id)
{
read_args(password2[id], 99)
remove_quotes(password2[id])
new data[140]
nvault_get( n_vault, name_log[id], data, 139)
if(equali(data, password2[id]))
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "WELCOME")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_LOGGED", name_log[id])
loggedin[id] = true
g_name[id] = name_log[id]
client_cmd(id, "jointeam 2")
new string[50]; nvault_get(n_vault3, g_name[id], string, charsmax(string))
new str1[8], str2[8], str3[8], str4[8]
parse(string, str1, 7, str2, 7, str3, 7, str4, 7)
g_hunterlevel[id] = str_to_num(str1)
g_zmhunterlevel[id] = str_to_num(str2)
g_zmkiller[id] = str_to_num(str3)
g_nemelevel[id] = str_to_num(str4)
}
else
{
client_cmd(id, "messagemode [Logar]Login_Senha")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "REGS_LOGIN_PASS_INVALID")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "TRY_AGAIN")
}
}
////////////////////////////////////////////////////////////////////
///////////////////////// Sistema de Banco /////////////////////////
////////////////////////////////////////////////////////////////////
public show_menu2(id)
{
if(loggedin[id] == true)
{
new szText[100]
new data1[30]
nvault_get(n_vault2, g_name[id], data1, charsmax(data1))
if(equal(data1 , ""))
formatex(szText, charsmax(szText), "\yConta:\r %s ^n\ySaldo:\r 0", g_name[id])
else
formatex(szText, charsmax(szText), "\yConta:\r %s ^n\ySaldo:\r %s", g_name[id], data1)
new menu2 = menu_create(szText, "menu_handler2")
formatex(szText, charsmax(szText), "%L", id, "BANK_TAKE_AMOUNT")
menu_additem(menu2, szText, "1", 0)
formatex(szText, charsmax(szText), "%L", id, "BANK_TAKE_ALL")
menu_additem(menu2, szText, "2", 0)
formatex(szText, charsmax(szText), "%L", id, "BANK_SAVE_AMOUNT")
menu_additem(menu2, szText, "3", 0)
formatex(szText, charsmax(szText), "%L", id, "BANK_SAVE_ALL")
menu_additem(menu2, szText, "4", 0)
formatex(szText, charsmax(szText), "%L", id, "BANK_DONATE_AMOUNT")
menu_additem(menu2, szText, "5", 0)
menu_display(id, menu2, 0)
}
else
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "INFO_RBA")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "YOU_ARE_NOT_LOGGED")
client_cmd(id, "say /conta")
}
return PLUGIN_HANDLED;
}
public menu_handler2(id, menu2, item)
{
new data[6], iName[64], access, callback
menu_item_getinfo(menu2, item, access, data, 5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
client_cmd(id, "messagemode [Banco]Sacar_Quantidade")
}
case 2:
{
new data1[30]
nvault_get(n_vault2, g_name[id], data1, charsmax(data1))
new have_hand = zp_get_user_ammo_packs(id)
new have = str_to_num(data1)
if(have > 0)
{
zp_set_user_ammo_packs(id, have_hand + have)
new string1[30]
formatex(string1, charsmax(string1), "0")
nvault_set(n_vault2, g_name[id], string1)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_TAKE_AP", have)
}
else
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_HAVE_0AP_BANK")
}
}
case 3:
{
client_cmd(id, "messagemode [Banco]Depositar_Quantidade")
}
case 4:
{
new aps = zp_get_user_ammo_packs(id)
if(aps == 0)
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_HAVE_0AP")
return PLUGIN_HANDLED;
}
new aps_have[30]
nvault_get(n_vault2, g_name[id], aps_have, 29)
new result = aps + str_to_num(aps_have)
new aps2[30]
formatex(aps2, charsmax(aps2), "%i", result)
nvault_set(n_vault2, g_name[id], aps2)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_SAVE_AP", aps)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_BALANCE_BANK", result)
zp_set_user_ammo_packs(id, 0)
}
case 5:
{
donatemenu(id)
}
}
return PLUGIN_CONTINUE
}
public cmdtakeamout(id)
{
new amout[33][100]
read_args(amout[id], 99)
remove_quotes(amout[id])
new data1[30]
nvault_get(n_vault2, g_name[id], data1, charsmax(data1))
new want = str_to_num(amout[id])
new have = str_to_num(data1)
if(want > have)
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_NOT_HAVE_AP_BANK", want)
show_menu2(id)
if(containi(amout[id], " ") == -1)
{
show_menu2(id)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_NOT_HAVE_AP_BANK", want)
}
else
{
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + want)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_TAKE_AP", want)
new string1[30]
formatex(string1, charsmax(string1), "%i", have - want)
nvault_set(n_vault2, g_name[id], string1)
}
}
else
{
show_menu2(id)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_QUANTITY_INVALID")
}
}
public cmdsaveamout(id)
{
new amout[33][100]
new aps = zp_get_user_ammo_packs(id)
read_args(amout[id], 99)
remove_quotes(amout[id])
new want = str_to_num(amout[id])
if(want > aps)
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_NOT_HAVE_AP", want)
show_menu2(id)
if(containi(amout[id], " ") == -1)
{
show_menu2(id)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_NOT_HAVE_AP", want)
}
else
{
new data1[30]
nvault_get(n_vault2, g_name[id], data1, charsmax(data1))
new aps_bank = str_to_num(data1)
new save_aps = aps_bank + want
new string1[16]
formatex(string1, charsmax(string1), "%i", save_aps)
nvault_set(n_vault2, g_name[id], string1)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) - want)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_SAVE_AP", want)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_BALANCE_TOTAL", aps_bank + want)
}
}
else
{
show_menu2(id)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_QUANTITY_INVALID")
}
}
public cmdsave(id)
{
if(loggedin[id] == true)
{
new aps = zp_get_user_ammo_packs(id)
if(aps == 0)
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_HAVE_0AP")
return PLUGIN_HANDLED;
}
new aps2[16]
new aps3[16]
nvault_get(n_vault2, g_name[id], aps3, 15)
new aps4 = aps + str_to_num(aps3)
formatex(aps2, charsmax(aps2), "%i", aps)
nvault_set(n_vault2, g_name[id], aps2)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_SAVE_AP", aps)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_BALANCE_BANK", aps4)
zp_set_user_ammo_packs(id, 0)
}
return PLUGIN_HANDLED
}
public cmdSaveAll(id)
{
if(get_pcvar_num(cvar_autosave) == 1)
{
new aps = zp_get_user_ammo_packs(id)
if(aps == 0)
{
return PLUGIN_HANDLED;
}
new aps_have[30]
nvault_get(n_vault2, g_name[id], aps_have, 29)
new result = aps + str_to_num(aps_have)
new aps2[30]
formatex(aps2, charsmax(aps2), "%i", result)
nvault_set(n_vault2, g_name[id], aps2)
zp_set_user_ammo_packs(id, 0)
}
return PLUGIN_CONTINUE
}
public donatemenu(id)
{
new menu6 = menu_create("\rEscolha alguem para doar Packs:", "menu_handler6");
new players[32], pnum, tempid;
new szName[32], szTempid[10];
get_players(players, pnum);
for( new i; i<pnum; i++ )
{
tempid = players[i];
get_user_name(tempid, szName, 31);
num_to_str(tempid, szTempid, 9);
menu_additem(menu6, szName, szTempid, 0);
}
menu_display(id, menu6, 0);
}
public menu_handler6(id, menu6, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu6);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu6, item, access, data,5, iName, 63, callback);
new tempid = str_to_num(data);
donateid = tempid
client_cmd(id, "messagemode [Banco]Doar_Quantidade")
menu_destroy(menu6);
return PLUGIN_HANDLED;
}
public cmdDonate(id)
{
new aps[100]
read_args(aps, 99)
remove_quotes(aps)
new numaps = str_to_num(aps)
if(containi(aps, " ") == -1)
{
new haveap[10]; nvault_get(n_vault2, g_name[id], haveap, 9)
new numhaveap = str_to_num(haveap)
if(numhaveap <= 0)
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_QUANTITY_INVALID")
return PLUGIN_HANDLED;
}
else
{
new result = numhaveap - numaps
new string[100]; formatex(string, 99, "%i", result)
nvault_set(n_vault2, g_name[id], string)
new aps2[10]; nvault_get(n_vault2, g_name[donateid], aps2, 9)
new numaps2 = str_to_num(aps2)
new result2 = numaps2 + numaps
new string2[100]; formatex(string2, 99, "%i", result2)
nvault_set(n_vault2, g_name[donateid], string2)
new name1[50], name2[50]
get_user_name(id, name1, 49)
get_user_name(donateid, name2, 49)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_DONATE_DONATOR", numaps, name2, result)
client_printcolor(donateid, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_DONATE_RECEIVER", name1, numaps, result2)
}
}
else
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_QUANTITY_INVALID")
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE
}
/////////////////////////////////////////////////////////////////////
///////////////////////// Comandos de Admin /////////////////////////
/////////////////////////////////////////////////////////////////////
public cmdShowList(id)
{
new players[32], pnum, tempid;
get_players(players, pnum);
client_print(id, print_console, "Nome no Jogo - Nome da Conta - Ammo Pack(s)")
for( new i; i<pnum; i++ )
{
tempid = players[i];
if(id != tempid)
{
new name[45]
get_user_name(tempid, name, charsmax(name))
if(equali(g_name[tempid], ""))
{
client_print(id, print_console, "%s - Nao esta Logado - Desconhecido", name, g_name[tempid])
}
if(equali(g_name[tempid], "") == 0)
{
new aps[10]; nvault_get(n_vault2, g_name[tempid], aps, 9)
client_print(id, print_console, "%s - %s - %s", name, g_name[tempid], aps)
}
}
}
}
public cmdAdd(id)
{
new arg1[50], arg2[50], arg3[15], name2[40], time2
read_argv(1, arg1, charsmax(arg1))
if(nvault_lookup(n_vault, arg1, name2, 39, time2) == 1)
{
client_print(id, print_console, "%s - Ja existe.", arg1)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_ALREADY_EXISTS", arg1)
}
else
{
read_argv(2, arg2, charsmax(arg2))
read_argv(3, arg3, charsmax(arg3))
nvault_set(n_vault, arg1, arg2)
nvault_set(n_vault2, arg1, arg3)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_CREATED")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_LOGIN", arg1)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_PASSWORD", arg2)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_AMMOPACKS", arg3)
}
}
public cmdRemove(id)
{
new arg1[50], name2[20], time2
read_argv(1, arg1, charsmax(arg1))
if(nvault_lookup(n_vault, arg1, name2[id], 19, time2) == 1)
{
nvault_remove(n_vault, arg1)
nvault_remove(n_vault2, arg1)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_REMOVED", arg1)
}
else
{
client_print(id, print_console, "%s - Nao existe!", arg1)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_DOES_NOT_EXIST", arg1)
}
}
public cmdGetAp(id)
{
new arg1[50], name2[50], time2
read_argv(1, arg1, charsmax(arg1))
remove_quotes(arg1)
if(nvault_lookup(n_vault, arg1, name2, 49, time2) == 1)
{
new aps[10]
nvault_get(n_vault2, arg1, aps, 9)
new apsnum = str_to_num(aps)
client_print(id, print_console, "%s - Possui %i Ammo Pack(s).", arg1, apsnum)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_HAS_AP", arg1, apsnum)
}
else
{
client_print(id, print_console, "%s - Nao existe!", arg1)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_DOES_NOT_EXIST", arg1)
}
}
public cmdSetAp(id)
{
new arg1[50], arg2[50], name2[40], time2
read_argv(1, arg1, charsmax(arg1))
if(nvault_lookup(n_vault, arg1, name2, 39, time2) == 1)
{
read_argv(2, arg2, charsmax(arg2))
nvault_set(n_vault2, arg1, arg2)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_SET_AP", arg2, arg1)
}
else
{
client_print(id, print_console, "%s - Nao existe!", arg1)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ACCOUNT_DOES_NOT_EXIST", arg1)
}
}
/////////////////////////////////////////////////////////////////////////
///////////////////////// Sistema de Conquistas /////////////////////////
/////////////////////////////////////////////////////////////////////////
public archivments_menu(id)
{
if(get_pcvar_num(cvar_achvs) != 1)
return PLUGIN_HANDLED;
if(loggedin[id] == true)
{
new title[80]; formatex(title, 79, "\yConquistas ^n\yConta:\r %s", g_name[id])
new menu5 = menu_create(title, "handler_archs")
new humanhtitle[200]
if(g_hunterlevel[id] < 4)
formatex(humanhtitle, 199, "\wHuman Hunter\y Level %i - \rProximo Level: %i\w (%i APs)^n\y Mate %i Zombies sem morrer!^n", g_hunterlevel[id], g_hunterlevel[id] + 1, (g_hunterlevel[id] + 1) * 120, (g_hunterlevel[id] + 1) * 5)
else
formatex(humanhtitle, 199, "\wHuman Hunter\y Level %i - \rFull^n", g_hunterlevel[id])
menu_additem(menu5, humanhtitle , "1")
new zmhtitle[200]
if(g_zmhunterlevel[id] < 2)
formatex(zmhtitle, 199, "\wZombie Hunter\y Level %i - \rProximo Level: %i\w (%i APs)^n\y Infecte %i Humanos sem morrer!^n", g_zmhunterlevel[id], g_zmhunterlevel[id] + 1, (g_zmhunterlevel[id] + 1) * 250, (g_zmhunterlevel[id] + 1) * 5)
else
formatex(zmhtitle, 199, "\wZombie Hunter\y Level %i - \rFull^n", g_zmhunterlevel[id])
menu_additem(menu5, zmhtitle , "2")
new zmkillertitle[200]
if(g_zmkiller[id] < 3)
formatex(zmkillertitle, 199, "\wZombie Killer\y Level %i - \rProximo Level: %i\w (%i APs)^n\y Mate %i Humanos nos rounds Swarm/Plague!^n", g_zmkiller[id], g_zmkiller[id] + 1, (g_zmkiller[id] + 1) * 300, (g_zmkiller[id] + 1) * 3)
else
formatex(zmkillertitle, 199, "\wZombie Killer\y Level %i - \rFull^n", g_zmkiller[id])
menu_additem(menu5, zmkillertitle, "3")
new nemetitle[200]
if(g_nemelevel[id] < 1)
formatex(nemetitle, 199, "\wTerminator\y Level %i - \rProximo Level: %i\w (%i APs)^n\y Mate Nemesis!^n", g_nemelevel[id], g_nemelevel[id] + 1, 400)
else
formatex(nemetitle, 199, "\wTerminator\y Level %i - \rFull^n", g_nemelevel[id])
menu_additem(menu5, nemetitle, "4")
menu_display(id, menu5, 0)
}
else
{
show_menu1(id)
}
return PLUGIN_CONTINUE
}
public handler_archs(id, menu5, item)
{
if(get_pcvar_num(cvar_achvs) != 1)
return PLUGIN_HANDLED;
new data[6], iName[64], access, callback
menu_item_getinfo(menu5, item, access, data, 5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
if(g_hunterlevel[id] >= 4)
return PLUGIN_HANDLED
client_printcolor(id, "[ZP] !tMate %i Zombies sem morrer !y- !tGanhe %i Ammo Pack(s).", (g_hunterlevel[id] + 1) * 5, (g_hunterlevel[id] + 1) * 120)
}
case 2:
{
if(g_zmhunterlevel[id] >= 2)
return PLUGIN_HANDLED
client_printcolor(id, "[ZP] !tInfecte %i Humanos sem morrer !y- !tGanhe %i Ammo Pack(s).", (g_zmhunterlevel[id] + 1) * 5, (g_zmhunterlevel[id] + 1) * 250)
}
case 3:
{
if(g_zmkiller[id] >= 3)
return PLUGIN_HANDLED
client_printcolor(id, "[ZP] !tMate %i Humanos nos rounds Swarm/Plague Round !y- !tGanhe %i Ammo Pack(s).", (g_zmkiller[id] + 1) * 3, (g_zmkiller[id] + 1) * 300)
}
case 4:
{
if(g_zmkiller[id] >= 1)
return PLUGIN_HANDLED
client_printcolor(id, "[ZP] !tMate o Nemesis !y- !tGanhe 400 Ammo Pack(s).")
}
}
return PLUGIN_CONTINUE
}
public DeathMsg()
{
new killer = read_data(1)
new victim = read_data(2)
if(get_pcvar_num(cvar_achvs) != 1)
return PLUGIN_HANDLED;
g_zmkillcount[victim] = 0
g_zmkillercount[victim] = 0
if(zp_is_nemesis_round())
{
if(zp_get_user_nemesis(victim) && loggedin[killer] == true && g_nemelevel[killer] != 1 && cs_get_user_team(killer) == CS_TEAM_CT && is_valid_player(killer))
{
g_nemelevel[killer]++
new name[50]; get_user_name(killer, name, charsmax(name))
client_printcolor(killer, "[ZP] !g%s !yalcancou o !tTerminator Level: %i !ye ganhou!t %i Ammo Pack(s).", name, g_zmkiller[killer] + 1, 500)
g_zmkiller[killer]++
g_zmkillercount[killer] = 0
give_present(killer, 500)
new string[20]; formatex(string, 19, "%i %i %i %i", g_hunterlevel[killer], g_zmhunterlevel[killer], g_zmkiller[killer], g_nemelevel[killer])
nvault_set(n_vault3, g_name[killer], string)
}
}
if(is_valid_player(killer) && loggedin[killer] == true && g_zmkiller[killer] != 3 && !zp_is_nemesis_round())
{
if(zp_is_plague_round() || zp_is_swarm_round())
{
if(is_valid_player(victim) && zp_get_user_zombie(killer) && cs_get_user_team(victim) == CS_TEAM_CT)
{
g_zmkillercount[killer]++
client_printcolor(killer, "[ZP] !tKillstreak Zombie Killer:!y %i", g_zmkillercount[killer])
showStats(killer, 3)
if(g_zmkillercount[killer] >= (g_zmkiller[killer] + 1) * 3)
{
new name[50]; get_user_name(killer, name, charsmax(name))
client_printcolor(0, "[ZP] !g%s !yalcancou o !tZombie Killer Level: %i !te ganhou !t%i Ammo Pack(s).", name, g_zmkiller[killer] + 1, (g_zmkiller[killer] + 1) * 300)
g_zmkiller[killer]++
g_zmkillercount[killer] = 0
give_present(killer, g_zmkiller[killer] * 300)
new string[20]; formatex(string, 19, "%i %i %i %i", g_hunterlevel[killer], g_zmhunterlevel[killer], g_zmkiller[killer], g_nemelevel[killer])
nvault_set(n_vault3, g_name[killer], string)
}
}
}
}
if(is_valid_player(killer) && zp_get_user_zombie(victim) && g_hunterlevel[killer] != 4 && loggedin[killer] == true)
{
if(zp_get_user_survivor(killer))
return PLUGIN_HANDLED;
g_killcount[killer]++
client_printcolor(killer, "[ZP] !tKillstreak Human Hunter:!y %i", g_killcount[killer])
showStats(killer, 1)
if(g_killcount[killer] >= (g_hunterlevel[killer] + 1) * 5)
{
new name[50]; get_user_name(killer, name, charsmax(name))
client_printcolor(0, "[ZP] !g%s !yalcancou o !tHuman Hunter Level: %i !ye ganhou !t%i Ammo Pack(s).", name, g_hunterlevel[killer] + 1, (g_hunterlevel[killer] + 1) * 120)
g_hunterlevel[killer]++
g_killcount[killer] = 0
give_present(killer, g_hunterlevel[killer] * 120)
new string[20]; formatex(string, 19, "%i %i %i %i", g_hunterlevel[killer], g_zmhunterlevel[killer], g_zmkiller[killer], g_nemelevel[killer])
nvault_set(n_vault3, g_name[killer], string)
}
}
return PLUGIN_CONTINUE
}
public zp_user_infected_post(id, infector, nemesis)
{
if(get_pcvar_num(cvar_achvs) != 1)
return PLUGIN_HANDLED;
g_killcount[id] = 0
if(is_valid_player(infector) && g_zmhunterlevel[infector] != 2 && loggedin[infector] == true && zp_get_user_zombie(infector))
{
g_zmkillcount[infector]++
client_printcolor(infector, "[ZP] !tKillstreak Zombie Hunter:!y %i", g_zmkillcount[infector])
showStats(infector, 2)
if(g_zmkillcount[infector] >= (g_zmhunterlevel[infector] + 1) * 5)
{
new name[50]; get_user_name(infector, name, charsmax(name))
client_printcolor(0, "[ZP] !g%s !yalcancou o !tZombie Hunter Level: %i !ye ganhou !t%i Ammo Pack(s)", name, g_zmhunterlevel[infector] + 1, (g_zmhunterlevel[infector] + 1) * 250)
g_zmhunterlevel[infector]++
g_zmkillcount[infector] = 0
give_present(infector, g_zmhunterlevel[infector] * 250)
new string[20]; formatex(string, 19, "%i %i %i %i", g_hunterlevel[infector], g_zmhunterlevel[infector], g_zmkiller[infector], g_nemelevel[infector])
nvault_set(n_vault3, g_name[infector], string)
}
}
return PLUGIN_CONTINUE
}
public give_present(id, amout)
{
new curaps[10]
nvault_get(n_vault2, g_name[id], curaps, 9)
new intaps = str_to_num(curaps)
new result = intaps + amout
new string[10]
formatex(string, 10, "%i", result)
nvault_set(n_vault2, g_name[id], string)
client_printcolor(id, "[ZP] !yVoce possui^3 %i Ammo Pack(s) !yno seu Banco.", result)
}
public showStats(id, mode)
{
new text[200]
new mode2 = mode
switch(mode2)
{
case 1:
{
formatex(text, charsmax(text), "Human Hunter: %i / %i", g_killcount[id], (g_hunterlevel[id] + 1) * 5)
}
case 2:
{
formatex(text, charsmax(text), "Zombie Hunter: %i / %i", g_zmkillcount[id], (g_zmhunterlevel[id] + 1) * 5)
}
case 3:
{
formatex(text, charsmax(text), "Zombie Killer: %i / %i", g_zmkillercount[id], (g_zmkiller[id] + 1) * 3)
}
}
set_hudmessage(255, 255, 255, 0.02, 0.50, 0, 6.0, 4.0, _, _, -1)
show_hudmessage(id, text)
}
public round_start()
{
new players[32], pnum, tempid;
get_players(players, pnum);
for( new i; i<pnum; i++ )
{
tempid = players[i];
g_killcount[tempid] = 0;
}
}
Eu ja adc a inlude .Tentei seguir um tutorial da "allied" mais nao deu certo .
Ele nvault cai toda hora...
Última edição por rotam157 em 12/7/2012, 2:44 pm, editado 1 vez(es)