Guest User

Untitled

a guest
Jun 10th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.82 KB | None | 0 0
  1. #define     color_yellow    0xFFFF00AA
  2.  
  3. new tracedid;
  4. new pDetective[MAX_PLAYERS];
  5. new pLocating[MAX_PLAYERS]
  6.  
  7.  
  8. dcmd(locate, 6, cmdtext);
  9. dcmd(locateoff, 9, cmdtext);
  10.  
  11.  
  12. dcmd_locate(playerid, input[])
  13. {
  14.     if(GetPlayerColor(playerid) == color_green )
  15.     {
  16.         if(pDetective[playerid] == 1)
  17.         {
  18.             if(pLocating[playerid] == 0)
  19.             new Float:x, Float:y, Float:z;
  20.             pLocating[playerid] = 1 // Shows if the player is locating a player or not
  21.             if(sscanf(input, "u", id)) return SendClientMessage(playerid, color_grey, "Usage: /locate [id]");
  22.             GetPlayerPos(id, x, y, z);
  23.             GivePlayerMoney(playerid, -500); // Player pays 500 dollars to use this command each time
  24.             SetPlayerMarkerForPlayer(playerid, tracedid, color_yellow);
  25.             SendClientMessage(playerid, color_yellow, "[Computer]: Target has been marked. To kill radar, use /locateoff");
  26.         }
  27.         else
  28.         {
  29.             SendClientMessage(playerid, color_yellow, "[Computer]: You are already tracing someone.");
  30.         }
  31.     else
  32.     {
  33.         GameTextForPlayer(playerid, "~r~You are not a military member", 3000, 5);
  34.     }
  35.     }
  36. return 1;
  37. }
  38.  
  39. dcmd_locateoff(playerid, input[])
  40. {
  41.     if(GetPlayerColor(playerid) == color_green )
  42.     {
  43.         if(pDetective[playerid] == 1)
  44.         {
  45.             if(pLocating[playerid] == 1)
  46.             {
  47.                 SetMarketForPlayer(playerid, tracedid, 0xFFFFFF00); // taking off the tracer
  48.                 SendClientMessage(playerid, color_yellow, "[Computer]: You killed the location-mark on target.");
  49.                 pLocating[playerid] = 0
  50.             }
  51.             else
  52.             {
  53.                 SendClientMessage(playerid, color_yellow, "[Computer]: You currently do not trace anyone.");
  54.             }
  55.         else
  56.         {
  57.             SendClientMessage(playerid, color_red, "* You are not a detective! *");
  58.         }
  59.     else
  60.     {
  61.         SendclientMessage(playerid, color_red, "* You are not a Military member. *");
  62.     }
  63.     }
  64.     return 1;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment