playerAimedAtPed
Tells your gamemode that a player aims at a ped another player’s game runs: that player, or an NPC.
Renamed in 0.28 from aim; see renamed names.
Signature
Section titled “Signature”server.on("playerAimedAtPed", ({ aimer, target, aimerPedNetworkId, targetPedNetworkId, targetSeat, provenance }) => void)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
aimer |
PlayerSnapshot or null |
The player aiming. |
target |
PlayerSnapshot or null |
The player aimed at, or null for an NPC. |
aimerPedNetworkId |
number |
The aiming ped’s network ID. |
targetPedNetworkId |
number |
The network ID of what was aimed at; a vehicle’s ID for the NPCs in it. |
targetSeat |
number | null |
null for the entity itself; for an NPC in a vehicle, its seat: 0 the driver, 1-3 a passenger. Always null for a player. |
provenance |
"client-report" |
The aimer’s game says so; the server doesn’t prove it. |
Example
Section titled “Example”import { server } from "nativemp";
server.on("playerAimedAtPed", ({ aimer, target }) => { if (aimer && target) server.log(`${aimer.name} aims at ${target.name}`);});Related
Section titled “Related”playerHitEntity: a hit