RosGard Posted June 18, 2018 Share Posted June 18, 2018 вот код : local marker = createMarker(1934.1379394531, -1759.0357666016, 12.546875, "cylinder", 1.0, 38, 122, 216) addEventHandler("onClientMarkerHit", resourceRoot, function(player) Windo = guiCreateWindow(30, 375, 300, 500, "Автосалон", false) Close = guiCreateButton(200, 455, 800, 500, "Закрыть", false, Windo) CreatedBy = guiCreateLabel(80, 25, 200, 15, "Выберите авто из списка:", false, Windo) loli = guiCreateGridList(0, 0.10, 0.95, 0.70, true, Windo) column = guiGridListAddColumn(loli, "Выберите:", 0.55) colum = guiGridListAddColumn(loli, "Цена:", 0.35) lolu = guiGridListAddRow(loli, "lol", "385$") guiGridListAddRow(loli, "lolsdsd", "1000$") roo = getCameraTarget(thePlayer) setCameraMatrix(1935.3367919922, -1751.9916992188, 15.3828125, 1942.6214599609, -1752.1103515625, 13.3828125) showCursor(true) end) function onGuiClick (button) if guiGridListGetSelectedItem(loli, 1) then veh = createVehicle(500, 1942.6214599609, -1752.1103515625, 13.3828125) timer = setTimer(function() local x, y, z = getElementRotation(veh) setElementRotation(veh, x, y, z+3) end, 50, 0) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) function onGuiClick (button) if (source == Close) then Enabled = false guiSetVisible (Windo, false ) showCursor(false) setCameraTarget(roo) destroyElement(veh) end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) Выбора машины вообще нет, она появляется если нажать в любом месте gui. Но есть же функция guiGridListGetSelectedItem?? И еще, после закрытия не убирается машина, она остается там же на координатах, как исправить. Link to comment
Other Languages Moderators Disinterpreter Posted June 19, 2018 Other Languages Moderators Share Posted June 19, 2018 (edited) Во-первых, у тебя откроется гуишка при входе в любой маркер, а не определенный, во-вторых, смотри мой пример: https://github.com/Disinterpreter/ClassicDM-MTA/blob/master/skinshop/skinshop_cl.lua#L39 Edited June 19, 2018 by Disinterpreter 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