I use the "SpecialWarn" message to let me know if it's working.
PHP Code:
if(iCompanionCount > 1 && 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.FloatValue, aAutoTimerUpdatePlayer, _, TIMER_REPEAT);
}
__________________