View Single Post
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-26-2018 , 16:55   Re: [TF2] Help with timer
Reply With Quote #7

+attack + AddCommandListener make's it to an "event", it sure registers it but not the actual key pressed, thanks for pointing it out. Think this should do it slightly better:

PHP Code:
#include <sdktools>

#pragma semicolon 1

public void OnMapStart()
{
    
CreateTimer(1.5Timer_Recheck_TIMER_REPEAT TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action Timer_Recheck(Handle hTimer)
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            if (
IsPlayerAlive(i))
            {
                if (
GetClientButtons(i) == IN_USE)
                {
                    
GivePlayerAmmo(i);
                }
            }
        }
    }
    
    return 
Plugin_Continue;

mug1wara is offline