streetFoodVendorSpawnRequest
Asks your gamemode before a street food vendor appears at a food cart or a hotdog van. One player’s game runs the
vendor for everyone; player is that player, not a buyer.
Renamed in 0.28 from streetFoodVendorRequest; see renamed names.
Signature
Section titled “Signature”server.on("streetFoodVendorSpawnRequest", ({ player, vendorKind, objectId, unit }) => boolean | void | Promise<boolean | void>)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerSnapshot |
The player whose game would run the vendor. |
vendorKind |
"food-cart" | "hotdog-truck" |
A food cart or a hotdog van. |
objectId |
number |
Which cart (its number in the game) or van (its network ID). |
unit |
DispatchUnitProposal |
The vendor: model, position and network ID. |
Returns
Section titled “Returns”false keeps the vendor away, so nobody can buy there. true, or nothing, lets the vendor appear. The first false
stops the handlers after it. See how decisions work.
Example
Section titled “Example”Vendors only at food carts, not at hotdog vans.
import { server } from "nativemp";
server.on("streetFoodVendorSpawnRequest", ({ vendorKind }) => vendorKind !== "hotdog-truck");Related
Section titled “Related”playerStartInteractionRequest: decide whether a player may buystreetFoodVendorAttackRequest: a vendor attacking a player