07.12.2014, 15:36
Quote:
OP, I will not script it for you, however I'll (hopefully) point you in the right directions.
Use this to allow the script to manually handle the engine & lights of vehicles. https://sampwiki.blast.hk/wiki/SetVehicleParamsEx I use this under the OnVehicleSpawn() callback (to set engine & lights to 0) & under my '/engine' & '/lights' commands. (to toggle them) However, you want to toggle it by a key press, so you would use the callback OnPlayerKeyStateChange(). https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange Then when you have made so the script detects when a player hits a key, use GetVehicleParamsEx(). https://sampwiki.blast.hk/wiki/GetVehicleParamsEx Use it to take the information from the vehicle that the player currently is in. (if he is, use IsPlayerInAnyVehicle() to check this, perhaps? ![]() Then you could just do something like: pawn Код:
About the fuel; you could have a timer that will run every X milliseconds, I.E every 10 seconds, and check each vehicle if the engine is on; deduct fuel of the vehicle. (for this you would have to declare a Fuel[MAX_VEHICLES] of some sort, and OnVehicleSpawn(), set it to like.. 100. (this is all up to you) Of course you could have a WAY more complicated system, but this is a very, very basic one you could create, then once you feel comfortable with those things, you could expand it. Feel free to post again if you have more questions. Sorry if I'm posting a clusterfuck of stuff that might make no sense; I'm tired. |
I'll work on that, thanks.