Ajudem aiii!
Código:
zp_giveap <nome> <quantia>
amx_giveap <nome> <quantia>
Código:
#include <amxmodx>
#include <zombieplague>
#define PLUGIN "Dar Packs"
#define VERSION "1.0"
#define AUTHOR "Victor #"
new PlayerId[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /darpacks" , "SetPacks")
register_clcmd("Quantidade_Para_Dar" ,"CheckSet")
}
public SetPacks( id ) {
if(!(get_user_flags( id ) & ADMIN_BAN) )
return PLUGIN_HANDLED
new menu = menu_create("\rDar Packs:", "menuhandled");
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_EXITNAME, "\dSair" )
menu_setprop(menu, MPROP_BACKNAME, "\dVoltar" )
menu_setprop(menu, MPROP_NEXTNAME, "\dProxima" )
}
menu_display(id, menu);
return PLUGIN_HANDLED;
}
public menuhandled(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 Quantidade_Para_Dar")
client_print(id, print_chat, "Digite a Quantidade de AmmoPacks para Dar")
return PLUGIN_HANDLED;
}
public CheckSet( id ) {
new szArgs[40]
read_args( szArgs, 39 )
remove_quotes( szArgs )
trim( szArgs )
new szName[2][33]
get_user_name(id, szName[0], 32)
get_user_name(PlayerId[id], szName[1], 32)
new szNum = str_to_num(szArgs)
static log[100]
formatex(log, charsmax(log), "Admin %s deu %d Ammo Packs para o Player %s.", szName[0], szNum, szName[1])
log_to_file("Dar Packs.log", log)
zp_set_user_ammo_packs(PlayerId[id], zp_get_user_ammo_packs( PlayerId[id] ) + szNum)
}