26.09.2012, 21:26
pawn Код:
new UserTimer[MAX_PLAYERS]; // New variable for the timer is created.
forward SixtySeconds(playerid); // Forward the callback.
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(UserTimer[playerid]); // Kills the timer. (In case it is currently running or still active).
return 1;
}
public OnPlayerConnect(playerid)
{
UserTimer[playerid] = SetTimerEx("SixtyMinutes", 3600000, false, "d", playerid); // Set the timer and assign it to the variable. There are 3600000 miliseconds in one hour. This should be placed accordingly, as the timer will start once the user has connected, NOT logged in.
return 1;
}
public SixtySeconds(playerid) // The new callback.
{
SendClientMessage(playerid, -1, "It has been one hour since your login."); // Send the user a message after it has been one hour.
return 1;
}
SetTimerEx
Public Functions