Jump to content

[Help] How to show exact image section, that local player is standing on map?


Kazafka

Recommended Posts

Posted (edited)

I mean, how do I can show exact image section, that player is standing on in the real world now, using dxDrawImageSection()?

Like, when mini map is in size of 3000px by 3000px, how to show exact same pos, that local player is on?

I tried a lot with:

local x, y = getElementPosition(localPlayer)
local x = (x * hud.width) / 3000
local y = (y * hud.height) / 3000
--Rest of code

or

hud.units = 3000 / 6000

local x, y = getElementPosition(localPlayer)
local x = x * hud.units
local y = y * hud.units

--Rest of code

(I even tried with just):

lo

local x, y = getElementPosition(localPlayer)
--Rest of code

But I guess, that I'm showing w r o n g image section. How can I fix it, or make it better?

I tried to understand others' code, but I couldn't. So, I'm writing my, but still, I need some help. So how can I fix something?

BTW, if someone want to see full code, please, visit here: [click, Code v2].

And if you will manage something, please, share it with me, I want to learn how to do something correctly.

Edited by VaporZ
Posted

Maybe I asked in wrong way, maybe yes, maybe no. But the point is, that the image I am rendering has set 0, 0 pos into left upper corner, not in the middle of it. So maybe I need to set center of image, but I don't know how.

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