Quote:
Originally Posted by eyal282
Just do this:
[code]
#include <sourcemod>
new hTimerAmmo = INVALID_HANDLE;
public OnPluginStart()
{
HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
}
public OnMapStart()
{
hTimerAmmo = INVALID_HANDLE;
}
public Event_RoundStart(Handle:hEvent, const String:Name[], bool:dontBroadcast)
{
if(hTimerAmmo != INVALID_HANDLE)
{
CloseHandle(hTimerAmmo);
hTimerAmmo = INVALID_HANDLE;
}
hTimerAmmo = CreateTimer(1.5, GiveAllAmmo, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}
public Action:GiveAllAmmo(Handle:hTimer)
{
// Give ammo stuff here, will be executed every 1.5 seconds.
return Plugin_Continue;
}
|
I can't do this, it needs to detect if i'm pressing a specific button, and i don't want to it be executed when round start.