Will this work - backup cmd
#1

pawn Код:
CMD:bk(playerid, params[])
{
    if (!IsPlayerCop(playerid)) 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(IsPlayerCop(i)) // 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;
}

forward RemoveMarker(playerid);
public RemoveMarker(playerid)
{
    ICBK[playerid] = 0;
    SetPlayerMarkerForPlayer(00, 00, 00); // Removing marker
    SendClientMessage(playerid,0xC2A2DAAA,"You have been unmarked from Police Radar, if you still need backup use /bk");
    return 1;
}
As title says will this work? I want to make it for RP server so when officer will write /bk it will show his location on map with purple marker, so police will be able to fallow him.. Thanks for answers
Reply
#2

It looks like it should function properly, how about trying to test it and if it doesn't work, write back here and tell us the problem with it.
Reply
#3

Do you get any errors? If not, it should be working.
Reply
#4

SetPlayerMarkerForPlayer(00, 00 ,00);

fix them, and p.s, 00 (the last argument) is for invisble marker , Read https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
Reply
#5

@DexterC I can't test it on my server I have problems with port forwarding so I can't test with friend
@offon No errors I just want to know if it will work properly
@Sawalha Fix what? :S Player markers are not showed on server cuz it's RP server, I want to make /bk so marker will appear and it will be visible by officers only..
Reply
#6

If you get no errors, then the script will work properly. You don't need to fix anything, like Sawalha said.
Sawalha: I think FF is for invisibility.
Reply
#7

Offon it's 00 for invisibility.
Reply
#8

Well I will inform you if there will be any problems, thanks for the answers
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)