Infarto Posted December 12, 2012 Share Posted December 12, 2012 Hola soy nuevo en esto y quiero aprender. Quien me daría una mano? Para presentarme de donde soy y eso.. Bueno queria empezar hacer un Bike Spawn en hospital quien me daría una mano? Les dejo mi skype felipe.calligo Link to comment
NodZen Posted December 12, 2012 Share Posted December 12, 2012 Hola , primero Bienvenido. Bueno con respecto a tu tema, tienes que usar la funcion : createVehicle Link to comment
Infarto Posted December 12, 2012 Author Share Posted December 12, 2012 Perfecto pero lo que queria yo es que me des una mano con una gui. un marker.. Pienso que no es completo.. Tu que dices? Link to comment
Xperia Posted December 12, 2012 Share Posted December 12, 2012 Lo que quiere el es un spawn como el de CIT.Usa esto: https://community.multitheftauto.com/index.php?p=resources&s=details&id=6039 Link to comment
Infarto Posted December 12, 2012 Author Share Posted December 12, 2012 Hola Xperia descargue este pero no encuentro el marcador por todo el mapa. Link to comment
NodZen Posted December 12, 2012 Share Posted December 12, 2012 Te recomiendo este tutorial Es de Pekio , un miembro de aqui. Link to comment
Infarto Posted December 13, 2012 Author Share Posted December 13, 2012 mmm.. no veo ningun tutorial aqui, Bueno si queires agregame al skype y me ayudas Link to comment
NodZen Posted December 13, 2012 Share Posted December 13, 2012 mmm.. no veo ningun tutorial aqui, Bueno si queires agregame al skype y me ayudas Si se vè. Miralo todo , tiene exactamente lo que necesitas Link to comment
Xperia Posted December 13, 2012 Share Posted December 13, 2012 ¿Miraste en la comisaria de LS? Link to comment
Infarto Posted December 14, 2012 Author Share Posted December 14, 2012 Miré pero no encontre nada Link to comment
angelberge Posted December 20, 2012 Share Posted December 20, 2012 Ese script que pusieron arroja error Link to comment
Cuervo_fi Posted December 20, 2012 Share Posted December 20, 2012 Intenta Así Client side: local marker1 = createMarker(1183.80, -1311.5, 12.60, 'cylinder', 3, 48, 150, 214, 140) local markers = {marker1} local vehicles = {"BMX", "Bike", "Mountain bike", "Faggio"} function createVehGui () MainGui = guiCreateWindow(408,203,240,349,"Bikes",false) guiWindowSetSizable ( MainGui, false ) VehGrid = guiCreateGridList(14,32,180,256,false,MainGui) guiGridListSetSelectionMode(VehGrid,2) _bikes = guiGridListAddColumn(VehGrid,"Elige",0.85) Spawn = guiCreateButton(15,305,96,35,"Aceptar",false,MainGui) guiSetFont(Spawn,"clear-normal") Cancel = guiCreateButton(128,305,96,35,"Salir",false,MainGui) guiSetFont(Cancel,"clear-normal") for index, vehicle in ipairs(vehicles) do local row = guiGridListAddRow (VehGrid) guiGridListSetItemText ( VehGrid, row, _bikes, tostring(vehicle), false, false ) end end for i,marker in ipairs ( markers ) do addEventHandler ( "onClientMarkerHit", marker, function ( hitElement ) if ( hitElement == localPlayer ) then if getElementType( hitElement ) == "player" and not isPedInVehicle(hitElement) then createVehGui ( hitElement ) if ( MainGui ~= nil ) then guiSetVisible ( MainGui, true ) showCursor ( true ) guiSetInputEnabled ( true ) setElementFrozen ( hitElement, false ) end end end end ) end addEventHandler("onClientGUIClick", root, function () if (source == Spawn) then local row,col = guiGridListGetSelectedItem(VehGrid) if (row and col and row ~= -1 and col ~= -1) then local vehicleName = guiGridListGetItemText(VehGrid, row, 1) if vehicleName == "BMX" then triggerServerEvent("spawnvehicle",localPlayer,481) elseif vehicleName == "Bike" then triggerServerEvent("spawnvehicle",localPlayer,509) elseif vehicleName == "Mountain bike" then triggerServerEvent("spawnvehicle",localPlayer,510) elseif vehicleName == "Faggio" then triggerServerEvent("spawnvehicle",localPlayer,462) end else outputChatBox("Error: Please, select a vehicle of list.",255,0,0) end elseif (source == Cancel) then triggerEvent("closeWindow", root ) end end ) addEventHandler("onClientGUIDoubleClick", root, function () if ( source == VehGrid ) then local row,col = guiGridListGetSelectedItem(VehGrid) if (row and col and row ~= -1 and col ~= -1) then local vehicleName = guiGridListGetItemText(VehGrid, row, 1) if vehicleName == "BMX" then triggerServerEvent("spawnvehicle",localPlayer,481) elseif vehicleName == "Bike" then triggerServerEvent("spawnvehicle",localPlayer,481) elseif vehicleName == "Mountain bike" then triggerServerEvent("spawnvehicle",localPlayer,510) elseif vehicleName == "Faggio" then triggerServerEvent("spawnvehicle",localPlayer,462) end end end end ) for i,marker in ipairs ( markers ) do addEventHandler("onClientMarkerLeave", marker, function () triggerEvent("closeWindow", root ) end ) end addEvent("closeWindow", true) addEventHandler("closeWindow", root, function () guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) setElementFrozen(localPlayer, false) end ) Server side: local vehicles = { } addEvent ( "spawnvehicle", true ) addEventHandler ( "spawnvehicle", root, function ( vehID ) if ( isElement ( vehicles [ source ] ) ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( vehID, getElementPosition ( source ) ) if ( vehicles [ source ] ) then setVehicleColor ( vehicles [ source ], 255, 255, 255 ) end setTimer ( warpPedIntoVehicle, 200, 1, source, vehicles [ source ] ) triggerClientEvent ( source, "closeWindow", root ) end ) Link to comment
Recommended Posts