Jump to content

Bad argument at getElementModel


Recommended Posts

skinid = getElementModel(player) 
carid = getElementModel(theVehicle) 
if skinid == 280 or 281 or 282 and carid == 596 or 598 or 597 and isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "police" ) ) then 
             outputChatBox ("REMEMBER: This is a government car.") 
             else 
             setPlayerWantedLevel ( source, 4 ) 
             outputChatBox ("You rob a Police car! A 4-level star has been given to you.") 
             end 

Link to comment

Well, the error is pretty obvious isn't it? You have a bad argument in getElementModel, which means theVehicle isn't a vehicle. Post the code where you define "theVehicle".

Also, your ifthenelse should be like this:

skinid = getElementModel(player) 
carid = getElementModel(theVehicle) 
if skinid==280 or skinid==281 or skinid==282 and carid==596 or carid==598 or carid==597 and isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "police" ) ) then 
      outputChatBox ("REMEMBER: This is a government car.") 
else 
      setPlayerWantedLevel ( source, 4 ) 
      outputChatBox ("You rob a Police car! A 4-level star has been given to you.") 
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...