Set Nearest Checkpoint
#1

I'm planning to improve the pilot job in my Server, but the issue is:

I don't know how to script nearest checkpoint.

Example:
1. There are 3 Airports, Los Santos Airport, San Fierro Airport, Las Venturas Airport
2. You are in a plane, flying above Red County
3. When you do /flight, it detects the nearest airport from the player, so the checkpoint is Set to LSA Gate(Los Santos Airport Gate)

Any help will be appreciated, I'm still newbie.
Reply
#2

You need to use the GetPlayerDistanceFromPoint function.

https://sampwiki.blast.hk/wiki/GetPlayerDistanceFromPoint
Reply
#3

Quote:
Originally Posted by Monotox
Посмотреть сообщение
You need to use the GetPlayerDistanceFromPoint function.

https://sampwiki.blast.hk/wiki/GetPlayerDistanceFromPoint
Then what should I do?
Reply
#4

Quote:
Originally Posted by Dirda
Посмотреть сообщение
Then what should I do?
Create 3 variables. Get the distance from the three airports. Then compare which the lowest and then Set Checkpoint. Use 3 if statements.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)