Jump to content

Problem Locking, Turn Engine on/off of a vehicle


Zafire

Recommended Posts

I make this script and works it load vehicles put te correct color all, the unique problem is the script dont lock or unlock the cars or turn engine off on.. when i enter in any car it is not locked and the engine is turn on!.. maybe can you help me?

function cargarVehiculos() 
    local vehnum = 0 
    local resultado = mysql_query(sql_connect, "SELECT * FROM vehiculos ORDER BY id ASC") 
    if(resultado) then 
        while true do 
            local row = mysql_fetch_assoc(resultado) 
            if(not row) then 
                break 
            end 
            local vehiculo = createVehicle(row["modelo"], row["x"], row["y"], row["z"]) 
            setVehicleColor(vehiculo, row["color1"], row["color2"], row["color1"], row["color2"]) 
            if(row["encendido"] == 1) then 
                setVehicleEngineState(vehiculo, true) 
            else 
                setVehicleEngineState(vehiculo, false) 
            end 
            if(row["cerrado"] == 1) then 
                setVehicleLocked(vehiculo, true)  
            else 
                setVehicleLocked(vehiculo, false)  
            end 
            vehnum = vehnum + 1 
        end 
    end 
    return vehnum 
end 

Thanks

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