View Single Post
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 12-24-2017 , 00:51   Re: Question: What is a ConVar.FloatValue's expected value?
Reply With Quote #11

I use the "SpecialWarn" message to let me know if it's working.

PHP Code:
if(iCompanionCount && iBotCount iPlayerCount 1)
{
    
flPlayerAloneStartTime[iPlayerIndex] = GetEngineTime();
    
bMsg[iPlayerIndex] = true;
}

else
{
    if(
bMsg[iPlayerIndex] && bIsValidClient(iPlayerIndex))
        
PrintHintText(iPlayerIndex"[ASS] %t""SpecialWarn");
    
bMsg[iPlayerIndex] = false;

When I use CreateTimer(cvPunishDetectionDelay.FloatValue, the message doesn't pop up when I pass the distance limit. When I use CreateTimer(0.1 the message appears.

This is all the relevant code for the ConVar:
PHP Code:
ConVar cvPunishDetectionDelay;

public 
void OnPluginStart()
{
     
cvPunishDetectionDelay CreateConVar("asspunish_detectiondelay""0.1""The Punishment system will check for Speedrunners every time this many seconds pass.\n(0 or X < 1: OFF)\n(X: ON, seconds allowed.)"
}

public 
void OnMapStart()
{
     if(
cvPunishDetectionDelay.IntValue != 0)
          
hPunishTimer CreateTimer(cvPunishDetectionDelay.FloatValueaAutoTimerUpdatePlayer_TIMER_REPEAT);

__________________

Last edited by Psyk0tik; 12-24-2017 at 00:52.
Psyk0tik is offline