Advertisement
2ky

/showme - red marker for 5 mins then auto-hide

2ky
Jan 16th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.85 KB | None | 0 0
  1. //At the top of your script, near your other global definitions -
  2.  
  3. new Shown[MAX_PLAYERS] = -1;
  4.  
  5. //OnPlayerCommandText -
  6.  
  7. if (strcmp("/showme", cmdtext, true, 7) == 0)
  8.     {
  9.         if(Shown[playerid] == -1) {
  10.             for(new i=0; i<MAX_PLAYERS; i++) {
  11.                 // Make the players marker red to all currently online players.
  12.                 SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
  13.             }
  14.             Shown[playerid] = 1;
  15.             SetTimerEx("HideMarker", 60000*5, 1, "i", playerid);
  16.         }
  17.         else return 0; //Already shown!
  18.     }
  19.     return 0;
  20. }
  21.  
  22. //Out of the OnPlayerCommandText callback -
  23.  
  24. forward HideMarker(playerid);
  25. public HideMarker(playerid)
  26. {
  27.     for(new i=0; i<MAX_PLAYERS; i++) {
  28.         SetPlayerMarkerForPlayer(i, playerid, 0xFFFFFF00 );
  29.         Shown[playerid] = -1;
  30.     }
  31.     return 1;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement