Raised This Month: $ Target: $400
 0% 

Check value of a cvar for x seconds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-04-2013 , 12:12   Re: Check value of a cvar for x seconds
Reply With Quote #10

Quote:
Originally Posted by Bladell View Post
I think that is because of podbot module...

Code:
public plugin_init() {
	set_task(1.0, "check_cvar", _, _, _, "b")
}
	
public check_cvar() {
	new i;
	if(get_cvar_num("sv_maxspeed") <= 100)
		i++;

	if(i>=30)
		server_cmd("amx_map de_dust2")
}
Should work, right?
No, because i will always be 0 at the start of the check. Move i to be a global variable and then it will work. Though, you should use PCVARs and reset i to 0 when it detects that it is higher than 100
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
 



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 23:16.


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