dzek (varez) Posted January 24, 2010 Share 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 Link to comment
dzek (varez) Posted January 24, 2010 Author Share 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 Link to comment
Gamesnert Posted January 24, 2010 Share 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. Link to comment
Gamesnert Posted January 24, 2010 Share 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. Link to comment
dzek (varez) Posted January 24, 2010 Author Share Posted January 24, 2010 arghh, i didnt see it how to check if player is driving a vehicle, client-side? Link to comment
dzek (varez) Posted January 24, 2010 Author Share Posted January 24, 2010 arghh, i didnt see it how to check if player is driving a vehicle, client-side? Link to comment
Gamesnert Posted January 24, 2010 Share 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. Link to comment
Gamesnert Posted January 24, 2010 Share 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. Link to comment
dzek (varez) Posted January 24, 2010 Author Share Posted January 24, 2010 ohh, weird.. thanks Link to comment
dzek (varez) Posted January 24, 2010 Author Share Posted January 24, 2010 ohh, weird.. thanks Link to comment
50p Posted January 24, 2010 Share 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. Link to comment
50p Posted January 24, 2010 Share 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. 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