Thehookerkiller01 Posted July 7, 2009 Share Posted July 7, 2009 Hey, is it possible to make a timer for onVehicleFire, like when a player is in a firetruck, he only can use the vehicle fire 2 minutes. And then it's empty, and he have to refill it. And for a hydra, 10x a fire. Is it also possible, when a player hits something very fast, he will be go trough the front window (like gta4), but not when a player is up trough a wall, because then he will be warped into the wall. Link to comment
Gamesnert Posted July 7, 2009 Share Posted July 7, 2009 Could you please clarify the first question? Because I doubt that you can "use" a fire while in a Firetruck... Unless you built a flamethrower on top of it. ^^ And about the second question, it should be possible yes. It'll just require some calculation I guess. Link to comment
Thehookerkiller01 Posted July 7, 2009 Author Share Posted July 7, 2009 Use vehicle fire. The vehicle weapon (like water in a firetruck) Link to comment
Gamesnert Posted July 7, 2009 Share Posted July 7, 2009 You mean Extinguish? ("Blussen" in Dutch) Then it might be possible, but you'd need to calculate the arch of the water and also get the turret rotation. For the turret rotation you can use getVehicleTurretPosition (note that you need to do math.deg on the coordinates to get the coordinates in degrees, as they're in radians) Then with some heavy calculations you can make the extinguishing. Link to comment
Thehookerkiller01 Posted July 7, 2009 Author Share Posted July 7, 2009 Yes, and also that the fire truck can be empty of water. Link to comment
Gamesnert Posted July 7, 2009 Share Posted July 7, 2009 That should be possible. Some functions that should make it possible to make it relatively good: - getControlState - setControlState - onClientRender - getTickCount It might require some thinking, but that's the fun thing about scripting! Problem solving! Link to comment
Dark Dragon Posted July 11, 2009 Share Posted July 11, 2009 get if the player is in a fire truck, get if hes pressing fire, calculate the milliseconds he used it using get tick count twice toggle the control off when the used time is too high (maybe also don't forget to re enable it when he exits, re remove it when he enters again) Link to comment
darkdreamingdan Posted July 11, 2009 Share Posted July 11, 2009 This is still quite hard. Dont forget you can rotate the turret up/down/left/right so the target position isnt constant. You could disable movement to make things easier perhaps (up and down that is) Link to comment
Dark Dragon Posted July 12, 2009 Share Posted July 12, 2009 but what does it have to do with the turret position? isn't he trying to simulate a tank of water that is becoming more and more empty? well when reading the first post again he says something about a timer of two minutes, well making the turret only work for two minutes is really easy using setTimer Link to comment
Gamesnert Posted July 12, 2009 Share Posted July 12, 2009 From what I understood he wants 2 things: 1. He wants the tank of the fire truck to become empty over time. 2. He wants to be able to extinguish vehicle fire with the fire trucks. I guess he means the fire that appears if vehicle health < 250. This is why the turret "position" is required. Also, setTimer might be an easy way to do it indeed, except that the timer will continue running unless disabled and there's no simple way to get the time left until the timer runs out. (only getTickCount() might be a way I think) So ye, it's a small puzzle to make the first thing working. But not nearly as hard as the second one... Link to comment
Dark Dragon Posted July 12, 2009 Share Posted July 12, 2009 good luck extinguish this fire in the 5 seconds before the explosion also, the settimer was meant for the thing mentioned in the first post which sounds like he just wanted to disable it two minutes after vehicle enter. actually i don't see what makes you think he wants to extinguish vehicle fire, for the hydra thing you can just count Link to comment
Gamesnert Posted July 12, 2009 Share Posted July 12, 2009 You mean Extinguish? ("Blussen" in Dutch)Then it might be possible, but you'd need to calculate the arch of the water and also get the turret rotation. For the turret rotation you can use getVehicleTurretPosition (note that you need to do math.deg on the coordinates to get the coordinates in degrees, as they're in radians) Then with some heavy calculations you can make the extinguishing. Yes, and also that the fire truck can be empty of water. It's not only the first post that matters you know. Link to comment
Dark Dragon Posted July 13, 2009 Share Posted July 13, 2009 so basically the more we post the more he wants? then I'll be outta here now. 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