Mission with nearest start -
mitchboy - 19.02.2012
Hi, i am building a pilot system.
I want the system to know which start point is the closest one from the position of the player.
And maybe if it's possible but optional: it generates couples of points (the point A and B)(the airports and gates) and if it starts at Las Venturas Gate 1, it may not get the destination Las Venturas Gate 2 or the same as startpoint.
Please help me.
Re: Mission with nearest start -
Madd Kat - 19.02.2012
well this function will help
https://sampwiki.blast.hk/wiki/GetPlayerDistanceFromPoint
HTH's
Re: Mission with nearest start -
mitchboy - 19.02.2012
Yeah i thought so but don't realy know how to start with it
Re: Mission with nearest start -
Madd Kat - 20.02.2012
Ill give ya a general rundown but wont code this for ya as i dont have the skillset just yet.
and i think i know what your looking for but not 100%
but if it was me ID start off with an array of the start points something like {id,name,x,y,z}
then I would run a loop and get my distance from each point
after that is some simple math to find the closest point
Id wrap that up in a function and return the ID back so I could mark it in game.
depending on how your gonna use it you may need a timer also.
Like if you want it to update itself.
Goodluck
Re: Mission with nearest start -
mitchboy - 20.02.2012
Yeah and i never made a script like that, so i want someone to make a start with it if it's possible.
Re: Mission with nearest start -
ejul - 09.11.2012
give me the...code...
i can make it get nearest..
Re: Mission with nearest start -
Coz - 17.07.2013
Quote:
Originally Posted by ejul
give me the...code...
i can make it get nearest..
|
Ejul I'm trying to do the same thing in my server, please respond if your still willing to help, i'll post cost