I'm not sure your method works, as you also convert first result char into an integer.
Try this :
PHP Code:
#include <amxmodx>
#define MAXPLAYERS 32
new g_pcvarMaxCount
new g_iCount[MAXPLAYERS+1]
public plugin_init()
{
register_plugin("Developer 0", "1.0.1", "connorr")
g_pcvarMaxCount = register_cvar("max_bad_value", "2")
set_task(10.0, "taskDeveloperCheck", _, _, _, "b")
}
public client_putinserver(id)
{
g_iCount[id] = 0
}
public taskDeveloperCheck()
{
new players[MAXPLAYERS], inum
get_players(players, inum, "ch") //don't collect BOTs & HLTVs
for(new i; i<inum; ++i)
{
query_client_cvar(players[i] , "developer" , "cvar_result")
}
}
public cvar_result(id, const cvar[], const value[])
{
new Float:fValue = str_to_float(value)
if(!fValue)
return
client_cmd(id, "developer 0")
client_print(id, print_chat, "Your ^"developer^" cvar has been set to 0, don't change it")
if(++g_iCount[id] >= get_pcvar_num(g_pcvarMaxCount))
{
server_cmd("kick #%d Developer isn't allowed on this server", get_user_userid(id))
}
}
__________________