Jump to content

[Help] crosshair


Recommended Posts

Posted (edited)

I saw on some server , that without having to aim the gun in his hand ( target running without having gun in hand, type DayZ SA ) by pressing the right mouse button , podria someone show me how I can put this fuction on my server?

Ex:

n8flVce.png

RjoAy13.jpg

Edited by Guest
Posted

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 
  

Posted
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

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