-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpvsFIX.inc
69 lines (57 loc) · 1.3 KB
/
gpvsFIX.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#if defined _GPVS_included
#endinput
#endif
#define _GPVS_included
#if !defined PAWNRAKNET_INC_
#error You need to have Pawn.RakNet.
#endif
#define INVALID_SEAT_ID (-1)
static gpvsPlayerSeat[MAX_PLAYERS char];
/*
Function ~>
*/
stock GetPlayerVehicleSeat(playerid)
{
if(!IsPlayerConnected(playerid) || !IsPlayerInAnyVehicle(playerid))
return INVALID_SEAT_ID;
else
return gpvsPlayerSeat{playerid};
}
public OnIncomingPacket(playerid, packetid, BitStream:bs)
{
if(packetid == 0xC8)
gpvsPlayerSeat{playerid} = 0;
else if(packetid == 0xD3)
{
BS_SetReadOffset(bs, 26);
BS_ReadValue(\
bs,
PR_BITS, gpvsPlayerSeat{playerid}, 6
);
BS_ResetReadPointer(bs);
}
#if defined gpvsOnIncomingPacket
return gpvsOnIncomingPacket(playerid, packetid, bs);
#else
return true;
#endif
}
/*
Hooking function and callback.
*/
#if defined _ALS_OnIncomingPacket
#undef OnIncomingPacket
#else
#define _ALS_OnIncomingPacket
#endif
#define OnIncomingPacket gpvsOnIncomingPacket
#if defined gpvsOnIncomingPacket
forward gpvsOnIncomingPacket(playerid, packetid, BitStream:bs);
#endif
/* <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> */
#if defined _ALS_GetPlayerVehicleSeat
#undef GetPlayerVehicleSeat
#else
#define _ALS_GetPlayerVehicleSeat
#endif
#define GetPlayerVehicleSeat GetPlayerVehicleSeatFixed