Jump to content

how to make static image at ped head?


Recommended Posts

Posted

local px,py,pz = getElementPosition(vehicle)

local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz )

if pdistance <= 133 then

local sx,sy = getScreenFromWorldPosition( px, py, pz + 0.3 )

if not sx or not sy then break end

local awatarid = getElementData(player, "omg.avek")

dxDrawImage(sx-27,sy-55, 55, 64 , 'img/'..awatarid..'.png', 0, 0, 0, tocolor ( 255, 255, 255, 140 ) )

end

It works flawlessy but when i'm near to opponent the image is normal, but when im driving out the image is bigger. How can i make it normal-size all the time? Thanks!

Posted

calculate the distance ( which is pdistance ) and use that to do some magic math. ^_^ ( with the width and the height of your image ).

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted
isPedInVehicle 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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