16.01.2014, 11:59
Why this says "you are not authorized to use this command" even if I'm in gang 12 or 13 (officer/cadet)
EDIT: also is the loop scripted right?
EDIT: also is the loop scripted right?
pawn Код:
if(!strcmp(cmdtext, "/bk", true))
{
if(GangInfo[playerid][Gang] != 12||GangInfo[playerid][Gang] != 13) return SendClientMessage(playerid, 0xFF0000AA, "You are not authorized to use this command"); // only cops can use it.
if(ICBK[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA,"You need to wait 1 minute before calling backup again!"); // Message if player will want to spam backup..
new bName[MAX_PLAYER_NAME];
ICBK[playerid] = 1; // Is calling backup, so player won't be able to spam it
GetPlayerName(playerid, bName, sizeof(bName));
format(string, sizeof(string), "{FF0000}.:DISPATCH:.:{30C1C1} ALL UNITS! %s is requesting immediate assistance, his location has been located on radar!", bName); // msg
for(new i = 0; i < MAX_PLAYERS; i++) // loop...
{
if(GangInfo[playerid][Gang] == 12||GangInfo[playerid][Gang] == 13) // checking if player is cop
{
SendClientMessage(i,0x0FFDD349,string); // same color as in dispatch chat, and it will send msg to cops only
SetPlayerMarkerForPlayer(i, playerid, 0xC2A2DAAA); // it will set purple marker on player whoever called backup and only cops will be able to see it
SetTimerEx("RemoveMarker", 60000, false, "i",playerid); // We will set 1 min timer to auto remove marker
}
}
return 1;
}
}