Jump to content

Позиция клика на карте


Recommended Posts

Help me please, с позицией клика на карте. Саму карту уже сделал:

  
local x,y,z = getElementPosition(getLocalPlayer()) 
local screenx, screeny = guiGetScreenSize() 
local box_screen_y = (screeny/100 * 98) - 430 
local font_screen_x = (screenx/100) + (450) 
local font_screen_y = (screeny/100 *98) - 430 
local point_x = (3000 + x)/6000 * 450 
local point_y = (3000 - y)/6000 * 430 
  

Но как определить куда он нажал? Хочу сделать миномет, а с этой хренью никак.

Желательно получить позицию X,Y,Z.

Link to comment
getWorldFromScreenPosition

Можно пример?

По даной функции есть пример на вики.

https://wiki.multitheftauto.com/wiki/Ge ... enPosition

Example

_____________________________________________________________________________________________

This example binds the local player's "i" key to a function that creates an explosion in the middle of the screen.

function explosion () 
  local w, h = guiGetScreenSize () 
  local x, y, z = getWorldFromScreenPosition ( w/2, h/2, 10 ) 
  createExplosion ( x, y, z, 11 ) 
end 
bindKey ( "i", "down", explosion ) 

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