open.mp forum
[Pawn] Trucking mission issue - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Trucking mission issue (/showthread.php?tid=1670)



Trucking mission issue - JohnnyMP - 2021-02-13

Hello guys,?



i starded making some trucking missions in my server and all i got for now is that when player types /work server checks few things like is player wanted or is player in truck with trailer attached and then it picks random mission and put mission load cp for player.



My question is next : How to make player able to choose from few closest Load points to his position ?



If anyone played on Convoy Trucking im trying to make same thing because its kinda bad if u are in LS and u start ur truck mission there but u get ur load point in SF.


RE: Trucking mission issue - JohnnyMP - 2021-02-15

anyone ?


RE: Trucking mission issue - Manyula - 2021-02-16

You need to define what ?close? means.



1. Find the closest x load points?



Iterate over the load points, measure the player?s distance to each one and sort them. Then pick the closest x load points and show them to the player in a dialog.



2. Find all load points in range x?



Iterate over the load points, and on each iteration, measure the distance to the player and save the ones below your range x in an array. Finally, show them to the player in a dialog.


RE: Trucking mission issue - Vamp - 2021-02-23

(2021-02-13, 07:17 PM)JohnnyMP Wrote: Hello guys,?



i starded making some trucking missions in my server and all i got for now is that when player types /work server checks few things like is player wanted or is player in truck with trailer attached and then it picks random mission and put mission load cp for player.



My question is next : How to make player able to choose from few closest Load points to his position ?



If anyone played on Convoy Trucking im trying to make same thing because its kinda bad if u are in LS and u start ur truck mission there but u get ur load point in SF.



I also got a trucking script. Didn't implement any distance check tho.?



Use?GetPlayerDistanceFromPoint(playerid, x, y, z);