SoiiNoob Posted March 19, 2012 Share Posted March 19, 2012 i wanna set a marker, when you are on it you can choose 3 types of bicycles (Bike, BMX, Mountain Bike) [with double click if you can] here's a simple fail -- GUI p1 = createMarker ( 2249.1606445313, -1262.4528808594, 23, "cylinder", 1, 0, 0, 255, 255 ) Boton1 = guiCreateButton(275,20,15,15,"x",false,cerrar) guiSetVisible(createSelectedVehicle, false) function cerrar() guiSetVisible(cerrar, false) showCursor(false) end function hit (player) if player == getLocalPlayer() then guiSetVisible(createSelectedVehicle, true) showCursor(true) end end addEventHandler( "onClientGUIClick", Boton1, cerrar ) addEventHandler( "onClientMarkerHit", p1, hit ) -- part of freeroam function createSelectedVehicle(leaf) if not leaf then leaf = getSelectedGridListLeaf(wndCreateVehicle, 'vehicles') if not leaf then return end end server.giveMeVehicles(leaf.id) end wndCreateVehicle = { 'wnd', text = 'Create vehicle', width = 300, controls = { { 'lst', id='vehicles', width=280, height=340, columns={ {text='Vehicle', attr='name'} }, rows={xml='vehicles.xml', attrs={'id', 'name'}}, onitemdoubleclick=createSelectedVehicle }, {'btn', id='create', onclick=createSelectedVehicle}, {'btn', id='close', closeswindow=true} } } function createVehicleCommand(cmd, ...) local vehID local vehiclesToCreate = {} local args = { ... } for i,v in ipairs(args) do vehID = tonumber(v) if not vehID then vehID = getVehicleModelFromName(v) end if vehID then table.insert(vehiclesToCreate, math.floor(vehID)) end end server.giveMeVehicles(vehiclesToCreate) end addCommandHandler('createvehicle', createVehicleCommand) addCommandHandler('cv', createVehicleCommand) Edit: I wanna some like this Link to comment
Kenix Posted March 19, 2012 Share Posted March 19, 2012 https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI Link to comment
drk Posted March 19, 2012 Share Posted March 19, 2012 Maybe this too: www.lua-users.org/wiki/TutorialDirectory 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