Hey can anyone help me add
zp_cs_set_user_money(id, zp_cs_get_user_money(id) + Values[value]);
zp_set_user_exp(id, zp_get_user_exp(id) + Exps[exp]);
in 1 line?
and edit the client print msg
client_print(id, print_chat, "[ZP] You have just received %d $ and %d exp, try again after map change!", Values[value]);
PHP Code:
#include <amxmodx>
#include <zombieplague>
new bool:g_HasMoneynEXP[33] = false;
new const GET_CSO[][] = {
"say /get",
"say_team /get"
}
new Values[6] = {
20000,
35000,
45000,
50000,
60000,
100000
}
new Exps[6] = {
200,
400,
600,
800,
1000,
1500
}
public plugin_init() {
register_cvar("cso_get", VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
for (new i; i < sizeof GET_CSO; i++)
register_clcmd(GET_CSO[i], "give_money_exp");
}
public plugin_natives()
{
register_native("zp_cs_get_user_money", "_get_money", 1)
register_native("zp_cs_set_user_money", "native_set_money", 1)
register_native("zp_get_user_exp", "native_get_exp", 1)
register_native("zp_set_user_exp", "native_set_exp", 1)
}
public give_money_exp(id) {
if(g_HasMoneynEXP[id]) {
client_print(id, print_chat, "[CSO] Retry again after map changes to get more Money&Exp!");
return PLUGIN_HANDLED;
}
new value = random_num(20000, 100000)
new exp = random_num(200, 1500)
zp_cs_set_user_money(id, zp_cs_get_user_money(id) + Values[value]);
zp_set_user_exp(id, zp_get_user_exp(id) + Exps[exp]);
client_print(id, print_chat, "[CSO] You have just received %d $ and exp, try again after map change!", Values[value], Exps[exp]);
g_HasMoneynEXP[id] = true;
return PLUGIN_HANDLED;
}