Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Info:
- PlayerInfo[i][playerTimer][0] = minutes;
- PlayerInfo[i][playerTimer][1] = seconds;
- */
- if(PlayerInfo[i][pTimerSet]==true) // updates every second
- {
- PlayerInfo[i][playerTimer][1]--;
- if(PlayerInfo[i][playerTimer][1]<=1)
- {
- PlayerInfo[i][playerTimer][0]--;
- if(PlayerInfo[i][playerTimer][0] == 0)
- {
- PlayerInfo[i][playerTimer][0] = 0;
- PlayerInfo[i][playerTimer][1] = 0;
- SetPlayerTimer(i,PlayerInfo[i][playerTimer][0],PlayerInfo[i][playerTimer][1]);
- PlayerInfo[i][pTimerSet] = false;
- }
- else if(PlayerInfo[i][playerTimer][0] == 1)
- {
- PlayerInfo[i][playerTimer][0] = 0; // last Minute
- PlayerInfo[i][playerTimer][1] = 59;
- SetPlayerTimer(i,PlayerInfo[i][playerTimer][0],PlayerInfo[i][playerTimer][1]);
- }
- }
- }
- stock SetPlayerTimer(playerid,minutes,seconds) // add size and font ? optional
- {
- new string[86];
- PlayerInfo[playerid][pTimerSet] = true;
- format(string,sizeof(string),"Time_left:_%02d:%02d",minutes,seconds);
- PlayerTextDrawSetString(playerid,timerForPlayer[playerid],string);
- PlayerTextDrawShow(playerid,timerForPlayer[playerid]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement