..:D&G:.. Posted February 15, 2015 Share Posted February 15, 2015 Hey, I am trying to make a speedometer and the script returns boolean instead of the vehicle when I try to see if the vehicle has it's lights on. local vehicle = getPedOccupiedVehicle(localPlayer) if ( getVehicleOverrideLights ( vehicle ) == 2 ) then disc = guiCreateStaticImage(screenX - globalImageWidth - globalOffsetX, screenY - globalImageHeight - ( globalOffsetY + 15 ), globalImageWidth, globalImageHeight, "speedometer/disc.png", false) Any ideas how to fix it? Link to comment
Castillo Posted February 15, 2015 Share Posted February 15, 2015 You mean that getPedOccupiedVehicle returns a boolean instead of the vehicle element? then, I guess the player is not in a vehicle at all? Link to comment
..:D&G:.. Posted February 15, 2015 Author Share Posted February 15, 2015 getVehicleOverrideLights returns boolean, and when I start the resource I get that error, and the player is not in a vehicle, but it should work when the player gets in a vehicle.. Link to comment
Castillo Posted February 15, 2015 Share Posted February 15, 2015 getVehicleOverrideLights will return a boolean ( false in this case ) if "vehicle" is not a vehicle element. Link to comment
Moderators IIYAMA Posted February 16, 2015 Moderators Share Posted February 16, 2015 As Solidsnake14 said, solution: if vehicle and getVehicleOverrideLights ( vehicle ) == 2 then 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