Guest User

Untitled

a guest
Jun 19th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.64 KB | None | 0 0
  1. // If business has no products deny entry, just add this below
  2. // if(BizInfo[b][bLocked]) return SendClientMessage(playerid,COLOR_GREY,"   This business is closed, come back later.");
  3. if(BizInfo[b][bProducts] == 0) return SendClientMessage(playerid, COLOR_GREY, "   This business has no products, come back later.");
  4.  
  5. // new /id
  6.     if(strcmp(cmd, "/id", true) == 0)
  7.     {
  8.         if(IsPlayerConnected(playerid))
  9.         {
  10.             tmp = strtok(cmdtext, idx);
  11.             if(!strlen(tmp))
  12.             {
  13.                 SendClientMessage(playerid, COLOR_WHITE, "USAGE: /id [playerid/PartOfName]");
  14.                 return 1;
  15.             }
  16.             giveplayerid = ReturnUser(tmp);
  17.             if(IsPlayerConnected(giveplayerid))
  18.             {
  19.                 if(giveplayerid != INVALID_PLAYER_ID)
  20.                 {
  21.                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  22.                     format(string, sizeof(string), "[%d] %s [Level: %d] [Ping: %d]", giveplayerid, giveplayer, PlayerInfo[giveplayerid][pLevel], GetPing(giveplayerid));
  23.                     // Ex: [34] Dylan [Level: 24] [Ping: 68]
  24.                     SendClientMessage(playerid, COLOR_GRAD1, string);
  25.                 }
  26.             }
  27.             else
  28.             {
  29.                 format(string, sizeof(string), "   %d is not an active player !", giveplayerid);
  30.                 SendClientMessage(playerid, COLOR_GRAD1, string);
  31.             }
  32.         }
  33.         return 1;
  34.     }
  35.    
  36.    
  37. // Roadblocks
  38. enum rbInfo
  39. {
  40.     rbCreated,
  41.     Float:rbX,
  42.     Float:rbY,
  43.     Float:rbZ,
  44.     rbObject,
  45. };
  46. new RoadblockInfo[MAX_SPIKESTRIPS][rbInfo];
  47.  
  48. stock CreateRoadblock(Float:x,Float:y,Float:z,Float:Angle)
  49. {
  50.     for(new i = 0; i < sizeof(RoadblockInfo); i++)
  51.     {
  52.         if(RoadblockInfo[i][rbCreated] == 0)
  53.         {
  54.             RoadblockInfo[i][rbCreated]=1;
  55.             RoadblockInfo[i][rbX]=x;
  56.             RoadblockInfo[i][rbY]=y;
  57.             RoadblockInfo[i][rbZ]=z-0.4;
  58.             RoadblockInfo[i][rbObject] = CreateObject(3578, x, y, z-0.4, 0, 0, Angle);
  59.             return 1;
  60.         }
  61.     }
  62.     return 0;
  63. }
  64.  
  65. stock DeleteClosestRoadblock(playerid)
  66. {
  67.     for(new i = 0; i < sizeof(RoadblockInfo); i++)
  68.     {
  69.         if(IsPlayerInRangeOfPoint(playerid, 5.0, RoadblockInfo[i][rbX], RoadblockInfo[i][rbY], RoadblockInfo[i][rbZ]))
  70.         {
  71.             if(RoadblockInfo[i][rbCreated] == 1)
  72.             {
  73.                 new string[128];
  74.                 new location[MAX_ZONE_NAME];
  75.                 GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
  76.                 format(string, sizeof(string), "HQ: %s %s has removed a roadblock at %s.", GetPlayerRank(playerid),PlayerName(playerid), location);
  77.                 SendRadioMessage(1, TEAM_BLUE_COLOR, string);
  78.                 SendRadioMessage(2, TEAM_BLUE_COLOR, string);
  79.                 SendRadioMessage(3, TEAM_BLUE_COLOR, string);
  80.                 SendRadioMessage(5, TEAM_BLUE_COLOR, string);
  81.                 RoadblockInfo[i][rbCreated]=0;
  82.                 RoadblockInfo[i][rbX]=0.0;
  83.                 RoadblockInfo[i][rbY]=0.0;
  84.                 RoadblockInfo[i][rbZ]=0.0;
  85.                 DestroyObject(RoadblockInfo[i][rbObject]);
  86.                 return 1;
  87.             }
  88.         }
  89.     }
  90.     return 0;
  91. }
  92.  
  93.  
  94.     if(strcmp(cmd, "/removeroadblock", true) == 0 || strcmp(cmd, "/rrb", true) == 0)
  95.     {
  96.         if(!IsACop(playerid) && !IsAnAgent(playerid) && !(PlayerInfo[playerid][pMember] == 5))
  97.         {
  98.             return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / RCSD / PG !");
  99.         }
  100.         DeleteClosestRoadblock(playerid);
  101.         return 1;
  102.     }
  103.  
  104.     if(strcmp(cmd, "/roadblock", true) == 0 || strcmp(cmd, "/arb", true) == 0)
  105.     {
  106.         if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY,"   You cannot place a Roadblock whilst in a vehicle !");
  107.         if(IsACop(playerid) && IsAnAgent(playerid) && PlayerInfo[playerid][pMember] == 5)
  108.         {
  109.             if(PlayerInfo[playerid][pRank] >= // INSERT CAPTAIN RANK HERE)
  110.             {
  111.                 new Float:X, Float:Y, Float:Z, Float:A;
  112.                 GetPlayerPos(playerid,X,Y,Z);
  113.                 GetPlayerFacingAngle(playerid,A);
  114.                 new location[MAX_ZONE_NAME];
  115.                 GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
  116.                 format(string, sizeof(string), "HQ: %s %s %s has placed a roadblock at %s.", GetPlayerFactionName(playerid),GetPlayerRank(playerid),PlayerName(playerid), location);
  117.                 SendRadioMessage(1, TEAM_BLUE_COLOR, string);
  118.                 SendRadioMessage(2, TEAM_BLUE_COLOR, string);
  119.                 SendRadioMessage(3, TEAM_BLUE_COLOR, string);
  120.                 SendRadioMessage(5, TEAM_BLUE_COLOR, string);
  121.                 ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0);
  122.                 CreateRoadblock(X,Y,Z,A);
  123.                 SetPlayerPos(playerid, X, Y+3,Z+2);
  124.                 return 1;
  125.             }
  126.             else
  127.             {
  128.                 SendClientMessage(playerid, COLOR_GREY,"   You are not the authorized rank to place a Roadblock !");
  129.                 return 1;
  130.             }
  131.         }
  132.         else
  133.         {
  134.             SendClientMessage(playerid, COLOR_GREY, "   You are not a COP / FBI !");
  135.         }
  136.         return 1;
  137.     }
Add Comment
Please, Sign In to add comment