dzek (varez) Posted January 24, 2010 Posted January 24, 2010 (edited) -- checks if player is still driving this vehicle local vehPlayer = getPedOccupiedVehicle(getLocalPlayer()) if (vehPlayer==veh) then local seat = getPedOccupiedVehicleSeat(getLocalPlayer()) outputChatBox("xd") end after doing getPedOccupiedVehicleSeat, or getPlayerOccupiedVehicleSeat my function stops working (no outputChatBox, or other).. whats wrong? Edited January 24, 2010 by Guest
dzek (varez) Posted January 24, 2010 Author Posted January 24, 2010 (edited) -- checks if player is still driving this vehicle local vehPlayer = getPedOccupiedVehicle(getLocalPlayer()) if (vehPlayer==veh) then local seat = getPedOccupiedVehicleSeat(getLocalPlayer()) outputChatBox("xd") end after doing getPedOccupiedVehicleSeat, or getPlayerOccupiedVehicleSeat my function stops working (no outputChatBox, or other).. whats wrong? Edited January 24, 2010 by Guest
Gamesnert Posted January 24, 2010 Posted January 24, 2010 I can't help to wonder: Is this script client-side, or server-side? As getLocalPlayer is client-side only, and getPedOccupiedVehicleSeat, is server-side only.
Gamesnert Posted January 24, 2010 Posted January 24, 2010 I can't help to wonder: Is this script client-side, or server-side? As getLocalPlayer is client-side only, and getPedOccupiedVehicleSeat, is server-side only.
dzek (varez) Posted January 24, 2010 Author Posted January 24, 2010 arghh, i didnt see it how to check if player is driving a vehicle, client-side?
dzek (varez) Posted January 24, 2010 Author Posted January 24, 2010 arghh, i didnt see it how to check if player is driving a vehicle, client-side?
Gamesnert Posted January 24, 2010 Posted January 24, 2010 You can do: getVehicleController(vehPlayer) OR getVehicleOccupant(vehPlayer,0) I don't exactly get why there's a getVehicleController if getVehicleOccupant can be used to do the same, but oh well. Choose whichever you want, basically they'll do the same.
Gamesnert Posted January 24, 2010 Posted January 24, 2010 You can do: getVehicleController(vehPlayer) OR getVehicleOccupant(vehPlayer,0) I don't exactly get why there's a getVehicleController if getVehicleOccupant can be used to do the same, but oh well. Choose whichever you want, basically they'll do the same.
50p Posted January 24, 2010 Posted January 24, 2010 ....I don't exactly get why there's a getVehicleController if getVehicleOccupant can be used to do the same, but oh well. Choose whichever you want, basically they'll do the same. Trailers don't have drivers so getVehicleOccupant will fail when you want to get "driver of the trailer". Though, getVehicleController will return the driver who tows the trailer (sitting as driver in the truck towing that trailer). Wiki says it all.
50p Posted January 24, 2010 Posted January 24, 2010 ....I don't exactly get why there's a getVehicleController if getVehicleOccupant can be used to do the same, but oh well. Choose whichever you want, basically they'll do the same. Trailers don't have drivers so getVehicleOccupant will fail when you want to get "driver of the trailer". Though, getVehicleController will return the driver who tows the trailer (sitting as driver in the truck towing that trailer). Wiki says it all.
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