Jump to content

Help with aiming function


adithegman

Recommended Posts

I've tried to make a script that tells you what are you aiming at. For ex, it tells you if you're aiming at a player or a vehicle. But for whatever reason, it doesn't work... The script runs just fine, no warnings/errors. Thanks for the help.

 

function checkAiming( )
    if isPedAiming ( getLocalPlayer() ) then
        local w, h = guiGetScreenSize ()
        local elementType = getElementType ( getPedTarget ( getLocalPlayer ( ) ) )
        dxDrawText ( "You are aiming at a(n) " .. elementType .. " now", w/2, h/4)
    end
end

addEventHandler( "onPlayerRender", getRootElement(), checkAiming )

 

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