SA-MP Forums Archive
Can someone assist me with this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can someone assist me with this? (/showthread.php?tid=310982)



Can someone assist me with this? - Dokins - 14.01.2012

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



Re: Can someone assist me with this? - spedico - 14.01.2012

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


Re: Can someone assist me with this? - Dokins - 14.01.2012

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.


Re: Can someone assist me with this? - Scenario - 14.01.2012

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


Re: Can someone assist me with this? - Dokins - 14.01.2012

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.


Re: Can someone assist me with this? - Scenario - 14.01.2012

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

https://sampwiki.blast.hk/wiki/SetPlayerMapIcon


Re: Can someone assist me with this? - Dokins - 14.01.2012

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.


Re: Can someone assist me with this? - Scenario - 14.01.2012

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


Re: Can someone assist me with this? - Dokins - 14.01.2012

Yeah but how do I call the timer?


Re: Can someone assist me with this? - Scenario - 14.01.2012

SetTimer