Core-Services
DiscordShop
  • 🏠HOME
  • ⚙️SCRIPTS
    • CS_MENU_DEFAULT
    • CS_VISA
    • CS_SHOPS
    • CS_GARAGE
    • CS_REVIVESTATION
    • CS_PANICBUTTON V2
    • CS_DEATHTIMEOUT V2
    • CS_VEHICLERENTAL
      • Installation
      • Configuration
        • config.lua
        • devConfig.lua
        • framework.lua
        • webhook.lua
      • Exports
Powered by GitBook
On this page

Was this helpful?

  1. SCRIPTS
  2. CS_VEHICLERENTAL
  3. Configuration

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
Previousconfig.luaNextframework.lua

Last updated 6 days ago

Was this helpful?

⚙️