Bom galera é o seguinte vcs poderiam me ajudar a trocar o flag do bkadmin da letra "A" para "V", pois só eu quero ter acesso n quero que master tenha acesso somente fundador.
Esse BKadmin ja vem incluido com o banco de ammo packs.
Obrigado.
.Sma abaixo.
Esse BKadmin ja vem incluido com o banco de ammo packs.
Obrigado.
.Sma abaixo.
- Código:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <nfvault>
#include <cstrike>
#include <zombieplague>
#define PLUGIN "Banco ammo Packs"
#define VERSION "2.0"
#define AUTHOR "Odair-Araujo | Wilian"
#define m_menuCode 205
enum
{
BANK_ACCEPTED,
BANK_LOCKED,
BANK_ACESS_ACEITO,
BANK_SENHA_RECUSADA,
BANK_WELCOME
}
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
const OFFSET_CSMENUCODE = 205
new g_registrado[33]
new login_registro[33][20], password_registro[33][20], password_confirm[33][20]
new login_logar[33][10], password_logar[33][10]
new change_password_old[33], change_password_new[33]
new conta_banco[33][100], saldo_banco[33], saldo_banco_temp[33]
new register_data[128], bank_data[128], bank_data_temp[128]
new const register_key[] = "Contas_Registro"
new const bank_key[] = "Banco_Saldo"
new const bank_key_temp[] = "Banco_Saldo_Temporario"
new const BaseDadosRegistro[] = "db_registro.txt"
new const BaseDadosBanco[] = "db_banco.txt"
new const BaseDadosBancoTemp[] = "db_banco_temp.txt"
new g_mensagens
new szText[555 char]
enum
{
ACTION_VERIFY_ACCOUNTDATA = 1,
ACTION_REMOVE_ACCOUNTDATA,
ACTION_BAN_ACCOUNTDATA,
ACTION_ADD_AMMOPACKS,
ACTION_REMOVE_AMMOPACKS,
ACTION_MODIFY_AMMOPACKS
}
#define PL_ACTION g_menu_data[id][0]
new g_menu_data[32+1][1]
new PlayerID[33]
new bool:acessomenu[33]
public client_authorized(id)
{
new authid[32]
get_user_authid(id, authid, 31)
if (access(id, ADMIN_IMMUNITY))
acessomenu[id] = true
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_message(get_user_msgid("ShowMenu"), "message_show_menu")
register_message(get_user_msgid("VGUIMenu"), "message_vgui_menu")
register_clcmd("chooseteam", "protecao3");
register_clcmd("jointeam", "protecao3");
register_menucmd(register_menuid("Terrorist_Select",1),511,"cmd_joinclass");
register_menucmd(register_menuid("CT_Select",1),511,"cmd_joinclass");
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
register_menu("Master Main Menu", KEYSMENU, "menu_registro_master")
register_menu("Banco Main Menu", KEYSMENU, "menu_banco_master")
register_clcmd("say /banco" , "mostrar_menu_banco")
register_clcmd("say banco" , "mostrar_menu_banco")
register_clcmd("say .banco" , "mostrar_menu_banco")
register_clcmd("say /bank" , "mostrar_menu_banco")
register_clcmd("say bank" , "mostrar_menu_banco")
register_clcmd("say .bank" , "mostrar_menu_banco")
register_clcmd("say /sair" , "sair_da_conta")
register_clcmd("[Registrar]Login", "registrar_login");
register_clcmd("[Registrar]Senha", "registrar_senha");
register_clcmd("[Registrar]Confirmar_Senha", "registrar_confirmar_senha");
register_clcmd("[Entrar]Login", "logar_login");
register_clcmd("[Entrar]Senha", "logar_senha");
register_clcmd("[MudarSenha]Senha_Atual", "cmd_change_password_old")
register_clcmd("[MudarSenha]Senha_Nova", "cmd_change_password_new")
register_clcmd("[Sacar]Quantia", "sacar_quantidade");
register_clcmd("[Depositar]Quantia", "depositar_quantidade");
register_clcmd("[Adicionar.AmmoPacks]Quantia", "cmd_add_ammopacks")
register_clcmd("[Remover.AmmoPacks]Quantia", "cmd_remove_ammopacks")
register_clcmd("[Modificar.AmmoPacks]Quantia", "cmd_modify_ammopacks")
register_clcmd("say", "say_commands")
register_clcmd("say_team", "say_commands")
register_event("DeathMsg","event_deathmsg","a")
register_forward(FM_Sys_Error, "fw_svshutdown");
register_forward(FM_GameShutdown, "fw_svshutdown");
register_forward(FM_ServerDeactivate , "fw_svshutdown");
register_forward(FM_ChangeLevel, "fw_svshutdown");
g_mensagens = CreateHudSyncObj()
nfv_file(BaseDadosRegistro, register_data, charsmax(register_data))
nfv_file(BaseDadosBanco, bank_data, charsmax(bank_data))
nfv_file(BaseDadosBancoTemp, bank_data_temp, charsmax(bank_data_temp))
}
public message_show_menu(msgid, dest, id) {
if(!g_registrado[id])
return PLUGIN_HANDLED
static team_select[] = "#Team_Select"
static menu_text_code[sizeof team_select]
get_msg_arg_string(4, menu_text_code, sizeof menu_text_code - 1)
if (!equal(menu_text_code, team_select))
return PLUGIN_CONTINUE
static param_menu_msgid[2]
param_menu_msgid[0] = msgid
set_force_team_join_task(id, msgid)
return PLUGIN_HANDLED
}
public message_vgui_menu(msgid, dest, id) {
if (get_msg_arg_int(1) != 2)
return PLUGIN_CONTINUE
if(!g_registrado[id])
return PLUGIN_HANDLED
static param_menu_msgid[2]
param_menu_msgid[0] = msgid
set_force_team_join_task(id, msgid)
return PLUGIN_HANDLED
}
set_force_team_join_task(id, menu_msgid) {
static param_menu_msgid[2]
param_menu_msgid[0] = menu_msgid
set_task(0.1, "task_force_team_join", id, param_menu_msgid, sizeof param_menu_msgid)
}
public task_force_team_join(menu_msgid[], id) {
static msg_block
msg_block = get_msg_block(menu_msgid[0])
set_msg_block(menu_msgid[0], BLOCK_SET)
set_msg_block(menu_msgid[0], msg_block)
}
public plugin_precache()
{
precache_sound("sound_banco/banco_acesso.wav")
precache_sound("sound_banco/banco_erro.wav")
precache_sound("sound_banco/banco_bemvindo.wav")
}
public fw_svshutdown()
{
for (new id = 1; id <= get_maxplayers(); id++)
if (is_user_connected(id))
salvar_packs(id)
}
public plugin_end()
{
for (new id = 1; id <= get_maxplayers(); id++)
if (is_user_connected(id))
salvar_packs(id)
}
public plugin_natives() register_native("registrado", "native_get_user_registrado", 1);
public native_get_user_registrado(id) return g_registrado[id];
public client_putinserver(id)
{
if(!is_user_bot(id) && !is_user_hltv(id))
{
set_task(0.5, "mostrar_menu_registro", id)
set_task(0.6, "som_entrada", id)
}
return PLUGIN_CONTINUE
}
public som_entrada(id) client_cmd(id, "spk sound_banco/banco_bemvindo")
public client_connect(id)
{
g_registrado[id] = false;
login_logar[id] = " "
password_logar[id] = " "
conta_banco[id] = " "
saldo_banco[id] = 0
remove_task(id)
return PLUGIN_CONTINUE;
}
public client_disconnect(id)
{
salvar_packs(id)
g_registrado[id] = false;
login_logar[id] = " "
password_logar[id] = " "
conta_banco[id] = " "
saldo_banco[id] = 0
saldo_banco_temp[id] = 0
zp_set_user_ammo_packs( id, 0 )
remove_task(id)
acessomenu[id] = false
}
public protecao1(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))
{
mostrar_menu_registro(iReceiver)
return PLUGIN_CONTINUE
}
set_pdata_int(iReceiver, m_menuCode, 0)
return PLUGIN_HANDLED
}
public protecao2(iMsgID, iDest, iReceiver)
{
if(get_msg_arg_int(1) != 2)
{
return PLUGIN_CONTINUE
}
return PLUGIN_HANDLED;
}
public protecao3(id)
{
static Team; Team = get_user_team(id)
if((Team == 0 || Team == 3) && !g_registrado[id])
{
mostrar_menu_registro(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public cmd_joinclass(id) return PLUGIN_HANDLED;
public fw_PlayerPreThink(id)
{
new ammo_packs = zp_get_user_ammo_packs(id)
saldo_banco_temp[id] = ammo_packs
}
public mostrar_menu_registro(id)
{
static menu[555], len
len = 0
len += formatex(menu[len], charsmax(menu) - len, g_registrado[id] ? "\wSistema De Registro^n^n" : "\wSistema de Registro\d^n^n")
len += formatex(menu[len], charsmax(menu) - len, g_registrado[id] ? "\wConta:\d %s^n\wSaldo:\r %i\d^n^n" : "", conta_banco[id], saldo_banco[id])
len += formatex(menu[len], charsmax(menu) - len, g_registrado[id] ? "\d1. Nova Conta^n" : "\r1. \wNova Conta^n")
len += formatex(menu[len], charsmax(menu) - len, g_registrado[id] ? "\d2. Entrar^n^n" : "\r2. \wEntrar^n^n")
len += formatex(menu[len], charsmax(menu) - len, g_registrado[id] ? "\r3. \wAlterar Senha^n" : "\d3. Alterar Senha^n")
len += formatex(menu[len], charsmax(menu) - len, g_registrado[id] ? "\r4. \wSair da Conta^n" : "\d4. Sair da Conta^n^n")
len += formatex(menu[len], charsmax(menu) - len, "\r0. \wSair^n^n")
set_pdata_int(id, OFFSET_CSMENUCODE, 0)
show_menu(id, KEYSMENU, menu, -1, "Master Main Menu")
return PLUGIN_HANDLED;
}
public menu_registro_master(id, key)
{
switch(key)
{
case 0:
{
if(!g_registrado[id])
{
client_cmd(id, "messagemode [Registrar]Login")
ClearSyncHud(id , g_mensagens)
set_hudmessage(1, 1, 255, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Digite um Login para sua Conta. ^nObs: Nao precisa ser o seu Nick!")
EmitSound(id, BANK_ACCEPTED)
}
else mostrar_menu_registro(id), EmitSound(id, BANK_LOCKED), ChatColor(id, "!g[ Register ] !yVoce ja esta Logado.")
}
case 1:
{
if(!g_registrado[id])
{
client_cmd(id, "messagemode [Entrar]Login")
ClearSyncHud(id , g_mensagens)
set_hudmessage(1, 1, 255, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Digite o Login da sua Conta.")
EmitSound(id, BANK_ACCEPTED)
}
else mostrar_menu_registro(id), EmitSound(id, BANK_LOCKED), ChatColor(id, "!g[ Register ] !yVoce ja esta Logado.")
}
case 2:
{
if(!g_registrado[id]) mostrar_menu_registro(id), EmitSound(id, BANK_LOCKED), ClearSyncHud(id , g_mensagens), set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5), ShowSyncHudMsg(id, g_mensagens, "Voce nao esta Logado.")
else trocar_senha(id)
}
case 3:
{
if(!g_registrado[id]) mostrar_menu_registro(id), EmitSound(id, BANK_LOCKED), ClearSyncHud(id , g_mensagens), set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5), ShowSyncHudMsg(id, g_mensagens, "Voce nao esta Logado.")
else sair_da_conta(id)
}
case 4,5,6,7: mostrar_menu_registro(id)
case 9: if(!g_registrado[id]) mostrar_menu_registro(id)
}
return PLUGIN_CONTINUE
}
public trocar_senha(id)
{
if(!g_registrado[id])
return PLUGIN_HANDLED
ClearSyncHud(id , g_mensagens)
set_hudmessage(1, 1, 255, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Digite a senha atual da sua Conta.")
EmitSound(id, BANK_ACCEPTED)
client_cmd(id, "messagemode [MudarSenha]Senha_Atual")
return PLUGIN_CONTINUE
}
public cmd_change_password_old(id)
{
if(!g_registrado[id])
return PLUGIN_HANDLED
read_args(change_password_old[id], charsmax(change_password_old))
remove_quotes(change_password_old[id])
trim(change_password_old[id])
new data[521]; nfv_get_data(register_data, register_key, login_logar[id], data[id], charsmax(data))
parse(data[id], password_logar[id], 190)
if(equal(change_password_old[id], password_logar[id]))
{
ClearSyncHud(id , g_mensagens)
set_hudmessage(1, 1, 255, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Digita uma Senha Nova para sua Conta. ^nDica: Nunca coloque uma senha antiga da Conta.")
EmitSound(id, BANK_ACCEPTED)
client_cmd(id, "messagemode [MudarSenha]Senha_Nova")
}
else
{
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Senha digitada esta Incorreta.")
EmitSound(id, BANK_SENHA_RECUSADA)
mostrar_menu_registro(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public cmd_change_password_new(id)
{
if(!g_registrado[id])
return PLUGIN_HANDLED
read_args(change_password_new[id], charsmax(change_password_new))
remove_quotes(change_password_new[id])
trim(change_password_new[id])
new symbol[30]; read_args(symbol, charsmax(symbol))
remove_quotes(symbol)
trim(symbol)
if (!valid_symbol(change_password_new[id], strlen(change_password_new[id])))
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens,"Sua Senha nao deve haver Simbolos ou Espaco.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
if (strlen(change_password_new[id]) <= 2)
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens,"Sua Nova Senha deve haver no minimo 3 Digitos.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
if (strlen(change_password_new[id]) >= 20)
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens,"Sua Nova Senha deve haver no maximo 20 Digitos.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
if (equal(change_password_new[id], login_registro[id]))
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Sua Senha deve ser diferente do Login.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
if (contain(change_password_new[id], login_registro[id]) != -1)
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Sua Senha nao deve haver partes do Login.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
ClearSyncHud(id , g_mensagens)
set_hudmessage(1, 1, 255, 0.04, 0.15, 2, 3.0, 3.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Sua Senha foi alterada com Sucesso!")
EmitSound(id, BANK_ACCEPTED)
ChatColor(id, "!g[ Register ] !ySua Senha foi alterada para: !g%s", change_password_new[id])
nfv_set_data(register_data, register_key, login_logar[id], change_password_new[id])
return PLUGIN_CONTINUE
}
public sair_da_conta(id)
{
if(!g_registrado[id]) return PLUGIN_HANDLED
salvar_packs(id)
g_registrado[id] = false;
login_registro[id] = ""
password_registro[id] = ""
password_confirm[id] = ""
login_logar[id] = ""
password_logar[id] = ""
conta_banco[id] = ""
saldo_banco[id] = 0
zp_set_user_ammo_packs(id, 0)
user_silentkill(id)
cs_set_user_team(id, CS_TEAM_UNASSIGNED)
mostrar_menu_registro(id)
return PLUGIN_HANDLED
}
public registrar_login(id)
{
if(g_registrado[id]) return PLUGIN_HANDLED
read_args(login_registro[id], 99)
remove_quotes(login_registro[id])
trim(login_registro[id])
new symbol[30]; read_args(symbol, charsmax(symbol))
remove_quotes(symbol)
trim(symbol)
if (!valid_symbol(symbol, strlen(symbol)))
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Seu Login nao deve haver Simbolos ou Espaco.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
if (strlen(login_registro[id]) < 3)
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Seu Login deve haver no minimo 3 Digitos.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
if (strlen(login_registro[id]) > 7)
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Seu Login deve haver no maximo 7 Digitos.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
static data[128]
if (nfv_get_data(register_data, register_key, login_registro[id], data, charsmax(data)))
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Este Login ja esta em Uso.")
EmitSound(id, BANK_LOCKED)
}
else
{
client_cmd(id, "messagemode [Registrar]Senha")
ClearSyncHud(id , g_mensagens)
set_hudmessage(1, 1, 255, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Digite uma Senha para sua Conta.^nObs: Coloque uma Senha Segura para sua Conta.")
EmitSound(id, BANK_ACCEPTED)
}
return PLUGIN_CONTINUE
}
public registrar_senha(id)
{
if(g_registrado[id]) return PLUGIN_HANDLED
read_args(password_registro[id], 99)
remove_quotes(password_registro[id])
trim(password_registro[id])
new symbol[30]; read_args(symbol, charsmax(symbol))
remove_quotes(symbol)
trim(symbol)
if (!valid_symbol(symbol, strlen(symbol)))
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens,"Sua Senha nao deve haver Simbolos ou Espaco.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
if(equal( password_registro[id], "123456") || equal( password_registro[id], "654321" ) ||
equal( password_registro[id], "012345" ) || equal( password_registro[id], "543210" )
|| equal( password_registro[id], "159753" ))
{
client_print( id, print_chat, "Voce nao pode ter uma senha tao facil")
change_password_new [id] = false
return PLUGIN_HANDLED;
}
if (strlen(password_registro[id]) <= 3)
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens,"Sua Senha deve haver no minimo 3 Digitos.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
if (strlen(password_registro[id]) >= 13)
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens,"Sua Senha deve haver no maximo 13 Digitos.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
if (equal(password_registro[id], login_registro[id]))
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Sua Senha deve ser diferente do Login.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
if (contain(password_registro[id], login_registro[id]) != -1)
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Sua Senha nao deve conter partes do Login.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
client_cmd(id, "messagemode [Registrar]Confirmar_Senha")
ClearSyncHud(id , g_mensagens)
set_hudmessage(1, 1, 255, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Confirme sua Senha.")
EmitSound(id, BANK_ACCEPTED)
return PLUGIN_HANDLED;
}
public registrar_confirmar_senha(id)
{
if(g_registrado[id]) return PLUGIN_HANDLED
read_args(password_confirm[id], 99)
remove_quotes(password_confirm[id])
trim(password_confirm[id])
if(equal(password_registro[id], password_confirm[id]))
{
menu_confirm(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(1, 255, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Verifique os Dados da sua Conta e Confirme!")
EmitSound(id, BANK_ACCEPTED)
}
else
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Senha Digita e diferente da Anterior.")
EmitSound(id, BANK_LOCKED)
}
return PLUGIN_HANDLED
}
public menu_confirm(id)
{
static item[255]
formatex(item, charsmax(item), "\rFinalizar o Registro:^n^nSeu Login: \d%s^n\rSua Senha: \d%s", login_registro[id], password_registro[id])
new menu = menu_create(item, "menu_confirm_handler")
menu_additem(menu, "\wConfirmar Registro", "1")
menu_additem(menu, "\wRetornar", "2")
menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)
set_pdata_int(id, OFFSET_CSMENUCODE, 0)
menu_display(id, menu, 0)
return PLUGIN_HANDLED;
}
public menu_confirm_handler(id, menu, item)
{
new data[6], iName[64], access, callback;
menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback);
switch (str_to_num(data))
{
case 1:
{
mostrar_menu_registro(id)
nfv_set_data(register_data, register_key, login_registro[id], password_registro[id])
ClearSyncHud(id , g_mensagens)
set_hudmessage(1, 255, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Sua Conta foi criada com Sucesso!")
ChatColor(id, "!g[ Register] !tSeu Login: !g%s", login_registro[id])
ChatColor(id, "!g[ Register] !tSua Senha: !g%s", password_registro[id])
ChatColor(id, "!g[ Register] !tAgora faca o !gLogin !te Bom Jogo.")
EmitSound(id, BANK_ACESS_ACEITO)
}
case 2:
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Preencha os dados da sua conta Novamente!")
EmitSound(id, BANK_LOCKED)
}
}
return PLUGIN_HANDLED;
}
public logar_login(id)
{
if(g_registrado[id]) return PLUGIN_HANDLED
read_args(login_logar[id], 99)
remove_quotes(login_logar[id])
trim(login_logar[id])
new players[32], pnum, tempid
get_players(players, pnum)
for( new i; i<pnum; i++ )
{
tempid = players[i]
if(id != tempid)
if(equal(login_logar[id], login_logar[tempid]))
{
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Essa Conta ja esta Logada no Servidor.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
}
new data[192]
if(!nfv_get_data(register_data, register_key, login_logar[id], data, charsmax(data)))
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Este Login nao esta Registrado no Banco de Dados.")
EmitSound(id, BANK_LOCKED)
}
else
{
client_cmd(id, "messagemode [Entrar]Senha")
ClearSyncHud(id , g_mensagens)
set_hudmessage(1, 1, 255, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Digite a Senha da sua Conta.")
EmitSound(id, BANK_ACCEPTED)
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public logar_senha(id)
{
if(g_registrado[id]) return PLUGIN_HANDLED
read_args(password_logar[id], 99)
remove_quotes(password_logar[id])
trim(password_logar[id])
new data[140]
nfv_get_data(register_data, register_key, login_logar[id], data, charsmax(data))
if(equali(data, password_logar[id]))
{
ClearSyncHud(id , g_mensagens)
ChatColor(id, "!g[ Register] !yVoce acaba de logar na Conta: !g%s!y!", login_logar[id])
EmitSound(id, BANK_ACESS_ACEITO)
engclient_cmd(id,"jointeam","5")
engclient_cmd(id,"joinclass","5")
conta_banco[id] = login_logar[id]
new data[140]
nfv_get_data(bank_data, bank_key, conta_banco[id], data, charsmax(data))
saldo_banco[id] = str_to_num(data)
new temp[140]
nfv_get_data(bank_data_temp, bank_key_temp, conta_banco[id], temp, charsmax(data))
saldo_banco_temp[id] = str_to_num(temp)
zp_set_user_ammo_packs( id, saldo_banco_temp[id] )
g_registrado[id] = true;
set_task(1.0, "task_autosave", id)
}
else
{
mostrar_menu_registro(id)
ClearSyncHud(id , g_mensagens)
set_hudmessage(255, 1, 1, 0.04, 0.15, 2, 3.0, 10.0, 0.04, 1.5)
ShowSyncHudMsg(id, g_mensagens, "Senha digitada esta Incorreta, Tente Novamente !!")
EmitSound(id, BANK_SENHA_RECUSADA)
}
return PLUGIN_HANDLED
}
public task_autosave(id)
salvar_packs_altomatico(id);
public salvar_packs_altomatico(id)
{
if(!g_registrado[id]) return PLUGIN_HANDLED
new string[30]; num_to_str(zp_get_user_ammo_packs( id ), string, charsmax(string));
nfv_set_data(bank_data_temp, bank_key_temp, conta_banco[id], string)
set_task(5.0, "task_autosave", id)
return PLUGIN_HANDLED;
}
public event_deathmsg()
{
new killer = read_data(1)
new victim = read_data(2)
if (!killer && !victim)
return PLUGIN_CONTINUE;
if(!g_registrado[killer]) return PLUGIN_HANDLED
if(!g_registrado[victim]) return PLUGIN_HANDLED
new string[30]; num_to_str(saldo_banco_temp[killer], string, charsmax(string));
nfv_set_data(bank_data_temp, bank_key_temp, conta_banco[killer], string)
new string2[30]; num_to_str(saldo_banco_temp[victim], string2, charsmax(string2));
nfv_set_data(bank_data_temp, bank_key_temp, conta_banco[victim], string2)
return PLUGIN_CONTINUE;
}
public salvar_packs(id)
{
if(!g_registrado[id]) return PLUGIN_HANDLED
new string[30]; num_to_str(zp_get_user_ammo_packs( id ), string, charsmax(string));
nfv_set_data(bank_data_temp, bank_key_temp, conta_banco[id], string)
return PLUGIN_HANDLED;
}
public mostrar_menu_banco(id)
{
if(!g_registrado[id]) return PLUGIN_HANDLED
static menu[555], len
len = 0
len += formatex(menu[len], charsmax(menu) - len, "\r[Banco] \wMenu do Banco^n^n\wConta:\d %s^n\wSaldo:\r %i^n^n", conta_banco[id], saldo_banco[id])
len += formatex(menu[len], charsmax(menu) - len, "\r1. \wSacar quantia^n")
len += formatex(menu[len], charsmax(menu) - len, "\r2. \wSacar tudo^n^n")
len += formatex(menu[len], charsmax(menu) - len, "\r3. \wDepositar quantia^n")
len += formatex(menu[len], charsmax(menu) - len, "\r4. \wDepositar tudo^n^n^n")
len += formatex(menu[len], charsmax(menu) - len, "\r0. \wSair")
set_pdata_int(id, OFFSET_CSMENUCODE, 0)
show_menu(id, KEYSMENU, menu, -1, "Banco Main Menu")
return PLUGIN_HANDLED;
}
public menu_banco_master(id, key)
{
switch (key)
{
case 0: client_cmd(id, "messagemode [Sacar]Quantia");
case 1: sacar_tudo(id);
case 2: client_cmd(id, "messagemode [Depositar]Quantia");
case 3: depositar_tudo(id);
}
}
public sacar_quantidade(id)
{
if(!g_registrado[id]) return PLUGIN_HANDLED
new quantidade[30]
read_args(quantidade, charsmax(quantidade))
remove_quotes(quantidade)
trim(quantidade)
if(equal(quantidade, "") || equal(quantidade, " "))
{
ChatColor(id, "!g[ Bank ] !yQuantia digitada e !gInvalida!y.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED;
}
if(!valid_ammt(quantidade, strlen(quantidade)))
{
ChatColor(id, "!g[ Bank ] !yQuantia digitada e !gInvalida!y.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED;
}
new qnt_saque = str_to_num(quantidade)
if(qnt_saque <= 0)
{
ChatColor(id, "!g[ Bank ] !yQuantia digitada e !gInvalida!y.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED;
}
if(qnt_saque > saldo_banco[id])
{
ChatColor(id, "!g[ Bank ] !yVoce nao possui !g%i !yAmmoPacks no Banco.", qnt_saque)
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED;
}
else
{
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + qnt_saque)
saldo_banco[id] -= qnt_saque
new string[30]; num_to_str(saldo_banco[id], string, charsmax(string));
nfv_set_data(bank_data, bank_key, conta_banco[id], string)
ChatColor(id, "!g[ Bank ] !yVoce sacou !g%i !yAmmoPacks.", qnt_saque)
ChatColor(id, "!g[ Bank ] !ySaldo no Banco: !g%i !yAmmoPacks.", saldo_banco[id])
EmitSound(id, BANK_ACCEPTED)
}
return PLUGIN_CONTINUE;
}
public sacar_tudo(id)
{
if(!g_registrado[id]) return PLUGIN_HANDLED
if(saldo_banco[id] > 0)
{
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + saldo_banco[id])
ChatColor(id, "!g[ Bank ] !yVoce sacou todos os !g%i !yAmmoPacks do Banco.", saldo_banco[id])
EmitSound(id, BANK_ACCEPTED)
saldo_banco[id] = 0
new string[30]; num_to_str(saldo_banco[id], string, charsmax(string));
nfv_set_data(bank_data, bank_key, conta_banco[id], string)
}
else ChatColor(id, "!g[ Bank ] !yVoce nao possui !gAmmoPacks !yno Banco."), EmitSound(id, BANK_LOCKED)
return PLUGIN_CONTINUE;
}
public depositar_quantidade(id)
{
if(!g_registrado[id]) return PLUGIN_HANDLED
new quantidade[30]
read_args(quantidade, charsmax(quantidade))
remove_quotes(quantidade)
trim(quantidade)
if(equal(quantidade, "") || equal(quantidade, " "))
{
ChatColor(id, "!g[ Bank ] !yQuantia digitada e !gInvalida!y.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED;
}
if(!valid_ammt(quantidade, strlen(quantidade)))
{
ChatColor(id, "!g[ Bank ] !yQuantia digitada e !gInvalida!y.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED;
}
new qnt_deposito = str_to_num(quantidade)
if(qnt_deposito <= 0)
{
ChatColor(id, "!g[ Bank ] !yQuantia digitada e !gInvalida!y.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED;
}
if(qnt_deposito > zp_get_user_ammo_packs(id))
{
ChatColor(id, "!g[ Bank] !yVoce nao possui !g%i !yAmmoPacks para Depositar.", qnt_deposito)
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED;
}
saldo_banco[id] += qnt_deposito
new string[30]; num_to_str(saldo_banco[id], string, charsmax(string));
nfv_set_data(bank_data, bank_key, conta_banco[id], string)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) - qnt_deposito)
ChatColor(id, "!g[ Bank ] !yVoce depositou !g%i !yAmmoPacks.", qnt_deposito)
ChatColor(id, "!g[ Bank ] !ySaldo no Banco: !g%i !yAmmoPacks.", saldo_banco[id])
EmitSound(id, BANK_ACCEPTED)
return PLUGIN_HANDLED;
}
public depositar_tudo(id)
{
if(!g_registrado[id]) return PLUGIN_HANDLED
if(zp_get_user_ammo_packs(id) == 0)
{
ChatColor(id, "!g[ Bank ] !yVoce nao possui !gAmmoPacks !ypara Depositar.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED;
}
saldo_banco[id] += zp_get_user_ammo_packs(id)
new string[30]; num_to_str(saldo_banco[id], string, charsmax(string));
nfv_set_data(bank_data, bank_key, conta_banco[id], string)
ChatColor(id, "!g[ Bank ] !yVoce depositou !g%i !yAmmoPacks.", zp_get_user_ammo_packs(id))
ChatColor(id, "!g[ Bank ] !ySaldo no Banco: !g%i !yAmmoPacks.", saldo_banco[id])
EmitSound(id, BANK_ACCEPTED)
zp_set_user_ammo_packs(id, 0)
return PLUGIN_HANDLED;
}
public say_commands(id)
{
if(!g_registrado[id]) return PLUGIN_HANDLED
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"))
{
mostrar_menu_registro(id)
return PLUGIN_HANDLED
}
if (equali(arg1, "bkadmin") || equali(arg1, "bkadm"))
{
cmd_admin_menu(id)
return PLUGIN_HANDLED
}
if(equali(arg1, "banco") || equali(arg1, "bank"))
{
if (!arg2[0])
{
mostrar_menu_banco(id)
return PLUGIN_HANDLED
}
else
{
new id2 = cmd_target(id, arg2, 2)
if (!id2)
return PLUGIN_CONTINUE
static id2name[32]
get_user_name(id2, id2name, 31)
ChatColor(id, "!g[ Bank ] !yO Jogador !g%s !ypossui !g%i !yAmmoPacks no Banco.", id2name, saldo_banco[id2])
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
else if(equali(arg1, "sacar") || equali(arg1, "withdraw") || equali(arg1, "take"))
{
if (isdigit(arg2[0]) || arg2[0] == '-' && isdigit(arg2[1]))
{
new amount = str_to_num(arg2);
if (amount < 0)
return PLUGIN_HANDLED
client_cmd(id, "[Sacar]Quantia ^"%i^"", amount)
return PLUGIN_HANDLED
}
else if(equali(arg2, "tudo") ||equali(arg2, "all"))
{
sacar_tudo(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
else if(equali(arg1, "depositar") || equali(arg1, "deposit") || equali(arg1, "store") || equali(arg1, "save"))
{
if (isdigit(arg2[0]) || arg2[0] == '-' && isdigit(arg2[1]))
{
new amount = str_to_num(arg2);
if (amount < 0)
return PLUGIN_HANDLED
client_cmd(id, "[Depositar]Quantia ^"%i^"", amount)
return PLUGIN_HANDLED
}
else if(equali(arg2, "tudo") || equali(arg2, "all"))
{
depositar_tudo(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
else if(equali(arg1, "saldo") || equali(arg1, "banco"))
{
if (!arg2[0])
{
ChatColor(id, "!g[ Bank ] !yVoce possui !g%i !yAmmoPacks no Banco.", saldo_banco[id])
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public cmd_admin_menu(id)
{
if(!acessomenu[id])
{
ChatColor(id, "!g[ BK Admin ] !yAcesso Negado.")
EmitSound(id, BANK_LOCKED)
return PLUGIN_HANDLED
}
new menu = menu_create("\r[BK ADMIN] \wMenu para admins", "cmd_admin_menu_handler")
menu_additem(menu, "Verificar Dados", "1")
menu_additem(menu, "Remover Conta", "2")
menu_additem(menu, "Desconectar Player ^n", "3")
menu_additem(menu, "\rAdicionar AmmoPacks", "4")
menu_additem(menu, "Remover AmmoPacks", "5")
menu_additem(menu, "Modificar AmmoPacks", "6")
menu_setprop(menu, MPROP_BACKNAME, "Voltar")
menu_setprop(menu, MPROP_NEXTNAME, "Proximo")
menu_setprop(menu, MPROP_EXITNAME, "Sair")
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}
public cmd_admin_menu_handler(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, 5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case ACTION_VERIFY_ACCOUNTDATA:
{
PL_ACTION = ACTION_VERIFY_ACCOUNTDATA
formatex(szText, charsmax(szText), "\ySelecione o Jogador para Verificar")
cmd_admin_submenu_playerlist(id)
}
case ACTION_REMOVE_ACCOUNTDATA:
{
PL_ACTION = ACTION_REMOVE_ACCOUNTDATA
formatex(szText, charsmax(szText), "\ySelecione o Jogador \r[Tenha Certeza]")
cmd_admin_submenu_playerlist(id)
}
case ACTION_BAN_ACCOUNTDATA:
{
PL_ACTION = ACTION_BAN_ACCOUNTDATA
formatex(szText, charsmax(szText), "\ySelecione o Jogador")
cmd_admin_submenu_playerlist(id)
}
case ACTION_ADD_AMMOPACKS:
{
PL_ACTION = ACTION_ADD_AMMOPACKS
formatex(szText, charsmax(szText), "\ySelecione o Jogador para \rAdicionar")
cmd_admin_submenu_playerlist(id)
}
case ACTION_REMOVE_AMMOPACKS:
{
PL_ACTION = ACTION_REMOVE_AMMOPACKS
formatex(szText, charsmax(szText), "\ySelecione o Jogador para \rRemover")
cmd_admin_submenu_playerlist(id)
}
case ACTION_MODIFY_AMMOPACKS:
{
PL_ACTION = ACTION_MODIFY_AMMOPACKS
formatex(szText, charsmax(szText), "\ySelecione o Jogador para \rModificar")
cmd_admin_submenu_playerlist(id)
}
}
return PLUGIN_HANDLED;
}
public cmd_admin_submenu_playerlist(id)
{
new menu = menu_create(szText, "cmd_admin_submenu_handler")
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(menu, szName, szTempid, 0)
}
menu_setprop(menu, MPROP_BACKNAME, "\wVoltar")
menu_setprop(menu, MPROP_NEXTNAME, "\wProxima")
menu_setprop(menu, MPROP_EXITNAME, "\wSair")
menu_display(id, menu, 0);
return PLUGIN_HANDLED
}
public cmd_admin_submenu_handler(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
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)
new AdminName[32]; get_user_name(id, AdminName, 31)
new PlayerName[32]; get_user_name(PlayerID[id], PlayerName, 31)
if(!is_user_connected(PlayerID[id]))
{
ChatColor(id, "!g[ BK Admin ] !yO Jogador !g%s !ynao esta no Servidor.", PlayerName)
EmitSound(id, BANK_LOCKED)
cmd_admin_menu(id)
return PLUGIN_HANDLED
}
if(!g_registrado[PlayerID[id]])
{
ChatColor(id, "!g[ BK Admin ] !yO Jogador !g%s !ynao esta Logado.", PlayerName)
EmitSound(id, BANK_LOCKED)
cmd_admin_menu(id)
return PLUGIN_HANDLED
}
switch (PL_ACTION)
{
case ACTION_VERIFY_ACCOUNTDATA:
{
static motd[1500], len; len = 0
len += formatex(motd[len], charsmax(motd) - len, "html><head><style type=^"text/css^">body{*: #000000;font-family:Verdana,Tahoma;}</style><meta http-equiv=^"Content-Type^" content=^"text/html; charset=windows-1257^"><font size=^"2^" color=^"#e0a518^"><b><center>Informacao do Jogador: %s</center></b></font></head><p><br /><font size=^"1^" color=^"#c0c0ff^">", PlayerName)
len += formatex(motd[len], charsmax(motd) - len, "<p><font size=^"1^" color=#ff0000><center> Conta: <font color=#00c000>%s</font></center>", login_logar[PlayerID[id]])
len += formatex(motd[len], charsmax(motd) - len, "<p><font size=^"1^" color=#ff0000><center> Senha: <font color=#00c000>%s</font></center>", password_logar[PlayerID[id]])
len += formatex(motd[len], charsmax(motd) - len, "<p><font size=^"1^" color=#ff0000><center> Banco: <font color=#00c000>%i</font></center>", saldo_banco[PlayerID[id]])
len += formatex(motd[len], charsmax(motd) - len, "<p><font size=^"1^" color=#ff0000><center> Ammo Packs: <font color=#00c000>%i</font></center>", zp_get_user_ammo_packs(PlayerID[id]))
show_motd(id, motd)
return PLUGIN_HANDLED
}
case ACTION_REMOVE_ACCOUNTDATA:
{
set_hudmessage(random_num(0,255), random_num(0,255), random_num(0,255), -1.0, -0.5, 1, 5.0, 5.0)
show_hudmessage(0, "ADMIN: '%s'^nRemoveu a Conta: '%s'^nJogador Logado na Conta: '%s' era: '%s'", AdminName, login_logar[PlayerID[id]], login_logar[PlayerID[id]], PlayerName)
nfv_take_data(register_data, register_key, login_logar[PlayerID[id]])
nfv_take_data(bank_data, bank_key, login_logar[PlayerID[id]])
nfv_take_data(bank_data_temp, bank_key_temp, login_logar[PlayerID[id]])
sair_da_conta(PlayerID[id])
static motd[1500], len; len = 0
len += formatex(motd[len], charsmax(motd) - len, "html><head><style type=^"text/css^">body{*: #000000;font-family:Verdana,Tahoma;}</style><meta http-equiv=^"Content-Type^" content=^"text/html; charset=windows-1257^"><font size=^"2^" color=^"#e0a518^"><b><center>Conta Removida</center></b></font></head><p><br /><font size=^"1^" color=^"#c0c0ff^">")
len += formatex(motd[len], charsmax(motd) - len, "<p><font size=^"2^" color=#ff0000><center> Admin: <font color=#00c000>%s</font></center>", AdminName)
len += formatex(motd[len], charsmax(motd) - len, "<p><font size=^"2^" color=#ff0000><center> Removeu todos os dados de sua Conta</font></center>")
show_motd(PlayerID[id], motd)
return PLUGIN_HANDLED
}
case ACTION_BAN_ACCOUNTDATA:
{
set_hudmessage(random_num(0,255), random_num(0,255), random_num(0,255), -1.0, -0.5, 2, 5.0, 5.0)
show_hudmessage(0, "Admin: '%s'^nDesconectou a Conta: '%s'^nJogador Logado na Conta: '%s' era: '%s'", AdminName, login_logar[PlayerID[id]], login_logar[PlayerID[id]], PlayerName)
nfv_prune(register_key, login_logar[PlayerID[id]], -1, -1)
nfv_prune(bank_key, login_logar[PlayerID[id]], -1, -1);
nfv_prune(bank_key_temp, login_logar[PlayerID[id]], -1, -1);
sair_da_conta(PlayerID[id])
static motd[1500], len; len = 0
len += formatex(motd[len], charsmax(motd) - len, "html><head><style type=^"text/css^">body{*: #000000;font-family:Verdana,Tahoma;}</style><meta http-equiv=^"Content-Type^" content=^"text/html; charset=windows-1257^"><font size=^"2^" color=^"#e0a518^"><b><center>Desconeccao de Player</center></b></font></head><p><br /><font size=^"1^" color=^"#c0c0ff^">")
len += formatex(motd[len], charsmax(motd) - len, "<p><font size=^"2^" color=#ff0000><center> Admin: <font color=#00c000>%s</font></center>", AdminName)
len += formatex(motd[len], charsmax(motd) - len, "<p><font size=^"2^" color=#ff0000><center> Desconectou voce dessa conta !!</font></center>")
show_motd(PlayerID[id], motd)
return PLUGIN_HANDLED
}
case ACTION_ADD_AMMOPACKS:
client_cmd(id, "messagemode [Adicionar.AmmoPacks]Quantia")
case ACTION_REMOVE_AMMOPACKS:
client_cmd(id, "messagemode [Remover.AmmoPacks]Quantia")
case ACTION_MODIFY_AMMOPACKS:
client_cmd(id, "messagemode [Modificar.AmmoPacks]Quantia")
}
return PLUGIN_HANDLED
}
public cmd_add_ammopacks(id)
{
new AdminName[32]; get_user_name(id, AdminName, 31)
new PlayerName[32]; get_user_name(PlayerID[id], PlayerName, 31)
new amount[30]; read_args(amount, charsmax(amount))
remove_quotes(amount)
new num_ammopacks = str_to_num(amount)
if(!valid_ammt(amount, strlen(amount)))
{
ChatColor(id, "!g[ BK Admin ] !yQuantia digitada e !gInvalida!y.")
EmitSound(id, BANK_LOCKED)
cmd_admin_menu(id)
return PLUGIN_HANDLED
}
if(num_ammopacks >= 0)
{
saldo_banco[PlayerID[id]] += num_ammopacks
new string[30]; num_to_str(saldo_banco[PlayerID[id]], string, charsmax(string));
nfv_set_data(bank_data, bank_key, conta_banco[PlayerID[id]], string)
ChatColor(id, "!g[ BK Admin ] !yVoce adicionou !g%i !yAmmoPacks na Conta: !g%s", num_ammopacks, PlayerName)
ChatColor(PlayerID[id], "!g[ BK Admin ] !yADMIN !gSUPREMO!y: !g%s!y adicionou !g%i !yAmmoPacks em sua Conta.", AdminName, num_ammopacks)
}
return PLUGIN_CONTINUE
}
public cmd_remove_ammopacks(id)
{
new AdminName[32]; get_user_name(id, AdminName, 31)
new PlayerName[32]; get_user_name(PlayerID[id], PlayerName, 31)
new amount[30]; read_args(amount, charsmax(amount))
remove_quotes(amount)
new num_ammopacks = str_to_num(amount)
if(!valid_ammt(amount, strlen(amount)))
{
ChatColor(id, "!g[ BK Admin] !yQuantia digitada e !gInvalida!y.")
EmitSound(id, BANK_LOCKED)
cmd_admin_menu(id)
return PLUGIN_HANDLED
}
saldo_banco[PlayerID[id]] -= num_ammopacks
new string[30]; num_to_str(saldo_banco[PlayerID[id]], string, charsmax(string));
nfv_set_data(bank_data, bank_key, conta_banco[PlayerID[id]], string)
ChatColor(id, "!g[ BK Admin ] !yVoce removeu !g%i !yAmmoPacks do Jogador: !g%s!y", num_ammopacks, PlayerName)
ChatColor(PlayerID[id], "!g[ BK Admin ] !yADMIN !gSUPREMO!y: !g%s !yremoveu !g%i !yAmmoPacks de sua Conta.", AdminName, num_ammopacks)
return PLUGIN_CONTINUE
}
public cmd_modify_ammopacks(id)
{
new AdminName[32]; get_user_name(id, AdminName, 31)
new PlayerName[32]; get_user_name(PlayerID[id], PlayerName, 31)
new amount[30]; read_args(amount, charsmax(amount))
remove_quotes(amount)
new num_ammopacks = str_to_num(amount)
if(!valid_ammt(amount, strlen(amount)))
{
ChatColor(id, "!g[ BK Admin ] !yQuantia digitada e !gInvalida!y.")
EmitSound(id, BANK_LOCKED)
cmd_admin_menu(id)
return PLUGIN_HANDLED
}
if(num_ammopacks >= 0)
{
saldo_banco[PlayerID[id]] = num_ammopacks
new string[30]; num_to_str(saldo_banco[PlayerID[id]], string, charsmax(string));
nfv_set_data(bank_data, bank_key, conta_banco[PlayerID[id]], string)
ChatColor(id, "!g[ BK Admin ] !yVoce modificou o Banco do Jogador !g%s !ypara !g%i !yAmmoPacks.", PlayerName, num_ammopacks)
ChatColor(PlayerID[id], "!g[ BK Admin ] !yADMIN !gSUPREMO!y: !g%s !ymodificou seu Banco para !g%i !yAmmoPacks.", AdminName, num_ammopacks)
cmd_admin_menu(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
stock EmitSound(id, sound)
{
switch(sound)
{
case BANK_ACCEPTED: client_cmd(id, "spk sound_banco/banco_acesso")
case BANK_LOCKED: client_cmd(id, "spk sound_banco/banco_erro")
case BANK_ACESS_ACEITO: client_cmd(id, "spk ^"access granted^"");
case BANK_SENHA_RECUSADA: client_cmd(id, "spk ^"access denied^"");
case BANK_WELCOME: client_cmd(id, "spk sound_banco/banco_bemvindo")
}
}
bool:valid_symbol(const symbol[], len)
{
new const valid_chars[][] =
{
"0" ,"1" ,"2" ,"3" ,"4" ,"5" ,"6" ,"7" ,"8" ,"9",
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
"k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
"u", "v", "w", "x", "y", "z"
}
static i, a, valids;
valids = 0
for(i = 0; i < len; i++)
{
for(a = 0; a < sizeof(valid_chars); a++)
{
if(symbol[i] == valid_chars[a][0])
{
valids++
break
}
}
}
if(valids != len)
return false
return true
}
bool:valid_ammt(const ammt[], len)
{
new 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;
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Chat Verde
replace_all(msg, 190, "!y", "^1") // Chat Normal
replace_all(msg, 190, "!t", "^3") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
replace_all(msg, 190, "!t2", "^0") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
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();
}
}
}