View Single Post
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-28-2008 , 05:55   Re: Help I need a developer 1 blocker
Reply With Quote #7

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
(playersinum"ch"//don't collect BOTs & HLTVs
    
for(new ii<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(idprint_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))
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline