Cop backup showing for EVERYONE?
#1

Even with IsACop it is still showing the whole server...

pawn Код:
CMD:bk(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD Officer.");
    new string[256];

    foreach(Player, i)
    {
        if(IsACop(playerid))
        {
            format(string, sizeof(string), "[Police Message] %s has activated their assistance beacon, please respond immediately.", RPN(playerid));
            SendClientMessage(i, COLOR_GREEN, string);
            SetPlayerMarkerForPlayer(playerid, i, COLOR_BLUE);
        }
    }
     return 1;
}

CMD:bkc(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD Officer.");
    new string[128];

    foreach(Player, i)
    {
        if(IsACop(playerid))
        {
            format(string, sizeof(string), "[Police Message] %s has deactivated their assistance beacon. Code 4.", RPN(playerid));
            SendClientMessage(i, COLOR_GREEN, string);
            SetPlayerMarkerForPlayer(i, playerid, TEAM_HIT_COLOR);
        }
    }
     return 1;
}
Reply
#2

Don't see the mistake look here.

Код:
foreach(Player, i)
    {
        if(IsACop(i))
Reply
#3

Why are you using foreach (a loop) if, i bet, IsACop as already a loop for cop team? Remove it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)