Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Argumentos requeridos: elObjeto: El objeto que va a moverse. tiempo: El tiempo en milisegundos para que el objeto llegue a su destino. destinoX: El valor X value de la posicion del destino. destinoY: El valor Y value de la posicion del destino. destinoZ: El valor Z value de la posicion del destino. Argumentos opcionales: moverx: La rotación a lo largo del eje X con respecto a su rotación actual, que es su ángulo de partida. movery: La rotación a lo largo del eje Y con relación a su rotación actual, que es su ángulo de partida. moverz: La rotación a lo largo del eje Z en relación con su rotación actual, que es su ángulo de partida.
  2. Podes usar la funcion: aclReload para cargar la ACL de nuevo. ADVERTENCIA: NO REINICIES/INICIES NINGUN RECURSO ANTES DE USAR LA FUNCION.
  3. Yeah, I forgot to change some things, copy the server side script again.
  4. Carlos, que yo sepa ese recurso usa el script del admin panel, asi que es lo mismo usar la funcion que mencione en el post anterior que usar este recurso. P.D: Para poner las banderas en la scoreboard podes probar con este recurso: https://community.multitheftauto.com/index.php?p= ... ls&id=3580
  5. Yeah, my mistake , copy the server side again, now it works .
  6. La funcion moveObject tiene argumentos de rotacion.
  7. No se vayan del tema, no queremos hacer off-topic .
  8. When you exit the vehicle it should destroy both truck and trailer if exists, it doesn't work?
  9. That's a forum bug, copy the server side again, I removed the Lua tags.
  10. Copy the server side again, I've added to destroy the trailer when the truck explodes and if the trailer explodes it'll destroy the truck.
  11. Puerta = createObject ( 2669, 2492.69921875, -1671.19921875, 13.699999809265, 0, 0, 0) PuertaBar = createObject ( 3036, 2584.3994140625, -1414.599609375, 25, 0, 353.99597167969, 90) Puerta2 = createObject ( 2933, 1588.4000244141, -1638, 14, 0, 0, 0) Elevador = createObject ( 2669, 1560.7674560547, -1324.4055175781, 17, 0, 0, 0) Base = createObject ( 980, 3060, -705, 13.199999809265, 0, 0, 90) Base2 = createObject ( 980, 3060, -716.59997558594, 13.199999809265, 0, 0, 90) Basef = createObject ( 3115, -1770.3000488281, 982.09997558594, 31, 90, 0, 270) BaseR = createObject ( 8673, 997.20001220703, 2133.3999023438, 11.5, 0, 0, 90) BaseM = createObject ( 8673, -2438.1999511719, 1542, 16.200000762939, 90, 0, 90) function abrirBaseM(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(BaseM,5000 , -2438.1999511719, 1560, 16.200000762939) end end addCommandHandler("abrirmt", abrirBaseM) function cerrarBaseM(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(BaseM,5000 , -2438.1999511719, 1542, 16.200000762939) end end addCommandHandler("cerrarmt", cerrarBaseM) function abrirBaseR(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(BaseR,5000 , 997.20001220703, 2113.3, 11.300000190735) end end addCommandHandler("abrirr", abrirBaseR) function cerrarBaseR(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(BaseR,5000 , 997.20001220703, 2133.3999023438, 11.300000190735) end end addCommandHandler("cerrarr", cerrarBaseR) function abrirBasef(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(Basef,5000 , -1770.3000488281, 982.09997558594, 13) end end addCommandHandler("abrirf", abrirBasef) function cerrarBasef(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Admin" ) ) then -- Aca pusiste "Everyone". moveObject(Basef,5000 , -1770.3000488281, 982.09997558594, 31) end end addCommandHandler("cerrarf", cerrarBasef) function abrirBase(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Admin" ) ) then -- Aca pusiste "Everyone". moveObject(Base,5000 , 3060, -705, 18) moveObject(Base2,5000 , 3060, -716.59997558594, 18) end end addCommandHandler("abrirbasels", abrirBase) function cerrarBase(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Admin" ) ) then -- Aca pusiste "Everyone". moveObject(Base,5000 , 3060, -705, 13.199999809265) moveObject(Base2,5000 , 3060, -716.59997558594, 13.199999809265) end end addCommandHandler("cerrarbasels", cerrarBase) function abrirPuertaBar(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(PuertaBar,5000 , 2584.3994140625, -1414.599609375, 20) end end addCommandHandler("abrirbar", abrirPuertaBar) function cerrarPuertaBar(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(PuertaBar,5000 , 2584.3994140625, -1414.599609375, 25) end end addCommandHandler("cerrarbar", cerrarPuertaBar) function subirElevador(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(Elevador,5000 , 1560.7674560547, -1324.4055175781, 330.39999389648) end end addCommandHandler("subirT", subirElevador) function bajarElevador(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(Elevador,5000 , 1560.7674560547, -1324.4055175781, 0) end end addCommandHandler("bajarT", bajarElevador) function abrirPuerta2(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(Puerta2,5000 , 1588.4000244141, -1638, 20) end end addCommandHandler("abrirls", abrirPuerta2) function abrirPuerta(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(Puerta,5000 , 2492.69921875, -1671.19921875, 40) end end addCommandHandler("subir", abrirPuerta) function cerrarPuerta(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then moveObject(Puerta,5000 , 2492.69921875, -1671.19921875, 13.699999809265) end end addCommandHandler("bajar", cerrarPuerta) function cerrarPuerta2(player) local accName = getAccountName ( getPlayerAccount ( player ) ) -- get his account name if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "Everyone" ) ) then -- Aca pusiste "Everyone". moveObject(Puerta2,5000 , 1588.4000244141, -1638, 14) end end addCommandHandler("cerrarls", cerrarPuerta2)
  12. No existe una funcion para eso, pero el admin panel tiene una que se llama: getPlayerCountry
  13. Si queres que te ayudemos postea tu script.
  14. for numero = 1, 10 do -- De 1 a 10 enviar un mensaje al chat. outputChatBox(numero) end local tabla = { "Hola", "Mundo!" } for numero, valor in ipairs(tabla) -- Hara un loop y enviara todos los mensajes al chat. outputChatBox(numero ..": ".. valor) do
  15. What part doesn't work? I don't see any problem.
  16. Claro que es posible. function cerrarPuertas() moveObject(puerta1,argumentos..) moveObject(puerta2,argumentos..) moveObject(puerta3,argumentos..) moveObject(puerta4,argumentos..) moveObject(puerta5,argumentos..) end addCommandHandler("cerrar",cerrarPuertas)
  17. I've tried to damage the trailer in a lot of ways, but no luck, I think is not possible if you don't shoot at it.
  18. I've tested mine and worked, I was in Los Santos and "Zone" was "LS".
  19. exports.scoreboard:addScoreboardColumn( "Zone",root,3,0.15 ) local uTimers = { } local zoneNames = { ["Los Santos"] = "LS", ["San Fierro"] = "SF", ["Las Venturas"] = "LV" } function setZoneData( player ) local player = player or source if isTimer( uTimers[ player ] ) then killTimer( uTimers[ player ] ) end uTimers[ player ] = setTimer( function( player ) local playerX, playerY, playerZ = getElementPosition ( player ) local playerZoneName = getZoneName ( playerX, playerY, playerZ, true ) setElementData ( player, "Zone", zoneNames[playerZoneName] or playerZoneName ) end, 1000, 0, player ) end addEventHandler( 'onPlayerJoin',root,setZoneData ) addEventHandler( 'onResourceStart',resourceRoot, function( ) for _,v in pairs( getElementsByType 'player' ) do setZoneData( v ) end end ) addEventHandler( 'onPlayerQuit',root, function( ) if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = nil end )
  20. -- client side: DeliveryLocations = { "-1838, 14, 16, 0", "-1708, 12, 4, 0", "-2464, 787, 36, 0", "-1935, 272, 42, 0", "653, 1691, 8, 0", "1052, 2088, 11, 0", "2185, 1976, 11, 0", "2868, 2577, 11, 0", "2244, 2234, 11, 0", "2351, 1891, 11, 0", "2842, 899, 11, 0", "2793, -2417, 14, 0", "2057, -2195, 14, 0", "1619, -1554, 14, 0", "988, -913, 43, 0", "1340, 285, 20, 0", "2260, -85, 27, 0", "708, -607, 17, 0", "202, -173, 2, 0", "-546, -499, 26, 0", "-1019, -649, 33, 0", "-165, 1016, 21, 0", "273, 1344, 12, 0" } ----------------------------------------------------------- local sWidth,sHeight = guiGetScreenSize() local loca = {} local DeliveryLocationTableSize = table.maxn ( DeliveryLocations ) local randomLocationIdx = math.random ( 1, DeliveryLocationTableSize ) local locString = tostring( DeliveryLocations[randomLocationIdx] ) loca.Location = split ( locString, string.byte( "," ) ) local DelX = loca.Location[1] local DelY = loca.Location[2] local DelZ = loca.Location[3] JobStart = createColSphere( -50, -271, 5.7, 1 ) JobStartM = createMarker( -50, -271, 5.7, "cylinder", 1, 0, 200, 0 ) JobStartB = createBlipAttachedTo( JobStart, 58 ) local vehicle local trailer function giveVehicle( theElement ) if ( theElement == getLocalPlayer() ) then triggerServerEvent("start",root, theElement) addEventHandler("onClientRender",root,renderHP) end end addEventHandler("onClientColShapeHit",JobStart,giveVehicle) addEvent("HP",true) addEventHandler("HP",root, function(mVehicle, mTrailer) vehicle = math.ceil(tonumber(mVehicle)) trailer = math.ceil(tonumber(mTrailer)) end ) function renderHP() dxDrawText("HP(Truck): " .. tostring(vehicle) .. "", sWidth/1.2,sHeight-47, sWidth, sHeight ) dxDrawText("HP(Trailer): " .. tostring(trailer) .. "", sWidth/1.2,sHeight-57, sWidth, sHeight ) end addEvent("trailerAtt",true) addEventHandler("trailerAtt",root, function() Destiny = createColSphere( DelX, DelY, DelZ, 3 ) DestinyM = createMarker( DelX, DelY, DelZ, "cylinder", 3, 0, 200, 0 ) DestinyB = createBlipAttachedTo( Destiny, 52 ) addEventHandler("onClientColShapeHit",Destiny,Reward) end ) addEvent("trailerDet",true) addEventHandler("trailerDet",root, function() removeEventHandler("onClientRender",root,renderHP) destroyElement(Destiny) destroyElement(DestinyM) destroyElement(DestinyB) end ) addEvent("destroyWin",true) addEventHandler("destroyWin",root, function( theElement ) if ( theElement == getLocalPlayer() ) then removeEventHandler("onClientRender",root,renderHP) end end ) addEvent("destroyFail",true) addEventHandler("destroyFail",root, function() removeEventHandler("onClientRender",root,renderHP) if (Destiny) then if (DestinyM) then if (DestinyB) then removeEventHandler("onClientRender",root,renderHP) destroyElement(Destiny) destroyElement(DestinyM) destroyElement(DestinyB) end end end end ) addEvent("destroyFailE",true) addEventHandler("destroyFailE",root, function() removeEventHandler("onClientRender",root,renderHP) if (Destiny) then if (DestinyM) then if (DestinyB) then destroyElement(Destiny) destroyElement(DestinyM) destroyElement(DestinyB) end end end end ) function Reward( theElement ) if ( theElement == getLocalPlayer() ) then removeEventHandler("onClientRender",root,renderHP) triggerServerEvent("win",root, theElement) destroyElement(Destiny) destroyElement(DestinyM) destroyElement(DestinyB) end end -- server side: local vehicles = {} addEvent("start",true) addEventHandler("start",root, function( theElement ) if theElement then if (not vehicles[theElement]) then vehicles[theElement] = {} end vehicles[theElement]["truck"] = createVehicle( 403, -22, -291, 6, 0, 0, 180 ) addEventHandler("onVehicleExplode",vehicles[theElement]["truck"],FailE) vehicles[theElement]["trailer"] = createVehicle ( 435, -14, -285, 7, 0, 0, 180 ) addEventHandler("onVehicleExplode",vehicles[theElement]["trailer"],FailE) setElementData(vehicles[theElement]["trailer"],"truck",vehicles[theElement]["truck"]) setElementData(vehicles[theElement]["truck"],"trailer",vehicles[theElement]["trailer"]) addEventHandler("onTrailerAttach",vehicles[theElement]["trailer"],attachT) addEventHandler("onTrailerDetach",vehicles[theElement]["trailer"],detachT) triggerClientEvent(theElement,"HP",root,getElementHealth(vehicles[theElement]["truck"]),getElementHealth(vehicles[theElement]["trailer"])) warpPedIntoVehicle(theElement, vehicles[theElement]["truck"]) addEventHandler("onVehicleDamage", vehicles[theElement]["truck"], function () local thePlayer = getVehicleOccupant(source) if (thePlayer) then local trailer = getVehicleTowedByVehicle(source) if (trailer) then trailerHealth = getElementHealth(trailer) else trailerHealth = 0 end triggerClientEvent(thePlayer,"HP",root,getElementHealth(source), trailerHealth) end end ) addEventHandler("onVehicleDamage", vehicles[theElement]["trailer"], function () if getVehicleTowingVehicle(source) then local thePlayer = getVehicleOccupant(getVehicleTowingVehicle(source)) if (thePlayer) then triggerClientEvent(thePlayer,"HP",root,getElementHealth(source),getElementHealth(getVehicleTowingVehicle(source))) end end end ) end end ) function FailE() local thePlayer = getVehicleController(source) outputChatBox("Congratulations, you've earned a free...", thePlayer, 0, 255, 0) setTimer( outputChatBox, 1000, 1, "GTFO. For making the vehicle go BOOM! And we ain't paying the hospital.", thePlayer, 255, 0, 0 ) triggerClientEvent(thePlayer,"destroyFail",thePlayer) if (getVehicleType(source) == "Trailer") then local truck = getElementData(source,"truck") if isElement(truck) then destroyElement(truck) end else local trailer = getElementData(source,"trailer") if isElement(trailer) then destroyElement(trailer) end end destroyElement(source) triggerClientEvent(thePlayer,"HP",root,0,0) end addEvent("win",true) addEventHandler("win",root, function( theElement ) if theElement then vHP = getElementHealth(vehicles[theElement]["truck"]) vTHP = getElementHealth(vehicles[theElement]["trailer"]) Money = 3000 + math.ceil(vHP) + math.ceil(vTHP) outputChatBox("Thanks, your reward is " .. Money .. "$", theElement, 0, 255, 0) triggerClientEvent(theElement, "destroyWin", theElement) givePlayerMoney( theElement, Money) if isElement(vehicles[theElement]["truck"]) then destroyElement(vehicles[theElement]["truck"]) end if isElement(vehicles[theElement]["trailer"]) then destroyElement(vehicles[theElement]["trailer"]) end end end ) function attachT( theTruck ) local thePlayer = getVehicleController(theTruck) outputChatBox("Deliver these parts to the indicated location. Do no step out of the vehicle or loose your trailer. if so YOU'RE FIRED.", thePlayer, 0, 255, 0) triggerClientEvent(thePlayer,"trailerAtt",thePlayer) end function detachT( theTruck ) local thePlayer = getVehicleController(theTruck) outputChatBox("Nice fail, you just lost your trailer.", thePlayer, 0, 255, 0) setTimer(outputChatBox,1500,1,"Oh yeah... YOU'RE FIRED.", thePlayer, 255, 0, 0) triggerClientEvent(thePlayer,"trailerDet",thePlayer) if isElement(vehicles[thePlayer]["truck"]) then destroyElement(vehicles[thePlayer]["truck"]) end if isElement(vehicles[thePlayer]["trailer"]) then destroyElement(vehicles[thePlayer]["trailer"]) end end function Fail( theVehicle ) if (vehicles[source]["truck"] == theVehicle) then outputChatBox("Congratulations, you've earned a free...", source, 0, 255, 0) setTimer( outputChatBox, 1000, 1, "GTFO.", source, 255, 0, 0 ) triggerClientEvent(source, "destroyFail", source) if isElement(vehicles[source]["truck"]) then destroyElement(vehicles[source]["truck"]) end if isElement(vehicles[source]["trailer"]) then destroyElement(vehicles[source]["trailer"]) end end end addEventHandler("onPlayerVehicleExit",root,Fail)
  21. Do you get any error(s) in the debugscript?
  22. Ah, creo que ya te entendi. Usa este script para obtener las coordenadas del jugador: addCommandHandler("getpos", function (thePlayer) local x, y, z = getElementPosition(thePlayer) outputChatBox(x ..", ".. y ..", ".. z) end )
  23. You renamed the resource, is not called "customblips" anymore. addEventHandler ( "onClientResourceStart", resourceRoot, function() exports.blips:createCustomBlip ( 2487.6000976563, -1668.4000244141, 20, 20, "taxi.png" ) end )
  24. Is the resource "customblips" running?
×
×
  • Create New...