Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // If business has no products deny entry, just add this below
- // if(BizInfo[b][bLocked]) return SendClientMessage(playerid,COLOR_GREY," This business is closed, come back later.");
- if(BizInfo[b][bProducts] == 0) return SendClientMessage(playerid, COLOR_GREY, " This business has no products, come back later.");
- // new /id
- if(strcmp(cmd, "/id", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /id [playerid/PartOfName]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- format(string, sizeof(string), "[%d] %s [Level: %d] [Ping: %d]", giveplayerid, giveplayer, PlayerInfo[giveplayerid][pLevel], GetPing(giveplayerid));
- // Ex: [34] Dylan [Level: 24] [Ping: 68]
- SendClientMessage(playerid, COLOR_GRAD1, string);
- }
- }
- else
- {
- format(string, sizeof(string), " %d is not an active player !", giveplayerid);
- SendClientMessage(playerid, COLOR_GRAD1, string);
- }
- }
- return 1;
- }
- // Roadblocks
- enum rbInfo
- {
- rbCreated,
- Float:rbX,
- Float:rbY,
- Float:rbZ,
- rbObject,
- };
- new RoadblockInfo[MAX_SPIKESTRIPS][rbInfo];
- stock CreateRoadblock(Float:x,Float:y,Float:z,Float:Angle)
- {
- for(new i = 0; i < sizeof(RoadblockInfo); i++)
- {
- if(RoadblockInfo[i][rbCreated] == 0)
- {
- RoadblockInfo[i][rbCreated]=1;
- RoadblockInfo[i][rbX]=x;
- RoadblockInfo[i][rbY]=y;
- RoadblockInfo[i][rbZ]=z-0.4;
- RoadblockInfo[i][rbObject] = CreateObject(3578, x, y, z-0.4, 0, 0, Angle);
- return 1;
- }
- }
- return 0;
- }
- stock DeleteClosestRoadblock(playerid)
- {
- for(new i = 0; i < sizeof(RoadblockInfo); i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, RoadblockInfo[i][rbX], RoadblockInfo[i][rbY], RoadblockInfo[i][rbZ]))
- {
- if(RoadblockInfo[i][rbCreated] == 1)
- {
- new string[128];
- new location[MAX_ZONE_NAME];
- GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
- format(string, sizeof(string), "HQ: %s %s has removed a roadblock at %s.", GetPlayerRank(playerid),PlayerName(playerid), location);
- SendRadioMessage(1, TEAM_BLUE_COLOR, string);
- SendRadioMessage(2, TEAM_BLUE_COLOR, string);
- SendRadioMessage(3, TEAM_BLUE_COLOR, string);
- SendRadioMessage(5, TEAM_BLUE_COLOR, string);
- RoadblockInfo[i][rbCreated]=0;
- RoadblockInfo[i][rbX]=0.0;
- RoadblockInfo[i][rbY]=0.0;
- RoadblockInfo[i][rbZ]=0.0;
- DestroyObject(RoadblockInfo[i][rbObject]);
- return 1;
- }
- }
- }
- return 0;
- }
- if(strcmp(cmd, "/removeroadblock", true) == 0 || strcmp(cmd, "/rrb", true) == 0)
- {
- if(!IsACop(playerid) && !IsAnAgent(playerid) && !(PlayerInfo[playerid][pMember] == 5))
- {
- return SendClientMessage(playerid,COLOR_GREY," You are not a Cop / FBI / RCSD / PG !");
- }
- DeleteClosestRoadblock(playerid);
- return 1;
- }
- if(strcmp(cmd, "/roadblock", true) == 0 || strcmp(cmd, "/arb", true) == 0)
- {
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY," You cannot place a Roadblock whilst in a vehicle !");
- if(IsACop(playerid) && IsAnAgent(playerid) && PlayerInfo[playerid][pMember] == 5)
- {
- if(PlayerInfo[playerid][pRank] >= // INSERT CAPTAIN RANK HERE)
- {
- new Float:X, Float:Y, Float:Z, Float:A;
- GetPlayerPos(playerid,X,Y,Z);
- GetPlayerFacingAngle(playerid,A);
- new location[MAX_ZONE_NAME];
- GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
- format(string, sizeof(string), "HQ: %s %s %s has placed a roadblock at %s.", GetPlayerFactionName(playerid),GetPlayerRank(playerid),PlayerName(playerid), location);
- SendRadioMessage(1, TEAM_BLUE_COLOR, string);
- SendRadioMessage(2, TEAM_BLUE_COLOR, string);
- SendRadioMessage(3, TEAM_BLUE_COLOR, string);
- SendRadioMessage(5, TEAM_BLUE_COLOR, string);
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0);
- CreateRoadblock(X,Y,Z,A);
- SetPlayerPos(playerid, X, Y+3,Z+2);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY," You are not the authorized rank to place a Roadblock !");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " You are not a COP / FBI !");
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment