Advertisement
Guest User

checkpoint timer set

a guest
Jan 30th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.69 KB | None | 0 0
  1. new CPTimeVar[MAX_PLAYERS];
  2. new NextCPTimer[MAX_PLAYERS];
  3.  
  4. forward NextCP(playerid);
  5.  
  6. public NextCP(playerid)
  7. {
  8.     new str[5];
  9.     format(str, sizeof(str), "~r~%d", CPTimeVar[playerid]);
  10.     GameTextForPlayer(playerid, str, 1000, 6);
  11.     if(CPTimeVar == 30) SetPlayerCheckPoint//add the cp coords here
  12.     if(CPTimeVar > 30)
  13.     {
  14.         KillTimer(NextCPTimer[playerid]);
  15.         CPTimeVar[playerid] = 0;
  16.         TogglePlayerControllable(playerid, 1);
  17.     }
  18.     return 1;
  19. }
  20.  
  21. public OnPlayerEnterCheckpoint(playerid)
  22. {
  23.     TogglePlayerControllable(playerid, 0);
  24.     DisablePlayerCheckpoint(playerid);
  25.     SetTimerEx("NextCP", 1000, true, "i", playerid);
  26.     return 1;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement