Senze Posted March 21, 2010 Share Posted March 21, 2010 Hey Guys today i started to create a fuel system but so I have one problem the fuel doesn't stop if the player left the car so the fuel only have to stop if the player set the enginestate of the vehicle to false And have to start drain the fule in the vehicle if the player is start the engine (toggle enginestate to true). If he forgoten to toggle the enginestate to "false" it will drain more and more so how can i handler this? create timer for all cars i think this sucks =/ so plz help me =( Link to comment
50p Posted March 21, 2010 Share Posted March 21, 2010 Hey Guys today i started to create a fuel system but so I have one problem the fuel doesn't stop if the player left the car so the fuel only have to stop if the player set the enginestate of the vehicle to falseAnd have to start drain the fule in the vehicle if the player is start the engine (toggle enginestate to true). If he forgoten to toggle the enginestate to "false" it will drain more and more so how can i handler this? create timer for all cars i think this sucks =/ so plz help me =( How else do you want to do it then? Link to comment
Senze Posted March 21, 2010 Author Share Posted March 21, 2010 hm your right hm i see so no way =/ but how to create a timer for only this vehicle? Link to comment
50p Posted March 22, 2010 Share Posted March 22, 2010 If you have a variable that holds vehicle element then it depends how you want the script to work. You can call your own functions which deal with fuel running out, say: local vehicle = getPedOccupiedVehicle( player ); setTimer( YOUR_FUEL_FUNC, 10000, 0, vehicle ); -- it'll pass vehicle to YOUR_FUEL_FUNC function YOUR_FUEL_FUNC( veh ) -- timer called this func and passed vehicle element -- veh will be vehicle element that timer passed in when calling this function end It's hard to give snippets because such snippets may not make sense to you. You should start your script and show some code, that way we can suggest what to change or what is wrong in your code. In case you didn't know, there are fuel scripts already: https://community.multitheftauto.com/index.html?p ... ils&id=119 https://community.multitheftauto.com/index.html?p ... ils&id=190 They are pretty old, so I don't know whether they work or not. Link to comment
Xierra Posted March 22, 2010 Share Posted March 22, 2010 I've been using slrfuel and it doesn't work at all. Link to comment
Senze Posted March 22, 2010 Author Share Posted March 22, 2010 so thank you but i have to try something other and it will work to =) i create i timer with o local variable and put it into a elementdata (from the current vehicle) if the player would take of the engine i get the elemtn data and kill the timer so it works =) Link to comment
Namorek Posted June 12, 2010 Share Posted June 12, 2010 I've been using slrfuel and it doesn't work at all. Yes doesn't work at slrfuel Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now