Skip to content

Retro Car Rental

All registered via lib.callback. Call with lib.callback.await from client or server.

CallbackReturns
rs_carrental:server:getRentalsActive rentals formatted for NUI
rs_carrental:server:hasVipbool - checks both inventory item and DB entry
rs_carrental:server:rentDeducts money, spawns vehicle, writes DB
rs_carrental:server:returnCalculates refund or overdue fee, deletes entity
rs_carrental:server:extendExtends expiry, applies tiered discount
rs_carrental:server:getVehicleNetIdnetId for a given rental ID
rs_carrental:server:purchaseVipDeducts money, gives item, writes VIP DB entry
  • rs_carrental:server:getVehicleCoords - server event, returns vehicle position for GPS tracking.
  • rs_carrental:client:setGps - client event, sets a waypoint to the vehicle.
ActionPayload
open{ config, locale, rentals, hasVip }
close-
updateRentals{ rentals }
updateVehicleStatus{ rentalId, fuel, engine, brakes }
updateLocale{ locale }
CallbackParams
rentVehiclemodel, categoryId, paymentMethod
returnVehiclerentalId
extendRentalrentalId, hours
trackGpsrentalId
purchaseVipoptionId, paymentMethod
closeUI-

Framework-agnostic server-side helpers:

Bridge.GetPlayer(src)
Bridge.RemoveMoney(src, amount, type)
Bridge.AddMoney(src, amount, type)
Bridge.GetMoney(src, type)
Bridge.GiveVehicleKeys(src, plate, vehicle)
Bridge.RegisterPlayerLoaded(cb)
Bridge.Notify(src, message, type)
Bridge.GiveItem(src, item, count)
Bridge.HasItem(src, item)
  1. Player interacts with NPC โ†’ client opens rental UI with location data.
  2. Player picks a vehicle โ†’ NUI sends rentVehicle.
  3. Server validates max rentals, VIP status, balance โ†’ spawns vehicle at spawnPoint, generates plate, writes DB.
  4. Background loop (60s interval) checks all active rentals for overdue status.
  5. On return: if early, partial refund based on ReturnRefundPercent. If overdue, fee charged at OverdueRatePerHour ร— hours (rounded up).

Both conditions must be true:

  1. vip_rental_card exists in player inventory.
  2. rs_carrental_vip row exists with expires_at > now.