Jump to content

crosshair problem


Best-Killer

Recommended Posts

local size = 30

 
addEventHandler("onClientRender", root, function () 
    local hX,hY,hZ = getPedTargetEnd ( getLocalPlayer() )
    local screenX1, screenY1 = getScreenFromWorldPosition ( hX,hY,hZ )
    local weapon = getPlayerWeapon(getLocalPlayer())
    if weapon ~= 0 and weapon ~=1 then
    if getControlState("aim_weapon") then
        dxDrawImage(screenX1-(size/2), screenY1-(size/2), size, size, "outras/trgt.png", 0,0,0, tocolor(255,255,255,255))
end
end 
end
)

the crosshair showed ig like in photo http://imgur.com/a/h8b9f

i want it be full crosshair like :http://imgur.com/a/nVnIH

what i have to do guys ?

 

Link to comment
33 minutes ago, Gravestone said:

Increase the width and height of the image.

It should be scaled down and still show the full image, just smaller.

It's strange, it looks like a whole different image altogether. Are you sure that you have the right image in dxDrawImage?

Link to comment

Right, now i understand.

The easiest way would probably be to edit the image itself to make it a full crosshair or just find a different one on the internet, i'm sure you'll find some.

The other (not so simple) way would be to draw the image twice, with the second one rotated.

Something like this:

dxDrawImage(screenX1-(size/2), screenY1-(size/2), size, size, "outras/trgt.png", 0,0,0, tocolor(255,255,255,255))
dxDrawImage(screenX1, screenY1, size, size, "outras/trgt.png", 180,-(size/2),-(size/2), tocolor(255,255,255,255))
--Something like that, it will be off but i'm just showing that it is possible, but it's better to go for a full crosshair image.

 

Edited by MIKI785
Link to comment
8 hours ago, MIKI785 said:

Right, now i understand.

The easiest way would probably be to edit the image itself to make it a full crosshair or just find a different one on the internet, i'm sure you'll find some.

The other (not so simple) way would be to draw the image twice, with the second one rotated.

Something like this:


dxDrawImage(screenX1-(size/2), screenY1-(size/2), size, size, "outras/trgt.png", 0,0,0, tocolor(255,255,255,255))
dxDrawImage(screenX1, screenY1, size, size, "outras/trgt.png", 180,-(size/2),-(size/2), tocolor(255,255,255,255))
--Something like that, it will be off but i'm just showing that it is possible, but it's better to go for a full crosshair image.

 

Thx dude 

 

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