Jump to content

Little help


diegofkda

Recommended Posts

Posted

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?

"Everything exists, because otherwise nothing would", Bob Marley, 2015.

Posted
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

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted
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

"Everything exists, because otherwise nothing would", Bob Marley, 2015.

Posted
this work?

Works but I'm seeing many getElementVelocity bugs.

"Everything exists, because otherwise nothing would", Bob Marley, 2015.

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