-
Notifications
You must be signed in to change notification settings - Fork 29
Fix surfing invisible
Nexius edited this page Oct 14, 2024
·
11 revisions
const PLAYER_SYNC = 207;
IPacket:PLAYER_SYNC(playerid, BitStream:bs)
{
new onFootData[PR_OnFootSync];
BS_IgnoreBits(bs, 8); // ignore packetid (byte)
BS_ReadOnFootSync(bs, onFootData);
if (onFootData[PR_surfingVehicleId] != 0
&& onFootData[PR_surfingVehicleId] != INVALID_VEHICLE_ID
) {
if (floatabs(onFootData[PR_surfingOffsets][0]) >= 50.0
|| floatabs(onFootData[PR_surfingOffsets][1]) >= 50.0
|| floatabs(onFootData[PR_surfingOffsets][2]) >= 50.0
) {
return 0; // ignore bad packet
}
}
return 1;
}
const PLAYER_SYNC = 207;
IPacket:PLAYER_SYNC(playerid, BitStream:bs)
{
new onFootData[PR_OnFootSync];
BS_IgnoreBits(bs, 8); // ignore packetid (byte)
BS_ReadOnFootSync(bs, onFootData);
if (onFootData[PR_surfingVehicleId] != 0
&& onFootData[PR_surfingVehicleId] != INVALID_VEHICLE_ID
) {
if (floatabs(onFootData[PR_surfingOffsets][0]) >= 50.0
|| floatabs(onFootData[PR_surfingOffsets][1]) >= 50.0
|| floatabs(onFootData[PR_surfingOffsets][2]) >= 50.0
) {
onFootData[PR_surfingOffsets][0] =
onFootData[PR_surfingOffsets][1] =
onFootData[PR_surfingOffsets][2] = 0.0;
BS_SetWriteOffset(bs, 8);
BS_WriteOnFootSync(bs, onFootData); // rewrite
}
}
return 1;
}
- Refer to BrunoBM16's RPC and Packet lists