Raised This Month: $ Target: $400
 0% 

Check N Change - Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 05-14-2004 , 20:13   Check N Change - Help
Reply With Quote #1

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

Code:
/* 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 )
Mr. Satan is offline
Send a message via AIM to Mr. Satan Send a message via MSN to Mr. Satan Send a message via Yahoo to Mr. Satan
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 05-14-2004 , 20:24  
Reply With Quote #2

you can't check client-side Cvars.... the get_cvar_num only gets server-side cvars
__________________
My Plugins

Got ??
AssKicR is offline
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 05-14-2004 , 20:26  
Reply With Quote #3

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?
Mr. Satan is offline
Send a message via AIM to Mr. Satan Send a message via MSN to Mr. Satan Send a message via Yahoo to Mr. Satan
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 05-15-2004 , 00:00  
Reply With Quote #4

Code:
register_clcmd("cl_drawdiamonds","disable") public disable(id) { client_cmd(id,"cl_drawdiamonds 0") }
Might work
What does cl_drawdiamonds do anyway?
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 05-15-2004 , 00:23  
Reply With Quote #5

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.
Mr. Satan is offline
Send a message via AIM to Mr. Satan Send a message via MSN to Mr. Satan Send a message via Yahoo to Mr. Satan
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode