Skip to content

streetFoodVendorAttackRequest

Asks your gamemode when a player knocks over a food cart and its vendor is about to attack them, as the game does for ten seconds. One player’s game reports what knocked the cart over and the server checks it; it is a report, not proof that the player meant it.

Renamed in 0.28 from streetFoodVendorReactionRequest; see renamed names.

server.on("streetFoodVendorAttackRequest", ({ reporter, target, objectId, position }) => boolean | void | Promise<boolean | void>)
Name Type Description
reporter PlayerSnapshot The player whose game reported it.
target PlayerSnapshot The player the vendor would attack.
vendorKind "food-cart" Always a food cart.
objectId number Which cart: its number in the game.
vendorPedNetworkId number The vendor’s network ID.
position Vector3 Where the cart stood.
durationMs number How long the attack lasts: 10,000 ms.
expiresAtSessionMs number When it ends, on the shared session clock.
provenance "client-report" A player’s game reported it.

false stops the attack; the cart stays broken. true, or nothing, lets the vendor attack. The first false stops the handlers after it. See how decisions work.

Vendors never fight back.

gamemodes/my-mode.ts
import { server } from "nativemp";
server.on("streetFoodVendorAttackRequest", () => false);