01.01.2014, 13:39
Код:
if(strcmp(cmd, "/crb", true) == 0) { if(IsACop(playerid) || IsAnAgent(playerid) || IsASoldier(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "Command: {FFFFFF}/crb [Roadblock ID]"); SendClientMessage(playerid, COLOR_LIGHTBLUE, "Available Roadblocks:"); SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock"); SendClientMessage(playerid, COLOR_GRAD1, "| 2: Medium Roadblock"); SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock"); SendClientMessage(playerid, COLOR_GRAD1, "| 4: Cone"); SendClientMessage(playerid, COLOR_GRAD1, "| 5: Detour Sign"); SendClientMessage(playerid, COLOR_GRAD1, "| 6: Will Be sign"); SendClientMessage(playerid, COLOR_GRAD1, "| 7: Line Closed Sign"); SendClientMessage(playerid, COLOR_GRAD1, "| 8: Flare"); return 1; } new rb = strval(tmp); if (rb == 1) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(1459,plocx,plocy,plocz,ploca); format(string,sizeof(string),"Officer %s has placed a Small Roadblock at his position, over.", sendername); SendRadioMessage(14,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1); return 1; } else if (rb == 2) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca); format(string,sizeof(string),"Officer %s has placed a Medium Roadblock at his position, over.",sendername); SendRadioMessage(14,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1); return 1; } else if (rb == 3) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180); format(string,sizeof(string),"[HQ]: Officer %s has placed a Big Roadblock at his position, over.",sendername); SendRadioMessage(14,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1); SetPlayerPos(playerid, plocx, plocy+1.3, plocz); return 1; } else if (rb == 4) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca); format(string,sizeof(string),"Officer %s has placed a Cone at his position, over.",sendername); SendRadioMessage(14,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1); return 1; } else if (rb == 5) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca); format(string,sizeof(string),"Officer %s has placed a Detour Sign at his position, over.",sendername); SendRadioMessage(14,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1); return 1; } else if (rb == 6) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca); format(string,sizeof(string),"Officer %s has placed a Will be at his position, over.",sendername); SendRadioMessage(14,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1); return 1; } else if (rb == 7) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180); format(string,sizeof(string),"Officer %s has placed a Line Closed Sign at his position, over.",sendername); SendRadioMessage(14,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1); return 1; } else if (rb == 8) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(18728,plocx,plocy,plocz-0.7,ploca+180); format(string,sizeof(string),"Officer %s has placed a Flare at his position, over.",sendername); SendRadioMessage(14,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Flare ~g~Placed!",3000,1); return 1; } } return 1; }