Jump to content

JuegosPato

Members
  • Posts

    69
  • Joined

  • Last visited

Details

  • Gang
    -bmx-
  • Occupation
    --

JuegosPato's Achievements

Snitch

Snitch (10/54)

0

Reputation

  1. Gracias me Funciono sobre el Team !! Segun SolidSnake14 dice que es un bug del MTA, Si tu me das las funciones de como hacer eso yo lo aria... Como ago para arreglar ese bug ?
  2. Tengo un nuevo problema! -Como ago para que el GUI es exclusivamente para un clan/team? -Si pasas con el JetPack desde arriba del marker desde una altura muy alta aparece el GUI
  3. Ahora tengo otro problema D:, cuando vas corriendo y tocas el marker te aparece el GUI y si sigues corriendo te sigue apareciendo el GUI D: Me pueden arreglar esto?? puse cosas mal definidas D:, me lo pueden arreglar? D: addEventHandler("onClientMarkerLeave", bikes, function ( leftPlayer,matchingDimension ) if (leaveElement == localPlayer) then guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) end end )
  4. EstrategiaGTA lo tuyo no funciono , pero el de SolidSnake si Gracias a todos igual
  5. Ya puse la funcion de 'destroyElement' y la de 'guiSetVisible', lo que no me se es 'isPedInVehicle' D: Cuando tengas un vehiculo y vas al marker que no se habra el GUI. Server side. addEvent ( 'spawnBike', true ) addEventHandler ( "spawnBike", getRootElement(), function ( cars ) if isElement ( veh ) then destroyElement ( veh ) end local cn = getVehicleModelFromName ( cars ) local x,y,z = getElementPosition ( source ) local cn2 = getVehicleNameFromModel ( cn ) veh = createVehicle ( cn, x, y, z ) warpPedIntoVehicle ( source, veh ) end ) Client. local vehicles = {"BMX", "Bike", "Mountain Bike"} local bikes = createMarker(1183.2487792969, -1314.9769287109, 12.546875, 'cylinder', 1.5, 255, 255, 255, 255) MainGui = guiCreateWindow(408,203,240,349,"Vehicle",false) VehGrid = guiCreateGridList(17,32,200,256,false,MainGui) guiGridListSetSelectionMode(VehGrid,2) _bikes = guiGridListAddColumn(VehGrid,"Vehicle name:",0.85) Spawn = guiCreateButton(15,305,96,35,"Use",false,MainGui) guiSetFont(Spawn,"clear-normal") Cancel = guiCreateButton(128,305,96,35,"Close",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 guiSetVisible(MainGui, false) addEventHandler("onClientMarkerHit", bikes, function ( hitElement ) if (hitElement == localPlayer) then if (MainGui ~= nil) then guiSetVisible(MainGui, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox ("Error: Please Re-enter in the marker to get your vehicle.", 255, 0, 0) end end end ) addEventHandler("onClientGUIClick", root, function () if (source == Spawn) then guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) local row,col = guiGridListGetSelectedItem(VehGrid) if (row and col and row ~= -1 and col ~= -1) then local vehicleName = guiGridListGetItemText(VehGrid, row, 1) if vehicleName then triggerServerEvent("spawnBike",localPlayer,vehicleName) end else outputChatBox("Erro: Please select a vehicle from the list.",255,0,0) end elseif (source == Cancel) then guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) end end ) addEventHandler("onClientPlayerWasted", root, function () guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) end)
  6. No entiendo nada , me cambiaste todo el script D:, pero lo intentare.
  7. Errores nuevos: -Cuando selecciona un Vehiculo y toca el boton "use", te da el coche, pero, no se te cierra el GUI. -Usas un coche y vas por el marker se te habre el GUI. -Podes poner muchos vehiculos y se te bugea todo.
  8. Ahora si aparecen los vehiculos, pero, cuando selecciono y toco en "Use" no me da el coche. /debuscript 3: WARNING: tdb/server.lua:2: Bad argument @ 'getElementModel' [Expected element at argument 1, go nil]
  9. Ahora esta el GUI, pero los nuevos errores son que no estan los vehiculos y tengo un error con el getElementModel D: Imagen: Por si acaso, aqui les dejo el Server. function spawnBike () local id = getElementModel(thevehicle) if id == 509 or id == 510 or id == 481 then local x, y, z = getElementPosition ( source ) local xr, yr, zr = getElementRotation ( source ) bike = createVehicle (id, x, y, z + 0.5, xr, yr, zr ) warpPedIntoVehicle(source, bike) end end addEvent( "spawnBike", true) addEventHandler("spawnBike",root,spa
  10. Ya puse el Ya le puse , pero, ahora me da error, no aparece el gui igual Esto es lo que aparece: ERROR:tdb-xd/client.lua21:attempt to call global 'createVehGui' (a nill value) local vehicles = {"BMX", "Bike", "Mountain Bike"} local bikes = createMarker(1183.2487792969, -1314.9769287109, 12.546875, 'cylinder', 1.5, 255, 255, 255, 255) MainGui = guiCreateWindow(408,203,240,349,"Vehicle",false) VehGrid = guiCreateGridList(17,32,200,256,false,MainGui) guiGridListSetSelectionMode(VehGrid,2) _bikes = guiGridListAddColumn(VehGrid,"Vehicle name:",0.85) Spawn = guiCreateButton(15,305,96,35,"Use",false,MainGui) guiSetFont(Spawn,"clear-normal") Cancel = guiCreateButton(128,305,96,35,"Close",false,MainGui) guiSetFont(Cancel,"clear-normal") for index, vehicle in ipairs(vehicles) do end local row = guiGridListAddRow (VehGrid) guiGridListSetItemText ( VehGrid, row, _bikes, tostring(vehicle), false, false ) guiSetVisible(MainGui, false) ---------------------------------------------------------------------------------------------------------------- addEventHandler("onClientMarkerHit", bikes, function ( hitElement ) if (hitElement == localPlayer) then createVehGui ( hitElement ) if (MainGui ~= nil) then guiSetVisible(MainGui, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox ("Error: Please Re-enter in the marker to get your vehicle.", 255, 0, 0) 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 then triggerServerEvent("spawnBike",localPlayer,vehicleName) end else outputChatBox("Erro: Please select a vehicle from the list.",255,0,0) end elseif (source == Cancel) then guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) end end ) addEventHandler("onClientPlayerWasted", root, function () guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) end)
  11. Client. local vehicles = {"BMX", "Bike", "Mountain Bike"} local bikes = createMarker(1183.2487792969, -1314.9769287109, 12.546875, 'cylinder', 1.5, 255, 255, 255, 255) MainGui = guiCreateWindow(408,203,240,349,"Vehicle",false) VehGrid = guiCreateGridList(17,32,200,256,false,MainGui) guiGridListSetSelectionMode(VehGrid,2) _bikes = guiGridListAddColumn(VehGrid,"Vehicle name:",0.85) Spawn = guiCreateButton(15,305,96,35,"Use",false,MainGui) guiSetFont(Spawn,"clear-normal") Cancel = guiCreateButton(128,305,96,35,"Close",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 ) guiSetVisible(MainGui, false) --Reemplace la función que tenias por esto. addEventHandler("onClientMarkerLeave", bikes, function ( leaveElement ) if (leaveElement == localPlayer) then guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) 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 then triggerServerEvent("spawnBike",localPlayer,vehicleName) end else outputChatBox("Erro: Please select a vehicle from the list.",255,0,0) end elseif (source == Cancel) then guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) end end ) addEventHandler("onClientPlayerWasted", root, function () guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) end) Server. function spawnBike () local id = getElementModel(thevehicle) if id == 509 or id == 510 or id == 481 then local x, y, z = getElementPosition ( source ) local xr, yr, zr = getElementRotation ( source ) bike = createVehicle (id, x, y, z + 0.5, xr, yr, zr ) warpPedIntoVehicle(source, bike) end end addEvent( "spawnBike", true) addEventHandler("spawnBike",root,spawnBike)
  12. Me dice que tengo un error en la Linea 12 (No agan caso sobre el getElementModel, era otro resource.)
  13. No seria mejor hacer un car spawn??, osea un marker y cuando lo tocas el marker te aparesca un gui para seleccionar una lista de coches, pero exclusivo para un team
  14. Como hago un scripts para que tenga los coches de una base exclusivo para un clan/team y que nadie lo pueda robar, destruir, etc...
×
×
  • Create New...