Jump to content

help bad argument


boro

Recommended Posts

Hi all i have script, this script work good but in console show it this line

WARNING: markers/carsmarkers.lua:55: Bad argument @ 'getElementModel' [Expected element at argument 1, got boolean 

What is bad ?

addEventHandler( "onColShapeLeave", safecol,function(hitPlayer,thePlayer,theVehicle, id) 
    if getElementType(hitPlayer)== "player" then 
            local vehicle = getPedOccupiedVehicle ( hitPlayer ) 
            if getElementModel ( vehicle, 522 ) then  -- THIS IS LINE 55 
            setElementModel ( vehicle, 481 ) 
end 
end 
    if getElementType(hitPlayer)== "player" then 
        local skin = getElementModel (hitPlayer) 
        if nonKillables[skin] then 
                    triggerClientEvent (hitPlayer, "onTriEvent", root, "text" )  
            toggleControl (hitPlayer, "fire", true) 
            toggleControl (hitPlayer, "vehicle_fire", true) 
        else 
            killPed (hitPlayer,hitPlayer) 
        end 
    end 
end) 

Link to comment
Hi all i have script, this script work good but in console show it this line
WARNING: markers/carsmarkers.lua:55: Bad argument @ 'getElementModel' [Expected element at argument 1, got boolean 

What is bad ?

addEventHandler( "onColShapeLeave", safecol,function(hitPlayer,thePlayer,theVehicle, id) 
    if getElementType(hitPlayer)== "player" then 
            local vehicle = getPedOccupiedVehicle ( hitPlayer ) 
            if getElementModel ( vehicle,522  ) then  -- THIS IS LINE 55 
            setElementModel ( vehicle, 481 ) 
end 
end 
    if getElementType(hitPlayer)== "player" then 
        local skin = getElementModel (hitPlayer) 
        if nonKillables[skin] then 
                    triggerClientEvent (hitPlayer, "onTriEvent", root, "text" )  
            toggleControl (hitPlayer, "fire", true) 
            toggleControl (hitPlayer, "vehicle_fire", true) 
        else 
            killPed (hitPlayer,hitPlayer) 
        end 
    end 
end) 

  
addEventHandler( "onColShapeLeave", safecol,function(hitPlayer,thePlayer,theVehicle, id) 
    if getElementType(hitPlayer)== "player" then 
            local vehicle = getPedOccupiedVehicle ( hitPlayer ) 
            if vehicle then 
            if getElementModel ( vehicle ) == 522  then  -- THIS IS LINE 55 
            setElementModel ( vehicle, 481 ) 
end 
end 
end 
    if getElementType(hitPlayer)== "player" then 
        local skin = getElementModel (hitPlayer) 
        if nonKillables[skin] then 
                    triggerClientEvent (hitPlayer, "onTriEvent", root, "text" ) 
            toggleControl (hitPlayer, "fire", true) 
            toggleControl (hitPlayer, "vehicle_fire", true) 
        else 
            killPed (hitPlayer,hitPlayer) 
        end 
    end 
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...