PDA

View Full Version : Check N Change - Help


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 )

AssKicR
05-14-2004, 20:24
you can't check client-side Cvars.... the get_cvar_num only gets server-side cvars

Mr. Satan
05-14-2004, 20:26
Mmmm, damn, then perhaps I could have it execute cl_drawdiamonds 0 when a client enters the server and then again at x minute intervals?

devicenull
05-15-2004, 00:00
register_clcmd("cl_drawdiamonds","disable")

public disable(id) {
client_cmd(id,"cl_drawdiamonds 0")
}

Might work
What does cl_drawdiamonds do anyway?

Mr. Satan
05-15-2004, 00:23
In the mod, ESF, it is used to toggle diamonds on/off.

The diamonds are shown above the heads of all other players and are colored red or green depending if the players in on your team or not.

I prefer to have them disabled on my server because there are various other things that indicate enemy/ally and diamonds almost defeat the purpose of teleport after-images.