devConfig.lua

A configuration file for developers.

The default devConfig.lua


-- THIS IS A CONFIG FILE SPECIFICALLY FOR DEVELOPERS

function cs_vehiclerental.giveVehicleKeys(src, veh, plate) -- Server sided

end

function cs_vehiclerental.removeVehicleKeys(src, veh, plate) -- Server sided

end



function cs_vehiclerental.clientGiveVehicleKeys(veh, plate) -- Client sided

end

function cs_vehiclerental.clientRemoveVehicleKeys(veh, plate) -- Client sided

end



function cs_vehiclerental.clientSetVehicleFuel(veh) -- Client sided
    SetVehicleFuelLevel(veh, 100.0)
end



function cs_vehiclerental.ShowUI()
    -- DisplayRadar(false)
end

function cs_vehiclerental.HideUI()
    -- DisplayRadar(true)
end



function cs_vehiclerental.onPlayerDrop(src, identifier, rentalKey, veh) -- Triggered when a renting player leaves the server
    local rentalData = cs_vehiclerental.RentalPositions[rentalKey]
    if not rentalData then return end

    if not rentalData.tpBack then return end

    local pos = rentalData.position
    if not pos then return end

    -- Format position from vector
    local jsonPos = json.encode({
        x = pos.x,
        y = pos.y,
        z = pos.z,
        heading = 0.0
    })

    -- Changes position in Database
    MySQL.update('UPDATE users SET position = ? WHERE identifier = ?', {
        jsonPos, identifier
    }, function(rowsChanged)
    end)
end

Last updated

Was this helpful?