Aircraft Commands
#1

I was wondering if theres a /takeoff and /land command like the server i play [SAP], i don't know how to code it
but when you are in sight of radio control (at a certain distance to an airport) and you enter the command /land and your in a plane,
it will send a message out to everyone online saying your about to land at whatever airport you are near, and same with /takeoff when your
about to takeoff it will send message saying your about to takeoff whatever airport.

Has anyone done this? I want to know :S
Reply
#2

Yah that sounds pretty simple. Yet if you haven't scripted before it would be tough.

In your onplayercommandtext, depends on if you use strcmp, dcmd etc

check players vehicle model is a plane and which airport a player is within range of use IsPlayerInRangeOfPoint looping through all your airport coordinates.
Then send out a message to anyone else within range of the airport by looping through all players and checking if they are in range of the same airport.

To do this you will have to get the locations of the centre of the airports then the radius.

https://sampwiki.blast.hk/wiki/OnPlayerCommandText
https://sampwiki.blast.hk/wiki/GetPlayerVehicleID
https://sampwiki.blast.hk/wiki/GetVehicleModel
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/SendClientMessage

Reply
#3

dcmd, would you have any idea how to write it up ? :S
I'm not sure how
Reply
#4

So it sounds like you want to script this yourself (alternatively ask in the script request thread)

I assume you have gone to
http://forum.sa-mp.com/index.php?topic=2750.0
and
https://sampwiki.blast.hk/wiki/Main_Page

For what you want specifically:
This is quite a lot to script.
You have to get the airport coordinates, get their areas, setup a check for player in plane, and write commands.

Give it a try and see how far you get. If you get stuck I can help you out, but I don't have time to script all that atm.

To get you started you will need to learn either the regular command system, or something better like dcmd.
https://sampwiki.blast.hk/wiki/OnPlayerCommandText
https://sampwiki.blast.hk/wiki/Fast_Commands#dcmd
http://forum.sa-mp.com/index.php?topic=75000.0

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)