-
Posts
186 -
Joined
-
Last visited
Everything posted by Sensacion
-
Ok, como quieras.
-
Postea todo server side
-
Revisa que lo tengas en cliente y server como te puse, o postea como tienes el meta.xml
-
"WARNING ... is invalid and will not work in future versions, please ..." I don't like this, i compile a file in "luac.multitheftauto.com" and I can still decompile this, I prefer to use another compiler, honestly I do not see the use.
-
Client: Marker1 = createMarker ( -2281.30, 2403.80, 4.9, "checkpoint", 2.5, 0, 255, 0, 255 ) function Marker20 ( hitPlayer, matchingDimension ) if source == Marker1 then Blip2 = createBlip ( -2281.30 , 2403.80 , 4.9 , 0 ) destroyElement ( Marker1 ) destroyElement ( Blip1 ) triggerServerEvent("pagar", localPlayer) end end addEventHandler ( "onClientMarkerHit", getRootElement(), Marker20 ) Server: addEvent("pagar",true) addEventHandler("pagar",getRootElement(), function () givePlayerMoney ( source, 50 ) end)
-
Usando triggerServerEvent
-
Te falta el onClientMarkerHit
-
guiSetVisible isPedInVehicle destroyElement
-
Tu script funciona hasta crear el tercer marker, si le pones local no ejecutará la parte de elseif source == Marker2 porque la variable es local.
-
será que no hay mucha entre las distancias de las coordenadas?
-
addEvent ( 'spawnBike', true ) addEventHandler ( 'spawnBike', root, function ( model ) id = getVehicleModelFromName( model ) local off = createVehicle ( id, 1183.2487792969, -1314.9769287109, 14.546875, 0, 0, 270 ) setTimer( warpPedIntoVehicle, 100, 1, source, off ) end )
-
cambia player por source
-
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 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)
-
Es que definiste Marker2 como variable local, quítale lo de local, quedando así: Marker2 = createMarker ...
-
Cambia "thePlayer" y "player" por source
-
Donde está el onClientMarkerHit o como haces aparecer el gui
-
Postea todo client y server.
-
Con el mio, con lo que quieres agregar sería así: models = { [29] = true , [294] = true , } function alCambiarSkin( oldModel, newModel ) if ( getElementType( source ) == "player" ) then local accountname = getAccountName ( getPlayerAccount ( source ) ) if not ( isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) ) then if ( models[ newModel ] ) then setTimer( setElementModel, 100, 1, source, oldModel ) outputChatBox ( "Este skin es solo para administradores!", source, 255, 0, 0 ) end end end end addEventHandler( "onElementModelChange", root, alCambiarSkin )
-
pasa lo mismo, pero como lo puedo hacer con el que modifique? models = { [29] = true ; [294] = true ; } function alCambiarSkin( oldModel, newModel ) if ( models[getElementType( source ) == "player"] ) then local accountname = getAccountName ( getPlayerAccount ( source ) ) if not ( isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) ) then setElementModel ( source, oldModel ) outputChatBox ( "Este skin es solo para 'admins'!", source, 0, 128, 255 ) end end end addEventHandler( "onElementModelChange", root, alCambiarSkin ) que raro, yo lo acabo de probar y funciona, me regresa al skin anterior. EDIT: Había puesto "aaa" en "Admin".
-
Se me ocurre algo como esto: function alCambiarSkin( oldModel, newModel ) if ( getElementType( source ) == "player" ) then local accountname = getAccountName ( getPlayerAccount ( source ) ) if not ( isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) ) then if ( newModel == 29 ) then setTimer( setElementModel, 100, 1, source, oldModel ) outputChatBox ( "Este skin es solo para administradores!", source, 255, 0, 0 ) end end end end addEventHandler( "onElementModelChange", root, alCambiarSkin )
-
Killer no es función, es un parámetro de la función que representa al "asesino", solamente ponle un if killer then ...
-
Wiki: killer: an element representing the player or vehicle who was the killer. If there was no killer this is false. Quizá se esté matando a sí mismo.
-
Con setVehicleHandling puedes aumentar a la velocidad, aceleración, motor, etc a la que quieras mientras presionas un tecla usando un bind.
-
Postea las funciones completas.