-
Notifications
You must be signed in to change notification settings - Fork 29
BulletSync
Nexius edited this page Aug 14, 2021
·
12 revisions
Destination:
Incoming/Outgoing
Description:
Called when a player fires a shot from a weapon (only bullet weapons are supported).
Important note:
It won't be called if you fired in vehicle as driver or if you are looking behind with the aim enabled (shooting in air).
Parameters (for incoming packet):
Value type | Parameter | Short description |
---|---|---|
PR_UINT8 |
packetId | The ID of the packet |
PR_UINT8 |
hitType | The type of thing the shot hit |
PR_UINT16 |
hitId | The ID of the player, vehicle or object that was hit |
PR_FLOAT3 |
origin | The position of where the bullet originated from on the X, Y and Z axes |
PR_FLOAT3 |
hitPos | The position of where the bullet hit on the X, Y and Z axes |
PR_FLOAT3 |
offsets | The offsets at which the shot hit on the X, Y and Z axes (relative to the hitId) |
PR_UINT8 |
weaponId | The ID of the weapon shot by the player |
Related SA-MP callbacks:
- OnPlayerWeaponShot (some missed parameters can be obtained using GetPlayerLastShotVectors)
Example (as incoming packet):
const BULLET_SYNC = 206;
IPacket:BULLET_SYNC(playerid, BitStream:bs)
{
new bulletData[PR_BulletSync];
BS_IgnoreBits(bs, 8);
BS_ReadBulletSync(bs, bulletData);
//Anything you want to see here
return 1;
}
- Refer to BrunoBM16's RPC and Packet lists