Jump to content

[HELP]Erro In Script


Black2

Recommended Posts

Why this don't work ?

function onVehicleEnter ( thePlayer ) 
    if ( not Barcos [ getElementModel ( source ) ] ) then return end 
    local occupation = getElementData( source, "Occupation", "Fisherman", true ) 
    if occupation and occupation ~= "" then 
        if (occupation == "Fisherman" ) then 
        getNewBarcoLocation ( thePlayer ) 
        end 
    end 
end 
addEventHandler ( "onVehicleEnter", root, onVehicleEnter ) 

Link to comment

There's a lot of errors in that.

Try using this and if it still doesn't work check debugscript (/debugscript 3)

function onVehicleEnter ( thePlayer ) 
    if ( not Barcos [ getElementModel ( source ) ] ) then  
        return  
    end 
     
    local occupation = tostring ( getElementData( thePlayer, "Occupation" ) ) 
    if ( occupation == "Fisherman" ) then 
        getNewBarcoLocation ( thePlayer ) 
    end 
end 
addEventHandler ( "onVehicleEnter", root, onVehicleEnter ) 

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