CowTurbo Posted May 7, 2011 Share Posted May 7, 2011 How to get cords from window which have map ? Like freeroam u can spawn using map. Link to comment
CowTurbo Posted May 7, 2011 Author Share Posted May 7, 2011 already did, its pretty hard to understand because of they own maded gui sys Link to comment
Castillo Posted May 8, 2011 Share Posted May 8, 2011 I'll give you the code of my OWN freeroam (it's a resource made totally from scratch, not an Arc_'s edit) since i don't use this resource, made it for fun when i was bored. sanAndreasMapWindow = guiCreateWindow(167,8,691,742,"Select destination",false) guiSetVisible(sanAndreasMapWindow, false) guiWindowSetSizable(sanAndreasMapWindow, false) imgMap = guiCreateStaticImage(9,41,673,649,"images/map.png",false,sanAndreasMapWindow) closeMapWindow = guiCreateButton(301,702,108,30,"Close",false,sanAndreasMapWindow) function mapPositionSet(x, y) local ele = getLocalPlayer() local vehicle = getPedOccupiedVehicle ( getLocalPlayer() ) local z_add = 1.5 if (vehicle) then ele = vehicle z_add = 3.0 end local knockoff_old = canPedBeKnockedOffBike(getLocalPlayer()) setPedCanBeKnockedOffBike(getLocalPlayer(), false) setElementPosition(ele, x, y, 600.0) setElementVelocity(ele, 0, 0, 0) fadeCamera(false, 0) setTimer(fadeCamera, 800, 1, true, 1.0) setTimer( function() local z = getGroundPosition(x, y, 600.0) local waterlvl = getWaterLevel(x, y, 0.0) local waterlvl2 = getWaterLevel(x, y, 50.0) if (waterlvl2) then waterlvl = waterlvl2 end if (waterlvl) then if (z < waterlvl) then z = waterlvl end end setPedCanBeKnockedOffBike(getLocalPlayer(), knockoff_old) setElementVelocity(ele, 0, 0, 0) setElementPosition(ele, x, y, z+z_add) setElementInterior(ele,0) if (vehicle) then setVehicleTurnVelocity(vehicle, 0, 0, 0) setElementRotation(vehicle, 0, 0, 270) end end ,800, 1) end function onImageClick(button, state, absoluteX, absoluteY) local wndPosX, wndPosY = guiGetPosition(sanAndreasMapWindow, false) local imgX, imgY = guiGetPosition(imgMap, false) local imgSizeX, imgSizeY = guiGetSize(imgMap, false) local relPosX = (absoluteX-wndPosX-imgX+0.5)/imgSizeX - 0.5 local relPosY = 0.5 - (absoluteY-wndPosY-imgY+0.5)/imgSizeY mapPositionSet(relPosX*6000, relPosY*6000) guiSetVisible(sanAndreasMapWindow,false) end addEventHandler("onClientGUIClick", imgMap, onImageClick, false) function closeTheMap() guiSetVisible(sanAndreasMapWindow,false) end addEventHandler("onClientGUIClick", closeMapWindow, closeTheMap, false) 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