Advertisement
Guest User

Untitled

a guest
Aug 13th, 2011
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.23 KB | None | 0 0
  1. [code]if(strcmp(cmd, "/drag", true) == 0)
  2.   {
  3.     if(IsPlayerConnected(playerid))
  4.     {
  5.      if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
  6.      {
  7.        tmp = strtok(cmdtext, idx);
  8.       if(!strlen(tmp)) {
  9.         SendClientMessage(playerid, COLOR_WHITE, "SERVER: /drag [Player ID]");
  10.         return 1;
  11.       }
  12.       giveplayerid = ReturnUser(tmp);
  13.        if(IsPlayerConnected(giveplayerid))
  14.       {
  15.         if(giveplayerid != INVALID_PLAYER_ID)
  16.         {
  17.           if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
  18.           {
  19.             SendClientMessage(playerid, COLOR_GREY, "  You can't drag Cops !");
  20.             return 1;
  21.           }
  22.           if(DragOff[giveplayerid] > 0)
  23.           {
  24.             SendClientMessage(playerid, COLOR_GREY, "  You Are already being Dragged!");
  25.             return 1;
  26.           }
  27.          if (ProxDetectorS(3.0, playerid, giveplayerid))
  28.          {
  29.                if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You Cannot Drag Yourself!"); return 1; }
  30.              GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  31.             GetPlayerName(playerid, sendername, sizeof(sendername));
  32.              format(string, sizeof(string), "* You are being dragged by %s,", sendername);
  33.             SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
  34.             format(string, sizeof(string), "* You begin to drag %s,", giveplayer);
  35.             SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  36.             format(string, sizeof(string), "* %s has started to drag %s.", sendername ,giveplayer);
  37.             ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  38.             TogglePlayerControllable(giveplayerid, 0);
  39.             DragOff[giveplayerid] = playerid;
  40.  
  41.          }
  42.          else
  43.          {
  44.            SendClientMessage(playerid, COLOR_GREY, "  That Player is not near you !");
  45.            return 1;
  46.          }
  47.         }
  48.       }
  49.       else
  50.       {
  51.         SendClientMessage(playerid, COLOR_GREY, "  That player is Offline !");
  52.         return 1;
  53.       }
  54.      }
  55.      else
  56.      {
  57.       SendClientMessage(playerid, COLOR_GREY, "  You are not a Cop / FBI / Navy / National Guard!");
  58.      }
  59.    }
  60.    return 1;
  61.   }
  62.   if(strcmp(cmd, "/stopdrag", true) == 0)
  63.   {
  64.     if(IsPlayerConnected(playerid))
  65.     {
  66.      if(PlayerInfo[playerid][pAdmin] == 10 || IsACop(playerid))
  67.      {
  68.        tmp = strtok(cmdtext, idx);
  69.       if(!strlen(tmp)) {
  70.         SendClientMessage(playerid, COLOR_WHITE, "SERVER: /stopdrag [Player ID]");
  71.         return 1;
  72.       }
  73.       giveplayerid = ReturnUser(tmp);
  74.       if(IsPlayerConnected(giveplayerid))
  75.       {
  76.         if(giveplayerid != INVALID_PLAYER_ID)
  77.         {
  78.           if (ProxDetectorS(3.0, playerid, giveplayerid))
  79.          {
  80.            if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot stop dragging yourself!"); return 1; }
  81.            if(DragOff[giveplayerid] > 0)
  82.            {
  83.              GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  84.             GetPlayerName(playerid, sendername, sizeof(sendername));
  85.              format(string, sizeof(string), "* %s stopped dragging you.", sendername);
  86.             SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
  87.             format(string, sizeof(string), "* You stopped dragging %s.", giveplayer);
  88.             SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  89.             TogglePlayerControllable(giveplayerid, 1);
  90.             DragOff[giveplayerid] = 0;
  91.            }
  92.            else
  93.            {
  94.              SendClientMessage(playerid, COLOR_GREY, "  That player isn't being dragged !");
  95.              return 1;
  96.            }
  97.          }
  98.          else
  99.          {
  100.            SendClientMessage(playerid, COLOR_GREY, "  That player is not near you !");
  101.            return 1;
  102.          }
  103.         }
  104.       }
  105.       else
  106.       {
  107.         SendClientMessage(playerid, COLOR_GREY, "  That player is Offline !");
  108.         return 1;
  109.       }
  110.      }
  111.      else
  112.      {
  113.       SendClientMessage(playerid, COLOR_GREY, "  You are not a Cop / FBI / Navy / National Guard !");
  114.      }
  115.    }//not connected
  116.    return 1;
  117.   }
  118. [/code]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement