@itoxicreal; the wrong was in the line of client_print, there are two values, "Values[value] & Exps[exp]" with just one field %d also you didn't use register_plugin !
PHP Code:
client_print(id, print_chat, "[CSO] You have just received %d $ and exp, try again after map change!", Values[value], Exps[exp]);
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <zp_buys>
new bool:bReward[ 33 ]
new const GET_CSO[ ][ ] =
{
"say /get",
"say_team /get"
}
enum GetReward
{
Value,
Exp
}
new g_szReward[ ][ GetReward ] =
{
{ 20000, 200 },
{ 35000, 400 },
{ 45000, 600 },
{ 50000, 800 },
{ 60000, 1000 },
{ 100000, 1500 }
}
public plugin_init( )
{
register_plugin( "Get random reward", VERSION, "Supremache" );
for (new i; i < sizeof GET_CSO; i++)
register_clcmd( GET_CSO[i], "GetReward" );
}
public GetReward( id )
{
if( bReward[ id ] )
{
client_print( id, print_chat, "[CSO] Retry again after map changes to get more Money&Exp!" );
}
else
{
new iValue = g_szReward[ random( sizeof( g_szReward ) ) ][ Value ]
new iExp = g_szReward[ random( sizeof( g_szReward ) ) ][ Exp ]
zp_cs_set_user_money( id, zp_cs_get_user_money(id) + iValue );
zp_set_user_exp( id, zp_get_user_exp(id) + iExp );
client_print( id, print_chat, "[CSO] You have just received $%d and %d exp, try again after map change!", iValue, iExp );
bReward[ id ] = true;
}
return PLUGIN_HANDLED;
}
__________________