Well, here is what am I using.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
new MyVariable[33], isDedicated, iMaxPlayers
public plugin_init()
{
isDedicated = is_dedicated_server()
iMaxPlayers = get_maxplayers()
}
public plugin_natives()
{
register_native("get_user_gold", "_get_user_gold")
}
public _get_user_gold(iPlugin, iParams)
{
if(iParams != 1)
return PLUGIN_CONTINUE
new id = get_param(1)
if(!(isDedicated <= id <= iMaxPlayers))
return PLUGIN_CONTINUE
return MyVariable[id]
}
For me it's quite simple. Here are only the basic checks, and you just return your variable. There isn't anything much to explain, indeed.
P.S.: IsDedicated stuff, for the most clear check (because it depends for the loop. If the server is dedicated, they begin from 1, otherwise, they begin from 0). Thanks to Black Rose (again)!
__________________