Jump to content

Show just to local player


Overkillz

Recommended Posts

Hey dear guys, I need ur help.

Im trying to do an info panel which show if the player if alive or training then show an image.

function ( source ) 
        local playerVehicle = getPedOccupiedVehicle(localPlayer) 
        for index,localPlayer in ipairs(getElementsByType("player")) do 
        if getElementData(localPlayer,"state") == "alive"or getElementData(localPlayer,"state") == "Training" then 
        local vehicleHealth = getElementHealth ( playerVehicle ) 
        local vehicleSpeed = getElementVelocity ( playerVehicle ) 

when the local player press enter, it still showing due to there are other player alive.

It is hidden just when all are "dead"

How I can fix it ?

I hope u can help me.

Thanks and regards.

Link to comment
  • Moderators
function ( source ) 
    for index,player in ipairs(getElementsByType("player")) do 
    if getElementData(player,"state") == "alive"or getElementData(player,"state") == "Training" then 
        local playerVehicle = getPedOccupiedVehicle(player) 
        local vehicleHealth = getElementHealth ( playerVehicle ) 
        local vehicleSpeed = getElementVelocity ( playerVehicle ) 

Link to comment
function ( source ) 
    for index,player in ipairs(getElementsByType("player")) do 
    if getElementData(player,"state") == "alive"or getElementData(player,"state") == "Training" then 
        local playerVehicle = getPedOccupiedVehicle(player) 
        local vehicleHealth = getElementHealth ( playerVehicle ) 
        local vehicleSpeed = getElementVelocity ( playerVehicle ) 

Thanks, but it doesnt work.

I give u a screenshot about it.

http://puu.sh/c74Nh/f9c9e2e529.png

Link to comment
  • Moderators
    function ( source ) 
        if getElementData(localPlayer,"state") == "alive"or getElementData(localPlayer,"state") == "Training" then 
            local playerVehicle = getPedOccupiedVehicle(localPlayer) 
            if playerVehicle then 
                local vehicleHealth = getElementHealth ( playerVehicle ) 
                local vehicleSpeed = getElementVelocity ( playerVehicle ) 

Link to comment
    function ( source ) 
        if getElementData(localPlayer,"state") == "alive"or getElementData(localPlayer,"state") == "Training" then 
            local playerVehicle = getPedOccupiedVehicle(localPlayer) 
            if playerVehicle then 
                local vehicleHealth = getElementHealth ( playerVehicle ) 
                local vehicleSpeed = getElementVelocity ( playerVehicle ) 

http://puu.sh/c75gb/ae3bf693a5.png

Link to comment
  • Moderators

You are a funny guy.

Showing me a few lines and telling me the code I posted doesn't work, your other code doesn't work what about that?

and you are defining source as argument, source isn't meant as argument.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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