19.07.2011, 02:48
Maybe this code can inspire you:
You have to save Inspiring[playerid] into file or database in OnPlayerDisconnect and load it in OnPlayerConnect if you want it to be like that.
pawn Код:
//On top of your script
new Inspire[MAX_PLAYERS]
Inspiring[MAX_PLAYERS];
forward Inspiration(playerid);
//Somewhere you want to start the timer
Inspiring[playerid] = 30;//It mean 30 minutes
Inspire[playerid] = SetTimerEx("Inspiration",60000,1,"d",playerid);
//Whereever you want
public Inspiration(playerid)
{
if(Inspiring[playerid] == 0)
{
KillTimer(Inspiring[playerid]);
//Your code here if the timer is ended/finished
return 1;
}
return Inspiring[playerid] -= 1;
}