SA-MP Forums Archive
Player position in race - 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: Player position in race (/showthread.php?tid=378460)



Player position in race - Amator - 17.09.2012

Hello.

I've made a basic sprint GM, there's no problem with it but I'd like to add a really simple thing that shows the player his position in the race.
I've found some systems around here but not as I want. One only gets the position if there is one player between two checkpoints, and an other one is for the entire race.
I would just like some clear explanations on how to do it. Without using any race FS or that kind of thing.
Showing the pos is not my problem, I need to get this pos..

Thanks you in advance for taking the time to read this.


AW: Player position in race - arvifilter - 18.09.2012

Ehm, the script depends to the racing map that you use:
you can make a variable for every player and increase the amount of it by the percent of the way they went and compare them at the OnPlayerUpadate.the thing you want is quite hard as most of the maps are not straight.
it's not impossible but for every map you make, you need to add thousands of lines to the GM.
this is the way I think it might work correctly, but there might be other ways too^^


Re : Player position in race - Amator - 18.09.2012

Well thanks for your answer


Re: Player position in race - Audiophr3ak - 18.09.2012

Use race checkpoints. Simply and efficient.


Re : Player position in race - Amator - 18.09.2012

I doesn't give the position


Re: Player position in race - clarencecuzz - 18.09.2012

Example of its use:
https://sampwiki.blast.hk/wiki/OnPlayerEnterRaceCheckpoint

pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    // Additional code...
    return 1;
}



Re : Player position in race - Amator - 18.09.2012

I'm not sure to understand, anyway I'm taking a look at it, thanks