Jump to content

PiojitoS

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by PiojitoS

  1. Hi, I need help with this function is for a Trucker job. I want the player to enter the truck to have ghostmode activated with other players, the problem is that only the local player recognizes me and I don't know how to make everyone see the ghostmode. I wrote this: **The problem is that the Ghost Mode is only activated for the local player who is in the truck, it is not activated for the server players. -----------------------------------CLIENT ----------------------------------- ----GHOSTMODE function ghostmodeTRUCKER(Trailertruck) --Trailertruck is a TRAILER in Server.lua local playerVehicle = getPedOccupiedVehicle(localPlayer) -- Get the players vehicle if playerVehicle then -- Check the return value. for i,v in pairs(getElementsByType("vehicle")) do --LOOP through all vehicles setElementCollidableWith(v, playerVehicle, false) -- Set the collison off with the other vehicles. setElementCollidableWith(v, Trailertruck, false) --A la inversa setElementCollidableWith(playerVehicle, v, false) setElementCollidableWith(Trailertruck, v, false) end end end addEvent( "ghostModeTRUCK", true ) addEventHandler("ghostModeTRUCK", getRootElement(), ghostmodeTRUCKER)
  2. ya se que el end no iba pero no funciona asi ni idea jaja no importa ya esta...
  3. Si lees bien lo que te conteste antes hay claramente te estoy nombrando al servidor en si y no solo a este script, asiq porfavor mejor deja de hablar sin saber, gracias...
  4. Ya probe todo y nada, es un bug del script algo de mta asiq me cago en la remaravillosa concha de mi madre ... No importa gracias igual, ya me da lo mismo q les aparesca a todos...
  5. Estos: outputChatBox("ADVERTENCIA: Vuelve al colectivo o perderas el trabajo", Player, 255, 255, 0, false) outputChatBox("Abandonaste el colectivo perdiste el trabajo", Player, 255, 0, 0) outputChatBox("Antes de sacar un colectivo debes seleccionar un recorrido.", source, 255, 0, 0)
  6. Los argumentos innecesarios estaban porq ya no sabia que hacer, puse tal como vos lo pusiste y tampoco funciona
  7. function AgarrarColectivo () if (not isPedInVehicle(localPlayer)) then if ( EstadoCivil == 1 ) then if ( ColectivosSacados == 0 ) and (not isPedInVehicle(localPlayer)) then triggerServerEvent ( "SacarColectivos", localPlayer ) ColectivosSacados = 1 else triggerServerEvent ( "YaTienesColectivo", localPlayer ) end else triggerServerEvent ( "SeleccionaRecorrido", localPlayer ) end end end addEventHandler( "onClientMarkerHit", MarkerColectivo, AgarrarColectivo ) function TomarTiempo () if ( ColectivosSacados == 0 ) then triggerServerEvent ( "MensajeDeCancel", localPlayer ) Seleccion = 0 EstadoCivil = 0 ColectivosSacados = 0 ViajeElejido = 0 Repeticiones = 1 end end function ComenzarViaje () x, y, z = viajesDestinos () ParadaSelect = createMarker ( x, y, z, "cylinder", 3, 0, 185, 85, 60, localPlayer ) BlipParada = createBlipAttachedTo ( ParadaSelect, 41, 2, 255, 255, 0, 255 ) triggerServerEvent ( "MensajeEmpezar", localPlayer ) end addEvent( "EmpezarLaburo", true ) addEventHandler( "EmpezarLaburo", localPlayer, ComenzarViaje ) function MensajeParaVolver () triggerServerEvent ( "MensajeVolver", localPlayer ) ParadaFinal = createMarker ( 1796.75427, -1930.97595, 12.5, "cylinder", 3, 0, 185, 85, 60, localPlayer ) BlipTerminal = createBlipAttachedTo ( ParadaFinal, 41, 2, 255, 255, 0, 255 ) Repeticiones = 1 end function RecorridosVariados(hitElement) if source == ParadaSelect and localPlayer == hitElement then local vehicle = getPedOccupiedVehicle ( localPlayer ) if vehicle and getElementModel(vehicle) == 431 then triggerServerEvent ( "PagoGeneral", localPlayer ) destroyElement ( ParadaSelect ) if isElement(BlipParada) then destroyElement ( BlipParada ) end if ( ViajeElejido == 1 ) then MensajeParaVolver () end if ( ViajeElejido == 2 ) then if ( Repeticiones < 3 ) then RepetirSecuencia () else MensajeParaVolver () end end if ( ViajeElejido == 3 ) then if ( Repeticiones < 5 ) then RepetirSecuencia () else MensajeParaVolver () end end if ( ViajeElejido == 4 ) then if ( Repeticiones < 10 ) then RepetirSecuencia () else MensajeParaVolver () end end if ( ViajeElejido == 5 ) then if ( Repeticiones < 15 ) then RepetirSecuencia () else MensajeParaVolver () end end if ( ViajeElejido == 6 ) then if ( Repeticiones < 20 ) then RepetirSecuencia () else MensajeParaVolver () end end if ( ViajeElejido == 7 ) then if ( Repeticiones < 30 ) then RepetirSecuencia () else MensajeParaVolver () end end if ( ViajeElejido == 8 ) then if ( Repeticiones < 50 ) then RepetirSecuencia () else MensajeParaVolver () end end if ( ViajeElejido == 9 ) then if ( Repeticiones < 75 ) then RepetirSecuencia () else MensajeParaVolver () end end if ( ViajeElejido == 10 ) then if ( Repeticiones < 100 ) then RepetirSecuencia () else MensajeParaVolver () end end end end end addEventHandler( "onClientMarkerHit", root, RecorridosVariados )
  8. No, eso era porque estaba enloquecido y no sabia que mas poner ya me canso... en otras funciones los output anda bien, estan al player local menos en estas function SacarUnColectivo (localPlayer) if not isPedInVehicle(source, thePlayer) then local x, y, z = getElementPosition ( source ) Bus = createVehicle ( 431, x, y, z + 3 ) warpPedIntoVehicle ( source, Bus ) Posicion = 1 triggerClientEvent("EmpezarLaburo",source) addEventHandler("onVehicleEnter", Bus, Adentro) addEventHandler("onVehicleExit", Bus, salioDelVehiculo) else outputChatBox("Debes estar afuera del vehiculo para subir a un colectivo.", source, 255, 0, 0) end end addEvent( "SacarColectivos", true ) addEventHandler( "SacarColectivos", getRootElement (), SacarUnColectivo ) function Adentro () Posicion = 1 end --function MensajeAdvertencia2 (thePlayer) --outputChatBox("ADVERTENCIA: Vuelve al colectivo o perderas el trabajo", source, 255, 255, 0, false) --end function salioDelVehiculo() setTimer ( function() outputChatBox("ADVERTENCIA: Vuelve al colectivo o perderas el trabajo", Player, 255, 255, 0, false) end, 50, 1 ) --setTimer ( MensajeAdvertencia2, 50, 1 ) Posicion = 0 setTimer ( PerdisteElTrabajo, 21000, 1 ) setTimer ( RomperColectivo, 21000, 1 ) end function RomperColectivo () if (Posicion == 0) then destroyElement (Bus) end end function PerdisteElTrabajo () if ( Posicion == 0 ) then outputChatBox("Abandonaste el colectivo perdiste el trabajo", Player, 255, 0, 0) SeAcabo () end end
  9. Tengo este problema: Estos dos output les aparecen a todos los player en cambio todos los otros estan iguales y no pasa eso, alguien me dice porq mierda me pasa ese efecto de magia negra ... function PerdisteElTrabajo (Player, localPlayer) if ( Posicion == 0 ) then outputChatBox("Abandonaste el colectivo perdiste el trabajo", source, 255, 0, 0) SeAcabo () end end function MensajeAdvertencia2 (player, localPlayer) outputChatBox("ADVERTENCIA: Vuelve al colectivo o perderas el trabajo", localPlayer, 255, 255, 0) end outputChatBox("Antes de sacar un colectivo debes seleccionar un recorrido.", source, 255, 0, 0) end addEvent( "SeleccionaRecorrido", true ) addEventHandler( "SeleccionaRecorrido", getRootElement (), SeleccionaUnRecorrido )
  10. Probe como tu dices y tampoco, por lo que yo veo el error no es en la funcion esa sino en las green, hay otro archivo que es donde estan las greenzones, yo no se si esta bien lo que hize o no peor me guie en base a un greenzone original... -----Zonas Zombie ----- "1812.9423828125" posY="-2161.5244140625" sizeX="180" sizeY="180" color="#ff0000" dimension="0" />--ZZ LS
  11. pero si pongo que no dañe al ped, le afecta a los zombies, en cambio esa funcion es para el jugador
  12. En mi servidor yo tengo las llamadas "Zonas Zombies" que es un mapeo en donde hay zombies encerrados y al matarlos te da dinero. Lo que yo busco es hacer que los players que entran hay adentro no se puedan matar entre ellos pero que los zombies si los puedan matar... Yo hize lo siguiente peor no funciona, ensima no me da ningun error: Client: addEvent("siGodMode", true) addEventHandler ("siGodMode", getRootElement(), function() addEventHandler ("onClientPlayerDamage", getLocalPlayer, cancelarEventoEvento) end) addEvent("noGodMode", true) addEventHandler ("noGodMode", getRootElement(), function() removeEventHandler ("onClientPlayerDamage", getLocalPlayer, cancelarEventoEvento) end) function cancelarEventoEvento (theplayer, attacker, weapon, bodypart) cancelEvent() end Server: addEventHandler ("onResourceStart", getRootElement(), function() local todasGreenzZz = getElementsByType ("radararea") for i,v in ipairs (todasGreenzZz) do local r,g,b,a = getRadarAreaColor (v) if (r == 255) and (g == 0) and (b == 0) and (a == 127) then local x,y = getElementPosition (v) local sx,sy = getRadarAreaSize (v) local col = createColCuboid (x,y, -50, sx,sy, 7500) setElementID (col, "greenzoneColshape") end end end) addEventHandler ("onColShapeHit", getRootElement(), function(hitElement, matchingDimension) if (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape") then toggleControl (hitElement, "vehicle_fire", false) triggerClientEvent (hitElement, "siGodMode", hitElement) end end ) addEventHandler ("onColShapeLeave", getRootElement(), function(leaveElement, matchingDimension) if (getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape") then toggleControl (leaveElement, "vehicle_fire", true) triggerClientEvent (leaveElement, "noGodMode", leaveElement) end end )
  13. me ayudan con ese ultimo error porfavor...
  14. El problema es el siguiente: Cuando me bajo del vehiculo se destruye todo menos el marker, no se que lo que es porque en el script no me da ningun error y la variable esta bien no entiendo... function terminaloAlJobGranjero2( thePlayer, hitElement, localPlayer ) guiSetVisible(dejarElJobGranjero, false) showCursor(false) if source == markerMarihuanos and localPlayer == hitElement then destroyElement ( markerMarihuanos ) end if isElement(blipMarihuanos) then destroyElement ( blipMarihuanos ) end end addEventHandler("onClientGUIClick", dejarElJobGranjero, terminaloAlJobGranjero2) el blip lo destruye, pero el marker sigue hay, aunq si vuelvo a hacer el trabajo ya no sirve ese marker pero me queda creado...
  15. esperen porq creo q lo solucione
  16. Ahora tengo otro problema .. El problema ahora es que al habe rmas de 1 player haciendo el trabajo como que se bugean los markers y blips, por ejemplo: Yo estoy trabajando en mi cosechadora y otro player en la suya, los amrker son locales, funciona eso pero cuando yo me bajo de la cosechadora no se destruye ni mi marker ni mi blip local, solo el vehiculo...
  17. ya esta, gracias por la ayuda...
  18. Granjero-S.lua:52: Bad Argument @ getElementType [Expected Element at argument 1, got nil]
  19. Yo cree un trabajo de granjero, donde tu vas en la cosechadora y tienes que ir pasando por cada marker q se van creando a medida q vas pasando, puse coordenadas en una tabla todo... Mi problema es que quiero hacer que cuando el player se baje de la combine harvested (Cosechadora) se eliminen los markers y blips, yo hize esto pero no funciona: Server: addEvent( "darVehiculo", true)-------------Aca le da el vehiculo q este evento lo llamo en el client al darle aceptar al job... addEventHandler("darVehiculo", getRootElement(), function ( localPlayer ) local cosechadora = createVehicle ( 532, -1049.494140625, -1183.4306640625, 129.70072937012, 0, 0, 0 )--Le da la Cosechadora warpPedIntoVehicle ( source, cosechadora ) exports["mensajesAutomaticos"]:sendMensajeClient("Ve con la cosechadora a cada planta marcada para asi ganar dinero!", 255, 255, 0 ) addEventHandler("onVehicleExit", cosechadora, salioDelVehiculo)--Aca hago que cuando el player se baje del vehiculo le cumple la funcion de abajo... end ) function salioDelVehiculo( player, seat, localPlayer)--Esta es la funcion, no se porq, pero aca no funciona lo que yo hize if seat == 0 then if getElementType( cosechadora ) == "vehicle" and getElementModel( cosechadora ) == 532 then removePedFromVehicle( player, cosechadora ) destroyElement( cosechadora ) setElementPosition ( player, -1052.515625, -1189.111328125, 128.93524169922 ) exports["mensajesAutomaticos"]:sendMensajeClient("Has salido de la cosechadora, dejas el trabajo!", 255, 0, 0 ) destroyElement( source ) setElementData(player, "desempleado") setElementData(player,getElementData("desempleado")) triggerClientEvent(source,"salirJobGranjero", root)--Aca llamo el evento del client para q elimine los markers destroyElement( MarihuanaCosechar1 ) destroyElement( MarihuanaCosechar2 ) destroyElement( MarihuanaCosechar3 ) destroyElement( MarihuanaCosechar4 ) destroyElement( MarihuanaCosechar5 ) destroyElement( MarihuanaCosechar6 ) destroyElement( MarihuanaCosechar7 ) destroyElement( MarihuanaCosechar8 ) destroyElement( MarihuanaCosechar9 ) destroyElement( MarihuanaCosechar10 ) destroyElement( MarihuanaCosechar11 ) destroyElement( MarihuanaCosechar12 ) destroyElement( MarihuanaCosechar13 ) destroyElement( MarihuanaCosechar14 ) destroyElement( MarihuanaCosechar15 ) destroyElement( MarihuanaCosechar16 ) destroyElement( MarihuanaCosechar17 ) destroyElement( MarihuanaCosechar18 ) destroyElement( MarihuanaCosechar19 ) end end end Client: function terminaloAlJobGranjero( thePlayer ) destroyElement ( markerMarihuanos ) destroyElement ( blipMarihuanos ) end addEvent("salirJobGranjero", true) addEventHandler("salirJobGranjero", root, terminaloAlJobGranjero) Me es de mucha ayuda si me dicen cual es el error, gracias....
  20. Si es solo para 1 script que tiene muchas cosas el panel y por eso me lleva bastante tiempo hacerlas pero en lo demas lo hago yo...
  21. ok lo intentare lo eh pensado pero me da paja jaja
  22. bueno quiero decir a las operaciones que haces por ejemplo: editUsername = guiCreateEdit(37, 144, 248, 24, "", false, registerWindow) resolucion = 1024/768 37/1024 = 0.0361328125 144/768 = 0.1875 248/1024 = 0.2421875 24/768 = 0.03125 y esto queda asi reemplazado: editUsername = guiCreateEdit(sWidth*0.0361, sHeight*0.187, sWidth*0.242, sHeight*0.0312, "", false, registerWindow) entendes? que en vez e hacerlo yo con la calculadora a eso que se haga solo...
  23. Hola, quiero saber como hago para que se dividan solas las resoluciones por cada numero sin tener que estar haciendolo yo... por ejemplo: windows= guiCreateStaticImage(155, 225, 135, 225, "DX.png", false) y que en vez de hacer yo las divisiones con la calculadora que se hagan atravez de algo en el script windows= guiCreateStaticImage(sWidth*0.345, sHeight*0.441, sWidth*0.320, sHeight*0.339, "DX.png", false) si me pueden responder me hacen un favor gracias...
×
×
  • Create New...