Jump to content

[Help] crosshair


Recommended Posts

Or simply draw the crosshair in the center of the window when aiming.

  
function drawCrosshairIfAiming() 
    if isPedAiming(localPlayer) then 
        dxDrawImage(...) 
    end 
end 
addEventHandler("onClientRender",root,drawCrosshairIfAiming) 
  
function isPedAiming ( thePedToCheck ) 
    if isElement(thePedToCheck) then 
        if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then 
            if getPedTask(thePedToCheck, "secondary", 0) == "TASK_SIMPLE_USE_GUN" then 
                return true 
            end 
        end 
    end 
    return false 
end 
  

Link to comment
  Tomas said:
Or simply draw the crosshair in the center of the window when aiming.
  
function drawCrosshairIfAiming() 
    if isPedAiming(localPlayer) then 
        dxDrawImage(...) 
    end 
end 
addEventHandler("onClientRender",root,drawCrosshairIfAiming) 
  
function isPedAiming ( thePedToCheck ) 
    if isElement(thePedToCheck) then 
        if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then 
            if getPedTask(thePedToCheck, "secondary", 0) == "TASK_SIMPLE_USE_GUN" then 
                return true 
            end 
        end 
    end 
    return false 
end 
  

The above script is not working as I expected, the gun appears , not more as in the examples . See how it's getting

xUwty1z.png

Link to comment
  • 3 weeks later...

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