streetFoodVendorAttackStarted
Tells your gamemode that a vendor started attacking a player, after
streetFoodVendorAttackRequest allowed it. It is sent once; not
again when your gamemode reloads or a player joins later.
Renamed in 0.28 from streetFoodVendorReaction; see renamed names.
Signature
Section titled “Signature”server.on("streetFoodVendorAttackStarted", ({ reporter, target, objectId, expiresAtSessionMs }) => void)Parameters
Section titled “Parameters”The same as streetFoodVendorAttackRequest:
| Name | Type | Description |
|---|---|---|
reporter |
PlayerSnapshot |
The player whose game reported it. |
target |
PlayerSnapshot |
The player the vendor attacks. |
vendorKind |
"food-cart" |
Always a food cart. |
objectId |
number |
Which cart. |
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. |
Example
Section titled “Example”import { chat, server } from "nativemp";
server.on("streetFoodVendorAttackStarted", ({ target }) => chat.sendServerMessage("The vendor is after you. Run!", target));Related
Section titled “Related”streetFoodVendorAttackRequest: decide whether the vendor attacks