Little problem?
#1

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?

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;
    }

}
Reply
#2

Okay I fixed that command I've posted above but there is 1 more problem, so the problem is when I write /bk it sends the msg to officers, but it doesn't want to show the MARKER for OTHER OFFICERS / CADETS, how can I make so the marker will be showed for officers and cadets (ganginfo 12 and 13)? Here is my current script, the script is for RP server where markers are hiden, I'm also using ShowPlayerMarkers to hide everyone's marker. (OnGameModeInit)

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    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 string[150];
            new pName[MAX_PLAYER_NAME];
            ICBK[playerid] = 1; // Is calling backup, so player won't be able to spam it
            GetPlayerName(playerid, pName, sizeof(pName));
            format(string, sizeof(string), "{FF0000}.:DISPATCH:.:{30C1C1} ALL UNITS! %s is requesting immediate assistance, his location has been located on radar!", pName); // msg
            for(new i = 0; i < MAX_PLAYERS; i++) // loop...
            {
                if(GangInfo[i][Gang] == 12||GangInfo[i][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;
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "You are not authorized to use this command"); // only cops can use it.
            return 1;
        }
    }
    return 0;
}
Thanks for help in advance
Reply
#3

Please help It's so important :S
Reply
#4

Код:
SetPlayerMarkerForPlayer(i, playerid, 0xC2A2DAAA);
That is your problem you are getting the players marker but it will only show 1 person because it says "playerid".
Reply
#5

But before that there is "i", that is supposed to show markers to all players that are ganginfo 12 or 13 (officers/cadets)
Reply
#6

Bump, why it doesn't show marker on map to all officers?
Reply
#7

Well bumping this topic last time, may you help me please? why it doesn't show marker to cops when one of officers write /bk
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)