Overkillz Posted October 10, 2014 Share Posted October 10, 2014 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 IIYAMA Posted October 10, 2014 Moderators Share Posted October 10, 2014 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
Overkillz Posted October 10, 2014 Author Share Posted October 10, 2014 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 IIYAMA Posted October 10, 2014 Moderators Share Posted October 10, 2014 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
Overkillz Posted October 10, 2014 Author Share Posted October 10, 2014 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 IIYAMA Posted October 10, 2014 Moderators Share Posted October 10, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now