Dimos7 Posted February 23, 2016 Posted February 23, 2016 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)
MajdMTA Posted February 23, 2016 Author Posted February 23, 2016 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.
Bonus Posted February 23, 2016 Posted February 23, 2016 Then tell us why they didnt work. The codes are going to the right way, what is wrong?
MajdMTA Posted February 23, 2016 Author Posted February 23, 2016 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.
Dimos7 Posted February 23, 2016 Posted February 23, 2016 use /debugscript 3 tell us the error and post the whole code
Bonus Posted February 23, 2016 Posted February 23, 2016 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.
GTX Posted February 23, 2016 Posted February 23, 2016 What I don't understand is what is so sacred in full code that you don't show lol?
MajdMTA Posted February 24, 2016 Author Posted February 24, 2016 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.
Dimos7 Posted February 24, 2016 Posted February 24, 2016 (edited) so you want see a vehicle location which your are not in Edited February 24, 2016 by Guest
Bonus Posted February 24, 2016 Posted February 24, 2016 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?
Dimos7 Posted February 24, 2016 Posted February 24, 2016 I think he want to take a vehicle zone which hes not in and go to his position
Bonus Posted February 24, 2016 Posted February 24, 2016 And which vehicle is that? How can you get that vehicle? Is it saved somewhere?
KariiiM Posted February 24, 2016 Posted February 24, 2016 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.
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