16.03.2014, 04:15
Here:
Others:
Код:
#define MAX_BARRICADES 10 new Barricade[MAX_BARRICADES];
Код:
CMD:deploycade(playerid, params[]) { if(IsACop(playerid) || PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pFaction] == 4 && PlayerInfo[playerid][pRank] >= 3) { if(PlayerInfo[playerid][pRank] <= 2) return SendClientMessage(playerid, COLOR_GRAD1, "You must be R3+ to use this command"); if(IsPlayerInAnyVehicle(playerid)) { SendClientMessageEx(playerid, COLOR_GREY, "You must be on foot to use this command."); return 1; } new number, string[128], Float:Position[4]; if(sscanf(params,"d",number)) { SendClientMessage(playerid,COLOR_WHITE,"USAGE: /deploycade <1/2/3/4/5/6/7>"); SendClientMessage(playerid,COLOR_GRAD1,"| 1: Small Roadblock | 2: Medium Roadblock"); SendClientMessage(playerid,COLOR_GRAD1,"| 3: Big Roadblock | 4: Traffic cone"); //SendClientMessage(playerid,COLOR_FBI,"| 5: Detour sign | 6: Will be sign"); SendClientMessage(playerid,COLOR_GRAD1,"| 5: Line closed sign"); SendClientMessage(playerid,COLOR_WHITE,"----------------------"); return 1; } for(new i; i<MAX_BARRICADES; i++) { if(Barricade[i] == 0) { GetPlayerPos(playerid, Position[0], Position[1], Position[2]); GetPlayerFacingAngle(playerid, Position[3]); switch(number) { case 1: { Barricade[i] = CreateDynamicObject(1459, Position[0], Position[1]+1, Position[2]-0.5, 0.0, 0.0, Position[3],-1, -1, -1, 200.0); } case 2: { Barricade[i] = CreateDynamicObject(978, Position[0], Position[1]+1, Position[2], 0.0, 0.0, Position[3],-1, -1, -1, 200.0); } case 3: { Barricade[i] = CreateDynamicObject(981, Position[0], Position[1]+1, Position[2], 0.0, 0.0, Position[3]+180.0, -1, -1, -1, 200.0); SetPlayerPos(playerid, Position[0], Position[1], Position[2]+5); } case 4: { Barricade[i] = CreateDynamicObject(1238, Position[0], Position[1]+1, Position[2]-0.5, 0.0, 0.0, Position[3],-1, -1, -1, 200.0); } /*case 5: { Barricade[i] = CreateDynamicObject(1425, Position[0], Position[1]+1, Position[2]-0.5, 0.0, 0.0, Position[3],-1, -1, -1, 200.0); } case 6: { Barricade[i] = CreateDynamicObject(3265, Position[0], Position[1]+1, Position[2]-0.9, 0.0, 0.0, Position[3],-1, -1, -1, 200.0); }*/ case 5: { Barricade[i] = CreateDynamicObject(3091, Position[0], Position[1]+1, Position[2]-0.25, 0.0, 0.0, Position[3],-1, -1, -1, 200.0); } } GetPlayerPos(playerid, Position[0], Position[1], Position[2]); GetPlayerFacingAngle(playerid, Position[3]); 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) || PlayerInfo[x][pFaction] == 4) { SendClientMessageEx(x, TEAM_BLUE_COLOR, string); if (PlayerInfo[x][pRank] >= 3) { SendClientMessageEx(x, COLOR_YELLOW, "You can remove a barricade by typing /destroycade."); } } } return 1; } } SendClientMessageEx(playerid, COLOR_GREY, "All available barriers have been deployed."); } else { SendClientMessageEx(playerid, COLOR_GREY, "You are not an LEO."); } return 1; }