Can someone assist me with this?
#1

Alright this part work's the actual issue is the SetPlayerMapIcon is not updating every second as it should.

pawn Код:
CMD:backup(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    new string[256];
    if(Faction[playerid] != 1) return SendClientMessage(playerid, COLOUR_GREY, "You are not a member of the police.");
    if(OnDuty[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You are not on duty.");
   
    foreach(Player, i)
    {
        if(Faction[i]== Faction[playerid])
        {
            format(string, sizeof(string), "[Police Message] %s has activated their assistance beacon, please respond immediately.", GetNameEx(playerid));
            SendClientMessage(i, COLOUR_GREEN, string);

            SetPlayerMarkerForPlayer(playerid, i, COLOUR_BLUE);
            SetPlayerMapIcon(i, 1, MAPX[playerid], MAPY[playerid], MAPZ[playerid], 0, COLOUR_BLUE); // ID 1 is POLICE.
            Beacon[playerid] = 1;
            }
        }
     return 1;
}
pawn Код:
public BackupUpdate()
{
    foreach(Player, i)
    {
        GetPlayerPos(i, MAPX[i],MAPY[i], MAPZ[i]);
    }
    return 1;
}
Reply
#2

So it should move the icon to players location?
In the foreach part you are just getting position of ALL players, nothing else.
Reply
#3

Yes, It should and yes, but on the CMD:backup if you look it has to retrieve it. All it needs to do is get it.
Reply
#4

I don't think the map icon is supposed to update that often...
Reply
#5

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I don't think the map icon is supposed to update that often...
On Red county RP. It does, That's why I'd like to implement it. It just doesn't update now.
Reply
#6

Double check to make sure you're following the syntax.

https://sampwiki.blast.hk/wiki/SetPlayerMapIcon
Reply
#7

I did actually miss one part of the syntax, style (last one) p.s Can you explain to me how to delay things, i.e if I created a command like /engine and there is like a delay before it sets the vehicles parameters like in real life Like:

/engine
"Your vehicle is starting"
Timer 3
2
1
Engine on.

If you understand that pseudocode.
Reply
#8

Just set a 3000ms timer and once the timer is called, toggle the engine on.
Reply
#9

Yeah but how do I call the timer?
Reply
#10

SetTimer
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)