Koella Posted April 17, 2013 Share Posted April 17, 2013 Hello everyone I am trying to make a global timer that checks every vehicle on the server every 10 seconds and despawns every vehicle that is in water and not a boat. I have a little problem with this part of the code: if isElementInWater(vehicle) then outputChatBox("you shouldn't despawn!") if checkBoat == false then destroyElement(vehicle) end else outputChatBox("much better") end My problem is, that, while I am sitting in the vehicle, I get the message "much better" every 10 seconds. BUT, if I stand outside of the vehicle (no player is in it anymore!), the message "you shouldn't despawn" appears when the timer triggers and the vehicle despawns (the vehicle is still on the street, not in water !) It doesn't make any sense to me why the outcome of "isElementInWater" would change if there's a player in the car or not. I can only explain it to myself by saying that the function itself is bugged. Thanks in advance for the help, Koella Link to comment
OGF Posted April 17, 2013 Share Posted April 17, 2013 Try checking if the ped is in the vehicle 'isPedInVehicle' <--- if that returns true then use getPedOccupiedVehicle to destroy it. Link to comment
Castillo Posted April 17, 2013 Share Posted April 17, 2013 That function is bugged on the server side, returns wrong data. Link to comment
OGF Posted April 17, 2013 Share Posted April 17, 2013 Yeah I was testing it, it seems to only work if you are inside a vehicle. Do you know if there is a bug report for it? I saw old ones but not relating to this. Link to comment
Jaysds1 Posted April 17, 2013 Share Posted April 17, 2013 I've checked but I don't see anything about this: http://tinyurl.com/co2znn9 Link to comment
Koella Posted April 17, 2013 Author Share Posted April 17, 2013 Okay thanks for the replies I'm gonna try and make it clientside then, but I hope this issue will get fixed soon xP 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