Mr. Satan
05-14-2004, 20:13
Hokay, so I wanted a plugin that would check the value of a cvar on every client and if the cvar value = 1, the plugin would change the cvar value to 0.
I took the old high_ping_kicker source and attempted to altar it but I don't think it works...please help meh x.x
/* AMX Mod script.
*
* (c) 2002-2003, OLO
* This file is provided as is (no warranties).
*
* Players with immunity won't be checked
*/
#include <amxmod>
new DRAWDIAMS_EN = 1
public plugin_init()
{
register_plugin("No Diamonds","1.2","Mr. Satan")
}
public client_disconnect(id)
remove_task( id )
public client_putinserver(id)
{
if ( !is_user_bot(id) )
{
new param[1]
param[0] = id
set_task( float(DRAWDIAMS_EN) , "checkPing" , id , param , 1 , "b" )
set_task( 10.0 , "showWarn" , id , param , 1 )
}
}
public checkPing(param[])
{
new id = param[ 0 ]
if ( get_user_flags(id) & ADMIN_IMMUNITY ) return // has immunity
if (get_cvar_num("cl_drawdiamonds") == 1)
set_cvar_num("cl_drawdiamonds",0)
}
public showWarn(param[])
client_print( param[0] ,print_chat,"* Diamonds Have Been Disabled On This Server", DRAWDIAMS_EN )
I took the old high_ping_kicker source and attempted to altar it but I don't think it works...please help meh x.x
/* AMX Mod script.
*
* (c) 2002-2003, OLO
* This file is provided as is (no warranties).
*
* Players with immunity won't be checked
*/
#include <amxmod>
new DRAWDIAMS_EN = 1
public plugin_init()
{
register_plugin("No Diamonds","1.2","Mr. Satan")
}
public client_disconnect(id)
remove_task( id )
public client_putinserver(id)
{
if ( !is_user_bot(id) )
{
new param[1]
param[0] = id
set_task( float(DRAWDIAMS_EN) , "checkPing" , id , param , 1 , "b" )
set_task( 10.0 , "showWarn" , id , param , 1 )
}
}
public checkPing(param[])
{
new id = param[ 0 ]
if ( get_user_flags(id) & ADMIN_IMMUNITY ) return // has immunity
if (get_cvar_num("cl_drawdiamonds") == 1)
set_cvar_num("cl_drawdiamonds",0)
}
public showWarn(param[])
client_print( param[0] ,print_chat,"* Diamonds Have Been Disabled On This Server", DRAWDIAMS_EN )