Jump to content

What's wrong?


FuriouZ

Recommended Posts

Hey!

I have a problem, debug gives me a warning ..."Bad argument @ 'getVehicleType' [Expected number at argument 1, got boolean]

local localVehicle = getPedOccupiedVehicle (getLocalPlayer())         
if ( isPedInVehicle(localPlayer) ) and ( getVehicleType(localVehicle) == "Helicopter" ) then 
-- 
else 
-- 
end 
  

Everything works, but debug just gives me this error.

Link to comment

What's the point of all those checks?

local veh = getPedOccupiedVehicle(localPlayer)        
if isElement(veh) and getVehicleType(veh) == "Helicopter" then -- you don't need isPedInVehicle because getPedOccupiedVehicle already returns required things. Simply check if it's an element and you should be fine 
-- 
else 
-- 
end 

Link to comment

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