Witam. Mam problem ze sprawdzeniem czy istnieje Timer. Robię to w ten sposób:
new Handle: timer_warmup[MAXPLAYERS+1] = INVALID_HANDLE;
......
public Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid") );
if(timer_warmup[client] == INVALID_HANDLE)
{
timer_warmup[client] = CreateTimer(0.5, BonusRozgrzewka, client);
return Plugin_Continue;
}
CloseHandle(timer_warmup[client]);
timer_warmup[client] = INVALID_HANDLE;
return Plugin_Continue;
}
public Action:BonusRozgrzewka(Handle:timer, any:client)
{
if(bIsWarmup && IsPlayerAlive(client))
{
timer_warmup[client] = INVALID_HANDLE;
if (g_iPlayer != -1)
SetEntData(client, g_iPlayer, 0);
UsunBronie(client);
DajBron(client);
}
}
A i tak Timer nigdy nie jest ustawiany, a w error logach mam:
L 05/22/2015 - 10:51:45: [SM] Native "KillTimer" reported: Invalid timer handle f800ac (error 1) L 05/22/2015 - 10:51:45: [SM] Displaying call stack trace for plugin "modyfikacja_rozgrzewki.smx": L 05/22/2015 - 10:51:45: [SM] [0] Line 131, C:\Users\Konrad\Desktop\Pawn Studio\Scripting\modyfikacja_rozgrzewki.sp::Event_PlayerSpawn()


Dodatki SourceMod













