PiojitoS Posted February 4, 2015 Posted February 4, 2015 (edited) 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.... Edited February 4, 2015 by Guest My Server: GTA | Project Army sv. My nickname in game is: PiojitoS
Castillo Posted February 4, 2015 Posted February 4, 2015 Algun error en el debugscript? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Tomas Posted February 4, 2015 Posted February 4, 2015 Intenta cambiar 'cosechadora' por 'source' en la función 'salioDelVehiculo' Currently developing for International Gaming Community - Join us!
PiojitoS Posted February 4, 2015 Author Posted February 4, 2015 Granjero-S.lua:52: Bad Argument @ getElementType [Expected Element at argument 1, got nil] My Server: GTA | Project Army sv. My nickname in game is: PiojitoS
Calculador Posted February 4, 2015 Posted February 4, 2015 Granjero-S.lua:52: Bad Argument @ getElementType [Expected Element at argument 1, got nil] Te aconsejo que uses está función de está manera local Vehiculo = getPedOccupiedVehicle ( player ) -- Esto para identificar el vehiculo que ocupa el jugador destroyElement ( Vehiculo ) -- Esto para destruir el vehículo
PiojitoS Posted February 4, 2015 Author Posted February 4, 2015 ya esta, gracias por la ayuda... My Server: GTA | Project Army sv. My nickname in game is: PiojitoS
PiojitoS Posted February 4, 2015 Author Posted February 4, 2015 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... My Server: GTA | Project Army sv. My nickname in game is: PiojitoS
PiojitoS Posted February 4, 2015 Author Posted February 4, 2015 esperen porq creo q lo solucione My Server: GTA | Project Army sv. My nickname in game is: PiojitoS
Tomas Posted February 4, 2015 Posted February 4, 2015 Usa tablas o simplemente client-side. Currently developing for International Gaming Community - Join us!
PiojitoS Posted February 5, 2015 Author Posted February 5, 2015 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... My Server: GTA | Project Army sv. My nickname in game is: PiojitoS
PiojitoS Posted February 5, 2015 Author Posted February 5, 2015 me ayudan con ese ultimo error porfavor... My Server: GTA | Project Army sv. My nickname in game is: PiojitoS
Calculador Posted February 5, 2015 Posted February 5, 2015 Intenta así: function terminaloAlJobGranjero2 ( ) guiSetVisible(dejarElJobGranjero, false) showCursor(false) destroyElement ( markerMarihuanos ) end if isElement(blipMarihuanos) then destroyElement ( blipMarihuanos ) end end addEventHandler("onClientGUIClick", dejarElJobGranjero, terminaloAlJobGranjero2) Lo quite porque tenías argumentos innecesarios..
PiojitoS Posted February 10, 2015 Author Posted February 10, 2015 Los argumentos innecesarios estaban porq ya no sabia que hacer, puse tal como vos lo pusiste y tampoco funciona My Server: GTA | Project Army sv. My nickname in game is: PiojitoS
Tomas Posted February 10, 2015 Posted February 10, 2015 function terminaloAlJobGranjero2 ( ) guiSetVisible(dejarElJobGranjero, false) showCursor(false) destroyElement ( markerMarihuanos ) if isElement(blipMarihuanos) then destroyElement ( blipMarihuanos ) end end addEventHandler("onClientGUIClick", dejarElJobGranjero, terminaloAlJobGranjero2) Currently developing for International Gaming Community - Join us!
PiojitoS Posted February 10, 2015 Author Posted February 10, 2015 ya se que el end no iba pero no funciona asi ni idea jaja no importa ya esta... My Server: GTA | Project Army sv. My nickname in game is: PiojitoS
Recommended Posts