Chaz-CR Posted September 23, 2013 Posted September 23, 2013 Esta funcion me hace mostrar la gui que hice en client, pero se muestra para todos los players y no solo para el que pasa por el marker! Que puedo hacer? function tuneCar(tP) if isElement(tP) then if getElementType(tP) == "player" then local iV = isPedInVehicle(tP) if iV == true then local playerVehicle = getPedOccupiedVehicle ( tP ) triggerClientEvent("gui",root) end end end end addEventHandler("onMarkerHit", markerDRIFT, tuneCar) ||Age Of Battles|WarLife|RPG|DM|FR|24/7|Custom Skins|Cars|Weapons|| http://facebook.com/AoBMTA - Fanpage
EstrategiaGTA Posted September 23, 2013 Posted September 23, 2013 Una cosa, si es solo de un marker, ¿porque no usaste onClientMarkerHit? Prueba así: function tuneCar(tP) if isElement(tP) then if getElementType(tP) == "player" then local iV = isPedInVehicle(tP) if iV == true then local playerVehicle = getPedOccupiedVehicle ( tP ) triggerClientEvent("gui",source) end end end end addEventHandler("onMarkerHit", markerDRIFT, tuneCar)
Chaz-CR Posted September 23, 2013 Author Posted September 23, 2013 segui tu consejo y lo hice onClientMarkerHit pero cuando algun player esta en el vehiculo aparece el gui y cuando no lo esta no aparece! function monstrar() if isElement(getLocalPlayer()) then if getElementType(getLocalPlayer()) == "player" then local iV = isPedInVehicle(getLocalPlayer()) if iV == true then guiSetVisible(ventana, true) showCursor(true) end end end end addEventHandler("onClientMarkerHit",markerDRIFT,monstrar) ||Age Of Battles|WarLife|RPG|DM|FR|24/7|Custom Skins|Cars|Weapons|| http://facebook.com/AoBMTA - Fanpage
Castillo Posted September 23, 2013 Posted September 23, 2013 function monstrar ( hitElement ) if ( hitElement == localPlayer ) then if isPedInVehicle ( localPlayer ) then guiSetVisible ( ventana, true ) showCursor ( true ) end end end addEventHandler ( "onClientMarkerHit", markerDRIFT, monstrar ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Chaz-CR Posted September 23, 2013 Author Posted September 23, 2013 Gracias una vez mas Castillo, funcionando perfectamente. Y a ti tambien Estrategia por tomarte tu tiempo y ayudarme! ||Age Of Battles|WarLife|RPG|DM|FR|24/7|Custom Skins|Cars|Weapons|| http://facebook.com/AoBMTA - Fanpage
Castillo Posted September 23, 2013 Posted September 23, 2013 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts