Zumbis Online
Últimos assuntos
» [PEDIDO] Plugin Quiz
por [Dk]Serial-Killer 13/9/2017, 10:02 pm

» [PEDIDO] Limite de madness ZP50
por cancels 9/9/2017, 5:38 pm

» [PEDIDO] Midnight's Darkness para ZPA
por PRO DARK 7/9/2017, 5:45 pm

» fast dl
por william 31/8/2017, 3:51 pm

» [ZP 5.0.8] Zombie Madness LIMIT! Ajuda Por Favor
por cancels 29/7/2017, 10:36 pm

» [Dúvida]Limit Madness
por cancels 29/7/2017, 7:31 pm

» [Dúvida]Menu VIP
por cancels 29/7/2017, 7:30 pm

» [Duvida]Menu
por cancels 28/7/2017, 9:31 pm

» [Pedido] Som De Tiros
por N0th1ng 26/7/2017, 7:06 pm

» [PEDIDO] Mudando Menu VIP
por PRO DARK 22/7/2017, 9:37 am

Frases filosóficas Zplague:
....
Os membros mais ativos da semana

Adsense

[PEDIDO]Bkadmin

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

[PEDIDO]Bkadmin

Mensagem por romulonp em 16/4/2013, 8:47 pm

Po , faz um tempo , eu tinha o banco do guhrds com bkadmin ja incluso so que alguem tinha editado pra min e eu nao lembro quem foi . sera que alguem poderia editar pra min ou isso e pago ?
.sma do banco
Spoiler:
#include
#include
#include
#include
#include
#include
#include

const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0

enum
{
REGS_ACCEPTED,
REGS_LOCKED,
BANK_ACCEPTED,
BANK_LOCKED
}

new const register_dados[] = "zp_rba_register"
new const bank_dados[] = "zp_rba_bank"

#define is_valid_player(%1) (1 <= %1 <= 32)
#define ADMIN_LEVEL ADMIN_IMMUNITY

new name[33][100]
new password[33][100]
new name_log[33][100]
new password2[33][100]
new g_name[33][100]
new g_tentativas[33]
new MudarSenhaAtual[33],
MudarSenhaNova[33]

new bool:loggedin[33]

new cvar_menustyle, cvar_punhish, cvar_tentativas, cvar_bantime

new bool:g_bSawMotd[33]
#define MOTD_FLAG_ARG 1
#define MOTD_FLAG_END 1
#define m_iMenuCode 205

new PlayerID[33]

new szText[555 char]

public plugin_init()
{
register_plugin("[ZP] Systems: Register + Bank", "2.5", "Mottzi/GuhRDS")
register_dictionary("zp_SystemsGuhRDS.txt")

cvar_menustyle = register_cvar("zp_menu_style", "1") // 1 - Len | 2 - Formatex
cvar_punhish = register_cvar("zp_error-pass_punish", "1") // 1 - Kick | 2 - Ban
cvar_tentativas = register_cvar("zp_error-pass_amount", "3") // Errar 3 Vezes
cvar_bantime = register_cvar("zp_error-pass_punish-bantime", "5") // Tempo do Ban

register_clcmd("jointeam", "check_status")
register_clcmd("chooseteam", "check_status")
register_clcmd("say", "HookSayCommands")
register_clcmd("say_team", "HookSayCommands")

register_clcmd("[Registrar]Login_Nome", "cmd_register_loginname_check")
register_clcmd("[Registrar]Login_Senha", "cmd_register_loginpw_check")
register_clcmd("[Logar]Login_Nome", "cmd_login_loginname_check")
register_clcmd("[Logar]Login_Senha", "cmd_login_loginpw_check")
register_clcmd("[Banco]Sacar_Quantidade", "cmd_bank_withdrawamount_check")
register_clcmd("[Banco]Depositar_Quantidade", "cmd_bank_depositamount_check")

register_clcmd("[Admin]Adicionar_Dados", "cmd_admin_adddata_check")
register_clcmd("[Admin]Remover_Dados", "cmd_admin_rmvdata_check")
register_clcmd("[Admin]Verificar_Dados" ,"cmd_admin_vrfdata_check")
register_clcmd("[Admin]DarAPs_Quantidade", "cmd_admin_addaps_check")
register_clcmd("[Admin]RemoverAPs_Quantidade", "cmd_admin_rmvaps_check")
register_clcmd("[Admin]ModificarAPs_Quantidade", "cmd_admin_modfaps_check")

register_clcmd("[MudarSenha]Senha_Atual_", "cmd_check_mudar_senha")
register_clcmd("[MudarSenha]Nova_Senha_", "cmd_mudar_senha")

register_concmd("zp_account_list", "cmdShowList", ADMIN_LEVEL, "zp_account_list")
register_concmd("zp_account_setap", "cmdSetAp", ADMIN_LEVEL, "zp_account_setap ")

register_message(get_user_msgid("ShowMenu"), "message_ShowMenu")
register_message(get_user_msgid("VGUIMenu"), "message_VGUIMenu")
register_message(get_user_msgid("MOTD"), "message_MOTD")

register_logevent("round_first", 2, "0=World triggered", "1&Restart_Round_")
register_logevent("round_first", 2, "0=World triggered", "1=Game_Commencing")

register_menu("Register", KEYSMENU, "cmd_register_menu_handler1")
register_menu("Bank", KEYSMENU, "cmd_bank_menu_handler1")
register_menu("Admin", KEYSMENU, "cmd_admin_menu_handler1")
}

public plugin_precache()
{
precache_sound("SystemsGuhRDS/regs_accepted_v2.wav")
precache_sound("SystemsGuhRDS/regs_locked_v2.wav")
precache_sound("SystemsGuhRDS/bank_accepted_v2.wav")
precache_sound("SystemsGuhRDS/bank_locked_v2.wav")
}

public client_connect(id)
{
remove_task(id)
}

public client_putinserver(id)
{
g_bSawMotd[id] = false

loggedin[id] = false
g_tentativas[id] = 0
g_name[id] = "Nao esta Logado"

set_task(1.0, "check_status", id)

return PLUGIN_CONTINUE
}

public client_disconnect(id)
{
cmdsave(id)

loggedin[id] = false
g_tentativas[id] = 0
g_name[id] = "Nao esta Logado"

remove_task(id)
}

public check_status(id)
{
new players[32], pnum, tempid;
get_players(players, pnum);

for(new i; i {
tempid = players[i];

if(!loggedin[tempid])
{
cmd_register_menu(id)
set_task(60.0, "check_login", id)
}
}
}

public check_login(id)
{
if(loggedin[id] == false)
{
server_cmd("kick #%i Nao logou", get_user_userid(id))

new Nick[33], Ip[13], SteamID[51]

get_user_ip(id, Ip[id], 12)
get_user_authid(id, SteamID[id], 50)
get_user_name(id, Nick[id], 32)

LogsNotLogged("------------------------------------------------------------------------------------------------------------------------")
LogsNotLogged("Registro: Jogador Kickado | Motivo: Não Logou")
LogsNotLogged("Jogador: Nome: %s", Nick[id])
LogsNotLogged("Jogador: IP: %s", Ip[id])
LogsNotLogged("Jogador: SteamID: %s", SteamID[id])
LogsNotLogged("------------------------------------------------------------------------------------------------------------------------")
}
}

////////////////////////////////////////////////////////////////////////////
///////////////////////// Hooks Select Team & Motd /////////////////////////
////////////////////////////////////////////////////////////////////////////

public message_ShowMenu(iMsgID, iDest, iReceiver)
{
new const Team_Select[] = "#Team_Select"

new szMenu[sizeof(Team_Select)]
get_msg_arg_string(4, szMenu, charsmax(szMenu))

if(!equal(szMenu, Team_Select))
{
return PLUGIN_CONTINUE
}
set_pdata_int(iReceiver, m_iMenuCode, 0)

return PLUGIN_HANDLED
}

public message_VGUIMenu(iMsgID, iDest, iReceiver)
{
if(get_msg_arg_int(1) != 2)
{
return PLUGIN_CONTINUE
}
return PLUGIN_HANDLED;
}

public message_MOTD(msgid, dest, id)
{
if(!g_bSawMotd[id])
{
if(get_msg_arg_int(MOTD_FLAG_ARG) == MOTD_FLAG_END)
{
g_bSawMotd[id] = true
}
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

/////////////////////////////////////////////////////////////////////
///////////////////////// Events First Round/////////////////////////
/////////////////////////////////////////////////////////////////////

public round_first()
{
set_cvar_num("mp_limitteams", 0)
set_cvar_num("mp_autoteambalance", 0)
set_cvar_num("sv_restartround", 1)
}

///////////////////////////////////////////////////////////////////////
///////////////////////// Sistema de Registro /////////////////////////
///////////////////////////////////////////////////////////////////////

public cmd_register_menu(id)
{
if(get_pcvar_num(cvar_menustyle) == 1)
{
static menu[240], len
len = 0

len += formatex(menu[len], charsmax(menu) - len, "\rEvilSkill.TeaM Sistema de Registro^n^n", id, "MENU_REGISTER_SYSTEM")
if(loggedin[id] == true)
len += formatex(menu[len], charsmax(menu) - len, "\d1. %L^n", id, "MENU_REGS_REGISTER")
else
len += formatex(menu[len], charsmax(menu) - len, loggedin[id] ? "\d1. %L^n" : "\r1. \w%L^n", id, "MENU_REGS_REGISTER")
len += formatex(menu[len], charsmax(menu) - len, loggedin[id] ? "\d2. %L^n^n" : "\r2. \w%L^n^n", id, "MENU_REGS_LOGAR")
len += formatex(menu[len], charsmax(menu) - len, loggedin[id] ? "\r3. \w%L^n" : "\d3. %L^n", id, "MENU_REGS_CHANGE_LOGIN-NAME")
len += formatex(menu[len], charsmax(menu) - len, loggedin[id] ? "\r4. \w%L^n^n" : "\d4. %L^n^n", id, "MENU_REGS_CHANGE_LOGIN-PW")
len += formatex(menu[len], charsmax(menu) - len, loggedin[id] ? "\r5. \w%L^n^n" : "\d5. %L^n^n", id, "MENU_REGS_ACCOUNT_EXIT")
len += formatex(menu[len], charsmax(menu) - len, loggedin[id] ? "\r0. \w%L^n" : "\d0. %L^n", id, "MENU_REGS_EXIT")

show_menu(id, KEYSMENU, menu, -1, "Register")
}
else if(get_pcvar_num(cvar_menustyle) == 2)
{
formatex(szText, charsmax(szText), "%L", id, "MENU_REGISTER_SYSTEM")
new menu = menu_create(szText, "cmd_register_menu_handler2")
if(loggedin[id] == true)
formatex(szText, charsmax(szText), "%L", id, "MENU_REGS_REGISTER")
else
formatex(szText, charsmax(szText), loggedin[id] ? "\d%L" : "\w%L", id, "MENU_REGS_REGISTER")
menu_additem(menu, szText, "1", 0)
formatex(szText, charsmax(szText), loggedin[id] ? "\d%L^n" : "\w%L^n", id, "MENU_REGS_LOGAR")
menu_additem(menu, szText, "2", 0)
formatex(szText, charsmax(szText), loggedin[id] ? "\w%L" : "\d%L", id, "MENU_REGS_CHANGE_LOGIN-NAME")
menu_additem(menu, szText, "3", 0)
formatex(szText, charsmax(szText), loggedin[id] ? "\w%L^n" : "\d%L^n", id, "MENU_REGS_CHANGE_LOGIN-PW")
menu_additem(menu, szText, "4", 0)
formatex(szText, charsmax(szText), loggedin[id] ? "\w%L" : "\d%L", id, "MENU_REGS_ACCOUNT_EXIT")
menu_additem(menu, szText, "5", 0)

menu_display(id, menu, 0)
}
}

public cmd_register_menu_handler1(id, key)
{
if(get_pcvar_num(cvar_menustyle) == 1)
{
switch(key)
{
case 0: cmd_register_check(id)
case 1: cmd_login_check(id)
case 2: cmd_register_menu(id)
case 3: filtrar_mudar_senha(id)
case 4: cmd_logout(id)
case 9: check_login(id)
}
if(key != 0 && key != 1 && key != 2 && key != 3 && key != 4 && key != 9)
{
cmd_register_menu(id)
return PLUGIN_HANDLED
}
}
return PLUGIN_HANDLED
}

public cmd_register_menu_handler2(id, menu, item)
{
if(get_pcvar_num(cvar_menustyle) == 2)
{
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: cmd_register_check(id)
case 2: cmd_login_check(id)
case 3: cmd_register_menu(id)
case 4: filtrar_mudar_senha(id)
case 5: cmd_logout(id)
case 0: check_login(id)
}
if(key != 1 && key != 2 && key != 3 && key != 4 && key != 5 && key != 0)
{
cmd_register_menu(id)
return PLUGIN_HANDLED
}
}
return PLUGIN_HANDLED
}

public cmd_register_check(id)
{
if(loggedin[id] == true)
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_YOU_ARE_LOGGED")
EmitSound(id, REGS_LOCKED)

cmd_register_menu(id)
}
else
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_TYPE_REGISTER_LOGIN_ACCOUNT")
EmitSound(id, REGS_ACCEPTED)

client_cmd(id, "messagemode [Registrar]Login_Nome")
}
}

public cmd_register_loginname_check(id)
{
read_args(name[id], 99)
remove_quotes(name[id])
new name2[33][100]

if(loggedin[id] == true)
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_YOU_ARE_LOGGED")
EmitSound(id, REGS_LOCKED)

cmd_register_menu(id)
}
else
{
if(fvault_get_data(register_dados, name[id], name2[id], 99) == 0 && containi(name[id], " ") == -1)
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_TYPE_REGISTER_PASS_ACCOUNT")
EmitSound(id, REGS_ACCEPTED)

client_cmd(id, "messagemode [Registrar]Login_Senha")
}
else if(fvault_get_data(register_dados, name[id], name2[id], 99) == 1)
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 7.0, 0.01, 2.0, 2.0)
show_dhudmessage(id, "%L^n%L", LANG_PLAYER, "REGS_REGISTER_LOGIN_INVALID", LANG_PLAYER, "TRY_AGAIN")
EmitSound(id, REGS_LOCKED)

cmd_register_menu(id)
}
}
}

public cmd_register_loginpw_check(id)
{
read_args(password[id], 99)
remove_quotes(password[id])

if(loggedin[id] == true)
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_YOU_ARE_LOGGED")
EmitSound(id, REGS_LOCKED)

cmd_register_menu(id)
}
else
{
if(containi(password[id], " ") == -1)
{
EmitSound(id, REGS_ACCEPTED)

fvault_set_data(register_dados, name[id], password[id])

loggedin[id] = true
g_name[id] = name[id]

remove_task(id)

client_cmd(id, "jointeam 5")

client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "REGS_ACCOUNTNEW_CREATED")
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "REGS_ACCOUNTNEW_LOGIN", name[id])
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "REGS_ACCOUNTNEW_PASSWORD", password[id])

LogsRegister("------------------------------------------------------------------------------------------------------------------------")
LogsRegister("Registro: Novos Dados Adcionados")
LogsRegister("Login: %s", name[id])
LogsRegister("Senha: %s", password[id])
LogsRegister("------------------------------------------------------------------------------------------------------------------------")
}
else
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 7.0, 0.01, 2.0, 2.0)
show_dhudmessage(id, "%L^n%L", LANG_PLAYER, "REGS_REGISTER_PASS_INVALID", LANG_PLAYER, "TRY_AGAIN")
EmitSound(id, REGS_LOCKED)

client_cmd(id, "messagemode [Registrar]Login_Senha")
}
}
}

public cmd_login_check(id)
{
if(loggedin[id] == false)
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_TYPE_LOGIN_ACCOUNT")

client_cmd(id, "messagemode [Logar]Login_Nome")
}
else if(loggedin[id] == true)
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_YOU_ARE_LOGGED")
EmitSound(id, REGS_LOCKED)

cmd_register_menu(id)
}
}

public cmd_login_loginname_check(id)
{
read_args(name_log[id], 99)
remove_quotes(name_log[id])
new name2[33][100]

if(loggedin[id] == false)
{
if(fvault_get_data(register_dados, name_log[id], name2[id], 99) == 0)
{
EmitSound(id, REGS_LOCKED)
cmd_register_menu(id)

set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 7.0, 0.01, 2.0, 2.0)
show_dhudmessage(id, "%L^n%L", LANG_PLAYER, "REGS_LOGIN_NAME_INVALID", LANG_PLAYER, "TRY_AGAIN")
}
else
{
EmitSound(id, REGS_ACCEPTED)
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, "%L", LANG_PLAYER, "REGS_TYPE_REGISTER_PASS_ACCOUNT")
}
}
else if(loggedin[id] == true)
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_YOU_ARE_LOGGED")
EmitSound(id, REGS_LOCKED)

cmd_register_menu(id)
}
}

public cmd_login_loginpw_check(id)
{
read_args(password2[id], 99)
remove_quotes(password2[id])
new data[140]

if(loggedin[id] == false)
{
fvault_get_data(register_dados, name_log[id], data, 139)

if(equali(data, password2[id]))
{
EmitSound(id, REGS_ACCEPTED)

loggedin[id] = true
g_name[id] = name_log[id]

remove_task(id)

client_cmd(id, "jointeam 5")

new Nick[33], Ip[13], SteamID[51]

get_user_ip(id, Ip[id], 12)
get_user_authid(id, SteamID[id], 50)
get_user_name(id, Nick[id], 32)
}
else
{
EmitSound(id, REGS_LOCKED)
cmd_register_menu(id)
g_tentativas[id]++
check_punish(id)

set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 7.0, 0.01, 2.0, 2.0)
show_dhudmessage(id, "%L^n%L", LANG_PLAYER, "REGS_LOGIN_PASS_INVALID", LANG_PLAYER, "TRY_AGAIN")
}
}
else if(loggedin[id] == true)
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_YOU_ARE_LOGGED")
EmitSound(id, REGS_LOCKED)

cmd_register_menu(id)
}
}

public check_punish(id)
{
if(g_tentativas[id] >= get_pcvar_num(cvar_tentativas))
{
new punish = get_pcvar_num(cvar_punhish)
if(punish <= 0 || punish >= 3)
return PLUGIN_HANDLED

new Nick[33], Ip[13], SteamID[51];

get_user_ip(id, Ip[id], 12)
get_user_authid(id, SteamID[id], 50)
get_user_name(id, Nick[id], 32)

if(punish == 1)
{
server_cmd("kick #%i foi kickado por errar a senha muitas vezes", get_user_userid(id))
LogsErrorPass("------------------------------------------------------------------------------------------------------------------------")
LogsErrorPass("Registro: Jogador Kickado | Motivo: Errou A Senha Muitas Vezes.")
LogsErrorPass("Jogador: Nome: %s", Nick[id])
LogsErrorPass("Jogador: IP: %s", Ip[id])
LogsErrorPass("Jogador: SteamID: %s", SteamID[id])
LogsErrorPass("------------------------------------------------------------------------------------------------------------------------")
return PLUGIN_HANDLED
}
if(punish == 2)
{
server_cmd("amx_banip #%i %i ^"foi banido %d minutos por errar a senha %s vezes^"", get_user_userid(id), get_pcvar_num(cvar_bantime), get_pcvar_num(cvar_bantime), get_pcvar_num(cvar_tentativas))
LogsErrorPass("------------------------------------------------------------------------------------------------------------------------")
LogsErrorPass("Registro: Jogador Banido | Motivo: Errou A Senha Muitas Vezes.")
LogsErrorPass("Jogador: Nome: %s", Nick[id])
LogsErrorPass("Jogador: IP: %s", Ip[id])
LogsErrorPass("Jogador: SteamID: %s", SteamID[id])
LogsErrorPass("------------------------------------------------------------------------------------------------------------------------")
}
}
return PLUGIN_CONTINUE
}

public cmd_logout(id)
{
if(loggedin[id] == false)
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_YOU_ARE_NOT_LOGGED")
EmitSound(id, REGS_LOCKED)

cmd_register_menu(id)
}
else
{
set_dhudmessage(0, 255, 0, -1.0, 0.0, 0, 5.0, 0.01, 1.5, 1.5)
show_dhudmessage(id, "%L", LANG_PLAYER, "REGS_LOGOUT_SUCESS")
EmitSound(id, REGS_ACCEPTED)

user_silentkill(id)
cs_set_user_team(id, CS_TEAM_UNASSIGNED)

loggedin[id] = false
g_name[id] = "Nao esta Logado"

check_status(id)
}
}

////////////////////////////////////////////////////////////////////
///////////////////////// Sistema de Banco /////////////////////////
////////////////////////////////////////////////////////////////////

public cmd_bank_menu(id)
{
if(loggedin[id] == true && get_pcvar_num(cvar_menustyle) == 1)
{
static menu[240], len
len = 0

new data1[30]
fvault_get_data(bank_dados, g_name[id], data1, charsmax(data1))

len += formatex(menu[len], charsmax(menu) - len, "\rEvilSkill.TeaM Banco^n^n", id, "MENU_BANK_SYSTEM")
if(equal(data1 , ""))
len += formatex(menu[len], charsmax(menu) - len, "%L^n%L^n^n", id, "MENU_BANK_ACCOUNT", g_name[id], id, "MENU_BANK_BALANCE0")
else
len += formatex(menu[len], charsmax(menu) - len, "%L^n%L^n^n", id, "MENU_BANK_ACCOUNT", g_name[id], id, "MENU_BANK_BALANCE", data1)
len += formatex(menu[len], charsmax(menu) - len, "\r1. \w%L^n", id, "MENU_BANK_TAKE_AMOUNT")
len += formatex(menu[len], charsmax(menu) - len, "\r2. \w%L^n^n", id, "MENU_BANK_TAKE_ALL")
len += formatex(menu[len], charsmax(menu) - len, "\r3. \w%L^n", id, "MENU_BANK_SAVE_AMOUNT")
len += formatex(menu[len], charsmax(menu) - len, "\r4. \w%L^n^n", id, "MENU_BANK_SAVE_ALL")
len += formatex(menu[len], charsmax(menu) - len, "\r0. \w%L", id, "MENU_BANK_EXIT")

show_menu(id, KEYSMENU, menu, -1, "Bank")
}
else if(loggedin[id] == true && get_pcvar_num(cvar_menustyle) == 2)
{
new szText[100]

new data1[30]
fvault_get_data("zp_rba_bank", g_name[id], data1, charsmax(data1))

if(equal(data1 , ""))
formatex(szText, charsmax(szText), "%L^n^n%L^n%L", id, "MENU_BANK_SYSTEM" , id, "MENU_BANK_ACCOUNT", g_name[id], id, "MENU_BANK_BALANCE0")
else
formatex(szText, charsmax(szText), "%L^n^n%L^n%L", id, "MENU_BANK_SYSTEM" , id, "MENU_BANK_ACCOUNT", g_name[id], id, "MENU_BANK_BALANCE", data1)
new menu = menu_create(szText, "cmd_bank_menu_handler2")
formatex(szText, charsmax(szText), "\w%L", id, "MENU_BANK_TAKE_AMOUNT")
menu_additem(menu, szText, "1", 0)
formatex(szText, charsmax(szText), "\w%L^n", id, "MENU_BANK_TAKE_ALL")
menu_additem(menu, szText, "2", 0)
formatex(szText, charsmax(szText), "\w%L", id, "MENU_BANK_SAVE_AMOUNT")
menu_additem(menu, szText, "3", 0)
formatex(szText, charsmax(szText), "\w%L", id, "MENU_BANK_SAVE_ALL")
menu_additem(menu, szText, "4", 0)
menu_display(id, menu, 0)
}
}

public cmd_bank_menu_handler1(id, key)
{
if(loggedin[id] == true && get_pcvar_num(cvar_menustyle) == 1)
{
switch(key)
{
case 0: client_cmd(id, "messagemode [Banco]Sacar_Quantidade")
case 1: cmd_bank_withdrawall(id)
case 2: client_cmd(id, "messagemode [Banco]Depositar_Quantidade")
case 3: cmd_bank_depositall(id)
}
if(key != 0 && key != 1 && key != 2 && key != 3 && key != 9)
{
cmd_bank_menu(id)
return PLUGIN_HANDLED
}
}
else
{
cmd_register_menu(id)
EmitSound(id, REGS_LOCKED)
}
return PLUGIN_HANDLED
}

public cmd_bank_menu_handler2(id, menu, item)
{
if(loggedin[id] == true && get_pcvar_num(cvar_menustyle) == 2)
{
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 [Banco]Sacar_Quantidade")
case 2: cmd_bank_withdrawall(id)
case 3: client_cmd(id, "messagemode [Banco]Depositar_Quantidade")
case 4: cmd_bank_depositall(id)
}
if(key != 0 && key != 1 && key != 2 && key != 3 && key != 4)
{
cmd_bank_menu(id)
return PLUGIN_HANDLED
}
}
else
{
cmd_register_menu(id)
EmitSound(id, REGS_LOCKED)
}
return PLUGIN_HANDLED
}

public cmd_bank_withdrawamount_check(id)
{
if(loggedin[id] == true)
{
new amout[30]
read_args(amout, charsmax(amout))
remove_quotes(amout)

if(!valid_ammt(amout, strlen(amout)))
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_QUANTITY_INVALID")
EmitSound(id, BANK_LOCKED)

return PLUGIN_HANDLED
}

new data1[30]; fvault_get_data(bank_dados, g_name[id], data1, charsmax(data1))

new want = str_to_num(amout)
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)
EmitSound(id, BANK_LOCKED)

return PLUGIN_HANDLED
}

zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + want)

num_to_str(have - want, amout, charsmax(amout))
fvault_set_data(bank_dados, g_name[id], amout)

client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_TAKE_AP", want)
EmitSound(id, BANK_ACCEPTED)
}
else
{
cmd_register_menu(id)
}
return PLUGIN_HANDLED
}

public cmd_bank_withdrawall(id)
{
if(loggedin[id] == true)
{
new data1[30]; fvault_get_data(bank_dados, 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")
fvault_set_data(bank_dados, g_name[id], string1)

client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_TAKE_AP", have)
EmitSound(id, BANK_ACCEPTED)
}
else
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_HAVE_0AP_BANK")
EmitSound(id, BANK_LOCKED)
}
}
else
{
cmd_register_menu(id)
}
}

public cmd_bank_depositamount_check(id)
{
if(loggedin[id] == true)
{
new amout[30]
read_args(amout, charsmax(amout))
remove_quotes(amout)

if(!valid_ammt(amout, strlen(amout)))
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_QUANTITY_INVALID")
EmitSound(id, BANK_LOCKED)

return PLUGIN_HANDLED
}

new want = str_to_num(amout)
new aps = zp_get_user_ammo_packs(id)

if(want > aps)
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_NOT_HAVE_AP", want)
EmitSound(id, BANK_LOCKED)

return PLUGIN_HANDLED
}

new data1[30]; fvault_get_data(bank_dados, g_name[id], data1, charsmax(data1))
new aps_bank = str_to_num(data1)

new save_aps = aps_bank + want

num_to_str(save_aps, amout, charsmax(amout))
fvault_set_data(bank_dados, g_name[id], amout)
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_BANK", aps_bank + want)
EmitSound(id, BANK_ACCEPTED)
}
else
{
cmd_register_menu(id)
}
return PLUGIN_HANDLED
}

public cmd_bank_depositall(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")
EmitSound(id, BANK_LOCKED)

return PLUGIN_HANDLED
}

new aps_have[30]; fvault_get_data(bank_dados, g_name[id], aps_have, 29)

new result = aps + str_to_num(aps_have)

new aps2[30]
formatex(aps2, charsmax(aps2), "%i", result)
fvault_set_data(bank_dados, g_name[id], aps2)
zp_set_user_ammo_packs(id, 0)

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)
EmitSound(id, BANK_ACCEPTED)
}
else
{
cmd_register_menu(id)
}
return PLUGIN_HANDLED
}

bool:valid_ammt(const ammt[], len)
{
static const valid_chars[][] = { "0" ,"1" ,"2" ,"3" ,"4" ,"5" ,"6" ,"7" ,"8" ,"9" }
static i, a, valids;

valids = 0

for(i = 0; i < len; i++)
{
for(a = 0; a < sizeof(valid_chars); a++)
{
if(ammt[i] == valid_chars[a][0])
{
valids++
break
}
}
}
if(valids != len)
return false
return true
}

/////////////////////////////////////////////////////////////////////
///////////////////////// Comandos de Admin /////////////////////////
/////////////////////////////////////////////////////////////////////

public cmdShowList(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL))
return PLUGIN_HANDLED

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 {
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]; fvault_get_data(bank_dados, g_name[tempid], aps, 9)
client_print(id, print_console, "%s - %s - %s", name, g_name[tempid], aps)
}
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public cmdSetAp(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL))
return PLUGIN_HANDLED

new arg1[50], arg2[50], name2[40]
read_argv(1, arg1, charsmax(arg1))

if(fvault_get_data(register_dados, arg1, name2, 39) == 1)
{
read_argv(2, arg2, charsmax(arg2))
fvault_set_data(bank_dados, arg1, arg2)

client_printcolor(0, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_BANK-ACCAPS_MDFY", arg1, arg2)
}
else
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_REGS-ACC_NOTEXIST", arg1)
}
return PLUGIN_CONTINUE
}

public cmd_admin_menu(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL))
return PLUGIN_HANDLED

if(get_pcvar_num(cvar_menustyle) == 1)
{
static menu[240], len
len = 0

len += formatex(menu[len], charsmax(menu) - len, "%L^n^n", id, "MENU_ADM")
len += formatex(menu[len], charsmax(menu) - len, "\r1. \w%L^n", id, "MENU_ADM_ADDDATA")
len += formatex(menu[len], charsmax(menu) - len, "\r2. \w%L^n", id, "MENU_ADM_RMVDATA")
len += formatex(menu[len], charsmax(menu) - len, "\r3. \w%L^n^n", id, "MENU_ADM_VRFYDATA")
len += formatex(menu[len], charsmax(menu) - len, "\r4. \w%L^n", id, "MENU_ADM_ADDAP")
len += formatex(menu[len], charsmax(menu) - len, "\r5. \w%L^n", id, "MENU_ADM_RMVAP")
len += formatex(menu[len], charsmax(menu) - len, "\r6. \w%L^n^n", id, "MENU_ADM_MDFYAP")
len += formatex(menu[len], charsmax(menu) - len, "\r0. \w%L", id, "MENU_ADM_EXIT")

show_menu(id, KEYSMENU, menu, -1, "Admin")
}
else if(get_pcvar_num(cvar_menustyle) == 2)
{
formatex(szText, charsmax(szText), "%L", id, "MENU_ADM")
new menu = menu_create(szText, "cmd_admin_menu_handler2")
formatex(szText, charsmax(szText), "\w%L", id, "MENU_ADM_ADDDATA")
menu_additem(menu, szText, "1", 0)
formatex(szText, charsmax(szText), "\w%L", id, "MENU_ADM_RMVDATA")
menu_additem(menu, szText, "2", 0)
formatex(szText, charsmax(szText), "\w%L^n", id, "MENU_ADM_VRFYDATA")
menu_additem(menu, szText, "3", 0)
formatex(szText, charsmax(szText), "\w%L", id, "MENU_ADM_ADDAP")
menu_additem(menu, szText, "4", 0)
formatex(szText, charsmax(szText), "\w%L", id, "MENU_ADM_RMVAP")
menu_additem(menu, szText, "5", 0)
formatex(szText, charsmax(szText), "\w%L", id, "MENU_ADM_MDFYAP")
menu_additem(menu, szText, "6", 0)
menu_display(id, menu, 0)
}
return PLUGIN_HANDLED
}

public cmd_admin_menu_handler1(id, key)
{
if(get_pcvar_num(cvar_menustyle) == 1)
{
switch(key)
{
case 0: client_cmd(id, "messagemode [Admin]Adicionar_Dados")
case 1: client_cmd(id, "messagemode [Admin]Remover_Dados")
case 2: client_cmd(id, "messagemode [Admin]Verificar_Dados")
case 3: cmd_admin_addaps_menu(id)
case 4: cmd_admin_rmvaps_menu(id)
case 5: cmd_admin_modfaps_menu(id)
}
if(key != 0 && key != 1 && key != 2 && key != 3 && key != 4 && key != 5 && key != 7 && key != 8 && key != 9)
{
cmd_register_menu(id)
return PLUGIN_HANDLED
}
}
return PLUGIN_HANDLED
}

public cmd_admin_menu_handler2(id, menu, item)
{
if(get_pcvar_num(cvar_menustyle) == 2)
{
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 [Admin]Adicionar_Dados")
case 2: client_cmd(id, "messagemode [Admin]Remover_Dados")
case 3: client_cmd(id, "messagemode [Admin]Verificar_Dados")
case 4: cmd_admin_addaps_menu(id)
case 5: cmd_admin_rmvaps_menu(id)
case 6: cmd_admin_modfaps_menu(id)
}
if(key != 1 && key != 2 && key != 3 && key != 4 && key != 5 && key != 6 && key != 0)
{
cmd_register_menu(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public cmd_admin_adddata_check(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL))
return PLUGIN_HANDLED

new arg1[50], arg2[50], arg3[15], name2[40]

read_argv(1, arg1, charsmax(arg1))

if(fvault_get_data(register_dados, arg1, name2, 39) == 1)
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_REGS-ACC_ALREADYEXISTS", arg1)
}
else
{
read_argv(2, arg2, charsmax(arg2))
read_argv(3, arg3, charsmax(arg3))

fvault_set_data(register_dados, arg1, arg2)
fvault_set_data(bank_dados, arg1, arg3)

client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_REGS-ACC_NEWLOGIN", arg1)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_REGS-ACC_NEWPASSWORD", arg2)
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_REGS-ACC_NEWAMMOPACKS", arg3)
}
return PLUGIN_CONTINUE
}

public cmd_admin_rmvdata_check(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL))
return PLUGIN_HANDLED

new arg1[50], name2[20]
read_argv(1, arg1, charsmax(arg1))

if(fvault_get_data(register_dados, arg1, name2[id], 19) == 1)
{
fvault_remove_key(register_dados, arg1)
fvault_remove_key(bank_dados, arg1)

client_printcolor(0, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_REGS-ACC_RMVD", arg1)
}
else
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_REGS-ACC_NOTEXIST", arg1)
}
return PLUGIN_CONTINUE
}

public cmd_admin_vrfdata_check(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL))
return PLUGIN_HANDLED

new arg1[50], name2[50]

read_argv(1, arg1, charsmax(arg1))
remove_quotes(arg1)

if(fvault_get_data(register_dados, arg1, name2, 49) == 1)
{
new aps[10]
fvault_get_data(bank_dados, arg1, aps, 9)
new apsnum = str_to_num(aps)

client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_BANK-ACC_VRFY", arg1, arg1, apsnum)
}
else
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_REGS-ACC_NOTEXIST", arg1)
}
return PLUGIN_CONTINUE
}

public cmd_admin_addaps_menu(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL))
return PLUGIN_HANDLED

formatex(szText, charsmax(szText), "%L^n\y%L", id, "MENU_ADM", id, "MENU_ADM_ADDAP")
new menu = menu_create(szText, "cmd_admin_addaps_handler")

new players[32], pnum, tempid
new szName[32], szTempid[10]

get_players(players, pnum)

for(new i; i {
tempid = players[i]

get_user_name(tempid, szName, 31)
num_to_str(tempid, szTempid, 9)

menu_additem(menu, szName, szTempid, 0)

menu_setprop(menu, MPROP_BACKNAME, "Voltar")
menu_setprop(menu, MPROP_NEXTNAME, "Proxima")
menu_setprop(menu, MPROP_EXITNAME, "\ySair")
}
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}

public cmd_admin_addaps_handler(id, menu, item)
{
if(item == MENU_EXIT)
return PLUGIN_HANDLED

new data[6], iName[64]
new access, callback

menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)

PlayerID[id] = str_to_num(data)

client_cmd(id, "messagemode [Admin]DarAPs_Quantidade")

return PLUGIN_HANDLED
}

public cmd_admin_addaps_check(id)
{
new amout[30]
read_args(amout, charsmax(amout))
remove_quotes(amout)

new szAps[11]
read_args(szAps, 10)
remove_quotes(szAps)

if(equal(szAps, "") || equal(szAps, " "))
return PLUGIN_HANDLED

new iAps = str_to_num(szAps)

if(iAps < 1) return PLUGIN_HANDLED

new numaps = str_to_num(amout)

if(!valid_ammt(amout, strlen(amout)))
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_QUANTITY_INVALID")
EmitSound(id, BANK_LOCKED)

return PLUGIN_HANDLED
}

new haveap[10]; fvault_get_data(bank_dados, g_name[PlayerID[id]], haveap, 9)
new numhaveap = str_to_num(haveap)

new result = numhaveap + numaps
num_to_str(result, amout, charsmax(amout))
fvault_set_data(bank_dados, g_name[PlayerID[id]], amout)

new szName[2][33]

get_user_name(id, szName[0], 32)
get_user_name(PlayerID[id], szName[1], 32)

LogsAdminAddAPs("------------------------------------------------------------------------------------------------------------------------")
LogsAdminAddAPs("Registro: Admin Add APs.")
LogsAdminAddAPs("Admin: Nome: %s", szName[0])
LogsAdminAddAPs("------------")
LogsAdminAddAPs("Jogador: Nome: %s", szName[1])
LogsAdminAddAPs("Jogador: Login: %s", g_name[PlayerID[id]])
LogsAdminAddAPs("Jogador: APs Adicionados: Indefinido")
LogsAdminAddAPs("Jogador: APs Banco: %s", numaps)
LogsAdminAddAPs("------------------------------------------------------------------------------------------------------------------------")

//client_printcolor(0, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_BANK-ACCAPS_ADD", szName[0], g_name[id])
//client_printcolor(0, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "PLAYER_LOGGED", g_name[id], szName[1])
client_printcolor(id, "!g[ZP] !yVoce Adicionou !t%s !yammopacks na conta: !t%s", szAps, g_name[PlayerID[id]])
client_printcolor(PlayerID[id], "!g[ZP] !yForam adicionados !t%s !yammopacks na sua conta.", szAps)

return PLUGIN_CONTINUE
}

public cmd_admin_rmvaps_menu(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL))
return PLUGIN_HANDLED

formatex(szText, charsmax(szText), "%L^n\y%L", id, "MENU_ADM", id, "MENU_ADM_RMVAP")
new menu = menu_create(szText, "cmd_admin_rmvaps_handler")

new players[32], pnum, tempid;
new szName[32], szTempid[10];

get_players(players, pnum);

for(new i; i {
tempid = players[i];

get_user_name(tempid, szName, 31);
num_to_str(tempid, szTempid, 9);

menu_additem(menu, szName, szTempid, 0);

menu_setprop(menu, MPROP_BACKNAME, "Voltar")
menu_setprop(menu, MPROP_NEXTNAME, "Proxima")
menu_setprop(menu, MPROP_EXITNAME, "\ySair")
}
menu_display(id, menu, 0);
return PLUGIN_HANDLED
}

public cmd_admin_rmvaps_handler(id, menu, item)
{
if(item == MENU_EXIT)
return PLUGIN_HANDLED;

new data[6], iName[64];
new access, callback;

menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

PlayerID[id] = str_to_num(data);

client_cmd(id, "messagemode [Admin]RemoverAPs_Quantidade")

return PLUGIN_HANDLED;
}

public cmd_admin_rmvaps_check(id)
{
new amout[30]
read_args(amout, charsmax(amout))
remove_quotes(amout)

new numaps = str_to_num(amout)

if(!valid_ammt(amout, strlen(amout)))
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_QUANTITY_INVALID")
EmitSound(id, BANK_LOCKED)

return PLUGIN_HANDLED
}

new haveap[10]; fvault_get_data(bank_dados, g_name[PlayerID[id]], haveap, 9)
new numhaveap = str_to_num(haveap)

new result = numhaveap - numaps
num_to_str(result, amout, charsmax(amout))
fvault_set_data(bank_dados, g_name[PlayerID[id]], amout)

new szName[2][33]

get_user_name(id, szName[0], 32)
get_user_name(PlayerID[id], szName[1], 32)

LogsAdminRemoveAPs("------------------------------------------------------------------------------------------------------------------------")
LogsAdminRemoveAPs("Registro: Admin Remove APs.")
LogsAdminRemoveAPs("Admin: Nome: %s", szName[0])
LogsAdminRemoveAPs("------------")
LogsAdminRemoveAPs("Jogador: Nome: %s", szName[1])
LogsAdminRemoveAPs("Jogador: Login: %s", g_name[PlayerID[id]])
LogsAdminRemoveAPs("Jogador: APs Removidos: Indefinido")
LogsAdminRemoveAPs("Jogador: APs Banco: %s", numaps)
LogsAdminRemoveAPs("------------------------------------------------------------------------------------------------------------------------")

client_printcolor(0, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_BANK-ACCAPS_RMV", szName[0], g_name[PlayerID[id]])
client_printcolor(0, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "PLAYER_LOGGED", g_name[PlayerID[id]], szName[1])

return PLUGIN_CONTINUE
}

public cmd_admin_modfaps_menu(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL))
return PLUGIN_HANDLED

formatex(szText, charsmax(szText), "%L^n\y%L", id, "MENU_ADM", id, "MENU_ADM_MDFYAP")
new menu = menu_create(szText, "cmd_admin_modfaps_handler")

new players[32], pnum, tempid;
new szName[32], szTempid[10];

get_players(players, pnum);

for(new i; i {
tempid = players[i];

get_user_name(tempid, szName, 31);
num_to_str(tempid, szTempid, 9);

menu_additem(menu, szName, szTempid, 0);

menu_setprop(menu, MPROP_BACKNAME, "Voltar")
menu_setprop(menu, MPROP_NEXTNAME, "Proxima")
menu_setprop(menu, MPROP_EXITNAME, "\ySair")
}
menu_display(id, menu, 0);
return PLUGIN_HANDLED
}

public cmd_admin_modfaps_handler(id, menu, item)
{
if(item == MENU_EXIT)
return PLUGIN_HANDLED;

new data[6], iName[64];
new access, callback;

menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

PlayerID[id] = str_to_num(data);

client_cmd(id, "messagemode [Admin]ModificarAPs_Quantidade")

return PLUGIN_HANDLED;
}

public cmd_admin_modfaps_check(id)
{
new amout[30]
read_args(amout, charsmax(amout))
remove_quotes(amout)

new numaps = str_to_num(amout)

if(!valid_ammt(amout, strlen(amout)))
{
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_QUANTITY_INVALID")
EmitSound(id, BANK_LOCKED)

return PLUGIN_HANDLED
}

new haveap[10]; fvault_get_data(bank_dados, g_name[PlayerID[id]], haveap, 9)

new result = numaps
num_to_str(result, amout, charsmax(amout))
fvault_set_data(bank_dados, g_name[PlayerID[id]], amout)

new szName[2][33]

get_user_name(id, szName[0], 32)
get_user_name(PlayerID[id], szName[1], 32)

LogsAdminModifyAPs("------------------------------------------------------------------------------------------------------------------------")
LogsAdminModifyAPs("Registro: Admin Modf APs.")
LogsAdminModifyAPs("Admin: Nome: %s", szName[0])
LogsAdminModifyAPs("------------")
LogsAdminModifyAPs("Jogador: Nome: %s", szName[1])
LogsAdminModifyAPs("Jogador: Login: %s", g_name[id])
LogsAdminModifyAPs("Jogador: APs Modificados p/: %s", numaps)
LogsAdminModifyAPs("------------------------------------------------------------------------------------------------------------------------")

//client_printcolor(0, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "ADM_BANK-ACCAPS_MDFY", szName[0], g_name[id], numaps)
//client_printcolor(0, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "PLAYER_LOGGED", g_name[id], szName[1])
client_printcolor(id, "!g[ZP] !yVoce modificou os ammopacks packs da conta: !t%s !ypara !t%s.", g_name[PlayerID[id]], numaps)

return PLUGIN_CONTINUE
}

/////////////////////////////////////////////////////////////////////
///////////////////////// Hook Say Commands /////////////////////////
/////////////////////////////////////////////////////////////////////

public cmdsave(id)
{
new aps = zp_get_user_ammo_packs(id)

if(aps == 0)
{
return PLUGIN_HANDLED;
}

new aps_have[30]
fvault_get_data(bank_dados, g_name[id], aps_have, 29)

new result = aps + str_to_num(aps_have)

new aps2[30]
formatex(aps2, charsmax(aps2), "%i", result)
fvault_set_data(bank_dados, g_name[id], aps2)

zp_set_user_ammo_packs(id, 0)

return PLUGIN_CONTINUE
}

public HookSayCommands(id, value, amout)
{
new text[70], arg1[32], arg2[32], arg3[6];
read_args(text, sizeof(text) - 1);
remove_quotes(text);
arg1[0] = '^0';
arg2[0] = '^0';
arg3[0] = '^0';
parse(text, arg1, sizeof(arg1) - 1, arg2, sizeof(arg2) - 1, arg3, sizeof(arg3) - 1);

if (equali(arg1, "/", 1) || equali(arg1, ".", 1) || equali(arg1, "!", 1))
format(arg1, 31, arg1[1]);

if (arg3[0])
return PLUGIN_CONTINUE;

if (equali(arg1, "conta") || equali(arg1, "account") || equali(arg1, "registro")
|| equali(arg1, "register") || equali(arg1, "reg") || equali(arg1, "login"))
{
cmd_register_menu(id)

return PLUGIN_HANDLED
}
if (equali(arg1, "admin") || equali(arg1, "adm"))
{
if (equali(arg2, "menus") || equali(arg2, "menu")
|| equali(arg2, "comandos") || equali(arg2, "comando")
|| equali(arg2, "commands") || equali(arg2, "command")
|| equali(arg2, "cmds") || equali(arg2, "cmd"))
{
cmd_admin_menu(id)

return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
if(loggedin[id] == true)
{
if (equali(arg1, "banco") || equali(arg1, "bank"))
{
cmd_bank_menu(id)

return PLUGIN_HANDLED
}
else if (equali(arg1, "sacar") || equali(arg1, "take"))
{
if (isdigit(arg2[0]) || arg2[0] == '-' && isdigit(arg2[1]))
{
cmd_bank_withdrawamount_check(id)

return PLUGIN_HANDLED
}
else if (equali(arg2, "tudo") || equali(arg2, "all"))
{
cmd_bank_withdrawall(id)

return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
else if (equali(arg1, "depositar") || equali(arg1, "deposit") || equali(arg1, "save"))
{
if (isdigit(arg2[0]) || arg2[0] == '-' && isdigit(arg2[1]))
{
cmd_bank_depositamount_check(id)

return PLUGIN_HANDLED
}
else if (equali(arg2, "tudo") || equali(arg2, "all"))
{
cmd_bank_depositall(id)

return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
else if (equali(arg1, "saldo"))
{
if (!arg2[0])
{
new data1[30]
fvault_get_data(bank_dados, g_name[id], data1, charsmax(data1))
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_BALANCE_M3", data1);
}
else
{
new id2 = cmd_target(id, arg2, 2)
if (!id2)
return PLUGIN_CONTINUE

static id2name[32]
get_user_name(id2, id2name, 31)
new data1[30]
fvault_get_data(bank_dados, g_name[id2], data1[id2], charsmax(data1))
client_printcolor(id, "%L %L", LANG_PLAYER, "TAG", LANG_PLAYER, "BANK_BALANCE_PLAYER", id2name, data1[id2])

return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
else
{
cmd_register_menu(id)
}
return PLUGIN_CONTINUE
}

//////////////////////////////////////////////////////////
///////////////////////// Stocks /////////////////////////
//////////////////////////////////////////////////////////

stock EmitSound(index, sound)
{
switch(sound)
{
case REGS_ACCEPTED: client_cmd(index, "spk SystemsGuhRDS/regs_accepted_v2")
case REGS_LOCKED: client_cmd(index, "spk SystemsGuhRDS/regs_locked_v2")
case BANK_ACCEPTED: client_cmd(index, "spk SystemsGuhRDS/bank_accepted_v2")
case BANK_LOCKED: client_cmd(index, "spk SystemsGuhRDS/bank_locked_v2")
}
}

stock client_printcolor(target, const message[], any:...)
{
static buffer[512], i, argscount;
argscount = numargs();

static g_msgSayText, g_MaxPlayers;
if(!g_msgSayText)
{
g_msgSayText = get_user_msgid("SayText");
}
if(!g_MaxPlayers)
{
g_MaxPlayers = get_maxplayers();
}
if (!target)
{
static player;
for (player = 1; player <= g_MaxPlayers; player++)
{
if (!is_user_connected(player))
continue;

static changed[5], changedcount;
changedcount = 0;

for (i = 2; i < argscount; i++)
{
if (getarg(i) == LANG_PLAYER)
{
setarg(i, 0, player);
changed[changedcount] = i;
changedcount++;
}
}
vformat(buffer, charsmax(buffer), message, 3);

replace_all(buffer, charsmax(buffer), "!g", "^4");
replace_all(buffer, charsmax(buffer), "!y", "^1");
replace_all(buffer, charsmax(buffer), "!t", "^3");

message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, player);
write_byte(player);
write_string(buffer);
message_end();
for (i = 0; i < changedcount; i++)
setarg(changed[i], 0, LANG_PLAYER);
}
}
else
{
vformat(buffer, charsmax(buffer), message, 3);

replace_all(buffer, charsmax(buffer), "!g", "^4");
replace_all(buffer, charsmax(buffer), "!y", "^1");
replace_all(buffer, charsmax(buffer), "!t", "^3");

message_begin(MSG_ONE, g_msgSayText, _, target);
write_byte(target);
write_string(buffer);
message_end();
}
}
public filtrar_mudar_senha(id)
{
check_status(id)
if(loggedin[id]==false)
{
set_dhudmessage(255, 0, 0, -1.0, 0.0, 0, 7.0, 0.01, 2.0, 2.0)
show_dhudmessage(id, "Voce precisa estar logado.")
cmd_register_menu(id)
}
else
{
set_dhudmessage(0, 0, 255, -1.0, 0.0, 0, 7.0, 0.01, 2.0, 2.0)
show_dhudmessage(id, "Digite sua senha atual.")
client_cmd(id, "messagemode [MudarSenha]Senha_Atual_")
}
return PLUGIN_CONTINUE
}
public cmd_check_mudar_senha(id)
{
read_args(MudarSenhaAtual[id], charsmax(MudarSenhaAtual))
remove_quotes(MudarSenhaAtual[id])
trim(MudarSenhaAtual[id])

if(equal(MudarSenhaAtual[id], "") || equal(MudarSenhaAtual[id], " "))
{
set_dhudmessage(0, 0, 255, -1.0, 0.0, 0, 7.0, 0.01, 2.0, 2.0)
show_dhudmessage(id, "Senha Digitada nao e valida.")
cmd_register_menu(id)
return PLUGIN_HANDLED
}
new tempData[521];
new tempData2[512]

new data[140]
fvault_get_data(register_dados, name_log[id], data, 139)

parse(data, password[id], 190)

if(equal(MudarSenhaAtual[id], password[id]))
{
set_dhudmessage(0, 0, 255, -1.0, 0.0, 0, 7.0, 0.01, 2.0, 2.0)
show_dhudmessage(id, "Digite uma nova senha.")
client_cmd(id, "messagemode [MudarSenha]Nova_Senha_")
}
else
{
set_dhudmessage(0, 0, 255, -1.0, 0.0, 0, 7.0, 0.01, 2.0, 2.0)
show_dhudmessage(id, "Senha Digitada nao e valida.")
cmd_register_menu(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

public cmd_mudar_senha(id)
{
read_args(MudarSenhaNova[id], charsmax(MudarSenhaNova))
remove_quotes(MudarSenhaNova[id])
trim(MudarSenhaNova[id])

new tempData[521];

new data[140]
fvault_get_data(register_dados, name_log[id], data, 139)
//fvault_get_data(register_dados, name[id], tempData[id], 520)
parse(tempData[id], password[id], 190)

if(equal(MudarSenhaAtual[id], "") || equal(MudarSenhaAtual[id], " "))
{
set_dhudmessage(0, 0, 255, -1.0, 0.0, 0, 7.0, 0.01, 2.0, 2.0)
show_dhudmessage(id, "Senha Digitada nao e valida.")
cmd_register_menu(id)
return PLUGIN_HANDLED
}
else
{
new tempData2[512]

formatex(tempData2[id], charsmax(tempData), "%s", MudarSenhaNova[id])

fvault_set_data(register_dados, name_log[id], tempData2[id])
client_printcolor(id, "%L !ySua senha foi alterada com sucesso. Senha antiga: !t%s !y|| Nova Senha: !t%s", LANG_PLAYER, "TAG", MudarSenhaAtual[id], MudarSenhaNova[id])
cmd_register_menu(id)
}
return PLUGIN_CONTINUE
}
////////////////////////////////////////////////////////
///////////////////////// Logs /////////////////////////
////////////////////////////////////////////////////////

LogsRegister(const message_fmt[], any:...)
{
static message[500]
vformat(message, sizeof(message) - 1, message_fmt, 2)

static filename[96]
new base[51], fr_data[51]
get_basedir(base, 50)

if(!filename[0])
{
get_basedir(filename, sizeof(filename) - 1)
add(filename, sizeof(filename) - 1, "logs/register_history.log")
}
format_time(fr_data, sizeof(filename) - 1, "%d-%m-%Y")
format(filename, sizeof(filename) - 1, "%s/logs/register_history_%s.log", base, fr_data)

log_to_file(filename, "%s", message)
}

LogsErrorPass(const message_fmt[], any:...)
{
static message[500]
vformat(message, sizeof(message) - 1, message_fmt, 2)

static filename[96]
new base[51], fr_data[51]
get_basedir(base, 50)

if(!filename[0])
{
get_basedir(filename, sizeof(filename) - 1)
add(filename, sizeof(filename) - 1, "logs/login-pass_error_history.log")
}
format_time(fr_data, sizeof(filename) - 1, "%d-%m-%Y")
format(filename, sizeof(filename) - 1, "%s/logs/login-pass_error_history_%s.log", base, fr_data)

log_to_file(filename, "%s", message);
}

LogsAdminAddAPs(const message_fmt[], any:...)
{
static message[500]
vformat(message, sizeof(message) - 1, message_fmt, 2)

static filename[96]
new base[51], fr_data[51]
get_basedir(base, 50)

if(!filename[0])
{
get_basedir(filename, sizeof(filename) - 1)
add(filename, sizeof(filename) - 1, "logs/admin_addaps_history.log")
}
format_time(fr_data, sizeof(filename) - 1, "%d-%m-%Y")
format(filename, sizeof(filename) - 1, "%s/logs/admin_addaps_history_%s.log", base, fr_data)

log_to_file(filename, "%s", message)
}

LogsAdminRemoveAPs(const message_fmt[], any:...)
{
static message[500]
vformat(message, sizeof(message) - 1, message_fmt, 2)

static filename[96]
new base[51], fr_data[51]
get_basedir(base, 50)

if( !filename[0] )
{
get_basedir(filename, sizeof(filename) - 1)
add(filename, sizeof(filename) - 1, "logs/admin_removeaps_history.log")
}
format_time(fr_data, sizeof(filename) - 1, "%d-%m-%Y")
format(filename, sizeof(filename) - 1, "%s/logs/admin_removeaps_history_%s.log", base, fr_data)

log_to_file(filename, "%s", message)
}

LogsAdminModifyAPs(const message_fmt[], any:...)
{
static message[500]
vformat(message, sizeof(message) - 1, message_fmt, 2)

static filename[96]
new base[51], fr_data[51]
get_basedir(base, 50)

if(!filename[0])
{
get_basedir(filename, sizeof(filename) - 1)
add(filename, sizeof(filename) - 1, "logs/admin_modifyaps_history.log")
}
format_time(fr_data, sizeof(filename) - 1, "%d-%m-%Y")
format(filename, sizeof(filename) - 1, "%s/logs/admin_modifyaps_history_%s.log", base, fr_data)

log_to_file(filename, "%s", message)
}

LogsNotLogged(const message_fmt[], any:...)
{
static message[500]
vformat(message, sizeof(message) - 1, message_fmt, 2)

static filename[96]
new base[51], fr_data[51]
get_basedir(base, 50)

if(!filename[0])
{
get_basedir(filename, sizeof(filename) - 1)
add(filename, sizeof(filename) - 1, "logs/not_loggedkick_history.log")
}
format_time(fr_data, sizeof(filename) - 1, "%d-%m-%Y")
format(filename, sizeof(filename) - 1, "%s/logs/not_loggedkick_history_%s.log", base, fr_data)

log_to_file(filename, "%s", message)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/
avatar
romulonp
Humano
Humano

Nick : Dii-Menor
Masculino Número de Mensagens : 223
Ammo Packs : 1955
Honra : 0
Data de inscrição : 18/04/2012

Ver perfil do usuário suportebetakillers

Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo

- Tópicos similares

 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum