Is your feature request related to a problem? Please describe.
Sometimes players accidentally buy a vehicle they don't want, and don't have an easy way to recover the cost.
Describe the solution you'd like
An action should be included in the vehicle shopkeeper that allows players to refund their last purchase. The vehicle must be alive and purchased within the last two minutes. The action should only appear when there is a vehicle to refund. If the player purchases multiple vehicles, they should be able to refund those vehicles, starting with the most recent purchase. It would also be nice if this feature could be used for purchased supply boxes and AI recruits.
Describe alternatives you've considered
It could be made so if the player buys more than one vehicle, the last vehicle is refunded. However, that requires more points and prevents players from buying multiple vehicles.
Additional context
Some technical details of a possible implementation:
After a purchase, SHZ_fnc_addRefundablePurchase is remote executed on the player to register the purchased vehicle
Vehicles are registered by storing a mapping of shopkeeper netId to an array of purchases
Perhaps call this SHZ_shopkeeperPurchases
Each element contains the vehicle that was purchased and a timestamp of the purchase
A "Refund last purchase" action is included with each shopkeeper that only shows up if there are valid refunds
Object must be alive
Must be within the last 2 minutes
When selecting the action, SHZ_refundPurchase is remote executed on the server to refund the vehicle
Server-side validation of the purchase time is not super necessary to implement
Player is notified of the (un)successful refund via SHZ_refundPurchaseCallback
After each purchase/refund, the SHZ_shopkeeperPurchases hashmap is cleaned up
Is your feature request related to a problem? Please describe. Sometimes players accidentally buy a vehicle they don't want, and don't have an easy way to recover the cost.
Describe the solution you'd like An action should be included in the vehicle shopkeeper that allows players to refund their last purchase. The vehicle must be alive and purchased within the last two minutes. The action should only appear when there is a vehicle to refund. If the player purchases multiple vehicles, they should be able to refund those vehicles, starting with the most recent purchase. It would also be nice if this feature could be used for purchased supply boxes and AI recruits.
Describe alternatives you've considered It could be made so if the player buys more than one vehicle, the last vehicle is refunded. However, that requires more points and prevents players from buying multiple vehicles.
Additional context Some technical details of a possible implementation:
SHZ_fnc_addRefundablePurchase
is remote executed on the player to register the purchased vehicleSHZ_shopkeeperPurchases
SHZ_refundPurchase
is remote executed on the server to refund the vehicleSHZ_refundPurchaseCallback
SHZ_shopkeeperPurchases
hashmap is cleaned upBIS_fnc_objectFromNetId