Jump to content

Little help


diegofkda

Recommended Posts

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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...