Guest User

Untitled

a guest
Jun 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.66 KB | None | 0 0
  1. if(strcmp(cmd, "/tazer", true) ==0 || strcmp(cmd, "/ta", true) ==0)
  2.     {
  3.         new suspect;
  4.         if(IsPlayerConnected(playerid))
  5.         {
  6.             if(gTeam[playerid] == 2 || IsACop(playerid))
  7.             {
  8.                 if(IsPlayerInAnyVehicle(playerid))
  9.                     return SendClientMessage(playerid, COLOR_GREY, " Vous ne pouvez pas visé a travers une voiture");
  10.  
  11.                 tmp = strtok(cmdtext, idx);
  12.                 if(!strlen(tmp))
  13.                 {
  14.                     suspect = GetClosestPlayer(playerid);
  15.                 }
  16.                 else
  17.                 {
  18.                     suspect = ReturnUser(tmp);
  19.                 }
  20.                
  21.                 if(IsPlayerConnected(suspect))
  22.                 {
  23.                     if(PlayerCuffed[suspect] > 0)
  24.                     {
  25.                         SendClientMessage(playerid, COLOR_GREY, "  Cette homme est menotter !");
  26.                         return 1;
  27.                     }
  28.                     if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
  29.                     {
  30.                         /*if(gTeam[suspect] == 2)
  31.                         {
  32.                             SendClientMessage(playerid, COLOR_GREY, "   Vous pouvez pas tazer un coéquipier !");
  33.                             return 1;
  34.                         }*/
  35.                         if(IsPlayerInAnyVehicle(suspect))
  36.                         {
  37.                             SendClientMessage(playerid, COLOR_GREY, "  Suspect embarqué !");
  38.                             return 1;
  39.                         }
  40.                         GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
  41.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  42.                         new randt = random(4)+1;
  43.                         if(randt == 1)
  44.                         {
  45.                             format(string, sizeof(string), "* %s tire au tazer sur %s,mais rate son tire.", sendername ,giveplayer);
  46.                             ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  47.                         }
  48.                         else
  49.                         {
  50.                             format(string, sizeof(string), "* Vous êtes tazer par l'agent %s pendant 20 seconds.", sendername);
  51.                             SendClientMessage(suspect, COLOR_WHITE, string);
  52.                             format(string, sizeof(string), "* Vous avez tazer %s pendant 20 seconds.", giveplayer);
  53.                             SendClientMessage(playerid, COLOR_WHITE, string);
  54.                             format(string, sizeof(string), "* %s tire avec son tazeur sur %s et le taze !.", sendername ,giveplayer);
  55.                             ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  56.                             GameTextForPlayer(suspect, "~r~Tazer", 2500, 3);
  57.                             TogglePlayerControllable(suspect, 0);
  58.                             LoopingAnim(suspect, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
  59.                             PlayerCuffedTime[suspect] = 20;
  60.                         }
  61.                     }
  62.                     else
  63.                     {
  64.                         SendClientMessage(playerid, COLOR_GREY, "  Personne a coté de vous");
  65.                         return 1;
  66.                     }
  67.                 }
  68.             }
  69.             else
  70.             {
  71.                 SendClientMessage(playerid, COLOR_GREY, "   Vous n'etez pas un Flic !");
  72.             }
  73.         }//not connected
  74.         return 1;
  75.     }
Add Comment
Please, Sign In to add comment