Nie testowałem, ale powinno działać i powinieneś mniej więcej zauważyć mechanikę działania:
#include <sourcemod>
int gTime[MAXPLAYERS + 1];
Handle gCounting[MAXPLAYERS + 1];
Handle gInfo[MAXPLAYERS + 1];
public void OnPluginStart()
{
RegConsoleCmd("sm_testinfo", Test);
}
public Action Test(int client, int args)
{
gTime[client] = 15;
gInfo[client] = CreateTimer(0.1, ShowInfo, GetClientUserId(client), TIMER_REPEAT);
gCounting[client] = CreateTimer(1.0, Count, GetClientUserId(client), TIMER_REPEAT);
}
public Action ShowInfo(Handle timer, any userid)
{
int client = GetClientOfUserId(userid);
if (!IsClientInGame(client))return Plugin_Stop;
if (gTime[client] <= 0)return Plugin_Stop;
PrintHintText(client, "Zostało Ci %i sekund", gTime[client]);
return Plugin_Continue;
}
public Action Count(Handle timer, any userid)
{
int client = GetClientOfUserId(userid);
if (!IsClientInGame(client))return Plugin_Stop;
gTime[client]--;
return Plugin_Continue;
}