Question: What is a ConVar.FloatValue's expected value?
I'm using this in my code:
PHP Code:
So why is it that 0.1 doesn't work but 1.0/5.5 does? Is it because 0.1 is basically close to 0 or something else? |
Re: Question: What is a ConVar.FloatValue's expected value?
What do you mean by it doesn't v work
|
Re: Question: What is a ConVar.FloatValue's expected value?
What I mean is that, when I set the convar cvPunishDetectionDelay to 0.1, it doesn't seem to be accepted, thus rendering the timer useless. When I set it to 1.0 or anything higher than 1, that's when the timer seems to work. My main question is just asking what exactly is the .FloatValue's expected value. I read a post by asherkin that a .BoolValue works as follows: 0.9 ~= 0 = false and 1.1 ~= 1 = true, but I don't know if that also applies to .FloatValues.
|
Re: Question: What is a ConVar.FloatValue's expected value?
SM Timers are checked if they should run EVERY gameframe, how the check is done is comparing the current game time (as dictated by "GetGameTime() (or GetEngineTime())") with the time Timer was created (and last executed for repeating Timers) plus the timer delay.
|
Re: Question: What is a ConVar.FloatValue's expected value?
What are you doing in the callback?
|
Re: Question: What is a ConVar.FloatValue's expected value?
Quote:
|
Re: Question: What is a ConVar.FloatValue's expected value?
Quote:
Spoiler
Though, the callback isn't the problem. I'm just wondering why setting the cvar value to 0.1 and using ConVar.FloatValue to retrieve it returns 0. I thought it'd be the same as manually setting the timer to 0.1. I suppose when doing ConVar.BoolValue it works as follows: 0.9 (any number with 0 as the whole number rounds off to 0) ~= 0 = false, 1.1 (anything with 1 as the whole number rounds off to 1) ~= 1 = true (if true, that value will be used as the bool value). And for ConVar.FloatValue, it seems to work as follows: 0.9 (any number with 0 as the whole number rounds off to 0) ~= 0 = false, 5.5 (1 or any value greater than 1) ~= 1 = true (if true, that value will be used as the float value). |
Re: Question: What is a ConVar.FloatValue's expected value?
So you are saying
CreateTimer(cvPunishDetectionDelay.FloatValue ,... <- does not work But CreateTimer(0.1, aAutoTimer <- works? |
Re: Question: What is a ConVar.FloatValue's expected value?
Quote:
When I set cvPunishDetectionDelay.FloatValue to 1 or higher though, it works. |
Re: Question: What is a ConVar.FloatValue's expected value?
how are you telling if the timer is working or not?
what happen if you add public Action tAutoTimerUpdatePlayer(Handle timer, any data) { PrintToChatAll("timer is working"); do you get spammed? if you do get spammed then i think maybe somewhere in your callback is wrong |
All times are GMT -4. The time now is 23:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.