Jump to content

help with getElementPosition


MajdMTA

Recommended Posts

Posted
function buttonPick() 
    if source == Button_VS_sn then 
        if isPedInVehicle(localPlayer) then 
           local v = getPedOccupiedVehicle(localPlayer) 
           local x, y, z = getElementPosition(v) 
           local vehicleZoneName = getZoneName(x, y, z) 
           guiSetText(label_Zone, "", tostring(vehicleZoneName)) 
        end 
    end 
end 
addEventHandler("onClientGUIClick", guiRaoot, buttonPick) 

Posted
function buttonPick() 
    if source == Button_VS_sn then 
        if isPedInVehicle(localPlayer) then 
           local v = getPedOccupiedVehicle(localPlayer) 
           local x, y, z = getElementPosition(v) 
           local vehicleZoneName = getZoneName(x, y, z) 
           guiSetText(label_Zone, "", tostring(vehicleZoneName)) 
        end 
    end 
end 
addEventHandler("onClientGUIClick", guiRaoot, buttonPick) 

Guys, none of this codes worked.. you can lock it.

Posted
Then tell us why they didnt work.

The codes are going to the right way, what is wrong?

Man, idk, also I'm tried.. only works with getElementPosition for localPlayer.

Posted

What I don't understand:

You want to get the zonename of the vehicle you are sitting in ... why?!

The zonename will be the same as the zonename of the localPlayer. Still don't understand what you are even trying.

Posted
What I don't understand:

You want to get the zonename of the vehicle you are sitting in ... why?!

The zonename will be the same as the zonename of the localPlayer. Still don't understand what you are even trying.

When i pick it... IT will be in Hospital for example okay? and if i'm in different place? think about that.

Posted

Me: Do you want to get the zone of the vehicle you are sitting in?

You: Yes, exactly.

When you are sitting in the vehicle, you are at the same place.

Which vehicle do you want to get now?

Posted

He didn't give us some details, to get an element's position it must be exists in somewhere, but on this code, he just adding vehicle to onClientGUIClick event parametre which that is incorrect and make no sense.

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...