30.06.2014, 18:09
pawn Код:
CMD:destroyflares(playerid, params[])
{
if(IsACop(playerid) || AdminDuty[playerid] == 1 && PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pAdmin] >= 5) {
if(IsPlayerInAnyVehicle(playerid) && AdminDuty[playerid] == 0)
return SendClientMessage(playerid, COLOR_GREY, "You must be on foot to use this command.");
if(GetPVarInt(playerid, "EventToken") == 1 || (PlayerInfo[playerid][pJailTime] > 0 && PlayerInfo[playerid][pJailed] < 6) && AdminDuty[playerid] == 0)
return SendClientMessage(playerid, COLOR_WHITE, "You can't do this right now.");
if(PlayerInfo[playerid][pRank] < 5 && PlayerInfo[playerid][pFaction] != 2 && AdminDuty[playerid] == 0)
return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 5 to use this command.");
new
szMessage[128];
for(new i; i < sizeof(g_PoliceFlares); i++)
{
DestroyDynamicObject(g_PoliceFlares[i][sObjectID]);
g_PoliceFlares[i][sX] = 0;
g_PoliceFlares[i][sY] = 0;
g_PoliceFlares[i][sZ] = 0;
g_PoliceFlares[i][sObjectID] = INVALID_OBJECT_ID;
}
format(szMessage, sizeof(szMessage), "HQ: All flares have been destroyed by %s.", GetPlayerNameEx(playerid));
SendLawEnforcementMessage(COLOR_DEPT_RADIO, szMessage);
SendRadioMessage(3, COLOR_DEPT_RADIO, szMessage);
SendRadioMessage(5, COLOR_DEPT_RADIO, szMessage);
} else SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");
return true;
}