Код:
if(strcmp(cmdtext, "/roadblock", true)==0 || strcmp(cmdtext, "/rb", true)==0)
{
if (gTeam[playerid] != TEAM_COP) return SendClientMessage(playerid, COLOR_GREY, "You are not playing as a cop!");
if (Rdeploy[playerid] != 0) return SendClientMessage(playerid, COLOR_GREY, "You can only deploy 1 roadblock at a time, type /drb to remove your existing one.");
if (roadblocktimer != 0) return SendClientMessage(playerid, COLOR_GREY, "Please wait before trying to spawn another roadblock!");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
Rdeploy[playerid] == CreateObject(981, X, Y, Z, 0.0, 0.0, A+180);
SetPlayerPos(playerid, X, Y, Z+4);
GameTextForPlayer(playerid, "~w~Roadblock ~r~Placed", 5000, 5);
SendClientMessage(playerid, COLOR_GREEN, "Roadblock deployed successfully, type /drb");
roadblocktimer == 1;
}
}
}
}
SetTimer("ResetRoadblockTimer", 60000, false);
return 1;
}
if(strcmp(cmdtext, "/drb", true)==0)
{
if (gTeam[playerid] != TEAM_COP)
{
SendClientMessage(playerid, COLOR_GREY, "You are not playing as a cop!");
return 1;
}
if (PlayerInfo[playerid][pRoadblock] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You haven't deployed a roadblock!");
return 1;
}
RemoveRoadblock(playerid);
SendClientMessage(playerid, COLOR_GREEN, "Roadblock removed successfully.");
return 1;
}