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.
Signature
Section titled “Signature”server.on("streetFoodVendorAttackRequest", ({ reporter, target, objectId, position }) => boolean | void | Promise<boolean | void>)Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”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.
Example
Section titled “Example”Vendors never fight back.
import { server } from "nativemp";
server.on("streetFoodVendorAttackRequest", () => false);Related
Section titled “Related”streetFoodVendorAttackStarted: the attack beganstreetFoodVendorSpawnRequest: decide whether a vendor appears