Nearest point in range of player -
Jimmy0wns - 07.02.2015
So after looking through the search option and ******, I'll start my own topic.
I'm trying to get the nearest "load" point of the player, unfortunately due to lacking knowledge of knowing how to do this
correctly, I can't get it to work right. It sort of works but it keeps sending me to the first pickup point even though you're next to an other one.
Here is my list of load and unload points (I forgot how these are called):
http://pastebin.com/aeLHzrbA
And if you're wanting to correct my current code (which doesn't work), feel free to do so:
http://pastebin.com/DTcgKaUQ
Thank you for your cooperation!
I used pastebin because the PAWN tags appear to be gone.
Re: Nearest point in range of player -
HazardouS - 07.02.2015
Just call ClosestMissionStart(playerid) in your /work command in order to set the CurrentMission[playerid] to a value, maybe different than 0. The code looks fine to me, even if you could use
https://sampwiki.blast.hk/wiki/GetPlayerDistanceFromPoint instead of that stock.
Re: Nearest point in range of player -
Jimmy0wns - 07.02.2015
I totally forgot to call the function itself, thank you!
-edit- still can't get it working, read post after this.
Re: Nearest point in range of player -
Jimmy0wns - 22.02.2015
I've updated the main post and my latest post, I still can't seem to get it working. I'd be glad if someone could help me out!
Re: Nearest point in range of player -
DRIFT_HUNTER - 22.02.2015
Dont forget you are using streamer, so its a streamed CP (You will only see it when you are nearby)
Re: Nearest point in range of player -
Jimmy0wns - 22.02.2015
It is showing up but it always picks the first point (aka ID 0)
Re: Nearest point in range of player -
DRIFT_HUNTER - 22.02.2015
Well i checked your code few times and it has to work, but i also noticed that your CP's are pretty close...you sure its always 0? Can you debug CurrentMission[playerid] in your CMD?
Re: Nearest point in range of player -
Jimmy0wns - 22.02.2015
It's always 0 and while debugging it does the same.
Re: Nearest point in range of player -
Jimmy0wns - 22.02.2015
Out of the sudden, everything works again while no code was changed.
Oh well, fuck logic anyways.