XaskeL Posted August 19, 2015 Share Posted August 19, 2015 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
XaskeL Posted August 20, 2015 Author Share Posted August 20, 2015 STAWR said: getWorldFromScreenPosition Можно пример? Link to comment
obuhhh Posted August 20, 2015 Share Posted August 20, 2015 XaskeL said: STAWR said: getWorldFromScreenPosition Можно пример? По даной функции есть пример на вики.https://wiki.multitheftauto.com/wiki/Ge ... enPosition Reveal hidden contents 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now