Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:deploycade(playerid, params[])
- {
- if(IsACop(playerid))
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, "You must be on foot to use this command.");
- return 1;
- }
- if(PlayerInfo[playerid][pRank] < 3 && PlayerInfo[playerid][pFaction] != 2)
- {
- SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 3 to use this command.");
- return 1;
- }
- if(GetPlayerInterior(playerid) != 0)
- {
- SendClientMessage(playerid, COLOR_GREY, "You can't deploy barricades in interiors.");
- return 1;
- }
- new string[128], Float:Position[4];
- for(new i; i<MAX_BARRICADES; i++)
- {
- if(Barricade[i] == 0)
- {
- GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
- GetPlayerFacingAngle(playerid, Position[3]);
- Barricade[i] = CreateDynamicObject(981, Position[0], Position[1], Position[2], 0.0, 0.0, Position[3]+180.0, -1, -1, -1, 200.0);
- SetPlayerPos(playerid, Position[0], Position[1]+4, Position[2]);
- new zone[MAX_ZONE_NAME];
- GetPlayer3DZone(playerid, zone, sizeof(zone));
- format(string, sizeof(string), "HQ: A barricade has been deployed by %s at %s.", GetPlayerNameEx(playerid), zone);
- foreach(Player, x)
- {
- if(IsACop(x))
- {
- SendClientMessage(x, TEAM_BLUE_COLOR, string);
- if(PlayerInfo[x][pRank] >= 3)
- {
- SendClientMessage(x, COLOR_YELLOW, "You can remove a barricade by typing /destroycade.");
- }
- }
- }
- return 1;
- }
- }
- SendClientMessage(playerid, COLOR_GREY, "All available barriers have been deployed.");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment