Jump to content

[Question] aiming


Stranger

Recommended Posts

  • Moderators

of course it isn't working.

The variable player is nil is nothing and useless, when you don't define it.

setTimer (function () 
    local players = getElementsByType("player") 
    for i=1,#players do 
        local player = players[i] 
        local target = getPedTarget (player) 
        if target and getElementType (target) == "vehicle" then 
            destroyElement (target) 
        end 
    end 
end, 500,0) 

Link to comment
  • Moderators
onPlayerTarget event is way better.

Not really since that only get triggered when a player change from target and not when he starts aiming.

The best result would be using bindkey, but will require more bandwidth.

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