diegofkda Posted March 25, 2011 Share Posted March 25, 2011 I was making this script function timers() setTimer ( playerinfo2, 50, 0) end addCommandHandler ("explosions", timers) function playerinfo2() local vehicle = getPedOccupiedVehicle (getLocalPlayer()) local x, y, z = getElementPosition ( vehicle ) if ( getElementVelocity(vehicle) == 100 ) then createExplosion ( x, y, z-4, 12 ) else end end Yes, it works correctly, as you can see, when the vehicle goes to 100, it will make an explosion near it. but i want to make the explosion when the vehicle goes MORE than 100, how to do it? Link to comment
Kenix Posted March 25, 2011 Share Posted March 25, 2011 I was making this script function timers() setTimer ( playerinfo2, 50, 0) end addCommandHandler ("explosions", timers) function playerinfo2() local vehicle = getPedOccupiedVehicle (getLocalPlayer()) local x, y, z = getElementPosition ( vehicle ) if ( getElementVelocity(vehicle) == 100 ) then createExplosion ( x, y, z-4, 12 ) else end end Yes, it works correctly, as you can see, when the vehicle goes to 100, it will make an explosion near it. but i want to make the explosion when the vehicle goes MORE than 100, how to do it? try this function timers() setTimer ( playerinfo2, 50, 0) end addCommandHandler ("explosions", timers) function playerinfo2() local vehicle = getPedOccupiedVehicle (getLocalPlayer()) local x, y, z = getElementPosition ( vehicle ) if ( getElementVelocity(vehicle) >= 100 ) then createExplosion ( x, y, z-4, 12 ) else end end and translate this http://www.lua.ru/doc/2.5.2.html and read Link to comment
diegofkda Posted March 25, 2011 Author Share Posted March 25, 2011 I was making this script function timers() setTimer ( playerinfo2, 50, 0) end addCommandHandler ("explosions", timers) function playerinfo2() local vehicle = getPedOccupiedVehicle (getLocalPlayer()) local x, y, z = getElementPosition ( vehicle ) if ( getElementVelocity(vehicle) == 100 ) then createExplosion ( x, y, z-4, 12 ) else end end Yes, it works correctly, as you can see, when the vehicle goes to 100, it will make an explosion near it. but i want to make the explosion when the vehicle goes MORE than 100, how to do it? try this function timers() setTimer ( playerinfo2, 50, 0) end addCommandHandler ("explosions", timers) function playerinfo2() local vehicle = getPedOccupiedVehicle (getLocalPlayer()) local x, y, z = getElementPosition ( vehicle ) if ( getElementVelocity(vehicle) >= 100 ) then createExplosion ( x, y, z-4, 12 ) else end end and translate this http://www.lua.ru/doc/2.5.2.html and read lol ok ty Link to comment
diegofkda Posted March 25, 2011 Author Share Posted March 25, 2011 this work? Works but I'm seeing many getElementVelocity bugs. 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