Skip to content

Quick pay & give cash ​

Quick pay pill ​

For small, frequent payments (tolls, parking, fuel, vending) a full sheet is too much. QuickPay shows a pill at the bottom centre instead, with the player's default method for the category. (np_fuel uses the full sheet at the pump: the player has just chosen fuel and amount on the pump screen.) np_vending uses the pill for card payments at its machines.

Quick pay

Key Action
E Pay with the shown method
TAB Open the full sheet for the same request (other account, split, …)
← → Change the stepper value, when the pill has one

The pill takes no NUI focus, so the player keeps driving. Lua reads the keys (Config.Keys.quickPay / quickMore) while the pill is up, and np_hud's bottom-center zone is hidden under it. It disappears after 30 s (Config.Quick.timeout).

The pill opens the full sheet by itself when it can't pay in one press: no usable default, a PIN or an approval is needed, or the charge was declined (the sheet then shows the reason).

lua
-- server: a toll gate
exports.np_payments:QuickPay(source, {
  merchant = { id = 'toll_delperro', label = 'Toll · Del Perro', icon = 'road', tint = 'neutral' },
  amount = 15, category = 'toll', payee = { type = 'society', id = 'government' },
}, function(result)
  if result.ok then openGate() end
end)

Without a callback QuickPay yields like Request. With one it returns { ok = true, pending, id } right away. With Config.Quick.enabled = false, QuickPay opens the full sheet.

Stepper ​

Parking with a stepper

A stepper lets the player change the amount on the pill, for example parking time. The amount is always value × pricePer, computed on the server.

lua
exports.np_payments:QuickPay(source, {
  merchant = { id = 'parking_legion', label = 'Legion Square Parking', sub = 'Meter 042', icon = 'square-parking', tint = 'blue' },
  amount = 10, category = 'parking', payee = { type = 'none' },
  stepper = { unit = 'h', value = 1, min = 1, max = 8, step = 1, pricePer = 10 },
})
Field Description
unit Label after the value (h, min, L)
value Start value
min / max / step Range and step
pricePer Price per unit of value

Auto-pay ​

Players switch auto-pay on per category in the Pay app. A quick payment in such a category, up to $25 (Config.Quick.autoMax), is then charged right away with the default method, without a pill. The player gets a toast "Auto-paid $15 with Checking". Auto-pay skips requests with a stepper, and methods that need a PIN or an approval.

Give cash ​

Hand cash to a player standing next to you, with a stepper on the pill.

  • np_menu context option Give cash on a player, or
  • /givecash [id] (Config.GiveCash.command). Without an id, the closest player within 3 m.

The pill takes cash only and steps in $10 (Config.GiveCash.step), up to your cash or $10,000 (max), whatever is lower. E hands it over: the money goes straight into the other player's cash, the giver plays the hand-over animation, and the receiver gets a toast "You got $50 cash from Marco".

The server checks again when E is pressed: the other player must still be online, the same character and within Config.GiveCash.distance, else the hand-over is declined.

Give cash has no receipt. np_menu's own Give money interaction is separate and doesn't use np_payments.