Jump to content

Mostrar GUI


Chaz-CR

Recommended Posts

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) 

Link to comment

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) 

Link to comment

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) 

Link to comment
function monstrar ( hitElement ) 
    if ( hitElement == localPlayer ) then 
        if isPedInVehicle ( localPlayer ) then 
            guiSetVisible ( ventana, true ) 
            showCursor ( true ) 
        end 
   end 
end 
addEventHandler ( "onClientMarkerHit", markerDRIFT, monstrar ) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...