dfdffdfdfdfd commited on
Commit
72629ed
·
verified ·
1 Parent(s): 49d9d41

Upload 31 files

Browse files
Files changed (31) hide show
  1. Pawn.CMD.inc +94 -0
  2. Pawn.RakNet.inc +974 -0
  3. Pawn.Regex.inc +69 -0
  4. _fixes_options.inc +310 -0
  5. _fixes_settings.inc +58 -0
  6. a_actor.inc +23 -0
  7. a_http.inc +16 -0
  8. a_mysql.inc +196 -0
  9. a_npc.inc +194 -0
  10. a_objects.inc +62 -0
  11. a_players.inc +236 -0
  12. a_samp.inc +438 -0
  13. a_sampdb.inc +25 -0
  14. a_vehicles.inc +77 -0
  15. bcrypt.inc +98 -0
  16. breaks.inc +529 -0
  17. colandreas.inc +576 -0
  18. crashdetect.inc +101 -0
  19. easyDialog.inc +114 -0
  20. fixes.inc +0 -0
  21. foreach.inc +515 -0
  22. formatex.inc +427 -0
  23. logger.inc +187 -0
  24. mapandreas.inc +16 -0
  25. progress2.inc +627 -0
  26. samp_logger_version.inc +3 -0
  27. sscanf2.inc +793 -0
  28. streamer.inc +371 -0
  29. strlib.inc +1088 -0
  30. timerfix.inc +35 -0
  31. weapon-config.inc +0 -0
Pawn.CMD.inc ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if !defined PAWNCMD_INC_
2
+ #define PAWNCMD_INC_
3
+ #if !defined PACK_PLUGIN_VERSION
4
+ #define PACK_PLUGIN_VERSION(%0,%1,%2) (((%0) << 16) | ((%1) << 8) | (%2))
5
+ #endif
6
+ #define PAWNCMD_VERSION PACK_PLUGIN_VERSION(3, 4, 0)
7
+ #define PAWNCMD_INCLUDE_VERSION PAWNCMD_VERSION
8
+ #if !defined __cplusplus
9
+ public _pawncmd_version = PAWNCMD_VERSION;
10
+ #pragma unused _pawncmd_version
11
+ public bool:_pawncmd_is_gamemode = !defined FILTERSCRIPT;
12
+ #pragma unused _pawncmd_is_gamemode
13
+ native PC_Init();
14
+ native PC_RegAlias(const cmd[], const alias[], ...);
15
+ native PC_SetFlags(const cmd[], flags);
16
+ native PC_GetFlags(const cmd[]);
17
+ native PC_RenameCommand(const cmd[], const newname[]);
18
+ native PC_CommandExists(const cmd[]);
19
+ native PC_DeleteCommand(const cmd[]);
20
+ native CmdArray:PC_GetCommandArray();
21
+ native CmdArray:PC_GetAliasArray(const cmd[]);
22
+ native PC_GetArraySize(CmdArray:arr);
23
+ native PC_GetCommandName(CmdArray:arr, index, dest[], size = sizeof dest);
24
+ native PC_FreeArray(&CmdArray:arr);
25
+ native PC_EmulateCommand(playerid, const cmdtext[]);
26
+ #if defined PC_OnInit
27
+ forward PC_OnInit();
28
+ #endif
29
+ #if defined OnPlayerCommandReceived
30
+ forward OnPlayerCommandReceived(playerid, cmd[], params[], flags);
31
+ #endif
32
+ #if defined OnPlayerCommandPerformed
33
+ forward OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags);
34
+ #endif
35
+ #define cmd:%0(%1) \
36
+ forward pc_cmd_%0(%1); \
37
+ public pc_cmd_%0(%1)
38
+ #define alias:%0(%1) \
39
+ forward pc_alias_%0(); \
40
+ public pc_alias_%0() \
41
+ PC_RegAlias(#%0, %1);
42
+ #define flags:%0(%1) \
43
+ forward pc_flags_%0(); \
44
+ public pc_flags_%0() \
45
+ PC_SetFlags(#%0, %1);
46
+ #define CMD cmd
47
+ #define COMMAND cmd
48
+ #define callcmd::%0(%1) \
49
+ pc_cmd_%0(%1)
50
+ #define PC_HasFlag(%0,%1) \
51
+ (PC_GetFlags(%0) & %1)
52
+ #if !defined isnull
53
+ #define isnull(%0) \
54
+ ((!(%0[0])) || (((%0[0]) == '\1') && (!(%0[1]))))
55
+ #endif
56
+ #if defined FILTERSCRIPT
57
+ public OnFilterScriptInit()
58
+ {
59
+ PC_Init();
60
+ #if defined PawnCmd_OnFilterScriptInit
61
+ PawnCmd_OnFilterScriptInit();
62
+ #endif
63
+ return 1;
64
+ }
65
+ #if defined _ALS_OnFilterScriptInit
66
+ #undef OnFilterScriptInit
67
+ #else
68
+ #define _ALS_OnFilterScriptInit
69
+ #endif
70
+ #define OnFilterScriptInit PawnCmd_OnFilterScriptInit
71
+ #if defined PawnCmd_OnFilterScriptInit
72
+ forward PawnCmd_OnFilterScriptInit();
73
+ #endif
74
+ #else
75
+ public OnGameModeInit()
76
+ {
77
+ PC_Init();
78
+ #if defined PawnCmd_OnGameModeInit
79
+ PawnCmd_OnGameModeInit();
80
+ #endif
81
+ return 1;
82
+ }
83
+ #if defined _ALS_OnGameModeInit
84
+ #undef OnGameModeInit
85
+ #else
86
+ #define _ALS_OnGameModeInit
87
+ #endif
88
+ #define OnGameModeInit PawnCmd_OnGameModeInit
89
+ #if defined PawnCmd_OnGameModeInit
90
+ forward PawnCmd_OnGameModeInit();
91
+ #endif
92
+ #endif
93
+ #endif
94
+ #endif
Pawn.RakNet.inc ADDED
@@ -0,0 +1,974 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if !defined PAWNRAKNET_INC_
2
+ #define PAWNRAKNET_INC_
3
+ #if !defined PACK_PLUGIN_VERSION
4
+ #define PACK_PLUGIN_VERSION(%0,%1,%2) (((%0) << 16) | ((%1) << 8) | (%2))
5
+ #endif
6
+ #define PAWNRAKNET_VERSION PACK_PLUGIN_VERSION(1, 6, 0)
7
+ #define PAWNRAKNET_INCLUDE_VERSION PAWNRAKNET_VERSION
8
+ #define PR_MAX_HANDLERS 256
9
+ enum PR_EventType
10
+ {
11
+ PR_INCOMING_PACKET,
12
+ PR_INCOMING_RPC,
13
+ PR_OUTGOING_PACKET,
14
+ PR_OUTGOING_RPC,
15
+ PR_INCOMING_CUSTOM_RPC,
16
+ PR_NUMBER_OF_EVENT_TYPES,
17
+ PR_OUTCOMING_PACKET = PR_OUTGOING_PACKET,
18
+ PR_OUTCOMING_RPC = PR_OUTGOING_RPC,
19
+ };
20
+ enum PR_ValueType
21
+ {
22
+ PR_INT8,
23
+ PR_INT16,
24
+ PR_INT32,
25
+ PR_UINT8,
26
+ PR_UINT16,
27
+ PR_UINT32,
28
+ PR_FLOAT,
29
+ PR_BOOL,
30
+ PR_STRING,
31
+ PR_CINT8,
32
+ PR_CINT16,
33
+ PR_CINT32,
34
+ PR_CUINT8,
35
+ PR_CUINT16,
36
+ PR_CUINT32,
37
+ PR_CFLOAT,
38
+ PR_CBOOL,
39
+ PR_CSTRING,
40
+ PR_BITS,
41
+ PR_FLOAT3,
42
+ PR_FLOAT4,
43
+ PR_VECTOR,
44
+ PR_NORM_QUAT,
45
+ PR_STRING8,
46
+ PR_STRING32,
47
+ PR_IGNORE_BITS,
48
+ };
49
+ enum PR_PacketPriority
50
+ {
51
+ PR_SYSTEM_PRIORITY,
52
+ PR_HIGH_PRIORITY,
53
+ PR_MEDIUM_PRIORITY,
54
+ PR_LOW_PRIORITY,
55
+ };
56
+ enum PR_PacketReliability
57
+ {
58
+ PR_UNRELIABLE = 6,
59
+ PR_UNRELIABLE_SEQUENCED,
60
+ PR_RELIABLE,
61
+ PR_RELIABLE_ORDERED,
62
+ PR_RELIABLE_SEQUENCED,
63
+ };
64
+ #if !defined __cplusplus
65
+ public _pawnraknet_version = PAWNRAKNET_VERSION;
66
+ #pragma unused _pawnraknet_version
67
+ public bool:_pawnraknet_is_gamemode = !defined FILTERSCRIPT;
68
+ #pragma unused _pawnraknet_is_gamemode
69
+ #define PR_BITS_TO_BYTES(%0) (((%0)+7)>>3)
70
+ #define PR_BYTES_TO_BITS(%0) ((%0)<<3)
71
+ #define PR_Handler<%0,%1>:%2(%3) \
72
+ forward pr_r%1_%2(); \
73
+ public pr_r%1_%2() PR_RegHandler(%2,"pr_"#%1"_"#%2,%0); \
74
+ forward pr_%1_%2(%3); \
75
+ public pr_%1_%2(%3)
76
+ #define IPacket:%0(%1) PR_Handler<PR_INCOMING_PACKET,ip>:%0(%1)
77
+ #define IRPC:%0(%1) PR_Handler<PR_INCOMING_RPC,ir>:%0(%1)
78
+ #define OPacket:%0(%1) PR_Handler<PR_OUTGOING_PACKET,op>:%0(%1)
79
+ #define ORPC:%0(%1) PR_Handler<PR_OUTGOING_RPC,or>:%0(%1)
80
+ #define ICustomRPC:%0(%1) PR_Handler<PR_INCOMING_CUSTOM_RPC,icr>:%0(%1)
81
+ #define IncomingPacket IPacket
82
+ #define IncomingRPC IRPC
83
+ #define OutgoingPacket OPacket
84
+ #define OutgoingRPC ORPC
85
+ #define IncomingCustomRPC ICustomRPC
86
+ #define OutcomingPacket OutgoingPacket
87
+ #define OutcomingRPC OutgoingRPC
88
+ #define PR_MAX_WEAPON_SLOTS 13
89
+ enum PR_OnFootSync
90
+ {
91
+ PR_lrKey,
92
+ PR_udKey,
93
+ PR_keys,
94
+ Float:PR_position[3],
95
+ Float:PR_quaternion[4],
96
+ PR_health,
97
+ PR_armour,
98
+ PR_weaponId,
99
+ PR_additionalKey,
100
+ PR_specialAction,
101
+ Float:PR_velocity[3],
102
+ Float:PR_surfingOffsets[3],
103
+ PR_surfingVehicleId,
104
+ PR_animationId,
105
+ PR_animationFlags,
106
+ };
107
+ enum PR_InCarSync
108
+ {
109
+ PR_vehicleId,
110
+ PR_lrKey,
111
+ PR_udKey,
112
+ PR_keys,
113
+ Float:PR_quaternion[4],
114
+ Float:PR_position[3],
115
+ Float:PR_velocity[3],
116
+ Float:PR_vehicleHealth,
117
+ PR_playerHealth,
118
+ PR_armour,
119
+ PR_weaponId,
120
+ PR_additionalKey,
121
+ PR_sirenState,
122
+ PR_landingGearState,
123
+ PR_trailerId,
124
+ Float:PR_trainSpeed,
125
+ };
126
+ enum PR_TrailerSync
127
+ {
128
+ PR_trailerId,
129
+ Float:PR_position[3],
130
+ Float:PR_quaternion[4],
131
+ Float:PR_velocity[3],
132
+ Float:PR_angularVelocity[3],
133
+ };
134
+ enum PR_PassengerSync
135
+ {
136
+ PR_vehicleId,
137
+ PR_seatId,
138
+ PR_driveBy,
139
+ PR_weaponId,
140
+ PR_additionalKey,
141
+ PR_playerHealth,
142
+ PR_playerArmour,
143
+ PR_lrKey,
144
+ PR_udKey,
145
+ PR_keys,
146
+ Float:PR_position[3],
147
+ };
148
+ enum PR_UnoccupiedSync
149
+ {
150
+ PR_vehicleId,
151
+ PR_seatId,
152
+ Float:PR_roll[3],
153
+ Float:PR_direction[3],
154
+ Float:PR_position[3],
155
+ Float:PR_velocity[3],
156
+ Float:PR_angularVelocity[3],
157
+ Float:PR_vehicleHealth,
158
+ };
159
+ enum PR_AimSync
160
+ {
161
+ PR_camMode,
162
+ Float:PR_camFrontVec[3],
163
+ Float:PR_camPos[3],
164
+ Float:PR_aimZ,
165
+ PR_camZoom,
166
+ PR_weaponState,
167
+ PR_aspectRatio,
168
+ };
169
+ enum PR_BulletSync
170
+ {
171
+ PR_hitType,
172
+ PR_hitId,
173
+ Float:PR_origin[3],
174
+ Float:PR_hitPos[3],
175
+ Float:PR_offsets[3],
176
+ PR_weaponId,
177
+ };
178
+ enum PR_SpectatingSync
179
+ {
180
+ PR_lrKey,
181
+ PR_udKey,
182
+ PR_keys,
183
+ Float:PR_position[3],
184
+ };
185
+ enum PR_MarkersSync
186
+ {
187
+ PR_numberOfPlayers,
188
+ PR_playerIsActive[MAX_PLAYERS],
189
+ PR_playerPositionX[MAX_PLAYERS],
190
+ PR_playerPositionY[MAX_PLAYERS],
191
+ PR_playerPositionZ[MAX_PLAYERS],
192
+ PR_playerIsParticipant[MAX_PLAYERS],
193
+ };
194
+ enum PR_WeaponsUpdate
195
+ {
196
+ PR_targetId,
197
+ PR_targetActorId,
198
+ PR_slotWeaponId[PR_MAX_WEAPON_SLOTS],
199
+ PR_slotWeaponAmmo[PR_MAX_WEAPON_SLOTS],
200
+ PR_slotUpdated[PR_MAX_WEAPON_SLOTS],
201
+ };
202
+ enum PR_StatsUpdate
203
+ {
204
+ PR_money,
205
+ PR_drunkLevel,
206
+ };
207
+ enum PR_RconCommand
208
+ {
209
+ PR_command[256],
210
+ };
211
+ native PR_Init();
212
+ native PR_SendPacket(BitStream:bs, playerid, PR_PacketPriority:priority = PR_HIGH_PRIORITY, PR_PacketReliability:reliability = PR_RELIABLE_ORDERED, orderingchannel = 0);
213
+ native PR_SendRPC(BitStream:bs, playerid, rpcid, PR_PacketPriority:priority = PR_HIGH_PRIORITY, PR_PacketReliability:reliability = PR_RELIABLE_ORDERED, orderingchannel = 0);
214
+ #pragma deprecated Use PR_SendPacket instead
215
+ native BS_Send(BitStream:bs, playerid, PR_PacketPriority:priority = PR_HIGH_PRIORITY, PR_PacketReliability:reliability = PR_RELIABLE_ORDERED, orderingchannel = 0) = PR_SendPacket;
216
+ #pragma deprecated Use PR_SendRPC instead
217
+ native BS_RPC(BitStream:bs, playerid, rpcid, PR_PacketPriority:priority = PR_HIGH_PRIORITY, PR_PacketReliability:reliability = PR_RELIABLE_ORDERED, orderingchannel = 0) = PR_SendRPC;
218
+ native PR_EmulateIncomingPacket(BitStream:bs, playerid);
219
+ native PR_EmulateIncomingRPC(BitStream:bs, playerid, rpcid);
220
+ #pragma deprecated Use PR_EmulateIncomingPacket instead
221
+ native BS_EmulateIncomingPacket(BitStream:bs, playerid) = PR_EmulateIncomingPacket;
222
+ #pragma deprecated Use PR_EmulateIncomingRPC instead
223
+ native BS_EmulateIncomingRPC(BitStream:bs, playerid, rpcid) = PR_EmulateIncomingRPC;
224
+ native BitStream:BS_New();
225
+ native BitStream:BS_NewCopy(BitStream:bs);
226
+ native BS_Delete(&BitStream:bs);
227
+ native BS_Reset(BitStream:bs);
228
+ native BS_ResetReadPointer(BitStream:bs);
229
+ native BS_ResetWritePointer(BitStream:bs);
230
+ native BS_IgnoreBits(BitStream:bs, number_of_bits);
231
+ native BS_SetWriteOffset(BitStream:bs, offset);
232
+ native BS_GetWriteOffset(BitStream:bs, &offset);
233
+ native BS_SetReadOffset(BitStream:bs, offset);
234
+ native BS_GetReadOffset(BitStream:bs, &offset);
235
+ native BS_GetNumberOfBitsUsed(BitStream:bs, &number);
236
+ native BS_GetNumberOfBytesUsed(BitStream:bs, &number);
237
+ native BS_GetNumberOfUnreadBits(BitStream:bs, &number);
238
+ native BS_GetNumberOfBitsAllocated(BitStream:bs, &number);
239
+ native BS_WriteValue(BitStream:bs, {PR_ValueType, Float, _}:...);
240
+ native BS_ReadValue(BitStream:bs, {PR_ValueType, Float, _}:...);
241
+ native PR_RegHandler(eventid, const publicname[], PR_EventType:type);
242
+ #define BS_ReadInt8(%0,%1) BS_ReadValue(%0,PR_INT8,%1)
243
+ #define BS_ReadInt16(%0,%1) BS_ReadValue(%0,PR_INT16,%1)
244
+ #define BS_ReadInt32(%0,%1) BS_ReadValue(%0,PR_INT32,%1)
245
+ #define BS_ReadUint8(%0,%1) BS_ReadValue(%0,PR_UINT8,%1)
246
+ #define BS_ReadUint16(%0,%1) BS_ReadValue(%0,PR_UINT16,%1)
247
+ #define BS_ReadUint32(%0,%1) BS_ReadValue(%0,PR_UINT32,%1)
248
+ #define BS_ReadFloat(%0,%1) BS_ReadValue(%0,PR_FLOAT,%1)
249
+ #define BS_ReadBool(%0,%1) BS_ReadValue(%0,PR_BOOL,%1)
250
+ #define BS_ReadString(%0,%1,%2) BS_ReadValue(%0,PR_STRING,%1,%2)
251
+ #define BS_ReadCompressedInt8(%0,%1) BS_ReadValue(%0,PR_CINT8,%1)
252
+ #define BS_ReadCompressedInt16(%0,%1) BS_ReadValue(%0,PR_CINT16,%1)
253
+ #define BS_ReadCompressedInt32(%0,%1) BS_ReadValue(%0,PR_CINT32,%1)
254
+ #define BS_ReadCompressedUint8(%0,%1) BS_ReadValue(%0,PR_CUINT8,%1)
255
+ #define BS_ReadCompressedUint16(%0,%1) BS_ReadValue(%0,PR_CUINT16,%1)
256
+ #define BS_ReadCompressedUint32(%0,%1) BS_ReadValue(%0,PR_CUINT32,%1)
257
+ #define BS_ReadCompressedFloat(%0,%1) BS_ReadValue(%0,PR_CFLOAT,%1)
258
+ #define BS_ReadCompressedBool(%0,%1) BS_ReadValue(%0,PR_CBOOL,%1)
259
+ #define BS_ReadCompressedString(%0,%1,%2) BS_ReadValue(%0,PR_CSTRING,%1,%2)
260
+ #define BS_ReadBits(%0,%1,%2) BS_ReadValue(%0,PR_BITS,%1,%2)
261
+ #define BS_ReadFloat3(%0,%1) BS_ReadValue(%0,PR_FLOAT3,%1)
262
+ #define BS_ReadFloat4(%0,%1) BS_ReadValue(%0,PR_FLOAT4,%1)
263
+ #define BS_ReadVector(%0,%1) BS_ReadValue(%0,PR_VECTOR,%1)
264
+ #define BS_ReadNormQuat(%0,%1) BS_ReadValue(%0,PR_NORM_QUAT,%1)
265
+ #define BS_ReadString8(%0,%1) BS_ReadValue(%0,PR_STRING8,%1,sizeof(%1))
266
+ #define BS_ReadString32(%0,%1) BS_ReadValue(%0,PR_STRING32,%1,sizeof(%1))
267
+ #define BS_WriteInt8(%0,%1) BS_WriteValue(%0,PR_INT8,%1)
268
+ #define BS_WriteInt16(%0,%1) BS_WriteValue(%0,PR_INT16,%1)
269
+ #define BS_WriteInt32(%0,%1) BS_WriteValue(%0,PR_INT32,%1)
270
+ #define BS_WriteUint8(%0,%1) BS_WriteValue(%0,PR_UINT8,%1)
271
+ #define BS_WriteUint16(%0,%1) BS_WriteValue(%0,PR_UINT16,%1)
272
+ #define BS_WriteUint32(%0,%1) BS_WriteValue(%0,PR_UINT32,%1)
273
+ #define BS_WriteFloat(%0,%1) BS_WriteValue(%0,PR_FLOAT,%1)
274
+ #define BS_WriteBool(%0,%1) BS_WriteValue(%0,PR_BOOL,%1)
275
+ #define BS_WriteString(%0,%1) BS_WriteValue(%0,PR_STRING,%1)
276
+ #define BS_WriteCompressedInt8(%0,%1) BS_WriteValue(%0,PR_CINT8,%1)
277
+ #define BS_WriteCompressedInt16(%0,%1) BS_WriteValue(%0,PR_CINT16,%1)
278
+ #define BS_WriteCompressedInt32(%0,%1) BS_WriteValue(%0,PR_CINT32,%1)
279
+ #define BS_WriteCompressedUint8(%0,%1) BS_WriteValue(%0,PR_CUINT8,%1)
280
+ #define BS_WriteCompressedUint16(%0,%1) BS_WriteValue(%0,PR_CUINT16,%1)
281
+ #define BS_WriteCompressedUint32(%0,%1) BS_WriteValue(%0,PR_CUINT32,%1)
282
+ #define BS_WriteCompressedFloat(%0,%1) BS_WriteValue(%0,PR_CFLOAT,%1)
283
+ #define BS_WriteCompressedBool(%0,%1) BS_WriteValue(%0,PR_CBOOL,%1)
284
+ #define BS_WriteCompressedString(%0,%1) BS_WriteValue(%0,PR_CSTRING,%1)
285
+ #define BS_WriteBits(%0,%1,%2) BS_WriteValue(%0,PR_BITS,%1,%2)
286
+ #define BS_WriteFloat3(%0,%1) BS_WriteValue(%0,PR_FLOAT3,%1)
287
+ #define BS_WriteFloat4(%0,%1) BS_WriteValue(%0,PR_FLOAT4,%1)
288
+ #define BS_WriteVector(%0,%1) BS_WriteValue(%0,PR_VECTOR,%1)
289
+ #define BS_WriteNormQuat(%0,%1) BS_WriteValue(%0,PR_NORM_QUAT,%1)
290
+ #define BS_WriteString8(%0,%1) BS_WriteValue(%0,PR_STRING8,%1)
291
+ #define BS_WriteString32(%0,%1) BS_WriteValue(%0,PR_STRING32,%1)
292
+ #define PR_EXPAND_ARR3(%0) %0[0],%0[1],%0[2]
293
+ #define PR_EXPAND_ARR4(%0) %0[0],%0[1],%0[2],%0[3]
294
+ stock BS_PackAspectRatio(Float:value)
295
+ {
296
+ return floatround((value - 1.0) * 255.0);
297
+ }
298
+ stock Float:BS_UnpackAspectRatio(value)
299
+ {
300
+ return float(value) / 255.0 + 1.0;
301
+ }
302
+ stock BS_PackCameraZoom(Float:value)
303
+ {
304
+ return floatround(((value - 35.0) / 35.0) * 63.0);
305
+ }
306
+ stock Float:BS_UnpackCameraZoom(value)
307
+ {
308
+ return (float(value) / 63.0) * 35.0 + 35.0;
309
+ }
310
+ stock BS_PackHealthArmour(health, armour, &healthArmour)
311
+ {
312
+ if (health > 0 && health < 100) {
313
+ healthArmour = (health / 7) << 4;
314
+ } else if (health >= 100) {
315
+ healthArmour = 0xF0;
316
+ } else {
317
+ healthArmour = 0;
318
+ }
319
+ if (armour > 0 && armour < 100) {
320
+ healthArmour |= (armour / 7);
321
+ } else if (armour >= 100) {
322
+ healthArmour |= 0xF;
323
+ }
324
+ }
325
+ stock BS_UnpackHealthArmour(healthArmour, &health, &armour)
326
+ {
327
+ health = healthArmour >> 4;
328
+ if (health == 0xF) {
329
+ health = 100;
330
+ } else {
331
+ health *= 7;
332
+ }
333
+ armour = healthArmour & 0xF;
334
+ if (armour == 0xF) {
335
+ armour = 100;
336
+ } else {
337
+ armour *= 7;
338
+ }
339
+ }
340
+ stock BS_ReadOnFootSync(BitStream:bs, data[PR_OnFootSync], outgoing = false)
341
+ {
342
+ if (outgoing) {
343
+ new hasLeftRight, hasUpDown, hasSurfInfo, hasAnimation, healthArmour;
344
+ BS_ReadValue(bs, PR_BOOL, hasLeftRight);
345
+ if (hasLeftRight) {
346
+ BS_ReadValue(bs, PR_UINT16, data[PR_lrKey]);
347
+ } else {
348
+ data[PR_lrKey] = 0;
349
+ }
350
+ BS_ReadValue(bs, PR_BOOL, hasUpDown);
351
+ if (hasUpDown) {
352
+ BS_ReadValue(bs, PR_UINT16, data[PR_udKey]);
353
+ } else {
354
+ data[PR_udKey] = 0;
355
+ }
356
+ BS_ReadValue(
357
+ bs,
358
+ PR_UINT16, data[PR_keys],
359
+ PR_FLOAT3, data[PR_position],
360
+ PR_NORM_QUAT, data[PR_quaternion],
361
+ PR_UINT8, healthArmour,
362
+ PR_UINT8, data[PR_weaponId],
363
+ PR_UINT8, data[PR_specialAction],
364
+ PR_VECTOR, data[PR_velocity],
365
+ PR_BOOL, hasSurfInfo
366
+ );
367
+ BS_UnpackHealthArmour(healthArmour, data[PR_health], data[PR_armour]);
368
+ if (hasSurfInfo) {
369
+ BS_ReadValue(
370
+ bs,
371
+ PR_UINT16, data[PR_surfingVehicleId],
372
+ PR_FLOAT3, data[PR_surfingOffsets]
373
+ );
374
+ } else {
375
+ data[PR_surfingVehicleId] = 0;
376
+ }
377
+ BS_ReadValue(bs, PR_BOOL, hasAnimation);
378
+ if (hasAnimation) {
379
+ BS_ReadValue(
380
+ bs,
381
+ PR_INT16, data[PR_animationId],
382
+ PR_INT16, data[PR_animationFlags]
383
+ );
384
+ } else {
385
+ data[PR_animationId] = 0;
386
+ data[PR_animationFlags] = 0;
387
+ }
388
+ } else {
389
+ BS_ReadValue(
390
+ bs,
391
+ PR_UINT16, data[PR_lrKey],
392
+ PR_UINT16, data[PR_udKey],
393
+ PR_UINT16, data[PR_keys],
394
+ PR_FLOAT3, data[PR_position],
395
+ PR_FLOAT4, data[PR_quaternion],
396
+ PR_UINT8, data[PR_health],
397
+ PR_UINT8, data[PR_armour],
398
+ PR_BITS, data[PR_additionalKey], 2,
399
+ PR_BITS, data[PR_weaponId], 6,
400
+ PR_UINT8, data[PR_specialAction],
401
+ PR_FLOAT3, data[PR_velocity],
402
+ PR_FLOAT3, data[PR_surfingOffsets],
403
+ PR_UINT16, data[PR_surfingVehicleId],
404
+ PR_INT16, data[PR_animationId],
405
+ PR_INT16, data[PR_animationFlags]
406
+ );
407
+ }
408
+ }
409
+ stock BS_ReadInCarSync(BitStream:bs, data[PR_InCarSync], outgoing = false)
410
+ {
411
+ if (outgoing) {
412
+ new vehicleHealth, healthArmour;
413
+ BS_ReadValue(
414
+ bs,
415
+ PR_UINT16, data[PR_vehicleId],
416
+ PR_UINT16, data[PR_lrKey],
417
+ PR_UINT16, data[PR_udKey],
418
+ PR_UINT16, data[PR_keys],
419
+ PR_NORM_QUAT, data[PR_quaternion],
420
+ PR_FLOAT3, data[PR_position],
421
+ PR_VECTOR, data[PR_velocity],
422
+ PR_UINT16, vehicleHealth,
423
+ PR_UINT8, healthArmour,
424
+ PR_UINT8, data[PR_weaponId],
425
+ PR_BOOL, data[PR_sirenState],
426
+ PR_BOOL, data[PR_landingGearState]
427
+ );
428
+ data[PR_vehicleHealth] = float(vehicleHealth);
429
+ BS_UnpackHealthArmour(healthArmour, data[PR_playerHealth], data[PR_armour]);
430
+ new hasTrainSpeed, hasTrailer;
431
+ BS_ReadValue(bs, PR_BOOL, hasTrainSpeed);
432
+ if (hasTrainSpeed) {
433
+ BS_ReadValue(bs, PR_FLOAT, data[PR_trainSpeed]);
434
+ } else {
435
+ data[PR_trainSpeed] = 0.0;
436
+ }
437
+ BS_ReadValue(bs, PR_BOOL, hasTrailer);
438
+ if (hasTrailer) {
439
+ BS_ReadValue(bs, PR_UINT16, data[PR_trailerId]);
440
+ } else {
441
+ data[PR_trailerId] = 0;
442
+ }
443
+ } else {
444
+ BS_ReadValue(
445
+ bs,
446
+ PR_UINT16, data[PR_vehicleId],
447
+ PR_UINT16, data[PR_lrKey],
448
+ PR_UINT16, data[PR_udKey],
449
+ PR_UINT16, data[PR_keys],
450
+ PR_FLOAT4, data[PR_quaternion],
451
+ PR_FLOAT3, data[PR_position],
452
+ PR_FLOAT3, data[PR_velocity],
453
+ PR_FLOAT, data[PR_vehicleHealth],
454
+ PR_UINT8, data[PR_playerHealth],
455
+ PR_UINT8, data[PR_armour],
456
+ PR_BITS, data[PR_additionalKey], 2,
457
+ PR_BITS, data[PR_weaponId], 6,
458
+ PR_UINT8, data[PR_sirenState],
459
+ PR_UINT8, data[PR_landingGearState],
460
+ PR_UINT16, data[PR_trailerId],
461
+ PR_FLOAT, data[PR_trainSpeed]
462
+ );
463
+ }
464
+ }
465
+ stock BS_ReadTrailerSync(BitStream:bs, data[PR_TrailerSync])
466
+ {
467
+ BS_ReadValue(
468
+ bs,
469
+ PR_UINT16, data[PR_trailerId],
470
+ PR_FLOAT3, data[PR_position],
471
+ PR_FLOAT4, data[PR_quaternion],
472
+ PR_FLOAT3, data[PR_velocity],
473
+ PR_FLOAT3, data[PR_angularVelocity]
474
+ );
475
+ }
476
+ stock BS_ReadPassengerSync(BitStream:bs, data[PR_PassengerSync])
477
+ {
478
+ BS_ReadValue(
479
+ bs,
480
+ PR_UINT16, data[PR_vehicleId],
481
+ PR_BITS, data[PR_driveBy], 2,
482
+ PR_BITS, data[PR_seatId], 6,
483
+ PR_BITS, data[PR_additionalKey], 2,
484
+ PR_BITS, data[PR_weaponId], 6,
485
+ PR_UINT8, data[PR_playerHealth],
486
+ PR_UINT8, data[PR_playerArmour],
487
+ PR_UINT16, data[PR_lrKey],
488
+ PR_UINT16, data[PR_udKey],
489
+ PR_UINT16, data[PR_keys],
490
+ PR_FLOAT3, data[PR_position]
491
+ );
492
+ }
493
+ stock BS_ReadUnoccupiedSync(BitStream:bs, data[PR_UnoccupiedSync])
494
+ {
495
+ BS_ReadValue(
496
+ bs,
497
+ PR_UINT16, data[PR_vehicleId],
498
+ PR_UINT8, data[PR_seatId],
499
+ PR_FLOAT3, data[PR_roll],
500
+ PR_FLOAT3, data[PR_direction],
501
+ PR_FLOAT3, data[PR_position],
502
+ PR_FLOAT3, data[PR_velocity],
503
+ PR_FLOAT3, data[PR_angularVelocity],
504
+ PR_FLOAT, data[PR_vehicleHealth]
505
+ );
506
+ }
507
+ stock BS_ReadAimSync(BitStream:bs, data[PR_AimSync])
508
+ {
509
+ BS_ReadValue(
510
+ bs,
511
+ PR_UINT8, data[PR_camMode],
512
+ PR_FLOAT3, data[PR_camFrontVec],
513
+ PR_FLOAT3, data[PR_camPos],
514
+ PR_FLOAT, data[PR_aimZ],
515
+ PR_BITS, data[PR_weaponState], 2,
516
+ PR_BITS, data[PR_camZoom], 6,
517
+ PR_UINT8, data[PR_aspectRatio]
518
+ );
519
+ }
520
+ stock BS_ReadBulletSync(BitStream:bs, data[PR_BulletSync])
521
+ {
522
+ BS_ReadValue(
523
+ bs,
524
+ PR_UINT8, data[PR_hitType],
525
+ PR_UINT16, data[PR_hitId],
526
+ PR_FLOAT3, data[PR_origin],
527
+ PR_FLOAT3, data[PR_hitPos],
528
+ PR_FLOAT3, data[PR_offsets],
529
+ PR_UINT8, data[PR_weaponId]
530
+ );
531
+ }
532
+ stock BS_ReadSpectatingSync(BitStream:bs, data[PR_SpectatingSync])
533
+ {
534
+ BS_ReadValue(
535
+ bs,
536
+ PR_UINT16, data[PR_lrKey],
537
+ PR_UINT16, data[PR_udKey],
538
+ PR_UINT16, data[PR_keys],
539
+ PR_FLOAT3, data[PR_position]
540
+ );
541
+ }
542
+ stock BS_ReadMarkersSync(BitStream:bs, data[PR_MarkersSync])
543
+ {
544
+ new numberOfPlayers, playerId, isActive;
545
+ BS_ReadInt32(bs, numberOfPlayers);
546
+ if (numberOfPlayers < 0 || numberOfPlayers > MAX_PLAYERS) {
547
+ return;
548
+ }
549
+ data[PR_numberOfPlayers] = numberOfPlayers;
550
+ for (new i; i < numberOfPlayers; i++) {
551
+ playerId = isActive = 0;
552
+ BS_ReadUint16(bs, playerId);
553
+ if (playerId >= MAX_PLAYERS) {
554
+ return;
555
+ }
556
+ data[PR_playerIsParticipant][playerId] = true;
557
+ BS_ReadCompressedBool(bs, isActive);
558
+ if (isActive) {
559
+ data[PR_playerIsActive][playerId] = true;
560
+ BS_ReadValue(
561
+ bs,
562
+ PR_INT16, data[PR_playerPositionX][playerId],
563
+ PR_INT16, data[PR_playerPositionY][playerId],
564
+ PR_INT16, data[PR_playerPositionZ][playerId]
565
+ );
566
+ }
567
+ }
568
+ }
569
+ stock BS_ReadWeaponsUpdate(BitStream:bs, data[PR_WeaponsUpdate])
570
+ {
571
+ new numberOfBytes, numberOfSlots, slotId, weaponId, ammo;
572
+ BS_GetNumberOfBytesUsed(bs, numberOfBytes);
573
+ if (numberOfBytes > 5) {
574
+ numberOfSlots = (numberOfBytes - 5) / 4;
575
+ }
576
+ BS_ReadValue(
577
+ bs,
578
+ PR_UINT16, data[PR_targetId],
579
+ PR_UINT16, data[PR_targetActorId]
580
+ );
581
+ while (numberOfSlots--) {
582
+ slotId = weaponId = ammo = 0;
583
+ BS_ReadValue(
584
+ bs,
585
+ PR_UINT8, slotId,
586
+ PR_UINT8, weaponId,
587
+ PR_UINT16, ammo
588
+ );
589
+ if (slotId < PR_MAX_WEAPON_SLOTS) {
590
+ data[PR_slotWeaponId][slotId] = weaponId;
591
+ data[PR_slotWeaponAmmo][slotId] = ammo;
592
+ data[PR_slotUpdated][slotId] = true;
593
+ }
594
+ }
595
+ }
596
+ stock BS_ReadStatsUpdate(BitStream:bs, data[PR_StatsUpdate])
597
+ {
598
+ BS_ReadValue(
599
+ bs,
600
+ PR_INT32, data[PR_money],
601
+ PR_INT32, data[PR_drunkLevel]
602
+ );
603
+ }
604
+ stock BS_ReadRconCommand(BitStream:bs, data[PR_RconCommand])
605
+ {
606
+ BS_ReadValue(
607
+ bs,
608
+ PR_STRING32, data[PR_command], sizeof(data[PR_command])
609
+ );
610
+ }
611
+ stock BS_WriteOnFootSync(BitStream:bs, data[PR_OnFootSync], outgoing = false)
612
+ {
613
+ if (outgoing) {
614
+ new healthArmour;
615
+ if (data[PR_lrKey]) {
616
+ BS_WriteValue(
617
+ bs,
618
+ PR_BOOL, true,
619
+ PR_UINT16, data[PR_lrKey]
620
+ );
621
+ } else {
622
+ BS_WriteValue(bs, PR_BOOL, false);
623
+ }
624
+ if (data[PR_udKey]) {
625
+ BS_WriteValue(
626
+ bs,
627
+ PR_BOOL, true,
628
+ PR_UINT16, data[PR_udKey]
629
+ );
630
+ } else {
631
+ BS_WriteValue(bs, PR_BOOL, false);
632
+ }
633
+ BS_PackHealthArmour(data[PR_health], data[PR_armour], healthArmour);
634
+ BS_WriteValue(
635
+ bs,
636
+ PR_UINT16, data[PR_keys],
637
+ PR_FLOAT3, data[PR_position],
638
+ PR_NORM_QUAT, data[PR_quaternion],
639
+ PR_UINT8, healthArmour,
640
+ PR_UINT8, data[PR_weaponId],
641
+ PR_UINT8, data[PR_specialAction],
642
+ PR_VECTOR, data[PR_velocity]
643
+ );
644
+ if (data[PR_surfingVehicleId]) {
645
+ BS_WriteValue(
646
+ bs,
647
+ PR_BOOL, true,
648
+ PR_UINT16, data[PR_surfingVehicleId],
649
+ PR_FLOAT3, data[PR_surfingOffsets]
650
+ );
651
+ } else {
652
+ BS_WriteValue(bs, PR_BOOL, false);
653
+ }
654
+ if (data[PR_animationId] || data[PR_animationFlags]) {
655
+ BS_WriteValue(
656
+ bs,
657
+ PR_BOOL, true,
658
+ PR_INT16, data[PR_animationId],
659
+ PR_INT16, data[PR_animationFlags]
660
+ );
661
+ } else {
662
+ BS_WriteValue(bs, PR_BOOL, false);
663
+ }
664
+ } else {
665
+ BS_WriteValue(
666
+ bs,
667
+ PR_UINT16, data[PR_lrKey],
668
+ PR_UINT16, data[PR_udKey],
669
+ PR_UINT16, data[PR_keys],
670
+ PR_FLOAT3, data[PR_position],
671
+ PR_FLOAT4, data[PR_quaternion],
672
+ PR_UINT8, data[PR_health],
673
+ PR_UINT8, data[PR_armour],
674
+ PR_BITS, data[PR_additionalKey], 2,
675
+ PR_BITS, data[PR_weaponId], 6,
676
+ PR_UINT8, data[PR_specialAction],
677
+ PR_FLOAT3, data[PR_velocity],
678
+ PR_FLOAT3, data[PR_surfingOffsets],
679
+ PR_UINT16, data[PR_surfingVehicleId],
680
+ PR_INT16, data[PR_animationId],
681
+ PR_INT16, data[PR_animationFlags]
682
+ );
683
+ }
684
+ }
685
+ stock BS_WriteInCarSync(BitStream:bs, data[PR_InCarSync], outgoing = false)
686
+ {
687
+ if (outgoing) {
688
+ new healthArmour;
689
+ BS_PackHealthArmour(data[PR_playerHealth], data[PR_armour], healthArmour);
690
+ BS_WriteValue(
691
+ bs,
692
+ PR_UINT16, data[PR_vehicleId],
693
+ PR_UINT16, data[PR_lrKey],
694
+ PR_UINT16, data[PR_udKey],
695
+ PR_UINT16, data[PR_keys],
696
+ PR_NORM_QUAT, data[PR_quaternion],
697
+ PR_FLOAT3, data[PR_position],
698
+ PR_VECTOR, data[PR_velocity],
699
+ PR_UINT16, floatround(data[PR_vehicleHealth]),
700
+ PR_UINT8, healthArmour,
701
+ PR_UINT8, data[PR_weaponId],
702
+ PR_BOOL, data[PR_sirenState],
703
+ PR_BOOL, data[PR_landingGearState]
704
+ );
705
+ if (data[PR_trainSpeed]) {
706
+ BS_WriteValue(bs,
707
+ PR_BOOL, true,
708
+ PR_FLOAT, data[PR_trainSpeed]
709
+ );
710
+ } else {
711
+ BS_WriteValue(bs, PR_BOOL, false);
712
+ }
713
+ if (data[PR_trailerId]) {
714
+ BS_WriteValue(bs,
715
+ PR_BOOL, true,
716
+ PR_UINT16, data[PR_trailerId]
717
+ );
718
+ } else {
719
+ BS_WriteValue(bs, PR_BOOL, false);
720
+ }
721
+ } else {
722
+ BS_WriteValue(
723
+ bs,
724
+ PR_UINT16, data[PR_vehicleId],
725
+ PR_UINT16, data[PR_lrKey],
726
+ PR_UINT16, data[PR_udKey],
727
+ PR_UINT16, data[PR_keys],
728
+ PR_FLOAT4, data[PR_quaternion],
729
+ PR_FLOAT3, data[PR_position],
730
+ PR_FLOAT3, data[PR_velocity],
731
+ PR_FLOAT, data[PR_vehicleHealth],
732
+ PR_UINT8, data[PR_playerHealth],
733
+ PR_UINT8, data[PR_armour],
734
+ PR_BITS, data[PR_additionalKey], 2,
735
+ PR_BITS, data[PR_weaponId], 6,
736
+ PR_UINT8, data[PR_sirenState],
737
+ PR_UINT8, data[PR_landingGearState],
738
+ PR_UINT16, data[PR_trailerId],
739
+ PR_FLOAT, data[PR_trainSpeed]
740
+ );
741
+ }
742
+ }
743
+ stock BS_WriteTrailerSync(BitStream:bs, data[PR_TrailerSync])
744
+ {
745
+ BS_WriteValue(
746
+ bs,
747
+ PR_UINT16, data[PR_trailerId],
748
+ PR_FLOAT3, data[PR_position],
749
+ PR_FLOAT4, data[PR_quaternion],
750
+ PR_FLOAT3, data[PR_velocity],
751
+ PR_FLOAT3, data[PR_angularVelocity]
752
+ );
753
+ }
754
+ stock BS_WritePassengerSync(BitStream:bs, data[PR_PassengerSync])
755
+ {
756
+ BS_WriteValue(
757
+ bs,
758
+ PR_UINT16, data[PR_vehicleId],
759
+ PR_BITS, data[PR_driveBy], 2,
760
+ PR_BITS, data[PR_seatId], 6,
761
+ PR_BITS, data[PR_additionalKey], 2,
762
+ PR_BITS, data[PR_weaponId], 6,
763
+ PR_UINT8, data[PR_playerHealth],
764
+ PR_UINT8, data[PR_playerArmour],
765
+ PR_UINT16, data[PR_lrKey],
766
+ PR_UINT16, data[PR_udKey],
767
+ PR_UINT16, data[PR_keys],
768
+ PR_FLOAT3, data[PR_position]
769
+ );
770
+ }
771
+ stock BS_WriteUnoccupiedSync(BitStream:bs, data[PR_UnoccupiedSync])
772
+ {
773
+ BS_WriteValue(
774
+ bs,
775
+ PR_UINT16, data[PR_vehicleId],
776
+ PR_UINT8, data[PR_seatId],
777
+ PR_FLOAT3, data[PR_roll],
778
+ PR_FLOAT3, data[PR_direction],
779
+ PR_FLOAT3, data[PR_position],
780
+ PR_FLOAT3, data[PR_velocity],
781
+ PR_FLOAT3, data[PR_angularVelocity],
782
+ PR_FLOAT, data[PR_vehicleHealth]
783
+ );
784
+ }
785
+ stock BS_WriteAimSync(BitStream:bs, data[PR_AimSync])
786
+ {
787
+ BS_WriteValue(
788
+ bs,
789
+ PR_UINT8, data[PR_camMode],
790
+ PR_FLOAT3, data[PR_camFrontVec],
791
+ PR_FLOAT3, data[PR_camPos],
792
+ PR_FLOAT, data[PR_aimZ],
793
+ PR_BITS, data[PR_weaponState], 2,
794
+ PR_BITS, data[PR_camZoom], 6,
795
+ PR_UINT8, data[PR_aspectRatio]
796
+ );
797
+ }
798
+ stock BS_WriteBulletSync(BitStream:bs, data[PR_BulletSync])
799
+ {
800
+ BS_WriteValue(
801
+ bs,
802
+ PR_UINT8, data[PR_hitType],
803
+ PR_UINT16, data[PR_hitId],
804
+ PR_FLOAT3, data[PR_origin],
805
+ PR_FLOAT3, data[PR_hitPos],
806
+ PR_FLOAT3, data[PR_offsets],
807
+ PR_UINT8, data[PR_weaponId]
808
+ );
809
+ }
810
+ stock BS_WriteSpectatingSync(BitStream:bs, data[PR_SpectatingSync])
811
+ {
812
+ BS_WriteValue(
813
+ bs,
814
+ PR_UINT16, data[PR_lrKey],
815
+ PR_UINT16, data[PR_udKey],
816
+ PR_UINT16, data[PR_keys],
817
+ PR_FLOAT3, data[PR_position]
818
+ );
819
+ }
820
+ stock BS_WriteMarkersSync(BitStream:bs, data[PR_MarkersSync])
821
+ {
822
+ BS_WriteInt32(bs, data[PR_numberOfPlayers]);
823
+ for (new i; i < MAX_PLAYERS; i++) {
824
+ if (!data[PR_playerIsParticipant][i]) {
825
+ continue;
826
+ }
827
+ BS_WriteValue(
828
+ bs,
829
+ PR_UINT16, i,
830
+ PR_CBOOL, data[PR_playerIsActive][i]
831
+ );
832
+ if (data[PR_playerIsActive][i]) {
833
+ BS_WriteValue(
834
+ bs,
835
+ PR_INT16, data[PR_playerPositionX][i],
836
+ PR_INT16, data[PR_playerPositionY][i],
837
+ PR_INT16, data[PR_playerPositionZ][i]
838
+ );
839
+ }
840
+ }
841
+ }
842
+ stock BS_WriteWeaponsUpdate(BitStream:bs, data[PR_WeaponsUpdate])
843
+ {
844
+ BS_WriteValue(
845
+ bs,
846
+ PR_UINT16, data[PR_targetId],
847
+ PR_UINT16, data[PR_targetActorId]
848
+ );
849
+ for (new slotId; slotId < PR_MAX_WEAPON_SLOTS; slotId++) {
850
+ if (!data[PR_slotUpdated][slotId]) {
851
+ continue;
852
+ }
853
+ BS_WriteValue(
854
+ bs,
855
+ PR_UINT8, slotId,
856
+ PR_UINT8, data[PR_slotWeaponId][slotId],
857
+ PR_UINT16, data[PR_slotWeaponAmmo][slotId]
858
+ );
859
+ }
860
+ }
861
+ stock BS_WriteStatsUpdate(BitStream:bs, data[PR_StatsUpdate])
862
+ {
863
+ BS_WriteValue(
864
+ bs,
865
+ PR_INT32, data[PR_money],
866
+ PR_INT32, data[PR_drunkLevel]
867
+ );
868
+ }
869
+ stock BS_WriteRconCommand(BitStream:bs, data[PR_RconCommand])
870
+ {
871
+ BS_WriteValue(
872
+ bs,
873
+ PR_STRING32, data[PR_command]
874
+ );
875
+ }
876
+ stock PR_SendPacketToPlayerStream(BitStream:bs, playerid, PR_PacketPriority:priority = PR_HIGH_PRIORITY, PR_PacketReliability:reliability = PR_RELIABLE_ORDERED, orderingchannel = 0)
877
+ {
878
+ #if defined foreach
879
+ foreach (new i : Player) {
880
+ #else
881
+ for (new i = GetPlayerPoolSize(); i >= 0; i--) {
882
+ #endif
883
+ if (!IsPlayerStreamedIn(i, playerid)) {
884
+ continue;
885
+ }
886
+ PR_SendPacket(bs, i, priority, reliability, orderingchannel);
887
+ }
888
+ }
889
+ stock PR_SendRPCToPlayerStream(BitStream:bs, playerid, rpcid, PR_PacketPriority:priority = PR_HIGH_PRIORITY, PR_PacketReliability:reliability = PR_RELIABLE_ORDERED, orderingchannel = 0)
890
+ {
891
+ #if defined foreach
892
+ foreach (new i : Player) {
893
+ #else
894
+ for (new i = GetPlayerPoolSize(); i >= 0; i--) {
895
+ #endif
896
+ if (!IsPlayerStreamedIn(i, playerid)) {
897
+ continue;
898
+ }
899
+ PR_SendRPC(bs, i, rpcid, priority, reliability, orderingchannel);
900
+ }
901
+ }
902
+ stock PR_SendPacketToVehicleStream(BitStream:bs, vehicleid, excludedplayerid = INVALID_PLAYER_ID, PR_PacketPriority:priority = PR_HIGH_PRIORITY, PR_PacketReliability:reliability = PR_RELIABLE_ORDERED, orderingchannel = 0)
903
+ {
904
+ #if defined foreach
905
+ foreach (new i : Player) {
906
+ #else
907
+ for (new i = GetPlayerPoolSize(); i >= 0; i--) {
908
+ #endif
909
+ if (i == excludedplayerid || !IsVehicleStreamedIn(vehicleid, i)) {
910
+ continue;
911
+ }
912
+ PR_SendPacket(bs, i, priority, reliability, orderingchannel);
913
+ }
914
+ }
915
+ stock PR_SendRPCToVehicleStream(BitStream:bs, vehicleid, rpcid, excludedplayerid = INVALID_PLAYER_ID, PR_PacketPriority:priority = PR_HIGH_PRIORITY, PR_PacketReliability:reliability = PR_RELIABLE_ORDERED, orderingchannel = 0)
916
+ {
917
+ #if defined foreach
918
+ foreach (new i : Player) {
919
+ #else
920
+ for (new i = GetPlayerPoolSize(); i >= 0; i--) {
921
+ #endif
922
+ if (i == excludedplayerid || !IsVehicleStreamedIn(vehicleid, i)) {
923
+ continue;
924
+ }
925
+ PR_SendRPC(bs, i, rpcid, priority, reliability, orderingchannel);
926
+ }
927
+ }
928
+ forward OnIncomingPacket(playerid, packetid, BitStream:bs);
929
+ forward OnIncomingRPC(playerid, rpcid, BitStream:bs);
930
+ forward OnOutgoingPacket(playerid, packetid, BitStream:bs);
931
+ forward OnOutgoingRPC(playerid, rpcid, BitStream:bs);
932
+ #pragma deprecated Use OnOutgoingPacket instead
933
+ forward OnOutcomingPacket(playerid, packetid, BitStream:bs);
934
+ #pragma deprecated Use OnOutgoingRPC instead
935
+ forward OnOutcomingRPC(playerid, rpcid, BitStream:bs);
936
+ #if defined FILTERSCRIPT
937
+ public OnFilterScriptInit()
938
+ {
939
+ PR_Init();
940
+ #if defined PawnRakNet_OnFilterScriptInit
941
+ PawnRakNet_OnFilterScriptInit();
942
+ #endif
943
+ return 1;
944
+ }
945
+ #if defined _ALS_OnFilterScriptInit
946
+ #undef OnFilterScriptInit
947
+ #else
948
+ #define _ALS_OnFilterScriptInit
949
+ #endif
950
+ #define OnFilterScriptInit PawnRakNet_OnFilterScriptInit
951
+ #if defined PawnRakNet_OnFilterScriptInit
952
+ forward PawnRakNet_OnFilterScriptInit();
953
+ #endif
954
+ #else
955
+ public OnGameModeInit()
956
+ {
957
+ PR_Init();
958
+ #if defined PawnRakNet_OnGameModeInit
959
+ PawnRakNet_OnGameModeInit();
960
+ #endif
961
+ return 1;
962
+ }
963
+ #if defined _ALS_OnGameModeInit
964
+ #undef OnGameModeInit
965
+ #else
966
+ #define _ALS_OnGameModeInit
967
+ #endif
968
+ #define OnGameModeInit PawnRakNet_OnGameModeInit
969
+ #if defined PawnRakNet_OnGameModeInit
970
+ forward PawnRakNet_OnGameModeInit();
971
+ #endif
972
+ #endif
973
+ #endif
974
+ #endif
Pawn.Regex.inc ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if !defined PAWNREGEX_INC_
2
+ #define PAWNREGEX_INC_
3
+ #define _pawnregex_included
4
+ #if !defined PACK_PLUGIN_VERSION
5
+ #define PACK_PLUGIN_VERSION(%0,%1,%2) (((%0) << 16) | ((%1) << 8) | (%2))
6
+ #endif
7
+ #define PAWNREGEX_VERSION PACK_PLUGIN_VERSION(1, 2, 3)
8
+ #define PAWNREGEX_INCLUDE_VERSION PAWNREGEX_VERSION
9
+ enum E_REGEX_GRAMMAR
10
+ {
11
+ REGEX_ECMASCRIPT,
12
+ REGEX_BASIC,
13
+ REGEX_EXTENDED,
14
+ REGEX_AWK,
15
+ REGEX_GREP,
16
+ REGEX_EGREP
17
+ };
18
+ enum E_REGEX_FLAG
19
+ {
20
+ REGEX_DEFAULT = 1 << 0,
21
+ REGEX_ICASE = 1 << 1,
22
+ REGEX_NOSUBS = 1 << 2,
23
+ REGEX_OPTIMIZE = 1 << 3,
24
+ REGEX_COLLATE = 1 << 4,
25
+ };
26
+ enum E_MATCH_FLAG
27
+ {
28
+ MATCH_DEFAULT = 1 << 0,
29
+ MATCH_NOT_BOL = 1 << 1,
30
+ MATCH_NOT_EOL = 1 << 2,
31
+ MATCH_NOT_BOW = 1 << 3,
32
+ MATCH_NOT_EOW = 1 << 4,
33
+ MATCH_ANY = 1 << 5,
34
+ MATCH_NOT_NULL = 1 << 6,
35
+ MATCH_CONTINUOUS = 1 << 7,
36
+ MATCH_PREV_AVAIL = 1 << 8,
37
+ MATCH_FORMAT_SED = 1 << 9,
38
+ MATCH_FORMAT_NO_COPY = 1 << 10,
39
+ MATCH_FORMAT_FIRST_ONLY = 1 << 11,
40
+ };
41
+ #if !defined __cplusplus
42
+ public _pawnregex_version = PAWNREGEX_VERSION;
43
+ #pragma unused _pawnregex_version
44
+ native Regex:Regex_New(const pattern[], E_REGEX_FLAG:flags = REGEX_DEFAULT, E_REGEX_GRAMMAR:grammar = REGEX_ECMASCRIPT);
45
+ native Regex_Delete(&Regex:r);
46
+ native Regex_Check(const str[], Regex:r, E_MATCH_FLAG:flags = MATCH_DEFAULT);
47
+ native Regex_Match(const str[], Regex:r, &RegexMatch:m, E_MATCH_FLAG:flags = MATCH_DEFAULT);
48
+ native Regex_Search(const str[], Regex:r, &RegexMatch:m, &pos, startpos = 0, E_MATCH_FLAG:flags = MATCH_DEFAULT);
49
+ native Regex_Replace(const str[], Regex:r, const fmt[], dest[], E_MATCH_FLAG:flags = MATCH_DEFAULT, size = sizeof dest);
50
+ native Match_GetGroup(RegexMatch:m, index, dest[], &length, size = sizeof dest);
51
+ native Match_Free(&RegexMatch:m);
52
+ #pragma deprecated Use Regex_New instead
53
+ native regex:regex_new(const pattern[], E_REGEX_FLAG:flags = REGEX_DEFAULT, E_REGEX_GRAMMAR:grammar = REGEX_ECMASCRIPT) = Regex_New;
54
+ #pragma deprecated Use Regex_Delete instead
55
+ native regex_delete(&regex:r) = Regex_Delete;
56
+ #pragma deprecated Use Regex_Check instead
57
+ native regex_check(const str[], regex:r, E_MATCH_FLAG:flags = MATCH_DEFAULT) = Regex_Check;
58
+ #pragma deprecated Use Regex_Match instead
59
+ native regex_match(const str[], regex:r, &match_results:m, E_MATCH_FLAG:flags = MATCH_DEFAULT) = Regex_Match;
60
+ #pragma deprecated Use Regex_Search instead
61
+ native regex_search(const str[], regex:r, &match_results:m, &pos, startpos = 0, E_MATCH_FLAG:flags = MATCH_DEFAULT) = Regex_Search;
62
+ #pragma deprecated Use Regex_Replace instead
63
+ native regex_replace(const str[], regex:r, const fmt[], dest[], E_MATCH_FLAG:flags = MATCH_DEFAULT, size = sizeof dest) = Regex_Replace;
64
+ #pragma deprecated Use Match_GetGroup instead
65
+ native match_get_group(match_results:m, index, dest[], &length, size = sizeof dest) = Match_GetGroup;
66
+ #pragma deprecated Use Match_Free instead
67
+ native match_free(&match_results:m) = Match_Free;
68
+ #endif
69
+ #endif
_fixes_options.inc ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if !_FIXES_NEW_COMPILER
2
+ #endinput
3
+ #endif
4
+ #if !FIXES_ExplicitOptions
5
+ #endinput
6
+ #endif
7
+ #if defined _inc__fixes_options
8
+ #undef _inc__fixes_options
9
+ #endif
10
+ #if defined _FIXES_OPTION
11
+ #undef _FIXES_OPTION
12
+ #define _FIXES_OPTION stock
13
+ #endif
14
+ #if !defined _FIXES_WARNING
15
+ #error `_fixes_options.inc` included, but `_FIXES_WARNING` is not defined to select a warning message.
16
+ #endif
17
+ #pragma warning push
18
+ #pragma warning enable 237
19
+ #if _FIXES_WARNING == 1
20
+ #warning Option `FIX_API` must now be explicit.
21
+ #elseif _FIXES_WARNING == 2
22
+ #warning Option `FIX_Natives` must now be explicit.
23
+ #elseif _FIXES_WARNING == 3
24
+ #warning Option `FIX_GetPlayerColour` must now be explicit.
25
+ #elseif _FIXES_WARNING == 4
26
+ #warning Option `FIX_FILTERSCRIPT` must now be explicit.
27
+ #elseif _FIXES_WARNING == 5
28
+ #warning Option `FIX_SpawnPlayer` must now be explicit.
29
+ #elseif _FIXES_WARNING == 6
30
+ #warning Option `FIX_SetPlayerName` must now be explicit.
31
+ #elseif _FIXES_WARNING == 7
32
+ #warning Option `FIX_GetPlayerSkin` must now be explicit.
33
+ #elseif _FIXES_WARNING == 8
34
+ #warning Option `FIX_GetWeaponName` must now be explicit.
35
+ #elseif _FIXES_WARNING == 9
36
+ #warning Option `FIX_SetPlayerWorldBounds` must now be explicit.
37
+ #elseif _FIXES_WARNING == 10
38
+ #warning Option `FIX_TogglePlayerControllable` must now be explicit.
39
+ #elseif _FIXES_WARNING == 11
40
+ #warning Option `FIX_HydraSniper` must now be explicit.
41
+ #elseif _FIXES_WARNING == 12
42
+ #warning Option `FIX_IsPlayerInCheckpoint` must now be explicit.
43
+ #elseif _FIXES_WARNING == 13
44
+ #warning Option `FIX_IsPlayerInRaceCheckpoint` must now be explicit.
45
+ #elseif _FIXES_WARNING == 14
46
+ #warning Option `FIX_GetPlayerWeapon` must now be explicit.
47
+ #elseif _FIXES_WARNING == 15
48
+ #warning Option `FIX_PutPlayerInVehicle` must now be explicit.
49
+ #elseif _FIXES_WARNING == 16
50
+ #warning Option `FIX_KEY_AIM` must now be explicit.
51
+ #elseif _FIXES_WARNING == 17
52
+ #warning Option `FIX_SPECIAL_ACTION_PISSING` must now be explicit.
53
+ #elseif _FIXES_WARNING == 18
54
+ #warning Option `FIX_IsValidVehicle` must now be explicit.
55
+ #elseif _FIXES_WARNING == 19
56
+ #warning Option `FIX_GetGravity` must now be explicit.
57
+ #elseif _FIXES_WARNING == 20
58
+ #warning Option `FIX_gpci` must now be explicit.
59
+ #elseif _FIXES_WARNING == 21
60
+ #warning Option `FIX_WEAPONS` must now be explicit.
61
+ #elseif _FIXES_WARNING == 22
62
+ #warning Option `FIX_BODYPARTS` must now be explicit.
63
+ #elseif _FIXES_WARNING == 23
64
+ #warning Option `FIX_CAMERAMODES` must now be explicit.
65
+ #elseif _FIXES_WARNING == 24
66
+ #warning Option `FIX_DriveBy` must now be explicit.
67
+ #elseif _FIXES_WARNING == 25
68
+ #warning Option `FIX_SilentTeleport` must now be explicit.
69
+ #elseif _FIXES_WARNING == 26
70
+ #warning Option `FIX_SetPlayerCheckpoint` must now be explicit.
71
+ #elseif _FIXES_WARNING == 27
72
+ #warning Option `FIX_SetPlayerRaceCheckpoint` must now be explicit.
73
+ #elseif _FIXES_WARNING == 28
74
+ #warning Option `FIX_TextDrawCreate` must now be explicit.
75
+ #elseif _FIXES_WARNING == 29
76
+ #warning Option `FIX_AttachTrailerToVehicle` must now be explicit.
77
+ #elseif _FIXES_WARNING == 30
78
+ #warning Option `FIX_GetVehicleComponentInSlot` must now be explicit.
79
+ #elseif _FIXES_WARNING == 31
80
+ #warning Option `FIX_TextDrawCreate_2` must now be explicit.
81
+ #elseif _FIXES_WARNING == 32
82
+ #warning Option `FIX_TextDrawSetString` must now be explicit.
83
+ #elseif _FIXES_WARNING == 33
84
+ #warning Option `FIX_TextDrawSetString_2` must now be explicit.
85
+ #elseif _FIXES_WARNING == 34
86
+ #warning Option `FIX_AllowInteriorWeapons` must now be explicit.
87
+ #elseif _FIXES_WARNING == 35
88
+ #warning Option `FIX_OnPlayerEnterVehicle` must now be explicit.
89
+ #elseif _FIXES_WARNING == 36
90
+ #warning Option `FIX_OnPlayerEnterVehicle_2` must now be explicit.
91
+ #elseif _FIXES_WARNING == 37
92
+ #warning Option `FIX_OnPlayerEnterVehicle_3` must now be explicit.
93
+ #elseif _FIXES_WARNING == 38
94
+ #warning Option `FIX_AllowTeleport` must now be explicit.
95
+ #elseif _FIXES_WARNING == 39
96
+ #warning Option `FIX_SetPlayerSpecialAction` must now be explicit.
97
+ #elseif _FIXES_WARNING == 40
98
+ #warning Option `FIX_ClearAnimations` must now be explicit.
99
+ #elseif _FIXES_WARNING == 41
100
+ #warning Option `FIX_ClearAnimations_2` must now be explicit.
101
+ #elseif _FIXES_WARNING == 42
102
+ #warning Option `FIX_GangZoneCreate` must now be explicit.
103
+ #elseif _FIXES_WARNING == 43
104
+ #warning Option `FIX_OnDialogResponse` must now be explicit.
105
+ #elseif _FIXES_WARNING == 44
106
+ #warning Option `FIX_GetPlayerDialog` must now be explicit.
107
+ #elseif _FIXES_WARNING == 45
108
+ #warning Option `FIX_PlayerDialogResponse` must now be explicit.
109
+ #elseif _FIXES_WARNING == 46
110
+ #warning Option `FIX_SetSpawnInfo` must now be explicit.
111
+ #elseif _FIXES_WARNING == 47
112
+ #warning Option `FIX_SetSpawnInfo_2` must now be explicit.
113
+ #elseif _FIXES_WARNING == 48
114
+ #warning Option `FIX_SetPlayerSkin` must now be explicit.
115
+ #elseif _FIXES_WARNING == 49
116
+ #warning Option `FIX_valstr` must now be explicit.
117
+ #elseif _FIXES_WARNING == 50
118
+ #warning Option `FIX_file_inc` must now be explicit.
119
+ #elseif _FIXES_WARNING == 51
120
+ #warning Option `FIX_SetPlayerAttachedObject` must now be explicit.
121
+ #elseif _FIXES_WARNING == 52
122
+ #warning Option `FIX_OnPlayerDeath` must now be explicit.
123
+ #elseif _FIXES_WARNING == 53
124
+ #warning Option `FIX_strins` must now be explicit.
125
+ #elseif _FIXES_WARNING == 54
126
+ #warning Option `FIX_IsPlayerConnected` must now be explicit.
127
+ #elseif _FIXES_WARNING == 55
128
+ #warning Option `FIX_TrainExit` must now be explicit.
129
+ #elseif _FIXES_WARNING == 56
130
+ #warning Option `FIX_Kick` must now be explicit.
131
+ #elseif _FIXES_WARNING == 57
132
+ #warning Option `FIX_OnVehicleMod` must now be explicit.
133
+ #elseif _FIXES_WARNING == 58
134
+ #warning Option `FIX_random` must now be explicit.
135
+ #elseif _FIXES_WARNING == 59
136
+ #warning Option `FIX_sleep` must now be explicit.
137
+ #elseif _FIXES_WARNING == 60
138
+ #warning Option `FIX_Menus` must now be explicit.
139
+ #elseif _FIXES_WARNING == 61
140
+ #warning Option `FIX_AddMenuItem` must now be explicit.
141
+ #elseif _FIXES_WARNING == 62
142
+ #warning Option `FIX_SetMenuColumnHeader` must now be explicit.
143
+ #elseif _FIXES_WARNING == 63
144
+ #warning Option `FIX_ShowMenuForPlayer` must now be explicit.
145
+ #elseif _FIXES_WARNING == 64
146
+ #warning Option `FIX_HideMenuForPlayer` must now be explicit.
147
+ #elseif _FIXES_WARNING == 65
148
+ #warning Option `FIX_GetPlayerMenu` must now be explicit.
149
+ #elseif _FIXES_WARNING == 66
150
+ #warning Option `FIX_HideMenuForPlayer_2` must now be explicit.
151
+ #elseif _FIXES_WARNING == 67
152
+ #warning Option `FIX_DisableMenu` must now be explicit.
153
+ #elseif _FIXES_WARNING == 68
154
+ #warning Option `FIX_DisableMenuRow` must now be explicit.
155
+ #elseif _FIXES_WARNING == 69
156
+ #warning Option `FIX_GetPlayerInterior` must now be explicit.
157
+ #elseif _FIXES_WARNING == 70
158
+ #warning Option `FIX_ApplyAnimation` must now be explicit.
159
+ #elseif _FIXES_WARNING == 71
160
+ #warning Option `FIX_ApplyAnimation_2` must now be explicit.
161
+ #elseif _FIXES_WARNING == 72
162
+ #warning Option `FIX_ApplyActorAnimation` must now be explicit.
163
+ #elseif _FIXES_WARNING == 73
164
+ #warning Option `FIX_ApplyActorAnimation_2` must now be explicit.
165
+ #elseif _FIXES_WARNING == 74
166
+ #warning Option `FIX_OnPlayerSpawn` must now be explicit.
167
+ #elseif _FIXES_WARNING == 75
168
+ #warning Option `FIX_GameText` must now be explicit.
169
+ #elseif _FIXES_WARNING == 76
170
+ #warning Option `FIX_HideGameText` must now be explicit.
171
+ #elseif _FIXES_WARNING == 77
172
+ #warning Option `FIX_GetPlayerWorldBounds` must now be explicit.
173
+ #elseif _FIXES_WARNING == 78
174
+ #warning Option `FIX_ClearPlayerWorldBounds` must now be explicit.
175
+ #elseif _FIXES_WARNING == 79
176
+ #warning Option `FIX_GameTextStyles` must now be explicit.
177
+ #elseif _FIXES_WARNING == 80
178
+ #warning Option `FIX_OnPlayerConnect` must now be explicit.
179
+ #elseif _FIXES_WARNING == 81
180
+ #warning Option `FIX_OnPlayerDisconnect` must now be explicit.
181
+ #elseif _FIXES_WARNING == 82
182
+ #warning Option `FIX_CreatePlayerTextDraw` must now be explicit.
183
+ #elseif _FIXES_WARNING == 83
184
+ #warning Option `FIX_CreatePlayerTextDraw_2` must now be explicit.
185
+ #elseif _FIXES_WARNING == 84
186
+ #warning Option `FIX_PlayerTextDrawSetString` must now be explicit.
187
+ #elseif _FIXES_WARNING == 85
188
+ #warning Option `FIX_PlayerTextDrawSetString_2` must now be explicit.
189
+ #elseif _FIXES_WARNING == 86
190
+ #warning Option `FIX_SetPlayerCamera` must now be explicit.
191
+ #elseif _FIXES_WARNING == 87
192
+ #warning Option `FIX_SetPlayerTime` must now be explicit.
193
+ #elseif _FIXES_WARNING == 88
194
+ #warning Option `FIX_OnPlayerRequestClass` must now be explicit.
195
+ #elseif _FIXES_WARNING == 89
196
+ #warning Option `FIX_SetPlayerColour` must now be explicit.
197
+ #elseif _FIXES_WARNING == 90
198
+ #warning Option `FIX_FileMaths` must now be explicit.
199
+ #elseif _FIXES_WARNING == 91
200
+ #warning Option `FIX_GetPlayerWeaponData` must now be explicit.
201
+ #elseif _FIXES_WARNING == 92
202
+ #warning Option `FIX_strcmp` must now be explicit.
203
+ #elseif _FIXES_WARNING == 93
204
+ #warning Option `FIX_GetPVarString` must now be explicit.
205
+ #elseif _FIXES_WARNING == 94
206
+ #warning Option `FIX_GetSVarString` must now be explicit.
207
+ #elseif _FIXES_WARNING == 95
208
+ #warning Option `FIX_toupper` must now be explicit.
209
+ #elseif _FIXES_WARNING == 96
210
+ #warning Option `FIX_tolower` must now be explicit.
211
+ #elseif _FIXES_WARNING == 97
212
+ #warning Option `FIX_ispacked` must now be explicit.
213
+ #elseif _FIXES_WARNING == 98
214
+ #warning Option `FIX_PassengerSeating` must now be explicit.
215
+ #elseif _FIXES_WARNING == 99
216
+ #warning Option `FIX_GogglesSync` must now be explicit.
217
+ #elseif _FIXES_WARNING == 100
218
+ #warning Option `FIX_GetPlayerPoolSize` must now be explicit.
219
+ #elseif _FIXES_WARNING == 101
220
+ #warning Option `FIX_SetPlayerPos` must now be explicit.
221
+ #elseif _FIXES_WARNING == 102
222
+ #warning Option `FIX_GetPlayerAmmo` must now be explicit.
223
+ #elseif _FIXES_WARNING == 103
224
+ #warning Option `FIX_JIT` must now be explicit.
225
+ #elseif _FIXES_WARNING == 104
226
+ #warning Option `FIX_OS` must now be explicit.
227
+ #elseif _FIXES_WARNING == 105
228
+ #warning Option `FIX_const` must now be explicit.
229
+ #elseif _FIXES_WARNING == 106
230
+ #warning Option `FIX_VEHICLES` must now be explicit.
231
+ #elseif _FIXES_WARNING == 107
232
+ #warning Option `FIX_GetPlayerWeather` must now be explicit.
233
+ #elseif _FIXES_WARNING == 108
234
+ #warning Option `FIX_GetWeather` must now be explicit.
235
+ #elseif _FIXES_WARNING == 109
236
+ #warning Option `FIX_GetWorldTime` must now be explicit.
237
+ #elseif _FIXES_WARNING == 110
238
+ #warning Option `FIX_GetConsoleVarAsString` must now be explicit.
239
+ #elseif _FIXES_WARNING == 111
240
+ #warning Option `FIX_GetConsoleVarAsInt` must now be explicit.
241
+ #elseif _FIXES_WARNING == 112
242
+ #warning Option `FIX_GetConsoleVarAsBool` must now be explicit.
243
+ #elseif _FIXES_WARNING == 113
244
+ #warning Option `FIX_GetConsoleVarAsFloat` must now be explicit.
245
+ #elseif _FIXES_WARNING == 114
246
+ #warning Option `FIX_tabsize` must now be explicit.
247
+ #elseif _FIXES_WARNING == 115
248
+ #warning Option `FIX_Callbacks` must now be explicit.
249
+ #elseif _FIXES_WARNING == 116
250
+ #warning Option `FIX_OnRconCommand` must now be explicit.
251
+ #elseif _FIXES_WARNING == 117
252
+ #warning Option `FIX_OnClientCheckResponse` must now be explicit.
253
+ #elseif _FIXES_WARNING == 118
254
+ #warning Option `FIX_GetMaxPlayers` must now be explicit.
255
+ #elseif _FIXES_WARNING == 119
256
+ #warning Option `FIX_BypassDialog` must now be explicit.
257
+ #elseif _FIXES_WARNING == 120
258
+ #warning Option `FIX_SetTimer` must now be explicit.
259
+ #elseif _FIXES_WARNING == 121
260
+ #warning Option `FIX_main` must now be explicit.
261
+ #elseif _FIXES_WARNING == 122
262
+ #warning Option `FIX_Pawndoc` must now be explicit.
263
+ #elseif _FIXES_WARNING == 123
264
+ #warning Option `FIX_OnVehicleSpawn` must now be explicit.
265
+ #elseif _FIXES_WARNING == 124
266
+ #warning Option `FIX_floatfract` must now be explicit.
267
+ #elseif _FIXES_WARNING == 125
268
+ #warning Option `FIX_strfind` must now be explicit.
269
+ #elseif _FIXES_WARNING == 126
270
+ #warning Option `FIX_strdel` must now be explicit.
271
+ #elseif _FIXES_WARNING == 127
272
+ #warning Option `FIX_LocalNPCNatives` must now be explicit.
273
+ #elseif _FIXES_WARNING == 128
274
+ #warning Option `FIX_RemoteNPCNatives` must now be explicit.
275
+ #elseif _FIXES_WARNING == 129
276
+ #warning Option `FIX_deconst` must now be explicit.
277
+ #elseif _FIXES_WARNING == 130
278
+ #warning Option `FIX_Streamer_HasIntData` must now be explicit.
279
+ #elseif _FIXES_WARNING == 131
280
+ #warning Option `FIX_Streamer_RemoveIntData` must now be explicit.
281
+ #elseif _FIXES_WARNING == 132
282
+ #warning Option `FIX_defaults` must now be explicit.
283
+ #elseif _FIXES_WARNING == 133
284
+ #warning Option `FIX_limit_tags` must now be explicit.
285
+ #elseif _FIXES_WARNING == 134
286
+ #warning Option `FIX_bool_tags` must now be explicit.
287
+ #elseif _FIXES_WARNING == 135
288
+ #warning Option `FIX_TEXT_DRAW_ALIGN` must now be explicit.
289
+ #elseif _FIXES_WARNING == 136
290
+ #warning Option `FIX_TEXT_DRAW_FONT` must now be explicit.
291
+ #elseif _FIXES_WARNING == 137
292
+ #warning Option `FIX_GetPlayerKeys` must now be explicit.
293
+ #elseif _FIXES_WARNING == 138
294
+ #warning Option `FIX_FORCE_SYNC` must now be explicit.
295
+ #elseif _FIXES_WARNING == 139
296
+ #warning Option `FIX_address_naught` must now be explicit.
297
+ #elseif _FIXES_WARNING == 140
298
+ #warning Option `FIX_main2` must now be explicit.
299
+ #elseif _FIXES_WARNING == 141
300
+ #warning Option `FIX_npcmodes` must now be explicit.
301
+ #elseif _FIXES_WARNING == 142
302
+ #warning Option `FIX_fgetchar2` must now be explicit.
303
+ #elseif _FIXES_WARNING == 143
304
+ #warning Option `FIX_memcpy` must now be explicit.
305
+ #elseif _FIXES_WARNING == 144
306
+ #warning Option `FIX_SHA256` must now be explicit.
307
+ #else
308
+ #error `_fixes_options.inc` included, but `_FIXES_WARNING` is not set to a valid warning message.
309
+ #endif
310
+ #pragma warning pop
_fixes_settings.inc ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if !_FIXES_NEW_COMPILER
2
+ #endinput
3
+ #endif
4
+ #if !FIXES_ExplicitSettings
5
+ #endinput
6
+ #endif
7
+ #if defined _inc__fixes_settings
8
+ #undef _inc__fixes_settings
9
+ #endif
10
+ #if defined _FIXES_SETTING
11
+ #undef _FIXES_SETTING
12
+ #define _FIXES_SETTING stock
13
+ #endif
14
+ #if !defined _FIXES_WARNING
15
+ #error `_fixes_settings.inc` included, but `_FIXES_WARNING` is not defined to select a warning message.
16
+ #endif
17
+ #pragma warning push
18
+ #pragma warning enable 237
19
+ #if _FIXES_WARNING == 1
20
+ #warning Setting `FIXES_ExplicitSettings`, to make all settings explicit, must now be explicit.
21
+ #elseif _FIXES_WARNING == 2
22
+ #warning Setting `FIXES_EnableAll`, to enable all fixes, must now be explicit.
23
+ #elseif _FIXES_WARNING == 3
24
+ #warning Setting `FIXES_EnableDeprecated`, to enable fixes for fixed bugs, must now be explicit.
25
+ #elseif _FIXES_WARNING == 4
26
+ #warning Setting `FIXES_DefaultDisabled`, to disable all fixes by default, must now be explicit.
27
+ #elseif _FIXES_WARNING == 5
28
+ #warning Setting `FIXES_ExplicitOptions`, to make all fixes explicit, must now be explicit.
29
+ #elseif _FIXES_WARNING == 6
30
+ #warning Setting `FIXES_SilentKick`, to kick users without any message, must now be explicit.
31
+ #elseif _FIXES_WARNING == 7
32
+ #warning Setting `FIXES_Debug`, to enable debug mode, must now be explicit.
33
+ #elseif _FIXES_WARNING == 8
34
+ #warning Setting `FIXES_Single`, to enable single script mode, must now be explicit.
35
+ #elseif _FIXES_WARNING == 9
36
+ #warning Setting `FIXES_NoSingleMsg`, to disable the single mode warning message, must now be explicit.
37
+ #elseif _FIXES_WARNING == 10
38
+ #warning Setting `FIXES_NoServerVarMsg`, to disable the config access warning message, must now be explicit.
39
+ #elseif _FIXES_WARNING == 11
40
+ #warning Setting `FIXES_NoGetMaxPlayersMsg`, to disable the `MAX_PLAYERS` warning message, must now be explicit.
41
+ #elseif _FIXES_WARNING == 12
42
+ #warning Setting `FIXES_NoPawndoc`, to disable all fixes.inc pawndoc output, must now be explicit.
43
+ #elseif _FIXES_WARNING == 13
44
+ #warning Setting `FIXES_CorrectInvalidTimerID`, to specify that you know invalid timers are `0`, must now be explicit.
45
+ #elseif _FIXES_WARNING == 14
46
+ #warning Setting `FIXES_NoYSI`, to optimise the code when YSI isn't used, must now be explicit.
47
+ #elseif _FIXES_WARNING == 15
48
+ #warning Setting `FIXES_OneRandomVehicleColour`, to allow only one random vehicle colour, must now be explicit.
49
+ #elseif _FIXES_WARNING == 16
50
+ #warning Setting `FIXES_NoVehicleColourMsg`, to disable the vehicle colours warning, must now be explicit.
51
+ #elseif _FIXES_WARNING == 17
52
+ #warning Setting `FIXES_CountFilterscripts`, to count loaded filterscripts, must now be explicit.
53
+ #elseif _FIXES_WARNING == 18
54
+ #warning Setting `FIXES_NoFilterscriptsMsg`, to hide the filterscripts error information, must now be explicit.
55
+ #else
56
+ #error `_fixes_settings.inc` included, but `_FIXES_WARNING` is not set to a valid warning message.
57
+ #endif
58
+ #pragma warning pop
a_actor.inc ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _INC_a_actor
2
+ #endinput
3
+ #endif
4
+ #define _INC_a_actor
5
+ #define _actor_included
6
+ #define SAMP_CONST_CORRECT
7
+ #pragma tabsize 4
8
+ native CreateActor(modelid, Float:X, Float:Y, Float:Z, Float:Rotation);
9
+ native DestroyActor(actorid);
10
+ native IsActorStreamedIn(actorid, forplayerid);
11
+ native SetActorVirtualWorld(actorid, vworld);
12
+ native GetActorVirtualWorld(actorid);
13
+ native ApplyActorAnimation(actorid, const animlib[], const animname[], Float:fDelta, loop, lockx, locky, freeze, time);
14
+ native ClearActorAnimations(actorid);
15
+ native SetActorPos(actorid, Float:X, Float:Y, Float:Z);
16
+ native GetActorPos(actorid, &Float:X, &Float:Y, &Float:Z);
17
+ native SetActorFacingAngle(actorid, Float:ang);
18
+ native GetActorFacingAngle(actorid, &Float:ang);
19
+ native SetActorHealth(actorid, Float:health);
20
+ native GetActorHealth(actorid, &Float:health);
21
+ native SetActorInvulnerable(actorid, invulnerable = true);
22
+ native IsActorInvulnerable(actorid);
23
+ native IsValidActor(actorid);
a_http.inc ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _INC_a_http
2
+ #endinput
3
+ #endif
4
+ #define _INC_a_http
5
+ #define SAMP_CONST_CORRECT
6
+ #pragma tabsize 4
7
+ #define HTTP_GET (1)
8
+ #define HTTP_POST (2)
9
+ #define HTTP_HEAD (3)
10
+ #define HTTP_ERROR_BAD_HOST (1)
11
+ #define HTTP_ERROR_NO_SOCKET (2)
12
+ #define HTTP_ERROR_CANT_CONNECT (3)
13
+ #define HTTP_ERROR_CANT_WRITE (4)
14
+ #define HTTP_ERROR_CONTENT_TOO_BIG (5)
15
+ #define HTTP_ERROR_MALFORMED_RESPONSE (6)
16
+ native HTTP(index, type, const url[], const data[], const callback[]);
a_mysql.inc ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined mysql_included
2
+ #endinput
3
+ #endif
4
+ #define mysql_included
5
+ #define ER_DBACCESS_DENIED_ERROR 1044
6
+ #define ER_ACCESS_DENIED_ERROR 1045
7
+ #define ER_UNKNOWN_TABLE 1109
8
+ #define ER_SYNTAX_ERROR 1149
9
+ #define CR_SERVER_GONE_ERROR 2006
10
+ #define CR_SERVER_LOST 2013
11
+ #define CR_COMMAND_OUT_OF_SYNC 2014
12
+ #define CR_SERVER_LOST_EXTENDED 2055
13
+ #if !defined E_LOGLEVEL
14
+ enum E_LOGLEVEL
15
+ {
16
+ NONE = 0,
17
+ DEBUG = 1,
18
+ INFO = 2,
19
+ WARNING = 4,
20
+ ERROR = 8,
21
+ ALL = ERROR | WARNING | INFO | DEBUG
22
+ };
23
+ #endif
24
+ enum E_ORM_ERROR
25
+ {
26
+ ERROR_INVALID,
27
+ ERROR_OK,
28
+ ERROR_NO_DATA
29
+ };
30
+ enum E_MYSQL_GLOBAL_OPTION
31
+ {
32
+ DUPLICATE_CONNECTIONS,
33
+ DUPLICATE_CONNECTION_WARNING
34
+ };
35
+ enum E_MYSQL_OPTION
36
+ {
37
+ AUTO_RECONNECT,
38
+ MULTI_STATEMENTS,
39
+ POOL_SIZE,
40
+ SERVER_PORT,
41
+ SSL_ENABLE,
42
+ SSL_KEY_FILE,
43
+ SSL_CERT_FILE,
44
+ SSL_CA_FILE,
45
+ SSL_CA_PATH,
46
+ SSL_CIPHER
47
+ };
48
+ enum E_MYSQL_FIELD_TYPE
49
+ {
50
+ MYSQL_TYPE_INVALID = -1,
51
+ MYSQL_TYPE_DECIMAL = 0,
52
+ MYSQL_TYPE_TINY,
53
+ MYSQL_TYPE_SHORT,
54
+ MYSQL_TYPE_LONG,
55
+ MYSQL_TYPE_FLOAT,
56
+ MYSQL_TYPE_DOUBLE,
57
+ MYSQL_TYPE_NULL,
58
+ MYSQL_TYPE_TIMESTAMP,
59
+ MYSQL_TYPE_LONGLONG,
60
+ MYSQL_TYPE_INT24,
61
+ MYSQL_TYPE_DATE,
62
+ MYSQL_TYPE_TIME,
63
+ MYSQL_TYPE_DATETIME,
64
+ MYSQL_TYPE_YEAR,
65
+ MYSQL_TYPE_NEWDATE,
66
+ MYSQL_TYPE_VARCHAR,
67
+ MYSQL_TYPE_BIT,
68
+ MYSQL_TYPE_TIMESTAMP2,
69
+ MYSQL_TYPE_DATETIME2,
70
+ MYSQL_TYPE_TIME2,
71
+ MYSQL_TYPE_JSON = 245,
72
+ MYSQL_TYPE_NEWDECIMAL = 246,
73
+ MYSQL_TYPE_ENUM = 247,
74
+ MYSQL_TYPE_SET = 248,
75
+ MYSQL_TYPE_TINY_BLOB = 249,
76
+ MYSQL_TYPE_MEDIUM_BLOB = 250,
77
+ MYSQL_TYPE_LONG_BLOB = 251,
78
+ MYSQL_TYPE_BLOB = 252,
79
+ MYSQL_TYPE_VAR_STRING = 253,
80
+ MYSQL_TYPE_STRING = 254,
81
+ MYSQL_TYPE_GEOMETRY = 255
82
+ };
83
+ enum E_MYSQL_EXECTIME_UNIT
84
+ {
85
+ MILLISECONDS,
86
+ MICROSECONDS
87
+ };
88
+ #define MYSQL_DEFAULT_HANDLE MySQL:1
89
+ #define MYSQL_INVALID_HANDLE MySQL:0
90
+ #define MYSQL_INVALID_CACHE Cache:0
91
+ #define MYSQL_INVALID_ORM ORM:0
92
+ native ORM:orm_create(const table[], MySQL:handle = MYSQL_DEFAULT_HANDLE);
93
+ native orm_destroy(ORM:id);
94
+ native E_ORM_ERROR:orm_errno(ORM:id);
95
+ native orm_apply_cache(ORM:id, row_idx, result_idx = 0);
96
+ native orm_select(ORM:id, const callback[] = "", const format[] = "", {Float, _}:...);
97
+ native orm_update(ORM:id, const callback[] = "", const format[] = "", {Float, _}:...);
98
+ native orm_insert(ORM:id, const callback[] = "", const format[] = "", {Float, _}:...);
99
+ native orm_delete(ORM:id, const callback[] = "", const format[] = "", {Float, _}:...);
100
+ native orm_load(ORM:id, const callback[] = "", const format[] = "", {Float, _}:...) = orm_select;
101
+ native orm_save(ORM:id, const callback[] = "", const format[] = "", {Float, _}:...);
102
+ native orm_addvar_int(ORM:id, &var, const columnname[]);
103
+ native orm_addvar_float(ORM:id, &Float:var, const columnname[]);
104
+ native orm_addvar_string(ORM:id, var[], var_maxlen, const columnname[]);
105
+ native orm_clear_vars(ORM:id);
106
+ native orm_delvar(ORM:id, const columnname[]);
107
+ native orm_setkey(ORM:id, const columnname[]);
108
+ native mysql_log(E_LOGLEVEL:loglevel = ERROR | WARNING);
109
+ native MySQL:mysql_connect(const host[], const user[], const password[], const database[], MySQLOpt:option_id = MySQLOpt:0);
110
+ native MySQL:mysql_connect_file(const file_name[] = "mysql.ini");
111
+ native mysql_close(MySQL:handle = MYSQL_DEFAULT_HANDLE);
112
+ native mysql_unprocessed_queries(MySQL:handle = MYSQL_DEFAULT_HANDLE);
113
+ native mysql_global_options(E_MYSQL_GLOBAL_OPTION:type, value);
114
+ native MySQLOpt:mysql_init_options();
115
+ native mysql_set_option(MySQLOpt:option_id, E_MYSQL_OPTION:type, ...);
116
+ native mysql_pquery(MySQL:handle, const query[], const callback[] = "", const format[] = "", {Float,_}:...);
117
+ native mysql_tquery(MySQL:handle, const query[], const callback[] = "", const format[] = "", {Float,_}:...);
118
+ native Cache:mysql_query(MySQL:handle, const query[], bool:use_cache = true);
119
+ native mysql_tquery_file(MySQL:handle, const file_path[], const callback[] = "", const format[] = "", {Float,_}:...);
120
+ native Cache:mysql_query_file(MySQL:handle, const file_path[], bool:use_cache = false);
121
+ native mysql_errno(MySQL:handle = MYSQL_DEFAULT_HANDLE);
122
+ native mysql_error(destination[], max_len = sizeof(destination), MySQL:handle = MYSQL_DEFAULT_HANDLE);
123
+ native mysql_escape_string(const source[], destination[], max_len = sizeof(destination), MySQL:handle = MYSQL_DEFAULT_HANDLE);
124
+ native mysql_format(MySQL:handle, output[], max_len, const format[], {Float,_}:...);
125
+ native mysql_set_charset(const charset[], MySQL:handle = MYSQL_DEFAULT_HANDLE);
126
+ native mysql_get_charset(destination[], max_len = sizeof(destination), MySQL:handle = MYSQL_DEFAULT_HANDLE);
127
+ native mysql_stat(destination[], max_len = sizeof(destination), MySQL:handle = MYSQL_DEFAULT_HANDLE);
128
+ native cache_get_row_count(&destination);
129
+ native cache_get_field_count(&destination);
130
+ native cache_get_result_count(&destination);
131
+ native cache_get_field_name(field_index, destination[], max_len = sizeof(destination));
132
+ native E_MYSQL_FIELD_TYPE:cache_get_field_type(field_index);
133
+ native cache_set_result(result_index);
134
+ stock cache_num_rows()
135
+ {
136
+ new row_count;
137
+ cache_get_row_count(row_count);
138
+ return row_count;
139
+ }
140
+ stock cache_num_fields()
141
+ {
142
+ new field_count;
143
+ cache_get_field_count(field_count);
144
+ return field_count;
145
+ }
146
+ stock cache_num_results()
147
+ {
148
+ new result_count;
149
+ cache_get_result_count(result_count);
150
+ return result_count;
151
+ }
152
+ #define cache_get_value(%1) (_:MSCGV0:MSCGV1:MSCGV2:cache_get_ovrld_value(%1))
153
+ #define MSCGV0:MSCGV1:MSCGV2:cache_get_ovrld_value(%1,"%2",%3) cache_get_value_name(%1,#%2,%3)
154
+ #define MSCGV1:MSCGV2:cache_get_ovrld_value(%1,%8string%9:%2,%3) cache_get_value_name(%1,%2,%3)
155
+ #define MSCGV2:cache_get_ovrld_value(%1,%2,%3) cache_get_value_index(%1,%2,%3)
156
+ #define cache_get_value_int(%1) (_:MSCGVI0:MSCGVI1:MSCGVI2:cache_get_value_int_ovrld(%1))
157
+ #define MSCGVI0:MSCGVI1:MSCGVI2:cache_get_value_int_ovrld(%1,"%2",%3) cache_get_value_name_int(%1,#%2,%3)
158
+ #define MSCGVI1:MSCGVI2:cache_get_value_int_ovrld(%1,%8string%9:%2,%3) cache_get_value_name_int(%1,%2,%3)
159
+ #define MSCGVI2:cache_get_value_int_ovrld(%1,%2,%3) cache_get_value_index_int(%1,%2,%3)
160
+ #define cache_get_value_float(%1) (_:MSCGVF0:MSCGVF1:MSCGVF2:cache_get_value_float_ovrld(%1))
161
+ #define MSCGVF0:MSCGVF1:MSCGVF2:cache_get_value_float_ovrld(%1,"%2",%3) cache_get_value_name_float(%1,#%2,%3)
162
+ #define MSCGVF1:MSCGVF2:cache_get_value_float_ovrld(%1,%8string%9:%2,%3) cache_get_value_name_float(%1,%2,%3)
163
+ #define MSCGVF2:cache_get_value_float_ovrld(%1,%2,%3) cache_get_value_index_float(%1,%2,%3)
164
+ #define cache_get_value_bool(%1) cache_get_value_int(%1)
165
+ #define cache_is_value_null(%1) (_:MSCIVN0:MSCIVN1:MSCIVN2:cache_is_value_null_ovrld(%1))
166
+ #define MSCIVN0:MSCIVN1:MSCIVN2:cache_is_value_null_ovrld(%1,"%2",%3) cache_is_value_name_null(%1,#%2,%3)
167
+ #define MSCIVN1:MSCIVN2:cache_is_value_null_ovrld(%1,%8string%9:%2,%3) cache_is_value_name_null(%1,%2,%3)
168
+ #define MSCIVN2:cache_is_value_null_ovrld(%1,%2,%3) cache_is_value_index_null(%1,%2,%3)
169
+ native cache_get_value_index(row_idx, column_idx, destination[], max_len = sizeof(destination));
170
+ native cache_get_value_index_int(row_idx, column_idx, &destination);
171
+ native cache_get_value_index_float(row_idx, column_idx, &Float:destination);
172
+ stock cache_get_value_index_bool(row_idx, column_idx, &bool:destination)
173
+ {
174
+ return cache_get_value_index_int(row_idx, column_idx, _:destination);
175
+ }
176
+ native cache_is_value_index_null(row_idx, column_idx, &bool:destination);
177
+ native cache_get_value_name(row_idx, const column_name[], destination[], max_len = sizeof(destination));
178
+ native cache_get_value_name_int(row_idx, const column_name[], &destination);
179
+ native cache_get_value_name_float(row_idx, const column_name[], &Float:destination);
180
+ stock cache_get_value_name_bool(row_idx, const column_name[], &bool:destination)
181
+ {
182
+ return cache_get_value_name_int(row_idx, column_name, _:destination);
183
+ }
184
+ native cache_is_value_name_null(row_idx, const column_name[], &bool:destination);
185
+ native Cache:cache_save();
186
+ native cache_delete(Cache:cache_id);
187
+ native cache_set_active(Cache:cache_id);
188
+ native cache_unset_active();
189
+ native bool:cache_is_any_active();
190
+ native bool:cache_is_valid(Cache:cache_id);
191
+ native cache_affected_rows();
192
+ native cache_insert_id();
193
+ native cache_warning_count();
194
+ native cache_get_query_exec_time(E_MYSQL_EXECTIME_UNIT:unit = MICROSECONDS);
195
+ native cache_get_query_string(destination[], max_len = sizeof(destination));
196
+ forward OnQueryError(errorid, const error[], const callback[], const query[], MySQL:handle);
a_npc.inc ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _INC_a_npc
2
+ #endinput
3
+ #endif
4
+ #if defined _INC_a_samp
5
+ #error Include `<a_samp>` or `<a_npc>`, not both.
6
+ #endif
7
+ #define _INC_a_npc
8
+ #define _samp_included
9
+ #define SAMP_CONST_CORRECT
10
+ #pragma tabsize 4
11
+ #if !defined MAX_PLAYER_NAME
12
+ #define MAX_PLAYER_NAME (24)
13
+ #endif
14
+ #if !defined MAX_PLAYERS
15
+ #define MAX_PLAYERS (1000)
16
+ #endif
17
+ #if !defined MAX_VEHICLES
18
+ #define MAX_VEHICLES (2000)
19
+ #endif
20
+ #if !defined MAX_OBJECTS
21
+ #define MAX_OBJECTS (2000)
22
+ #endif
23
+ #if !defined MAX_GANG_ZONES
24
+ #define MAX_GANG_ZONES (1024)
25
+ #endif
26
+ #if !defined MAX_TEXT_DRAWS
27
+ #define MAX_TEXT_DRAWS (Text:2048)
28
+ #endif
29
+ #if !defined MAX_MENUS
30
+ #define MAX_MENUS (Menu:128)
31
+ #endif
32
+ #define NO_TEAM (255)
33
+ #define INVALID_PLAYER_ID (0xFFFF)
34
+ #define INVALID_VEHICLE_ID (0xFFFF)
35
+ #define INVALID_OBJECT_ID (0xFFFF)
36
+ #define INVALID_MENU (Menu:0xFF)
37
+ #define INVALID_TEXT_DRAW (Text:0xFFFF)
38
+ #define INVALID_GANG_ZONE (-1)
39
+ #define PLAYER_STATE_NONE (0)
40
+ #define PLAYER_STATE_ONFOOT (1)
41
+ #define PLAYER_STATE_DRIVER (2)
42
+ #define PLAYER_STATE_PASSENGER (3)
43
+ #define PLAYER_STATE_WASTED (7)
44
+ #define PLAYER_STATE_SPAWNED (8)
45
+ #define PLAYER_STATE_SPECTATING (9)
46
+ #define WEAPON_BRASSKNUCKLE (1)
47
+ #define WEAPON_GOLFCLUB (2)
48
+ #define WEAPON_NITESTICK (3)
49
+ #define WEAPON_KNIFE (4)
50
+ #define WEAPON_BAT (5)
51
+ #define WEAPON_SHOVEL (6)
52
+ #define WEAPON_POOLSTICK (7)
53
+ #define WEAPON_KATANA (8)
54
+ #define WEAPON_CHAINSAW (9)
55
+ #define WEAPON_DILDO (10)
56
+ #define WEAPON_DILDO2 (11)
57
+ #define WEAPON_VIBRATOR (12)
58
+ #define WEAPON_VIBRATOR2 (13)
59
+ #define WEAPON_FLOWER (14)
60
+ #define WEAPON_CANE (15)
61
+ #define WEAPON_GRENADE (16)
62
+ #define WEAPON_TEARGAS (17)
63
+ #define WEAPON_MOLTOV (18)
64
+ #define WEAPON_COLT45 (22)
65
+ #define WEAPON_SILENCED (23)
66
+ #define WEAPON_DEAGLE (24)
67
+ #define WEAPON_SHOTGUN (25)
68
+ #define WEAPON_SAWEDOFF (26)
69
+ #define WEAPON_SHOTGSPA (27)
70
+ #define WEAPON_UZI (28)
71
+ #define WEAPON_MP5 (29)
72
+ #define WEAPON_AK47 (30)
73
+ #define WEAPON_M4 (31)
74
+ #define WEAPON_TEC9 (32)
75
+ #define WEAPON_RIFLE (33)
76
+ #define WEAPON_SNIPER (34)
77
+ #define WEAPON_ROCKETLAUNCHER (35)
78
+ #define WEAPON_HEATSEEKER (36)
79
+ #define WEAPON_FLAMETHROWER (37)
80
+ #define WEAPON_MINIGUN (38)
81
+ #define WEAPON_SATCHEL (39)
82
+ #define WEAPON_BOMB (40)
83
+ #define WEAPON_SPRAYCAN (41)
84
+ #define WEAPON_FIREEXTINGUISHER (42)
85
+ #define WEAPON_CAMERA (43)
86
+ #define WEAPON_PARACHUTE (46)
87
+ #define WEAPON_VEHICLE (49)
88
+ #define WEAPON_DROWN (53)
89
+ #define WEAPON_COLLISION (54)
90
+ #define KEY_ACTION (1)
91
+ #define KEY_CROUCH (2)
92
+ #define KEY_FIRE (4)
93
+ #define KEY_SPRINT (8)
94
+ #define KEY_SECONDARY_ATTACK (16)
95
+ #define KEY_JUMP (32)
96
+ #define KEY_LOOK_RIGHT (64)
97
+ #define KEY_HANDBRAKE (128)
98
+ #define KEY_LOOK_LEFT (256)
99
+ #define KEY_SUBMISSION (512)
100
+ #define KEY_LOOK_BEHIND (512)
101
+ #define KEY_WALK (1024)
102
+ #define KEY_ANALOG_UP (2048)
103
+ #define KEY_ANALOG_DOWN (4096)
104
+ #define KEY_ANALOG_RIGHT (16384)
105
+ #define KEY_ANALOG_LEFT (8192)
106
+ #define KEY_UP (-128)
107
+ #define KEY_DOWN (128)
108
+ #define KEY_LEFT (-128)
109
+ #define KEY_RIGHT (128)
110
+ #define PLAYER_RECORDING_TYPE_NONE (0)
111
+ #define PLAYER_RECORDING_TYPE_DRIVER (1)
112
+ #define PLAYER_RECORDING_TYPE_ONFOOT (2)
113
+ #if MAX_PLAYER_NAME < 1 || MAX_PLAYER_NAME > 24
114
+ #error MAX_PLAYER_NAME must be >= 1 and <= 24
115
+ #endif
116
+ #if MAX_PLAYERS < 1 || MAX_PLAYERS > 1000
117
+ #error MAX_PLAYERS must be >= 1 and <= 1000
118
+ #endif
119
+ #if MAX_VEHICLES < 1 || MAX_VEHICLES > 2000
120
+ #error MAX_VEHICLES must be >= 1 and <= 2000
121
+ #endif
122
+ #if MAX_OBJECTS < 1 || MAX_OBJECTS > 2000
123
+ #error MAX_OBJECTS must be >= 1 and <= 2000
124
+ #endif
125
+ #if MAX_GANG_ZONES < 1 || MAX_GANG_ZONES > 1024
126
+ #error MAX_GANG_ZONES must be >= 1 and <= 1024
127
+ #endif
128
+ #if MAX_TEXT_DRAWS < Text:1 || MAX_TEXT_DRAWS > Text:2048
129
+ #error MAX_TEXT_DRAWS must be >= 1 and <= 2048
130
+ #endif
131
+ #if MAX_MENUS < Menu:1 || MAX_MENUS > Menu:128
132
+ #error MAX_MENUS must be >= 1 and <= 128
133
+ #endif
134
+ public const SAMP_INCLUDES_VERSION = 0x037030;
135
+ #include <core>
136
+ #include <float>
137
+ #include <string>
138
+ #include <file>
139
+ #include <time>
140
+ #include <datagram>
141
+ #tryinclude <console>
142
+ #if !defined _console_included
143
+ #define _console_included
144
+ native print(const string[]);
145
+ native printf(const format[], {Float,_}:...);
146
+ #endif
147
+ native format(output[], len = sizeof output, const format[], {Float,_}:...);
148
+ native SetTimer(const funcname[], interval, repeating);
149
+ native KillTimer(timerid);
150
+ native GetTickCount();
151
+ native Float:asin(Float:value);
152
+ native Float:acos(Float:value);
153
+ native Float:atan(Float:value);
154
+ native Float:atan2(Float:y, Float:x);
155
+ native SendChat(const msg[]);
156
+ native SendCommand(const commandtext[]);
157
+ native GetPlayerState(playerid);
158
+ native GetPlayerPos(playerid, &Float:x, &Float:y, &Float:z);
159
+ native GetPlayerVehicleID(playerid);
160
+ native GetPlayerArmedWeapon(playerid);
161
+ native GetPlayerHealth(playerid);
162
+ native GetPlayerArmour(playerid);
163
+ native GetPlayerSpecialAction(playerid);
164
+ native IsPlayerStreamedIn(playerid);
165
+ native IsVehicleStreamedIn(vehicleid);
166
+ native GetPlayerKeys(playerid, &keys, &updown, &leftright);
167
+ native GetPlayerFacingAngle(playerid, &Float:ang);
168
+ native GetMyPos(&Float:x, &Float:y, &Float:z);
169
+ native SetMyPos(Float:x, Float:y, Float:z);
170
+ native GetMyFacingAngle(&Float:ang);
171
+ native SetMyFacingAngle(Float:ang);
172
+ native GetDistanceFromMeToPoint(Float:X, Float:Y, Float:Z, &Float:Distance);
173
+ native IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z);
174
+ native GetPlayerName(playerid, name[], len = sizeof name);
175
+ native IsPlayerConnected(playerid);
176
+ native StartRecordingPlayback(playbacktype, const recordname[]);
177
+ native StopRecordingPlayback();
178
+ native PauseRecordingPlayback();
179
+ native ResumeRecordingPlayback();
180
+ forward OnNPCModeInit();
181
+ forward OnNPCModeExit();
182
+ forward OnNPCConnect(myplayerid);
183
+ forward OnNPCDisconnect(reason[]);
184
+ forward OnNPCSpawn();
185
+ forward OnNPCEnterVehicle(vehicleid, seatid);
186
+ forward OnNPCExitVehicle();
187
+ forward OnClientMessage(color, text[]);
188
+ forward OnPlayerDeath(playerid);
189
+ forward OnPlayerText(playerid, text[]);
190
+ forward OnPlayerStreamIn(playerid);
191
+ forward OnPlayerStreamOut(playerid);
192
+ forward OnVehicleStreamIn(vehicleid);
193
+ forward OnVehicleStreamOut(vehicleid);
194
+ forward OnRecordingPlaybackEnd();
a_objects.inc ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _INC_a_objects
2
+ #endinput
3
+ #endif
4
+ #define _INC_a_objects
5
+ #define _objects_included
6
+ #define SAMP_CONST_CORRECT
7
+ #pragma tabsize 4
8
+ #define OBJECT_MATERIAL_SIZE_32x32 (10)
9
+ #define OBJECT_MATERIAL_SIZE_64x32 (20)
10
+ #define OBJECT_MATERIAL_SIZE_64x64 (30)
11
+ #define OBJECT_MATERIAL_SIZE_128x32 (40)
12
+ #define OBJECT_MATERIAL_SIZE_128x64 (50)
13
+ #define OBJECT_MATERIAL_SIZE_128x128 (60)
14
+ #define OBJECT_MATERIAL_SIZE_256x32 (70)
15
+ #define OBJECT_MATERIAL_SIZE_256x64 (80)
16
+ #define OBJECT_MATERIAL_SIZE_256x128 (90)
17
+ #define OBJECT_MATERIAL_SIZE_256x256 (100)
18
+ #define OBJECT_MATERIAL_SIZE_512x64 (110)
19
+ #define OBJECT_MATERIAL_SIZE_512x128 (120)
20
+ #define OBJECT_MATERIAL_SIZE_512x256 (130)
21
+ #define OBJECT_MATERIAL_SIZE_512x512 (140)
22
+ #define OBJECT_MATERIAL_TEXT_ALIGN_LEFT (0)
23
+ #define OBJECT_MATERIAL_TEXT_ALIGN_CENTER (1)
24
+ #define OBJECT_MATERIAL_TEXT_ALIGN_RIGHT (2)
25
+ native CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance = 0.0);
26
+ native AttachObjectToVehicle(objectid, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:RotX, Float:RotY, Float:RotZ);
27
+ native AttachObjectToObject(objectid, attachtoid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:RotX, Float:RotY, Float:RotZ, SyncRotation = 1);
28
+ native AttachObjectToPlayer(objectid, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:RotX, Float:RotY, Float:RotZ);
29
+ native SetObjectPos(objectid, Float:X, Float:Y, Float:Z);
30
+ native GetObjectPos(objectid, &Float:X, &Float:Y, &Float:Z);
31
+ native SetObjectRot(objectid, Float:RotX, Float:RotY, Float:RotZ);
32
+ native GetObjectRot(objectid, &Float:RotX, &Float:RotY, &Float:RotZ);
33
+ native GetObjectModel(objectid);
34
+ native SetObjectNoCameraCol(objectid);
35
+ native IsValidObject(objectid);
36
+ native DestroyObject(objectid);
37
+ native MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0);
38
+ native StopObject(objectid);
39
+ native IsObjectMoving(objectid);
40
+ native EditObject(playerid, objectid);
41
+ native EditPlayerObject(playerid, objectid);
42
+ native SelectObject(playerid);
43
+ native CancelEdit(playerid);
44
+ native CreatePlayerObject(playerid, modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance = 0.0);
45
+ native AttachPlayerObjectToVehicle(playerid, objectid, vehicleid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:RotZ);
46
+ native SetPlayerObjectPos(playerid, objectid, Float:X, Float:Y, Float:Z);
47
+ native GetPlayerObjectPos(playerid, objectid, &Float:X, &Float:Y, &Float:Z);
48
+ native SetPlayerObjectRot(playerid, objectid, Float:RotX, Float:RotY, Float:RotZ);
49
+ native GetPlayerObjectRot(playerid, objectid, &Float:RotX, &Float:RotY, &Float:RotZ);
50
+ native GetPlayerObjectModel(playerid, objectid);
51
+ native SetPlayerObjectNoCameraCol(playerid, objectid);
52
+ native IsValidPlayerObject(playerid, objectid);
53
+ native DestroyPlayerObject(playerid, objectid);
54
+ native MovePlayerObject(playerid, objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0);
55
+ native StopPlayerObject(playerid, objectid);
56
+ native IsPlayerObjectMoving(playerid, objectid);
57
+ native AttachPlayerObjectToPlayer(objectplayer, objectid, attachplayer, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:rX, Float:rY, Float:rZ);
58
+ native SetObjectMaterial(objectid, materialindex, modelid, const txdname[], const texturename[], materialcolor=0);
59
+ native SetPlayerObjectMaterial(playerid, objectid, materialindex, modelid, const txdname[], const texturename[], materialcolor=0);
60
+ native SetObjectMaterialText(objectid, const text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, const fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
61
+ native SetPlayerObjectMaterialText(playerid, objectid, const text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, const fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
62
+ native SetObjectsDefaultCameraCol(disable);
a_players.inc ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _INC_a_players
2
+ #endinput
3
+ #endif
4
+ #define _INC_a_players
5
+ #define _players_included
6
+ #define SAMP_CONST_CORRECT
7
+ #pragma tabsize 4
8
+ #if !defined MAX_PLAYER_ATTACHED_OBJECTS
9
+ #define MAX_PLAYER_ATTACHED_OBJECTS (10)
10
+ #endif
11
+ #if !defined MAX_CHATBUBBLE_LENGTH
12
+ #define MAX_CHATBUBBLE_LENGTH (144)
13
+ #endif
14
+ #define SPECIAL_ACTION_NONE (0)
15
+ #define SPECIAL_ACTION_DUCK (1)
16
+ #define SPECIAL_ACTION_USEJETPACK (2)
17
+ #define SPECIAL_ACTION_ENTER_VEHICLE (3)
18
+ #define SPECIAL_ACTION_EXIT_VEHICLE (4)
19
+ #define SPECIAL_ACTION_DANCE1 (5)
20
+ #define SPECIAL_ACTION_DANCE2 (6)
21
+ #define SPECIAL_ACTION_DANCE3 (7)
22
+ #define SPECIAL_ACTION_DANCE4 (8)
23
+ #define SPECIAL_ACTION_HANDSUP (10)
24
+ #define SPECIAL_ACTION_USECELLPHONE (11)
25
+ #define SPECIAL_ACTION_SITTING (12)
26
+ #define SPECIAL_ACTION_STOPUSECELLPHONE (13)
27
+ #define SPECIAL_ACTION_DRINK_BEER (20)
28
+ #define SPECIAL_ACTION_SMOKE_CIGGY (21)
29
+ #define SPECIAL_ACTION_DRINK_WINE (22)
30
+ #define SPECIAL_ACTION_DRINK_SPRUNK (23)
31
+ #define SPECIAL_ACTION_PISSING (68)
32
+ #define SPECIAL_ACTION_CUFFED (24)
33
+ #define SPECIAL_ACTION_CARRY (25)
34
+ #define FIGHT_STYLE_NORMAL (4)
35
+ #define FIGHT_STYLE_BOXING (5)
36
+ #define FIGHT_STYLE_KUNGFU (6)
37
+ #define FIGHT_STYLE_KNEEHEAD (7)
38
+ #define FIGHT_STYLE_GRABKICK (15)
39
+ #define FIGHT_STYLE_ELBOW (16)
40
+ #define WEAPONSKILL_PISTOL (0)
41
+ #define WEAPONSKILL_PISTOL_SILENCED (1)
42
+ #define WEAPONSKILL_DESERT_EAGLE (2)
43
+ #define WEAPONSKILL_SHOTGUN (3)
44
+ #define WEAPONSKILL_SAWNOFF_SHOTGUN (4)
45
+ #define WEAPONSKILL_SPAS12_SHOTGUN (5)
46
+ #define WEAPONSKILL_MICRO_UZI (6)
47
+ #define WEAPONSKILL_MP5 (7)
48
+ #define WEAPONSKILL_AK47 (8)
49
+ #define WEAPONSKILL_M4 (9)
50
+ #define WEAPONSKILL_SNIPERRIFLE (10)
51
+ #define WEAPONSTATE_UNKNOWN (-1)
52
+ #define WEAPONSTATE_NO_BULLETS (0)
53
+ #define WEAPONSTATE_LAST_BULLET (1)
54
+ #define WEAPONSTATE_MORE_BULLETS (2)
55
+ #define WEAPONSTATE_RELOADING (3)
56
+ #define PLAYER_VARTYPE_NONE (0)
57
+ #define PLAYER_VARTYPE_INT (1)
58
+ #define PLAYER_VARTYPE_STRING (2)
59
+ #define PLAYER_VARTYPE_FLOAT (3)
60
+ #define MAPICON_LOCAL (0)
61
+ #define MAPICON_GLOBAL (1)
62
+ #define MAPICON_LOCAL_CHECKPOINT (2)
63
+ #define MAPICON_GLOBAL_CHECKPOINT (3)
64
+ #define CAMERA_CUT (2)
65
+ #define CAMERA_MOVE (1)
66
+ #define SPECTATE_MODE_NORMAL (1)
67
+ #define SPECTATE_MODE_FIXED (2)
68
+ #define SPECTATE_MODE_SIDE (3)
69
+ #define PLAYER_RECORDING_TYPE_NONE (0)
70
+ #define PLAYER_RECORDING_TYPE_DRIVER (1)
71
+ #define PLAYER_RECORDING_TYPE_ONFOOT (2)
72
+ native SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
73
+ native SpawnPlayer(playerid);
74
+ native SetPlayerPos(playerid, Float:x, Float:y, Float:z);
75
+ native SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z);
76
+ native GetPlayerPos(playerid, &Float:x, &Float:y, &Float:z);
77
+ native SetPlayerFacingAngle(playerid, Float:ang);
78
+ native GetPlayerFacingAngle(playerid, &Float:ang);
79
+ native IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z);
80
+ native Float:GetPlayerDistanceFromPoint(playerid, Float:X, Float:Y, Float:Z);
81
+ native IsPlayerStreamedIn(playerid, forplayerid);
82
+ native SetPlayerInterior(playerid, interiorid);
83
+ native GetPlayerInterior(playerid);
84
+ native SetPlayerHealth(playerid, Float:health);
85
+ native GetPlayerHealth(playerid, &Float:health);
86
+ native SetPlayerArmour(playerid, Float:armour);
87
+ native GetPlayerArmour(playerid, &Float:armour);
88
+ native SetPlayerAmmo(playerid, weaponid, ammo);
89
+ native GetPlayerAmmo(playerid);
90
+ native GetPlayerWeaponState(playerid);
91
+ native GetPlayerTargetPlayer(playerid);
92
+ native GetPlayerTargetActor(playerid);
93
+ native SetPlayerTeam(playerid, teamid);
94
+ native GetPlayerTeam(playerid);
95
+ native SetPlayerScore(playerid, score);
96
+ native GetPlayerScore(playerid);
97
+ native GetPlayerDrunkLevel(playerid);
98
+ native SetPlayerDrunkLevel(playerid, level);
99
+ native SetPlayerColor(playerid, color);
100
+ native GetPlayerColor(playerid);
101
+ native SetPlayerSkin(playerid, skinid);
102
+ native GetPlayerSkin(playerid);
103
+ native GetPlayerCustomSkin(playerid);
104
+ native GivePlayerWeapon(playerid, weaponid, ammo);
105
+ native ResetPlayerWeapons(playerid);
106
+ native SetPlayerArmedWeapon(playerid, weaponid);
107
+ native GetPlayerWeaponData(playerid, slot, &weapons, &ammo);
108
+ native GivePlayerMoney(playerid, money);
109
+ native ResetPlayerMoney(playerid);
110
+ native SetPlayerName(playerid, const name[]);
111
+ native GetPlayerMoney(playerid);
112
+ native GetPlayerState(playerid);
113
+ native GetPlayerIp(playerid, ip[], len = sizeof ip);
114
+ native GetPlayerPing(playerid);
115
+ native GetPlayerWeapon(playerid);
116
+ native GetPlayerKeys(playerid, &keys, &updown, &leftright);
117
+ native GetPlayerName(playerid, name[], len = sizeof name);
118
+ native SetPlayerTime(playerid, hour, minute);
119
+ native GetPlayerTime(playerid, &hour, &minute);
120
+ native TogglePlayerClock(playerid, toggle);
121
+ native SetPlayerWeather(playerid, weather);
122
+ native ForceClassSelection(playerid);
123
+ native SetPlayerWantedLevel(playerid, level);
124
+ native GetPlayerWantedLevel(playerid);
125
+ native SetPlayerFightingStyle(playerid, style);
126
+ native GetPlayerFightingStyle(playerid);
127
+ native SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z);
128
+ native GetPlayerVelocity( playerid, &Float:X, &Float:Y, &Float:Z );
129
+ native PlayCrimeReportForPlayer(playerid, suspectid, crime);
130
+ native PlayAudioStreamForPlayer(playerid, const url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0);
131
+ native StopAudioStreamForPlayer(playerid);
132
+ native SetPlayerShopName(playerid, const shopname[]);
133
+ native SetPlayerSkillLevel(playerid, skill, level);
134
+ native GetPlayerSurfingVehicleID(playerid);
135
+ native GetPlayerSurfingObjectID(playerid);
136
+ native RemoveBuildingForPlayer(playerid, modelid, Float:fX, Float:fY, Float:fZ, Float:fRadius);
137
+ native GetPlayerLastShotVectors(playerid, &Float:fOriginX, &Float:fOriginY, &Float:fOriginZ, &Float:fHitPosX, &Float:fHitPosY, &Float:fHitPosZ);
138
+ #if MAX_PLAYER_ATTACHED_OBJECTS < 1 || MAX_PLAYER_ATTACHED_OBJECTS > 10
139
+ #error MAX_PLAYER_ATTACHED_OBJECTS must be >= 1 and <= 10
140
+ #endif
141
+ native SetPlayerAttachedObject(playerid, index, modelid, bone, Float:fOffsetX = 0.0, Float:fOffsetY = 0.0, Float:fOffsetZ = 0.0, Float:fRotX = 0.0, Float:fRotY = 0.0, Float:fRotZ = 0.0, Float:fScaleX = 1.0, Float:fScaleY = 1.0, Float:fScaleZ = 1.0, materialcolor1 = 0, materialcolor2 = 0);
142
+ native RemovePlayerAttachedObject(playerid, index);
143
+ native IsPlayerAttachedObjectSlotUsed(playerid, index);
144
+ native EditAttachedObject(playerid, index);
145
+ native PlayerText:CreatePlayerTextDraw(playerid, Float:x, Float:y, const text[]);
146
+ native PlayerTextDrawDestroy(playerid, PlayerText:text);
147
+ native PlayerTextDrawLetterSize(playerid, PlayerText:text, Float:x, Float:y);
148
+ native PlayerTextDrawTextSize(playerid, PlayerText:text, Float:x, Float:y);
149
+ native PlayerTextDrawAlignment(playerid, PlayerText:text, alignment);
150
+ native PlayerTextDrawColor(playerid, PlayerText:text, color);
151
+ native PlayerTextDrawUseBox(playerid, PlayerText:text, use);
152
+ native PlayerTextDrawBoxColor(playerid, PlayerText:text, color);
153
+ native PlayerTextDrawSetShadow(playerid, PlayerText:text, size);
154
+ native PlayerTextDrawSetOutline(playerid, PlayerText:text, size);
155
+ native PlayerTextDrawBackgroundColor(playerid, PlayerText:text, color);
156
+ native PlayerTextDrawFont(playerid, PlayerText:text, font);
157
+ native PlayerTextDrawSetProportional(playerid, PlayerText:text, set);
158
+ native PlayerTextDrawSetSelectable(playerid, PlayerText:text, set);
159
+ native PlayerTextDrawShow(playerid, PlayerText:text);
160
+ native PlayerTextDrawHide(playerid, PlayerText:text);
161
+ native PlayerTextDrawSetString(playerid, PlayerText:text, const string[]);
162
+ native PlayerTextDrawSetPreviewModel(playerid, PlayerText:text, modelindex);
163
+ native PlayerTextDrawSetPreviewRot(playerid, PlayerText:text, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fZoom = 1.0);
164
+ native PlayerTextDrawSetPreviewVehCol(playerid, PlayerText:text, color1, color2);
165
+ native SetPVarInt(playerid, const varname[], int_value);
166
+ native GetPVarInt(playerid, const varname[]);
167
+ native SetPVarString(playerid, const varname[], const string_value[]);
168
+ native GetPVarString(playerid, const varname[], string_return[], len = sizeof string_return);
169
+ native SetPVarFloat(playerid, const varname[], Float:float_value);
170
+ native Float:GetPVarFloat(playerid, const varname[]);
171
+ native DeletePVar(playerid, const varname[]);
172
+ native GetPVarsUpperIndex(playerid);
173
+ native GetPVarNameAtIndex(playerid, index, ret_varname[], ret_len = sizeof ret_varname);
174
+ native GetPVarType(playerid, const varname[]);
175
+ #if MAX_CHATBUBBLE_LENGTH < 1 || MAX_CHATBUBBLE_LENGTH > 144
176
+ #error MAX_CHATBUBBLE_LENGTH must be >= 1 and <= 144
177
+ #endif
178
+ native SetPlayerChatBubble(playerid, const text[], color, Float:drawdistance, expiretime);
179
+ native PutPlayerInVehicle(playerid, vehicleid, seatid);
180
+ native GetPlayerVehicleID(playerid);
181
+ native GetPlayerVehicleSeat(playerid);
182
+ native RemovePlayerFromVehicle(playerid);
183
+ native TogglePlayerControllable(playerid, toggle);
184
+ native PlayerPlaySound(playerid, soundid, Float:x, Float:y, Float:z);
185
+ native ApplyAnimation(playerid, const animlib[], const animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0);
186
+ native ClearAnimations(playerid, forcesync = 0);
187
+ native GetPlayerAnimationIndex(playerid);
188
+ native GetAnimationName(index, animlib[], len1 = sizeof animlib, animname[], len2 = sizeof animname);
189
+ native GetPlayerSpecialAction(playerid);
190
+ native SetPlayerSpecialAction(playerid, actionid);
191
+ native DisableRemoteVehicleCollisions(playerid, disable);
192
+ native SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
193
+ native DisablePlayerCheckpoint(playerid);
194
+ native SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size);
195
+ native DisablePlayerRaceCheckpoint(playerid);
196
+ native SetPlayerWorldBounds(playerid, Float:x_max,Float:x_min,Float:y_max,Float:y_min);
197
+ native SetPlayerMarkerForPlayer(playerid, showplayerid, color);
198
+ native ShowPlayerNameTagForPlayer(playerid, showplayerid, show);
199
+ native SetPlayerMapIcon(playerid, iconid, Float:x, Float:y, Float:z, markertype, color, style = MAPICON_LOCAL);
200
+ native RemovePlayerMapIcon(playerid, iconid);
201
+ native AllowPlayerTeleport(playerid, allow);
202
+ native SetPlayerCameraPos(playerid, Float:x, Float:y, Float:z);
203
+ native SetPlayerCameraLookAt(playerid, Float:x, Float:y, Float:z, cut = CAMERA_CUT);
204
+ native SetCameraBehindPlayer(playerid);
205
+ native GetPlayerCameraPos(playerid, &Float:x, &Float:y, &Float:z);
206
+ native GetPlayerCameraFrontVector(playerid, &Float:x, &Float:y, &Float:z);
207
+ native GetPlayerCameraMode(playerid);
208
+ native EnablePlayerCameraTarget(playerid, enable);
209
+ native GetPlayerCameraTargetObject(playerid);
210
+ native GetPlayerCameraTargetVehicle(playerid);
211
+ native GetPlayerCameraTargetPlayer(playerid);
212
+ native GetPlayerCameraTargetActor(playerid);
213
+ native Float:GetPlayerCameraAspectRatio(playerid);
214
+ native Float:GetPlayerCameraZoom(playerid);
215
+ native AttachCameraToObject(playerid, objectid);
216
+ native AttachCameraToPlayerObject(playerid, playerobjectid);
217
+ native InterpolateCameraPos(playerid, Float:FromX, Float:FromY, Float:FromZ, Float:ToX, Float:ToY, Float:ToZ, time, cut = CAMERA_CUT);
218
+ native InterpolateCameraLookAt(playerid, Float:FromX, Float:FromY, Float:FromZ, Float:ToX, Float:ToY, Float:ToZ, time, cut = CAMERA_CUT);
219
+ native IsPlayerConnected(playerid);
220
+ native IsPlayerInVehicle(playerid, vehicleid);
221
+ native IsPlayerInAnyVehicle(playerid);
222
+ native IsPlayerInCheckpoint(playerid);
223
+ native IsPlayerInRaceCheckpoint(playerid);
224
+ native SetPlayerVirtualWorld(playerid, worldid);
225
+ native GetPlayerVirtualWorld(playerid);
226
+ native EnableStuntBonusForPlayer(playerid, enable);
227
+ native EnableStuntBonusForAll(enable);
228
+ native TogglePlayerSpectating(playerid, toggle);
229
+ native PlayerSpectatePlayer(playerid, targetplayerid, mode = SPECTATE_MODE_NORMAL);
230
+ native PlayerSpectateVehicle(playerid, targetvehicleid, mode = SPECTATE_MODE_NORMAL);
231
+ native StartRecordingPlayerData(playerid, recordtype, const recordname[]);
232
+ native StopRecordingPlayerData(playerid);
233
+ native SelectTextDraw(playerid, hovercolor);
234
+ native CancelSelectTextDraw(playerid);
235
+ native CreateExplosionForPlayer(playerid, Float:X, Float:Y, Float:Z, type, Float:Radius);
236
+ native SendClientCheck(playerid, type, memAddr, memOffset, byteCount);
a_samp.inc ADDED
@@ -0,0 +1,438 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _INC_a_samp
2
+ #endinput
3
+ #endif
4
+ #if defined _INC_a_npc
5
+ #error Include `<a_samp>` or `<a_npc>`, not both.
6
+ #endif
7
+ #define _INC_a_samp
8
+ #define _samp_included
9
+ #define SAMP_CONST_CORRECT
10
+ #pragma tabsize 4
11
+ #if !defined MAX_PLAYER_NAME
12
+ #define MAX_PLAYER_NAME (24)
13
+ #endif
14
+ #if !defined MAX_PLAYERS
15
+ #define MAX_PLAYERS (1000)
16
+ #endif
17
+ #if !defined MAX_VEHICLES
18
+ #define MAX_VEHICLES (2000)
19
+ #endif
20
+ #if !defined MAX_ACTORS
21
+ #define MAX_ACTORS (1000)
22
+ #endif
23
+ #if !defined MAX_OBJECTS
24
+ #define MAX_OBJECTS (2000)
25
+ #endif
26
+ #if !defined MAX_GANG_ZONES
27
+ #define MAX_GANG_ZONES (1024)
28
+ #endif
29
+ #if !defined MAX_TEXT_DRAWS
30
+ #define MAX_TEXT_DRAWS (Text:2048)
31
+ #endif
32
+ #if !defined MAX_PLAYER_TEXT_DRAWS
33
+ #define MAX_PLAYER_TEXT_DRAWS (PlayerText:256)
34
+ #endif
35
+ #if !defined MAX_MENUS
36
+ #define MAX_MENUS (Menu:128)
37
+ #endif
38
+ #if !defined MAX_3DTEXT_GLOBAL
39
+ #define MAX_3DTEXT_GLOBAL (Text3D:1024)
40
+ #endif
41
+ #if !defined MAX_3DTEXT_PLAYER
42
+ #define MAX_3DTEXT_PLAYER (PlayerText3D:1024)
43
+ #endif
44
+ #if !defined MAX_PICKUPS
45
+ #define MAX_PICKUPS (4096)
46
+ #endif
47
+ #define NO_TEAM (255)
48
+ #define INVALID_PLAYER_ID (0xFFFF)
49
+ #define INVALID_VEHICLE_ID (0xFFFF)
50
+ #define INVALID_ACTOR_ID (0xFFFF)
51
+ #define INVALID_OBJECT_ID (0xFFFF)
52
+ #define INVALID_MENU (Menu:0xFF)
53
+ #define INVALID_TEXT_DRAW (Text:0xFFFF)
54
+ #define INVALID_PLAYER_TEXT_DRAW (PlayerText:0xFFFF)
55
+ #define INVALID_GANG_ZONE (-1)
56
+ #define INVALID_3DTEXT_ID (Text3D:0xFFFF)
57
+ #define INVALID_PLAYER_3DTEXT_ID (PlayerText3D:0xFFFF)
58
+ #define PLAYER_STATE_NONE (0)
59
+ #define PLAYER_STATE_ONFOOT (1)
60
+ #define PLAYER_STATE_DRIVER (2)
61
+ #define PLAYER_STATE_PASSENGER (3)
62
+ #define PLAYER_STATE_EXIT_VEHICLE (4)
63
+ #define PLAYER_STATE_ENTER_VEHICLE_DRIVER (5)
64
+ #define PLAYER_STATE_ENTER_VEHICLE_PASSENGER (6)
65
+ #define PLAYER_STATE_WASTED (7)
66
+ #define PLAYER_STATE_SPAWNED (8)
67
+ #define PLAYER_STATE_SPECTATING (9)
68
+ #define PLAYER_MARKERS_MODE_OFF (0)
69
+ #define PLAYER_MARKERS_MODE_GLOBAL (1)
70
+ #define PLAYER_MARKERS_MODE_STREAMED (2)
71
+ #define UNKNOWN_WEAPON (-1)
72
+ #define WEAPON_FIST (0)
73
+ #define WEAPON_BRASSKNUCKLE (1)
74
+ #define WEAPON_GOLFCLUB (2)
75
+ #define WEAPON_NITESTICK (3)
76
+ #define WEAPON_KNIFE (4)
77
+ #define WEAPON_BAT (5)
78
+ #define WEAPON_SHOVEL (6)
79
+ #define WEAPON_POOLSTICK (7)
80
+ #define WEAPON_KATANA (8)
81
+ #define WEAPON_CHAINSAW (9)
82
+ #define WEAPON_DILDO (10)
83
+ #define WEAPON_DILDO2 (11)
84
+ #define WEAPON_VIBRATOR (12)
85
+ #define WEAPON_VIBRATOR2 (13)
86
+ #define WEAPON_FLOWER (14)
87
+ #define WEAPON_CANE (15)
88
+ #define WEAPON_GRENADE (16)
89
+ #define WEAPON_TEARGAS (17)
90
+ #define WEAPON_MOLTOV (18)
91
+ #define WEAPON_COLT45 (22)
92
+ #define WEAPON_SILENCED (23)
93
+ #define WEAPON_DEAGLE (24)
94
+ #define WEAPON_SHOTGUN (25)
95
+ #define WEAPON_SAWEDOFF (26)
96
+ #define WEAPON_SHOTGSPA (27)
97
+ #define WEAPON_UZI (28)
98
+ #define WEAPON_MP5 (29)
99
+ #define WEAPON_AK47 (30)
100
+ #define WEAPON_M4 (31)
101
+ #define WEAPON_TEC9 (32)
102
+ #define WEAPON_RIFLE (33)
103
+ #define WEAPON_SNIPER (34)
104
+ #define WEAPON_ROCKETLAUNCHER (35)
105
+ #define WEAPON_HEATSEEKER (36)
106
+ #define WEAPON_FLAMETHROWER (37)
107
+ #define WEAPON_MINIGUN (38)
108
+ #define WEAPON_SATCHEL (39)
109
+ #define WEAPON_BOMB (40)
110
+ #define WEAPON_SPRAYCAN (41)
111
+ #define WEAPON_FIREEXTINGUISHER (42)
112
+ #define WEAPON_CAMERA (43)
113
+ #define WEAPON_PARACHUTE (46)
114
+ #define WEAPON_VEHICLE (49)
115
+ #define WEAPON_DROWN (53)
116
+ #define WEAPON_COLLISION (54)
117
+ #define KEY_ACTION (1)
118
+ #define KEY_CROUCH (2)
119
+ #define KEY_FIRE (4)
120
+ #define KEY_SPRINT (8)
121
+ #define KEY_SECONDARY_ATTACK (16)
122
+ #define KEY_JUMP (32)
123
+ #define KEY_LOOK_RIGHT (64)
124
+ #define KEY_HANDBRAKE (128)
125
+ #define KEY_LOOK_LEFT (256)
126
+ #define KEY_SUBMISSION (512)
127
+ #define KEY_LOOK_BEHIND (512)
128
+ #define KEY_WALK (1024)
129
+ #define KEY_ANALOG_UP (2048)
130
+ #define KEY_ANALOG_DOWN (4096)
131
+ #define KEY_ANALOG_LEFT (8192)
132
+ #define KEY_ANALOG_RIGHT (16384)
133
+ #define KEY_YES (65536)
134
+ #define KEY_NO (131072)
135
+ #define KEY_CTRL_BACK (262144)
136
+ #define KEY_UP (-128)
137
+ #define KEY_DOWN (128)
138
+ #define KEY_LEFT (-128)
139
+ #define KEY_RIGHT (128)
140
+ #define DIALOG_STYLE_MSGBOX (0)
141
+ #define DIALOG_STYLE_INPUT (1)
142
+ #define DIALOG_STYLE_LIST (2)
143
+ #define DIALOG_STYLE_PASSWORD (3)
144
+ #define DIALOG_STYLE_TABLIST (4)
145
+ #define DIALOG_STYLE_TABLIST_HEADERS (5)
146
+ #define TEXT_DRAW_FONT_SPRITE_DRAW (4)
147
+ #define TEXT_DRAW_FONT_MODEL_PREVIEW (5)
148
+ #define SERVER_VARTYPE_NONE (0)
149
+ #define SERVER_VARTYPE_INT (1)
150
+ #define SERVER_VARTYPE_STRING (2)
151
+ #define SERVER_VARTYPE_FLOAT (3)
152
+ #define DOWNLOAD_REQUEST_EMPTY (0)
153
+ #define DOWNLOAD_REQUEST_MODEL_FILE (1)
154
+ #define DOWNLOAD_REQUEST_TEXTURE_FILE (2)
155
+ #define CLICK_SOURCE_SCOREBOARD (0)
156
+ #define EDIT_RESPONSE_CANCEL (0)
157
+ #define EDIT_RESPONSE_FINAL (1)
158
+ #define EDIT_RESPONSE_UPDATE (2)
159
+ #define SELECT_OBJECT_GLOBAL_OBJECT (1)
160
+ #define SELECT_OBJECT_PLAYER_OBJECT (2)
161
+ #define BULLET_HIT_TYPE_NONE (0)
162
+ #define BULLET_HIT_TYPE_PLAYER (1)
163
+ #define BULLET_HIT_TYPE_VEHICLE (2)
164
+ #define BULLET_HIT_TYPE_OBJECT (3)
165
+ #define BULLET_HIT_TYPE_PLAYER_OBJECT (4)
166
+ #if MAX_PLAYER_NAME < 3 || MAX_PLAYER_NAME > 24
167
+ #error MAX_PLAYER_NAME must be >= 3 and <= 24
168
+ #endif
169
+ #if MAX_PLAYERS < 1 || MAX_PLAYERS > 1000
170
+ #error MAX_PLAYERS must be >= 1 and <= 1000
171
+ #endif
172
+ #if MAX_VEHICLES < 1 || MAX_VEHICLES > 2000
173
+ #error MAX_VEHICLES must be >= 1 and <= 2000
174
+ #endif
175
+ #if MAX_ACTORS < 1 || MAX_ACTORS > 1000
176
+ #error MAX_ACTORS must be >= 1 and <= 1000
177
+ #endif
178
+ #if MAX_OBJECTS < 1 || MAX_OBJECTS > 2000
179
+ #error MAX_OBJECTS must be >= 1 and <= 2000
180
+ #endif
181
+ #if MAX_GANG_ZONES < 1 || MAX_GANG_ZONES > 1024
182
+ #error MAX_GANG_ZONES must be >= 1 and <= 1024
183
+ #endif
184
+ #if MAX_TEXT_DRAWS < Text:1 || MAX_TEXT_DRAWS > Text:2048
185
+ #error MAX_TEXT_DRAWS must be >= 1 and <= 2048
186
+ #endif
187
+ #if MAX_PLAYER_TEXT_DRAWS < PlayerText:1 || MAX_PLAYER_TEXT_DRAWS > PlayerText:256
188
+ #error MAX_PLAYER_TEXT_DRAWS must be >= 1 and <= 256
189
+ #endif
190
+ #if MAX_MENUS < Menu:1 || MAX_MENUS > Menu:128
191
+ #error MAX_MENUS must be >= 1 and <= 128
192
+ #endif
193
+ #if MAX_3DTEXT_GLOBAL < Text3D:1 || MAX_3DTEXT_GLOBAL > Text3D:1024
194
+ #error MAX_3DTEXT_GLOBAL must be >= 1 and <= 1024
195
+ #endif
196
+ #if MAX_3DTEXT_PLAYER < PlayerText3D:1 || MAX_3DTEXT_PLAYER > PlayerText3D:1024
197
+ #error MAX_3DTEXT_PLAYER must be >= 1 and <= 1024
198
+ #endif
199
+ #if MAX_PICKUPS < 1 || MAX_PICKUPS > 4096
200
+ #error MAX_PICKUPS must be >= 1 and <= 4096
201
+ #endif
202
+ public const SAMP_INCLUDES_VERSION = 0x037030;
203
+ #pragma unused SAMP_INCLUDES_VERSION
204
+ #include <core>
205
+ #include <float>
206
+ #include <string>
207
+ #include <file>
208
+ #include <time>
209
+ #include <datagram>
210
+ #tryinclude <console>
211
+ #include <a_players>
212
+ #include <a_vehicles>
213
+ #include <a_objects>
214
+ #include <a_actor>
215
+ #include <a_sampdb>
216
+ #include <a_http>
217
+ #if !defined _console_included
218
+ #define _console_included
219
+ native print(const string[]);
220
+ native printf(const format[], {Float,_}:...);
221
+ #endif
222
+ native format(output[], len = sizeof output, const format[], {Float,_}:...);
223
+ native SendClientMessage(playerid, color, const message[]);
224
+ native SendClientMessageToAll(color, const message[]);
225
+ native SendPlayerMessageToPlayer(playerid, senderid, const message[]);
226
+ native SendPlayerMessageToAll(senderid, const message[]);
227
+ native SendDeathMessage(killer, killee, weapon);
228
+ native SendDeathMessageToPlayer(playerid, killer, killee, weapon);
229
+ native GameTextForAll(const string[], time, style);
230
+ native GameTextForPlayer(playerid, const string[], time, style);
231
+ native SetTimer(const funcname[], interval, repeating);
232
+ native SetTimerEx(const funcname[], interval, repeating, const format[], {Float,_}:...);
233
+ native KillTimer(timerid);
234
+ native GetTickCount();
235
+ native GetMaxPlayers();
236
+ native CallRemoteFunction(const function[], const format[], {Float,_}:...);
237
+ native CallLocalFunction(const function[], const format[], {Float,_}:...);
238
+ native Float:VectorSize(Float:x, Float:y, Float:z);
239
+ native Float:asin(Float:value);
240
+ native Float:acos(Float:value);
241
+ native Float:atan(Float:value);
242
+ native Float:atan2(Float:y, Float:x);
243
+ native GetPlayerPoolSize();
244
+ native GetVehiclePoolSize();
245
+ native GetActorPoolSize();
246
+ native SHA256_PassHash(const password[], const salt[], ret_hash[], ret_hash_len = sizeof ret_hash);
247
+ native SetSVarInt(const varname[], int_value);
248
+ native GetSVarInt(const varname[]);
249
+ native SetSVarString(const varname[], const string_value[]);
250
+ native GetSVarString(const varname[], string_return[], len = sizeof string_return);
251
+ native SetSVarFloat(const varname[], Float:float_value);
252
+ native Float:GetSVarFloat(const varname[]);
253
+ native DeleteSVar(const varname[]);
254
+ native GetSVarsUpperIndex();
255
+ native GetSVarNameAtIndex(index, ret_varname[], ret_len = sizeof ret_varname);
256
+ native GetSVarType(const varname[]);
257
+ native SetGameModeText(const string[]);
258
+ native SetTeamCount(count);
259
+ native AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
260
+ native AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
261
+ native AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2);
262
+ native AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren=0);
263
+ native AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
264
+ native CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
265
+ native DestroyPickup(pickup);
266
+ native ShowNameTags(show);
267
+ native ShowPlayerMarkers(mode);
268
+ native GameModeExit();
269
+ native SetWorldTime(hour);
270
+ native GetWeaponName(weaponid, weapon[], len = sizeof weapon);
271
+ native EnableTirePopping(enable);
272
+ native EnableVehicleFriendlyFire();
273
+ native AllowInteriorWeapons(allow);
274
+ native SetWeather(weatherid);
275
+ native Float:GetGravity();
276
+ native SetGravity(Float:gravity);
277
+ native AllowAdminTeleport(allow);
278
+ native SetDeathDropAmount(amount);
279
+ native CreateExplosion(Float:X, Float:Y, Float:Z, type, Float:Radius);
280
+ native EnableZoneNames(enable);
281
+ native UsePlayerPedAnims();
282
+ native DisableInteriorEnterExits();
283
+ native SetNameTagDrawDistance(Float:distance);
284
+ native DisableNameTagLOS();
285
+ native LimitGlobalChatRadius(Float:chat_radius);
286
+ native LimitPlayerMarkerRadius(Float:marker_radius);
287
+ native ConnectNPC(const name[], const script[]);
288
+ native IsPlayerNPC(playerid);
289
+ native AddCharModel(baseid, newid, const dffname[], const txdname[]);
290
+ native AddSimpleModel(virtualworld, baseid, newid, const dffname[], const txdname[]);
291
+ native AddSimpleModelTimed(virtualworld, baseid, newid, const dffname[], const txdname[], timeon, timeoff);
292
+ native FindModelFileNameFromCRC(crc, retstr[], retstr_size = sizeof retstr);
293
+ native FindTextureFileNameFromCRC(crc, retstr[], retstr_size = sizeof retstr);
294
+ native RedirectDownload(playerid, const url[]);
295
+ native IsPlayerAdmin(playerid);
296
+ native Kick(playerid);
297
+ native Ban(playerid);
298
+ native BanEx(playerid, const reason[]);
299
+ native SendRconCommand(const command[]);
300
+ native GetPlayerNetworkStats(playerid, retstr[], retstr_size = sizeof retstr);
301
+ native GetNetworkStats(retstr[], retstr_size = sizeof retstr);
302
+ native GetPlayerVersion(playerid, version[], len = sizeof version);
303
+ native BlockIpAddress(const ip_address[], timems);
304
+ native UnBlockIpAddress(const ip_address[]);
305
+ native GetServerVarAsString(const varname[], buffer[], len = sizeof buffer);
306
+ native GetServerVarAsInt(const varname[]);
307
+ native GetServerVarAsBool(const varname[]);
308
+ native GetConsoleVarAsString(const varname[], buffer[], len = sizeof buffer);
309
+ native GetConsoleVarAsInt(const varname[]);
310
+ native GetConsoleVarAsBool(const varname[]);
311
+ native GetServerTickRate();
312
+ native NetStats_GetConnectedTime(playerid);
313
+ native NetStats_MessagesReceived(playerid);
314
+ native NetStats_BytesReceived(playerid);
315
+ native NetStats_MessagesSent(playerid);
316
+ native NetStats_BytesSent(playerid);
317
+ native NetStats_MessagesRecvPerSecond(playerid);
318
+ native Float:NetStats_PacketLossPercent(playerid);
319
+ native NetStats_ConnectionStatus(playerid);
320
+ native NetStats_GetIpPort(playerid, ip_port[], ip_port_len = sizeof ip_port);
321
+ native Menu:CreateMenu(const title[], columns, Float:x, Float:y, Float:col1width, Float:col2width = 0.0);
322
+ native DestroyMenu(Menu:menuid);
323
+ native AddMenuItem(Menu:menuid, column, const menutext[]);
324
+ native SetMenuColumnHeader(Menu:menuid, column, const columnheader[]);
325
+ native ShowMenuForPlayer(Menu:menuid, playerid);
326
+ native HideMenuForPlayer(Menu:menuid, playerid);
327
+ native IsValidMenu(Menu:menuid);
328
+ native DisableMenu(Menu:menuid);
329
+ native DisableMenuRow(Menu:menuid, row);
330
+ native Menu:GetPlayerMenu(playerid);
331
+ native Text:TextDrawCreate(Float:x, Float:y, const text[]);
332
+ native TextDrawDestroy(Text:text);
333
+ native TextDrawLetterSize(Text:text, Float:x, Float:y);
334
+ native TextDrawTextSize(Text:text, Float:x, Float:y);
335
+ native TextDrawAlignment(Text:text, alignment);
336
+ native TextDrawColor(Text:text, color);
337
+ native TextDrawUseBox(Text:text, use);
338
+ native TextDrawBoxColor(Text:text, color);
339
+ native TextDrawSetShadow(Text:text, size);
340
+ native TextDrawSetOutline(Text:text, size);
341
+ native TextDrawBackgroundColor(Text:text, color);
342
+ native TextDrawFont(Text:text, font);
343
+ native TextDrawSetProportional(Text:text, set);
344
+ native TextDrawSetSelectable(Text:text, set);
345
+ native TextDrawShowForPlayer(playerid, Text:text);
346
+ native TextDrawHideForPlayer(playerid, Text:text);
347
+ native TextDrawShowForAll(Text:text);
348
+ native TextDrawHideForAll(Text:text);
349
+ native TextDrawSetString(Text:text, const string[]);
350
+ native TextDrawSetPreviewModel(Text:text, modelindex);
351
+ native TextDrawSetPreviewRot(Text:text, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fZoom = 1.0);
352
+ native TextDrawSetPreviewVehCol(Text:text, color1, color2);
353
+ native GangZoneCreate(Float:minx, Float:miny, Float:maxx, Float:maxy);
354
+ native GangZoneDestroy(zone);
355
+ native GangZoneShowForPlayer(playerid, zone, color);
356
+ native GangZoneShowForAll(zone, color);
357
+ native GangZoneHideForPlayer(playerid, zone);
358
+ native GangZoneHideForAll(zone);
359
+ native GangZoneFlashForPlayer(playerid, zone, flashcolor);
360
+ native GangZoneFlashForAll(zone, flashcolor);
361
+ native GangZoneStopFlashForPlayer(playerid, zone);
362
+ native GangZoneStopFlashForAll(zone);
363
+ native Text3D:Create3DTextLabel(const text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, virtualworld, testLOS=0);
364
+ native Delete3DTextLabel(Text3D:id);
365
+ native Attach3DTextLabelToPlayer(Text3D:id, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
366
+ native Attach3DTextLabelToVehicle(Text3D:id, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
367
+ native Update3DTextLabelText(Text3D:id, color, const text[]);
368
+ native PlayerText3D:CreatePlayer3DTextLabel(playerid, const text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, attachedplayer=INVALID_PLAYER_ID, attachedvehicle=INVALID_VEHICLE_ID, testLOS=0);
369
+ native DeletePlayer3DTextLabel(playerid, PlayerText3D:id);
370
+ native UpdatePlayer3DTextLabelText(playerid, PlayerText3D:id, color, const text[]);
371
+ native ShowPlayerDialog(playerid, dialogid, style, const caption[], const info[], const button1[], const button2[]);
372
+ native gpci(playerid, serial[], maxlen);
373
+ forward OnGameModeInit();
374
+ forward OnGameModeExit();
375
+ forward OnFilterScriptInit();
376
+ forward OnFilterScriptExit();
377
+ forward OnPlayerConnect(playerid);
378
+ forward OnPlayerDisconnect(playerid, reason);
379
+ forward OnPlayerSpawn(playerid);
380
+ forward OnPlayerDeath(playerid, killerid, reason);
381
+ forward OnVehicleSpawn(vehicleid);
382
+ forward OnVehicleDeath(vehicleid, killerid);
383
+ forward OnPlayerText(playerid, text[]);
384
+ forward OnPlayerCommandText(playerid, cmdtext[]);
385
+ forward OnPlayerRequestClass(playerid, classid);
386
+ forward OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
387
+ forward OnPlayerExitVehicle(playerid, vehicleid);
388
+ forward OnPlayerStateChange(playerid, newstate, oldstate);
389
+ forward OnPlayerEnterCheckpoint(playerid);
390
+ forward OnPlayerLeaveCheckpoint(playerid);
391
+ forward OnPlayerEnterRaceCheckpoint(playerid);
392
+ forward OnPlayerLeaveRaceCheckpoint(playerid);
393
+ forward OnRconCommand(cmd[]);
394
+ forward OnPlayerRequestSpawn(playerid);
395
+ forward OnObjectMoved(objectid);
396
+ forward OnPlayerObjectMoved(playerid, objectid);
397
+ forward OnPlayerPickUpPickup(playerid, pickupid);
398
+ forward OnVehicleMod(playerid, vehicleid, componentid);
399
+ forward OnEnterExitModShop(playerid, enterexit, interiorid);
400
+ forward OnVehiclePaintjob(playerid, vehicleid, paintjobid);
401
+ forward OnVehicleRespray(playerid, vehicleid, color1, color2);
402
+ forward OnVehicleDamageStatusUpdate(vehicleid, playerid);
403
+ forward OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z);
404
+ forward OnPlayerSelectedMenuRow(playerid, row);
405
+ forward OnPlayerExitedMenu(playerid);
406
+ forward OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
407
+ forward OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
408
+ forward OnRconLoginAttempt( ip[], password[], success );
409
+ forward OnPlayerUpdate(playerid);
410
+ forward OnPlayerStreamIn(playerid, forplayerid);
411
+ forward OnPlayerStreamOut(playerid, forplayerid);
412
+ forward OnVehicleStreamIn(vehicleid, forplayerid);
413
+ forward OnVehicleStreamOut(vehicleid, forplayerid);
414
+ forward OnActorStreamIn(actorid, forplayerid);
415
+ forward OnActorStreamOut(actorid, forplayerid);
416
+ forward OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
417
+ forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
418
+ forward OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart);
419
+ forward OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart);
420
+ forward OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
421
+ forward OnPlayerClickTextDraw(playerid, Text:clickedid);
422
+ forward OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
423
+ forward OnIncomingConnection(playerid, ip_address[], port);
424
+ forward OnTrailerUpdate(playerid, vehicleid);
425
+ forward OnVehicleSirenStateChange(playerid, vehicleid, newstate);
426
+ forward OnPlayerFinishedDownloading(playerid, virtualworld);
427
+ forward OnPlayerRequestDownload(playerid, type, crc);
428
+ forward OnPlayerClickPlayer(playerid, clickedplayerid, source);
429
+ forward OnPlayerEditObject( playerid, playerobject, objectid, response,
430
+ Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ );
431
+ forward OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid,
432
+ Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
433
+ Float:fRotX, Float:fRotY, Float:fRotZ,
434
+ Float:fScaleX, Float:fScaleY, Float:fScaleZ );
435
+ forward OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
436
+ forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
437
+ forward OnClientCheckResponse(playerid, actionid, memaddr, retndata);
438
+ forward OnScriptCash(playerid, amount, source);
a_sampdb.inc ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _INC_a_sampdb
2
+ #endinput
3
+ #endif
4
+ #define _INC_a_sampdb
5
+ #define _sampdb_included
6
+ #define SAMP_CONST_CORRECT
7
+ #pragma tabsize 4
8
+ native DB:db_open(const name[]);
9
+ native db_close(DB:db);
10
+ native DBResult:db_query(DB:db, const query[]);
11
+ native db_free_result(DBResult:dbresult);
12
+ native db_num_rows(DBResult:dbresult);
13
+ native db_next_row(DBResult:dbresult);
14
+ native db_num_fields(DBResult:dbresult);
15
+ native db_field_name(DBResult:dbresult, field, result[], maxlength = sizeof result);
16
+ native db_get_field(DBResult:dbresult, field, result[], maxlength = sizeof result);
17
+ native db_get_field_int(DBResult:result, field = 0);
18
+ native Float:db_get_field_float(DBResult:result, field = 0);
19
+ native db_get_field_assoc(DBResult:dbresult, const field[], result[], maxlength = sizeof result);
20
+ native db_get_field_assoc_int(DBResult:result, const field[]);
21
+ native Float:db_get_field_assoc_float(DBResult:result, const field[]);
22
+ native db_get_mem_handle(DB:db);
23
+ native db_get_result_mem_handle(DBResult:result);
24
+ native db_debug_openfiles();
25
+ native db_debug_openresults();
a_vehicles.inc ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _INC_a_vehicles
2
+ #endinput
3
+ #endif
4
+ #define _INC_a_vehicles
5
+ #define _vehicles_included
6
+ #define SAMP_CONST_CORRECT
7
+ #pragma tabsize 4
8
+ #define CARMODTYPE_SPOILER (0)
9
+ #define CARMODTYPE_HOOD (1)
10
+ #define CARMODTYPE_ROOF (2)
11
+ #define CARMODTYPE_SIDESKIRT (3)
12
+ #define CARMODTYPE_LAMPS (4)
13
+ #define CARMODTYPE_NITRO (5)
14
+ #define CARMODTYPE_EXHAUST (6)
15
+ #define CARMODTYPE_WHEELS (7)
16
+ #define CARMODTYPE_STEREO (8)
17
+ #define CARMODTYPE_HYDRAULICS (9)
18
+ #define CARMODTYPE_FRONT_BUMPER (10)
19
+ #define CARMODTYPE_REAR_BUMPER (11)
20
+ #define CARMODTYPE_VENT_RIGHT (12)
21
+ #define CARMODTYPE_VENT_LEFT (13)
22
+ #define VEHICLE_PARAMS_UNSET (-1)
23
+ #define VEHICLE_PARAMS_OFF (0)
24
+ #define VEHICLE_PARAMS_ON (1)
25
+ #define VEHICLE_MODEL_INFO_SIZE (1)
26
+ #define VEHICLE_MODEL_INFO_FRONTSEAT (2)
27
+ #define VEHICLE_MODEL_INFO_REARSEAT (3)
28
+ #define VEHICLE_MODEL_INFO_PETROLCAP (4)
29
+ #define VEHICLE_MODEL_INFO_WHEELSFRONT (5)
30
+ #define VEHICLE_MODEL_INFO_WHEELSREAR (6)
31
+ #define VEHICLE_MODEL_INFO_WHEELSMID (7)
32
+ #define VEHICLE_MODEL_INFO_FRONT_BUMPER_Z (8)
33
+ #define VEHICLE_MODEL_INFO_REAR_BUMPER_Z (9)
34
+ native CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren=0);
35
+ native DestroyVehicle(vehicleid);
36
+ native IsVehicleStreamedIn(vehicleid, forplayerid);
37
+ native GetVehiclePos(vehicleid, &Float:x, &Float:y, &Float:z);
38
+ native SetVehiclePos(vehicleid, Float:x, Float:y, Float:z);
39
+ native GetVehicleZAngle(vehicleid, &Float:z_angle);
40
+ native GetVehicleRotationQuat(vehicleid, &Float:w, &Float:x, &Float:y, &Float:z);
41
+ native Float:GetVehicleDistanceFromPoint(vehicleid, Float:X, Float:Y, Float:Z);
42
+ native SetVehicleZAngle(vehicleid, Float:z_angle);
43
+ native SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked);
44
+ native ManualVehicleEngineAndLights();
45
+ native SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
46
+ native GetVehicleParamsEx(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective);
47
+ native GetVehicleParamsSirenState(vehicleid);
48
+ native SetVehicleParamsCarDoors(vehicleid, driver, passenger, backleft, backright);
49
+ native GetVehicleParamsCarDoors(vehicleid, &driver, &passenger, &backleft, &backright);
50
+ native SetVehicleParamsCarWindows(vehicleid, driver, passenger, backleft, backright);
51
+ native GetVehicleParamsCarWindows(vehicleid, &driver, &passenger, &backleft, &backright);
52
+ native SetVehicleToRespawn(vehicleid);
53
+ native LinkVehicleToInterior(vehicleid, interiorid);
54
+ native AddVehicleComponent(vehicleid, componentid);
55
+ native RemoveVehicleComponent(vehicleid, componentid);
56
+ native ChangeVehicleColor(vehicleid, color1, color2);
57
+ native ChangeVehiclePaintjob(vehicleid, paintjobid);
58
+ native SetVehicleHealth(vehicleid, Float:health);
59
+ native GetVehicleHealth(vehicleid, &Float:health);
60
+ native AttachTrailerToVehicle(trailerid, vehicleid);
61
+ native DetachTrailerFromVehicle(vehicleid);
62
+ native IsTrailerAttachedToVehicle(vehicleid);
63
+ native GetVehicleTrailer(vehicleid);
64
+ native SetVehicleNumberPlate(vehicleid, const numberplate[]);
65
+ native GetVehicleModel(vehicleid);
66
+ native GetVehicleComponentInSlot(vehicleid, slot);
67
+ native GetVehicleComponentType(component);
68
+ native RepairVehicle(vehicleid);
69
+ native GetVehicleVelocity(vehicleid, &Float:X, &Float:Y, &Float:Z);
70
+ native SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z);
71
+ native SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z);
72
+ native GetVehicleDamageStatus(vehicleid, &panels, &doors, &lights, &tires);
73
+ native UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
74
+ native GetVehicleModelInfo(vehiclemodel, infotype, &Float:X, &Float:Y, &Float:Z);
75
+ native SetVehicleVirtualWorld(vehicleid, worldid);
76
+ native GetVehicleVirtualWorld(vehicleid);
77
+ native bool:IsValidVehicle(vehicleid);
bcrypt.inc ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined bcrypt_included
2
+ #endinput
3
+ #endif
4
+ #define bcrypt_included
5
+ #if !defined HTTP_GET
6
+ #include <a_http>
7
+ #endif
8
+ #define BCRYPT_HASH_LENGTH 61
9
+ #define BCRYPT_PLUGIN_VERSION "2.2.3"
10
+ enum BCRYPT_DEBUG_LEVEL {
11
+ BCRYPT_LOG_FATAL,
12
+ BCRYPT_LOG_ERROR,
13
+ BCRYPT_LOG_WARNING,
14
+ BCRYPT_LOG_INFO,
15
+ BCRYPT_LOG_DEBUG,
16
+ BCRYPT_LOG_TRACE
17
+ }
18
+ native bcrypt_hash(key[], cost = 12, callback_name[], callback_format[] = "", {Float, _}:...);
19
+ native bcrypt_check(password[], hash[], callback_name[], callback_format[] = "", {Float, _}:...);
20
+ native bcrypt_get_hash(dest[]);
21
+ native bool:bcrypt_is_equal();
22
+ native bool:bcrypt_needs_rehash(hash[], cost);
23
+ native bcrypt_find_cost(time_target = 250);
24
+ native bcrypt_set_thread_limit(value);
25
+ native bcrypt_debug(BCRYPT_DEBUG_LEVEL:level = BCRYPT_LOG_ERROR);
26
+ forward OnBcryptVersionCheck(index, response_code, data[]);
27
+ #if defined FILTERSCRIPT
28
+ public OnFilterScriptInit()
29
+ {
30
+ HTTP(0, HTTP_GET, "api.ls-rcr.com/bcrypt/?version_check&version=" #BCRYPT_PLUGIN_VERSION, "", "OnBcryptVersionCheck");
31
+ return CallLocalFunction("BCRYPT_OnFilterScriptInit", "");
32
+ }
33
+ forward BCRYPT_OnFilterScriptInit();
34
+ #if defined _ALS_OnFilterScriptInit
35
+ #undef OnFilterScriptInit
36
+ #else
37
+ #define _ALS_OnFilterScriptInit
38
+ #endif
39
+ #define OnFilterScriptInit BCRYPT_OnFilterScriptInit
40
+ #else
41
+ public OnGameModeInit()
42
+ {
43
+ HTTP(0, HTTP_GET, "api.ls-rcr.com/bcrypt/?version_check&version=" #BCRYPT_PLUGIN_VERSION, "", "OnBcryptVersionCheck");
44
+ return CallLocalFunction("BCRYPT_OnGameModeInit", "");
45
+ }
46
+ forward BCRYPT_OnGameModeInit();
47
+ #if defined _ALS_OnGameModeInit
48
+ #undef OnGameModeInit
49
+ #else
50
+ #define _ALS_OnGameModeInit
51
+ #endif
52
+ #define OnGameModeInit BCRYPT_OnGameModeInit
53
+ #endif
54
+ public OnBcryptVersionCheck(index, response_code, data[])
55
+ {
56
+ if(response_code == 200)
57
+ {
58
+ if(!strcmp("OK", data, false, 2))
59
+ {
60
+ print("plugin.bcrypt: The plugin is up-to-date.");
61
+ }
62
+ else if(!strcmp("UPDATE_AVAILABLE_MAJOR", data, false, 22))
63
+ {
64
+ print(" ");
65
+ printf(" * plugin.bcrypt: A MAJOR UPDATE IS AVAILABLE:");
66
+ printf(" * plugin.bcrypt: Current version: %s", BCRYPT_PLUGIN_VERSION);
67
+ printf(" * plugin.bcrypt: Latest version: %s", data[23]);
68
+ printf(" * plugin.bcrypt: Download: http://api.ls-rcr.com/bcrypt/?upgrade");
69
+ printf(" * plugin.bcrypt: Upgrading is highly recommended.");
70
+ print(" ");
71
+ }
72
+ else if(!strcmp("UPDATE_AVAILABLE_MINOR", data, false, 22))
73
+ {
74
+ print(" ");
75
+ printf("plugin.bcrypt: A minor update is available:");
76
+ printf("plugin.bcrypt: Current version: %s", BCRYPT_PLUGIN_VERSION);
77
+ printf("plugin.bcrypt: Latest version: %s", data[23]);
78
+ printf("plugin.bcrypt: Download: http://api.ls-rcr.com/bcrypt/?upgrade");
79
+ printf("plugin.bcrypt: Upgrading is recommended.");
80
+ print(" ");
81
+ }
82
+ else if(!strcmp("UPDATE_AVAILABLE_REVISION", data, false, 25))
83
+ {
84
+ print(" ");
85
+ printf("plugin.bcrypt: A new revision is available:");
86
+ printf("plugin.bcrypt: Current version: %s", BCRYPT_PLUGIN_VERSION);
87
+ printf("plugin.bcrypt: Latest version: %s", data[26]);
88
+ printf("plugin.bcrypt: Download: http://api.ls-rcr.com/bcrypt/?upgrade");
89
+ printf("plugin.bcrypt: Upgrading is recommended.");
90
+ print(" ");
91
+ }
92
+ }
93
+ else
94
+ {
95
+ print("plugin.bcrypt: Version check failed.");
96
+ }
97
+ return 1;
98
+ }
breaks.inc ADDED
@@ -0,0 +1,529 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #define IS_FILTERSCRIPT
2
+ static stock
3
+ bool:BREAKS_gFilterscript = false,
4
+ BREAKS_gRCPSize[MAX_PLAYERS] = { 0, ... },
5
+ BREAKS_gCPSize[MAX_PLAYERS] = { 0, ... },
6
+ bool:BREAKS_gRCPInitialised[MAX_PLAYERS] = { false, ... },
7
+ bool:BREAKS_gCPInitialised[MAX_PLAYERS] = { false, ... },
8
+ BREAKS_gPlayerColour[MAX_PLAYERS] = { 0, ... },
9
+ BREAKS_gPlayerSkin[MAX_PLAYERS] = { 0, ... },
10
+ bool:BREAKS_gExtraOPC[MAX_PLAYERS] = { false, ... },
11
+ BREAKS_gLibraryInitialised[MAX_PLAYERS][5];
12
+ static stock const
13
+ BREAKS_gscAnimLib[135][] =
14
+ {
15
+ "AIRPORT", "ATTRACTORS", "BAR", "BASEBALL", "BD_FIRE",
16
+ "BEACH", "BENCHPRESS", "BF_INJECTION", "BIKE_DBZ", "BIKED",
17
+ "BIKEH", "BIKELEAP", "BIKES", "BIKEV", "BLOWJOBZ",
18
+ "BMX", "BOMBER", "BOX", "BSKTBALL", "BUDDY",
19
+ "BUS", "CAMERA", "CAR", "CAR_CHAT", "CARRY",
20
+ "CASINO", "CHAINSAW", "CHOPPA", "CLOTHES", "COACH",
21
+ "COLT45", "COP_AMBIENT", "COP_DVBYZ", "CRACK", "CRIB",
22
+ "DAM_JUMP", "DANCING", "DEALER", "DILDO", "DODGE",
23
+ "DOZER", "DRIVEBYS", "FAT", "FIGHT_B", "FIGHT_C",
24
+ "FIGHT_D", "FIGHT_E", "FINALE", "FINALE2", "FLAME",
25
+ "FLOWERS", "FOOD", "FREEWEIGHTS", "GANGS", "GFUNK",
26
+ "GHANDS", "GHETTO_DB", "GOGGLES", "GRAFFITI", "GRAVEYARD",
27
+ "GRENADE", "GYMNASIUM", "HAIRCUTS", "HEIST9", "INT_HOUSE",
28
+ "INT_OFFICE", "INT_SHOP", "JST_BUISNESS", "KART", "KISSING",
29
+ "KNIFE", "LAPDAN1", "LAPDAN2", "LAPDAN3", "LOWRIDER",
30
+ "MD_CHASE", "MD_END", "MEDIC", "MISC", "MTB",
31
+ "MUSCULAR", "NEVADA", "ON_LOOKERS", "OTB", "PARACHUTE",
32
+ "PARK", "PAULNMAC", "PED", "PLAYER_DVBYS", "PLAYIDLES",
33
+ "POLICE", "POOL", "POOR", "PYTHON", "QUAD",
34
+ "QUAD_DBZ", "RAPPING", "RIFLE", "RIOT", "ROB_BANK",
35
+ "ROCKET", "RUNNINGMAN", "RUSTLER", "RYDER", "SAMP",
36
+ "SCRATCHING", "SEX", "SHAMAL", "SHOP", "SHOTGUN",
37
+ "SILENCED", "SKATE", "SMOKING", "SNIPER", "SNM",
38
+ "SPRAYCAN", "STRIP", "SUNBATHE", "SWAT", "SWEET",
39
+ "SWIM", "SWORD", "TANK", "TATTOOS", "TEC",
40
+ "TRAIN", "TRUCK", "UZI", "VAN", "VENDING",
41
+ "VORTEX", "WAYFARER", "WEAPONS", "WOP", "WUZI"
42
+ };
43
+ stock BREAKS_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
44
+ {
45
+ BREAKS_gPlayerSkin[playerid] = skin;
46
+ return SetSpawnInfo(playerid, team, skin, x, y, z, rotation, WEAPON:weapon1, weapon1_ammo, WEAPON:weapon2, weapon2_ammo, WEAPON:weapon3, weapon3_ammo);
47
+ }
48
+ #if defined _ALS_SetSpawnInfo
49
+ #undef SetSpawnInfo
50
+ #endif
51
+ #define SetSpawnInfo( BREAKS_SetSpawnInfo(
52
+ #define _ALS_SetSpawnInfo
53
+ stock BREAKS_SetPlayerSkin(playerid, skin)
54
+ {
55
+ BREAKS_gPlayerSkin[playerid] = skin;
56
+ return SetPlayerSkin(playerid, skin);
57
+ }
58
+ #if defined _ALS_SetPlayerSkin
59
+ #undef SetPlayerSkin
60
+ #endif
61
+ #define SetPlayerSkin( BREAKS_SetPlayerSkin(
62
+ #define _ALS_SetPlayerSkin
63
+ stock BREAKS_GetPlayerSkin(playerid)
64
+ {
65
+ return BREAKS_gPlayerSkin[playerid];
66
+ }
67
+ #if defined _ALS_GetPlayerSkin
68
+ #undef GetPlayerSkin
69
+ #endif
70
+ #define GetPlayerSkin( BREAKS_GetPlayerSkin(
71
+ #define _ALS_GetPlayerSkin
72
+ stock BREAKS_SetPlayerColor(playerid, colour)
73
+ {
74
+ BREAKS_gPlayerColour[playerid] = colour;
75
+ return SetPlayerColor(playerid, colour);
76
+ }
77
+ #if defined _ALS_SetPlayerColor
78
+ #undef SetPlayerColor
79
+ #endif
80
+ #define SetPlayerColor( BREAKS_SetPlayerColor(
81
+ #define _ALS_SetPlayerColor
82
+ stock BREAKS_GetPlayerColor(playerid)
83
+ {
84
+ return BREAKS_gPlayerColour[playerid];
85
+ }
86
+ #if defined _ALS_GetPlayerColor
87
+ #undef GetPlayerColor
88
+ #endif
89
+ #define GetPlayerColor( BREAKS_GetPlayerColor(
90
+ #define _ALS_GetPlayerColor
91
+ public OnFilterScriptInit()
92
+ {
93
+ BREAKS_gFilterscript = true;
94
+ for (new i = 0; i != MAX_PLAYERS; ++i)
95
+ {
96
+ if (IsPlayerConnected(i))
97
+ {
98
+ BREAKS_gExtraOPC[i] = true;
99
+ }
100
+ }
101
+ #if defined BREAKS_OnFilterScriptInit
102
+ BREAKS_OnFilterScriptInit();
103
+ #endif
104
+ return 1;
105
+ }
106
+ #if defined _ALS_OnFilterScriptInit
107
+ #undef OnFilterScriptInit
108
+ #endif
109
+ #define OnFilterScriptInit( BREAKS_OnFilterScriptInit(
110
+ #define _ALS_OnFilterScriptInit
111
+ #if defined BREAKS_OnFilterScriptInit
112
+ forward BREAKS_OnFilterScriptInit();
113
+ #endif
114
+ public OnGameModeInit()
115
+ {
116
+ if (!BREAKS_gFilterscript)
117
+ {
118
+ for (new i = 0; i != MAX_PLAYERS; ++i)
119
+ {
120
+ if (IsPlayerConnected(i))
121
+ {
122
+ BREAKS_gExtraOPC[i] = true;
123
+ }
124
+ }
125
+ }
126
+ #if defined BREAKS_OnGameModeInit
127
+ BREAKS_OnGameModeInit();
128
+ #endif
129
+ return 1;
130
+ }
131
+ #if defined _ALS_OnGameModeInit
132
+ #undef OnGameModeInit
133
+ #endif
134
+ #define OnGameModeInit( BREAKS_OnGameModeInit(
135
+ #define _ALS_OnGameModeInit
136
+ #if defined BREAKS_OnGameModeInit
137
+ forward BREAKS_OnGameModeInit();
138
+ #endif
139
+ public OnPlayerConnect(playerid)
140
+ {
141
+ BREAKS_gPlayerColour[playerid] = 0;
142
+ BREAKS_gPlayerSkin[playerid] = 0;
143
+ BREAKS_gCPInitialised[playerid] = false;
144
+ BREAKS_gRCPInitialised[playerid] = false;
145
+ BREAKS_gCPSize[playerid] = 0;
146
+ BREAKS_gRCPSize[playerid] = 0;
147
+ if (BREAKS_gExtraOPC[playerid])
148
+ {
149
+ BREAKS_gExtraOPC[playerid] = false;
150
+ }
151
+ #if defined BREAKS_OnPlayerConnect
152
+ else
153
+ {
154
+ BREAKS_OnPlayerConnect(playerid);
155
+ }
156
+ #endif
157
+ return 1;
158
+ }
159
+ #if defined _ALS_OnPlayerConnect
160
+ #undef OnPlayerConnect
161
+ #endif
162
+ #define OnPlayerConnect( BREAKS_OnPlayerConnect(
163
+ #define _ALS_OnPlayerConnect
164
+ #if defined BREAKS_OnPlayerConnect
165
+ forward BREAKS_OnPlayerConnect(playerid);
166
+ #endif
167
+ public OnPlayerDisconnect(playerid, reason)
168
+ {
169
+ #if defined BREAKS_OnPlayerDisconnect
170
+ if (reason != 4)
171
+ {
172
+ BREAKS_OnPlayerDisconnect(playerid, reason);
173
+ }
174
+ #endif
175
+ return 1;
176
+ }
177
+ #if defined _ALS_OnPlayerDisconnect
178
+ #undef OnPlayerDisconnect
179
+ #endif
180
+ #define OnPlayerDisconnect( BREAKS_OnPlayerDisconnect(
181
+ #define _ALS_OnPlayerDisconnect
182
+ #if defined BREAKS_OnPlayerDisconnect
183
+ forward BREAKS_OnPlayerDisconnect(playerid, reason);
184
+ #endif
185
+ public OnPlayerDeath(playerid, killerid, reason)
186
+ {
187
+ new money = GetPlayerMoney(playerid);
188
+ if (money > 0)
189
+ {
190
+ ResetPlayerMoney(playerid);
191
+ if (money > 100)
192
+ {
193
+ GivePlayerMoney(playerid, money - 100);
194
+ }
195
+ }
196
+ #if defined BREAKS_OnPlayerDeath
197
+ BREAKS_OnPlayerDeath(playerid, killerid, reason);
198
+ #endif
199
+ return 1;
200
+ }
201
+ #if defined _ALS_OnPlayerDeath
202
+ #undef OnPlayerDeath
203
+ #endif
204
+ #define OnPlayerDeath( BREAKS_OnPlayerDeath(
205
+ #define _ALS_OnPlayerDeath
206
+ #if defined BREAKS_OnPlayerDeath
207
+ forward BREAKS_OnPlayerDeath(playerid, killerid, reason);
208
+ #endif
209
+ stock BREAKS_SpawnPlayer(playerid)
210
+ {
211
+ if (IsPlayerInAnyVehicle(playerid))
212
+ {
213
+ SetPlayerHealth(playerid, 0.0);
214
+ }
215
+ return SpawnPlayer(playerid);
216
+ }
217
+ #if defined _ALS_SpawnPlayer
218
+ #undef SpawnPlayer
219
+ #endif
220
+ #define SpawnPlayer( BREAKS_SpawnPlayer(
221
+ #define _ALS_SpawnPlayer
222
+ stock BREAKS_SetPlayerName(playerid, name[])
223
+ {
224
+ new old[MAX_PLAYER_NAME + 1];
225
+ if (GetPlayerName(playerid, old, sizeof (old)))
226
+ {
227
+ if (strcmp(name, old, true) == 0)
228
+ {
229
+ return 1;
230
+ }
231
+ return SetPlayerName(playerid, name);
232
+ }
233
+ return 0;
234
+ }
235
+ #if defined _ALS_SetPlayerName
236
+ #undef SetPlayerName
237
+ #endif
238
+ #define SetPlayerName( BREAKS_SetPlayerName(
239
+ #define _ALS_SetPlayerName
240
+ stock BREAKS_GetWeaponName(weaponid, const weapon[], len)
241
+ {
242
+ switch (weaponid)
243
+ {
244
+ case 18, 44, 45:
245
+ weapon[0] = '\0';
246
+ return 0;
247
+ }
248
+ return _:GetWeaponName(WEAPON:weaponid, weapon, len);
249
+ }
250
+ #if defined _ALS_GetWeaponName
251
+ #undef GetWeaponName
252
+ #endif
253
+ #define GetWeaponName( BREAKS_GetWeaponName(
254
+ #define _ALS_GetWeaponName
255
+ stock BREAKS_SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size)
256
+ {
257
+ BREAKS_gCPInitialised = true;
258
+ if (BREAKS_gCPSize[playerid] == 0)
259
+ {
260
+ BREAKS_gCPSize[playerid] size;
261
+ }
262
+ return SetPlayerCheckpoint(playerid, x, y, z, BREAKS_gCPSize[playerid]);
263
+ }
264
+ #if defined _ALS_SetPlayerCheckpoint
265
+ #undef SetPlayerCheckpoint
266
+ #endif
267
+ #define SetPlayerCheckpoint( BREAKS_SetPlayerCheckpoint(
268
+ #define _ALS_SetPlayerCheckpoint
269
+ stock BREAKS_DisablePlayerCheckpoint(playerid)
270
+ {
271
+ BREAKS_gCPInitialised = true;
272
+ BREAKS_gCPSize[playerid] = 0;
273
+ return DisablePlayerCheckpoint(playerid);
274
+ }
275
+ #if defined _ALS_DisablePlayerCheckpoint
276
+ #undef DisablePlayerCheckpoint
277
+ #endif
278
+ #define DisablePlayerCheckpoint( BREAKS_DisablePlayerCheckpoint(
279
+ #define _ALS_DisablePlayerCheckpoint
280
+ stock BREAKS_SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size)
281
+ {
282
+ BREAKS_gRCPInitialised = true;
283
+ if (BREAKS_gRCPSize[playerid] == 0)
284
+ {
285
+ BREAKS_gRCPSize[playerid] size;
286
+ }
287
+ return _:SetPlayerRaceCheckpoint(playerid, CP_TYPE:type, x, y, z, nextx, nexty, nextz, BREAKS_gRCPSize[playerid]);
288
+ }
289
+ #if defined _ALS_SetPlayerRaceCheckpoint
290
+ #undef SetPlayerRaceCheckpoint
291
+ #endif
292
+ #define SetPlayerRaceCheckpoint( BREAKS_SetPlayerRaceCheckpoint(
293
+ #define _ALS_SetPlayerRaceCheckpoint
294
+ stock BREAKS_DisablePlayerRaceCP(playerid)
295
+ {
296
+ BREAKS_gRCPInitialised = true;
297
+ BREAKS_gRCPSize[playerid] = 0;
298
+ return DisablePlayerRaceCheckpoint(playerid);
299
+ }
300
+ #if defined _ALS_DisablePlayerRaceCP
301
+ #undef DisablePlayerRaceCheckpoint
302
+ #endif
303
+ #define DisablePlayerRaceCheckpoint( BREAKS_DisablePlayerRaceCP(
304
+ #define _ALS_DisablePlayerRaceCP
305
+ stock BREAKS_IsPlayerInCheckpoint(playerid)
306
+ {
307
+ return BREAKS_gCPInitialised[playerid] ? IsPlayerInCheckpoint(playerid) : random(cellmax);
308
+ }
309
+ #if defined _ALS_IsPlayerInCheckpoint
310
+ #undef IsPlayerInCheckpoint
311
+ #endif
312
+ #define IsPlayerInCheckpoint( BREAKS_IsPlayerInCheckpoint(
313
+ #define _ALS_IsPlayerInCheckpoint
314
+ stock BREAKS_IsPlayerInRaceCheckpoint(playerid)
315
+ {
316
+ return BREAKS_gRCPInitialised[playerid] ? IsPlayerInRaceCheckpoint(playerid) : random(cellmax);
317
+ }
318
+ #if defined _ALS_IsPlayerInRaceCheckpoint
319
+ #undef IsPlayerInRaceCheckpoint
320
+ #endif
321
+ #define IsPlayerInRaceCheckpoint( BREAKS_IsPlayerInRaceCheckpoint(
322
+ #define _ALS_IsPlayerInRaceCheckpoint
323
+ stock Text:BREAKS_TextDrawCreate(Float:x, Float:y, text[])
324
+ {
325
+ new len = strlen(text);
326
+ if (len == 0 || len > 1024)
327
+ {
328
+ #emit HALT 100
329
+ }
330
+ if (text[len - 1] == ' ')
331
+ {
332
+ return TextDrawCreate(x, y, " ");
333
+ }
334
+ return TextDrawCreate(x, y, text);
335
+ }
336
+ #if defined _ALS_TextDrawCreate
337
+ #undef TextDrawCreate
338
+ #endif
339
+ #define TextDrawCreate( BREAKS_TextDrawCreate(
340
+ #define _ALS_TextDrawCreate
341
+ stock PlayerText:BREAKS_CreatePlayerTextDraw(playerid, Float:x, Float:y, text[])
342
+ {
343
+ new len = strlen(text);
344
+ if (len == 0 || len > 1024)
345
+ {
346
+ #emit HALT 100
347
+ }
348
+ if (text[len - 1] == ' ')
349
+ {
350
+ return CreatePlayerTextDraw(playerid, x, y, " ");
351
+ }
352
+ return CreatePlayerTextDraw(playerid, x, y, text);
353
+ }
354
+ #if defined _ALS_CreatePlayerTextDraw
355
+ #undef CreatePlayerTextDraw
356
+ #endif
357
+ #define CreatePlayerTextDraw( BREAKS_CreatePlayerTextDraw(
358
+ #define _ALS_CreatePlayerTextDraw
359
+ stock BREAKS_TextDrawSetString(Text:text, string[])
360
+ {
361
+ new len = strlen(string);
362
+ if (len == 0 || len > 1024)
363
+ {
364
+ #emit HALT 100
365
+ }
366
+ if (string[len - 1] == ' ')
367
+ {
368
+ return TextDrawSetString(text, " ");
369
+ }
370
+ return TextDrawSetString(text, string);
371
+ }
372
+ #if defined _ALS_TextDrawSetString
373
+ #undef TextDrawSetString
374
+ #endif
375
+ #define TextDrawSetString( BREAKS_TextDrawSetString(
376
+ #define _ALS_TextDrawSetString
377
+ stock BREAKS_PlayerTextDrawSetString(playerid, PlayerText:text, string[])
378
+ {
379
+ new len = strlen(string);
380
+ if (len == 0 || len > 1024)
381
+ {
382
+ #emit HALT 100
383
+ }
384
+ if (string[len - 1] == ' ')
385
+ {
386
+ return PlayerTextDrawSetString(playerid, text, " ");
387
+ }
388
+ return PlayerTextDrawSetString(playerid, text, string);
389
+ }
390
+ #if defined _ALS_PlayerTextDrawSetString
391
+ #undef PlayerTextDrawSetString
392
+ #endif
393
+ #define PlayerTextDrawSetString( BREAKS_PlayerTextDrawSetString(
394
+ #define _ALS_PlayerTextDrawSetString
395
+ forward BREAKS_AllowInteriorWeapons(allow);
396
+ #if defined _ALS_AllowInteriorWeapons
397
+ #undef AllowInteriorWeapons
398
+ #endif
399
+ #define AllowInteriorWeapons( BREAKS_AllowInteriorWeapons(
400
+ #define _ALS_AllowInteriorWeapons
401
+ forward Float:BREAKS_GetGravity();
402
+ #if defined _ALS_GetGravity
403
+ #undef GetGravity
404
+ #endif
405
+ #define GetGravity( BREAKS_GetGravity(
406
+ #define _ALS_GetGravity
407
+ forward BREAKS_gpci(playerid, serial[], len = sizeof (serial));
408
+ #if defined _ALS_gpci
409
+ #undef gpci
410
+ #endif
411
+ #define gpci( BREAKS_gpci(
412
+ #define _ALS_gpci
413
+ forward BREAKS_HideGameTextForPlayer(playerid, style);
414
+ #if defined _ALS_HideGameTextForPlayer
415
+ #undef HideGameTextForPlayer
416
+ #endif
417
+ #define HideGameTextForPlayer( BREAKS_HideGameTextForPlayer(
418
+ #define _ALS_HideGameTextForPlayer
419
+ forward BREAKS_HideGameTextForAll(style);
420
+ #if defined _ALS_HideGameTextForAll
421
+ #undef HideGameTextForAll
422
+ #endif
423
+ #define HideGameTextForAll( BREAKS_HideGameTextForAll(
424
+ #define _ALS_HideGameTextForAll
425
+ forward bool:BREAKS_IsValidVehicle(vehicleid);
426
+ #if defined _ALS_IsValidVehicle
427
+ #undef IsValidVehicle
428
+ #endif
429
+ #define IsValidVehicle( BREAKS_IsValidVehicle(
430
+ #define _ALS_IsValidVehicle
431
+ stock BREAKS_random(max)
432
+ {
433
+ if (max < 0)
434
+ {
435
+ return 0;
436
+ }
437
+ return random(max);
438
+ }
439
+ #if defined _ALS_random
440
+ #undef random
441
+ #endif
442
+ #define random( BREAKS_random(
443
+ #define _ALS_random
444
+ stock BREAKS_IsPlayerConnected(playerid)
445
+ {
446
+ return IsPlayerConnected(playerid & 0xFFFF);
447
+ }
448
+ #if defined _ALS_IsPlayerConnected
449
+ #undef IsPlayerConnected
450
+ #endif
451
+ #define IsPlayerConnected( BREAKS_IsPlayerConnected(
452
+ #define _ALS_IsPlayerConnected
453
+ stock BREAKS_ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
454
+ {
455
+ for (new i = 0; i != sizeof (BREAKS_gscAnimLib); ++i)
456
+ {
457
+ if (strcmp(animlib, BREAKS_gscAnimLib[i], true) == 0)
458
+ {
459
+ if (BREAKS_gLibraryInitialised[playerid][i / 32] & (1 << (i % 32)))
460
+ {
461
+ return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, FORCE_SYNC:forcesync);
462
+ }
463
+ else
464
+ {
465
+ BREAKS_gLibraryInitialised[playerid][i / 32] |= (1 << (i % 32));
466
+ }
467
+ return 1;
468
+ }
469
+ }
470
+ return 0;
471
+ }
472
+ #if defined _ALS_ApplyAnimation
473
+ #undef ApplyAnimation
474
+ #endif
475
+ #define ApplyAnimation( BREAKS_ApplyAnimation(
476
+ #define _ALS_ApplyAnimation
477
+ stock BREAKS_valstr(dest[], value, bool:pack = false)
478
+ {
479
+ if (value == cellmin)
480
+ {
481
+ if (pack)
482
+ {
483
+ dest{0} = '-';
484
+ dest{1} = '-';
485
+ dest{2} = '\0';
486
+ }
487
+ else
488
+ {
489
+ dest[0] = '-';
490
+ dest[1] = '-';
491
+ dest[2] = '\0';
492
+ }
493
+ return 0;
494
+ }
495
+ return valstr(dest, value, pack);
496
+ }
497
+ #if defined _ALS_valstr
498
+ #undef valstr
499
+ #endif
500
+ #define valstr( BREAKS_valstr(
501
+ #define _ALS_valstr
502
+ stock BREAKS_ispacked(const string[])
503
+ {
504
+ return string[0] >= (1 << (cellbits - 8)) - 1;
505
+ }
506
+ #if defined _ALS_ispacked
507
+ #undef ispacked
508
+ #endif
509
+ #define ispacked( BREAKS_ispacked(
510
+ #define _ALS_ispacked
511
+ stock Float:BREAKS_floatfract(Float:value)
512
+ {
513
+ return (value - floatround(value, floatround_floor));
514
+ }
515
+ #if defined _ALS_floatfract
516
+ #undef floatfract
517
+ #endif
518
+ #define floatfract( BREAKS_floatfract(
519
+ #define _ALS_floatfract
520
+ #endinput
521
+ stock BREAKS_$()
522
+ {
523
+ return $();
524
+ }
525
+ #if defined _ALS_$
526
+ #undef $
527
+ #endif
528
+ #define $( BREAKS_$(
529
+ #define _ALS_$
colandreas.inc ADDED
@@ -0,0 +1,576 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _colandreas_included
2
+ #endinput
3
+ #endif
4
+ #define _colandreas_included
5
+ #pragma library colandreas
6
+ #define COLANDREAS_VERSION (10500)
7
+ #define COLANDREAS (COLANDREAS_VERSION)
8
+ #define CA_EXTRA_1 0
9
+ #define CA_EXTRA_2 1
10
+ #define CA_EXTRA_3 2
11
+ #define CA_EXTRA_4 3
12
+ #define CA_EXTRA_5 4
13
+ #define CA_EXTRA_6 5
14
+ #define CA_EXTRA_7 6
15
+ #define CA_EXTRA_8 7
16
+ #define CA_EXTRA_9 8
17
+ #define CA_EXTRA_10 9
18
+ #if defined MAX_CA_OBJECTS
19
+ #if MAX_CA_OBJECTS > 50000
20
+ #error [ColAndreas] MAX_CA_OBJECTS is too high, maximum value is 50000
21
+ #endif
22
+ #else
23
+ #define MAX_CA_OBJECTS 10000
24
+ #endif
25
+ #define WATER_OBJECT 20000
26
+ #define OBJECT_TYPE_OBJECT 0
27
+ #define OBJECT_TYPE_DYNAMIC 1
28
+ #if !defined FLOAT_INFINITY
29
+ #define FLOAT_INFINITY (Float:0x7F800000)
30
+ #endif
31
+ #define MAX_MULTICAST_SIZE 99
32
+ native CA_Init();
33
+ native CA_RemoveBuilding(modelid, Float:x, Float:y, Float:z, Float:radius);
34
+ native CA_RestoreBuilding(modelid, Float:x, Float:y, Float:z, Float:radius);
35
+ native CA_RayCastLine(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z);
36
+ native CA_RayCastLineID(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z);
37
+ native CA_RayCastLineExtraID(type, Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z);
38
+ native CA_RayCastMultiLine(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, Float:retx[], Float:rety[], Float:retz[], Float:retdist[], ModelIDs[], size = sizeof(retx));
39
+ native CA_RayCastLineAngle(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz);
40
+ native CA_RayCastReflectionVector(Float:startx, Float:starty, Float:startz, Float:endx, Float:endy, Float:endz, &Float:x, &Float:y, &Float:z, &Float:nx, &Float:ny, &Float:nz);
41
+ native CA_RayCastLineNormal(Float:startx, Float:starty, Float:startz, Float:endx, Float:endy, Float:endz, &Float:x, &Float:y, &Float:z, &Float:nx, &Float:ny, &Float:nz);
42
+ native CA_ContactTest(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
43
+ native CA_EulerToQuat(Float:rx, Float:ry, Float:rz, &Float:x, &Float:y, &Float:z, &Float:w);
44
+ native CA_QuatToEuler(Float:x, Float:y, Float:z, Float:w, &Float:rx, &Float:ry, &Float:rz);
45
+ native CA_GetModelBoundingSphere(modelid, &Float:offx, &Float:offy, &Float:offz, &Float:radius);
46
+ native CA_GetModelBoundingBox(modelid, &Float:minx, &Float:miny, &Float:minz, &Float:maxx, &Float:maxy, &Float:maxz);
47
+ native CA_SetObjectExtraID(index, type, data);
48
+ native CA_GetObjectExtraID(index, type);
49
+ native CA_RayCastLineEx(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz, &Float:rw, &Float:cx, &Float:cy, &Float:cz);
50
+ native CA_RayCastLineAngleEx(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz, &Float:ocx, &Float:ocy, &Float:ocz, &Float:orx, &Float:ory, &Float:orz);
51
+ native CA_LoadFromDff(newid, const dffFileName[]);
52
+ native CA_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, bool:add = false);
53
+ native CA_DestroyObject(index);
54
+ native CA_IsValidObject(index);
55
+ native CA_SetObjectPos(index, Float:x, Float:y, Float:z);
56
+ native CA_SetObjectRot(index, Float:rx, Float:ry, Float:rz);
57
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
58
+ static stock Iterator:CA_Objects<MAX_CA_OBJECTS>;
59
+ #endif
60
+ enum CAOBJECTINFO
61
+ {
62
+ ColdAndreadsID,
63
+ ObjectID,
64
+ ObjectType,
65
+ #if !defined _Y_ITERATE_LOCAL_VERSION && !defined _FOREACH_LOCAL_VERSION
66
+ bool:ObjectUsed,
67
+ #endif
68
+ }
69
+ static stock CA_ObjectList[MAX_CA_OBJECTS][CAOBJECTINFO];
70
+ #if defined STREAMER_TYPE_OBJECT
71
+ stock STREAMER_TAG_OBJECT:CA_CreateDynamicObjectEx_SC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
72
+ {
73
+ new STREAMER_TAG_OBJECT:id = CreateDynamicObjectEx(modelid, x, y, z, rx, ry, rz, streamdistance, drawdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
74
+ CA_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
75
+ return id;
76
+ }
77
+ stock STREAMER_TAG_OBJECT:CA_CreateDynamicObject_SC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, vw = -1, interior = -1, playerid = -1, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0)
78
+ {
79
+ new STREAMER_TAG_OBJECT:id = CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, vw, interior, playerid, streamdistance, drawdistance, areaid, priority);
80
+ CA_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
81
+ return id;
82
+ }
83
+ stock CA_CreateObject_SC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 300.0)
84
+ {
85
+ new id = CreateObject(modelid, x, y, z, rx, ry, rz, drawdistance);
86
+ if(id != INVALID_OBJECT_ID) CA_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
87
+ return id;
88
+ }
89
+ stock CA_CreateDynamicObjectEx_DC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
90
+ {
91
+ new index = -1;
92
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
93
+ index = Iter_Free(CA_Objects);
94
+ #else
95
+ for(new i = 0; i < MAX_CA_OBJECTS; i++)
96
+ {
97
+ if(CA_ObjectList[i][ObjectUsed] == false)
98
+ {
99
+ index = i;
100
+ break;
101
+ }
102
+ }
103
+ #endif
104
+ if(index > -1)
105
+ {
106
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
107
+ Iter_Add(CA_Objects, index);
108
+ #else
109
+ CA_ObjectList[index][ObjectUsed] = true;
110
+ #endif
111
+ CA_ObjectList[index][ObjectID] = _:CreateDynamicObjectEx(modelid, x, y, z, rx, ry, rz, streamdistance, drawdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
112
+ CA_ObjectList[index][ColdAndreadsID] = CA_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, true);
113
+ CA_ObjectList[index][ObjectType] = OBJECT_TYPE_DYNAMIC;
114
+ }
115
+ return index;
116
+ }
117
+ stock CA_CreateDynamicObject_DC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, vw = -1, interior = -1, playerid = -1, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0)
118
+ {
119
+ new index = -1;
120
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
121
+ index = Iter_Free(CA_Objects);
122
+ #else
123
+ for(new i = 0; i < MAX_CA_OBJECTS; i++)
124
+ {
125
+ if(CA_ObjectList[i][ObjectUsed] == false)
126
+ {
127
+ index = i;
128
+ break;
129
+ }
130
+ }
131
+ #endif
132
+ if(index > -1)
133
+ {
134
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
135
+ Iter_Add(CA_Objects, index);
136
+ #else
137
+ CA_ObjectList[index][ObjectUsed] = true;
138
+ #endif
139
+ CA_ObjectList[index][ObjectID] = _:CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, vw, interior, playerid, streamdistance, drawdistance, areaid, priority);
140
+ CA_ObjectList[index][ColdAndreadsID] = CA_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, true);
141
+ CA_ObjectList[index][ObjectType] = OBJECT_TYPE_DYNAMIC;
142
+ }
143
+ return index;
144
+ }
145
+ #endif
146
+ stock CA_CreateObject_DC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 300.0)
147
+ {
148
+ new index = -1;
149
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
150
+ index = Iter_Free(CA_Objects);
151
+ #else
152
+ for(new i = 0; i < MAX_CA_OBJECTS; i++)
153
+ {
154
+ if(CA_ObjectList[i][ObjectUsed] == false)
155
+ {
156
+ index = i;
157
+ break;
158
+ }
159
+ }
160
+ #endif
161
+ new id = CreateObject(modelid, x, y, z, rx, ry, rz, drawdistance);
162
+ if(id == INVALID_OBJECT_ID) return -1;
163
+ if(index > -1)
164
+ {
165
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
166
+ Iter_Add(CA_Objects, index);
167
+ #else
168
+ CA_ObjectList[index][ObjectUsed] = true;
169
+ #endif
170
+ CA_ObjectList[index][ObjectID] = id;
171
+ CA_ObjectList[index][ColdAndreadsID] = CA_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, true);
172
+ CA_ObjectList[index][ObjectType] = OBJECT_TYPE_OBJECT;
173
+ }
174
+ return index;
175
+ }
176
+ stock CA_DestroyObject_DC(index)
177
+ {
178
+ if(index < 0 || index >= MAX_CA_OBJECTS) return -1;
179
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
180
+ if(Iter_Contains(CA_Objects, index))
181
+ {
182
+ new next;
183
+ Iter_SafeRemove(CA_Objects, index, next);
184
+ if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_OBJECT) DestroyObject(CA_ObjectList[index][ObjectID]);
185
+ #if defined STREAMER_TYPE_OBJECT
186
+ else if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_DYNAMIC) DestroyDynamicObject(STREAMER_TAG_OBJECT:CA_ObjectList[index][ObjectID]);
187
+ #endif
188
+ CA_DestroyObject(CA_ObjectList[index][ColdAndreadsID]);
189
+ return next;
190
+ }
191
+ #else
192
+ if(CA_ObjectList[index][ObjectUsed])
193
+ {
194
+ if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_OBJECT) DestroyObject(CA_ObjectList[index][ObjectID]);
195
+ #if defined STREAMER_TYPE_OBJECT
196
+ else if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_DYNAMIC) DestroyDynamicObject(STREAMER_TAG_OBJECT:CA_ObjectList[index][ObjectID]);
197
+ #endif
198
+ CA_ObjectList[index][ObjectUsed] = false;
199
+ CA_DestroyObject(CA_ObjectList[index][ColdAndreadsID]);
200
+ return 1;
201
+ }
202
+ #endif
203
+ return -1;
204
+ }
205
+ stock CA_SetObjectPos_DC(index, Float:x, Float:y, Float:z)
206
+ {
207
+ if(index < 0 || index >= MAX_CA_OBJECTS) return -1;
208
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
209
+ if(Iter_Contains(CA_Objects, index))
210
+ {
211
+ if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_OBJECT) SetObjectPos(CA_ObjectList[index][ObjectID], x, y, z);
212
+ #if defined STREAMER_TYPE_OBJECT
213
+ else if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_DYNAMIC) SetDynamicObjectPos(STREAMER_TAG_OBJECT:CA_ObjectList[index][ObjectID], x, y, z);
214
+ #endif
215
+ CA_SetObjectPos(CA_ObjectList[index][ColdAndreadsID], x, y, z);
216
+ }
217
+ #else
218
+ if(CA_ObjectList[index][ObjectUsed])
219
+ {
220
+ if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_OBJECT) SetObjectPos(CA_ObjectList[index][ObjectID], x, y, z);
221
+ #if defined STREAMER_TYPE_OBJECT
222
+ else if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_DYNAMIC) SetDynamicObjectPos(STREAMER_TAG_OBJECT:CA_ObjectList[index][ObjectID], x, y, z);
223
+ #endif
224
+ SetObjectPos(CA_ObjectList[index][ObjectID], x, y, z);
225
+ CA_SetObjectPos(CA_ObjectList[index][ColdAndreadsID], x, y, z);
226
+ return 1;
227
+ }
228
+ #endif
229
+ return -1;
230
+ }
231
+ stock CA_SetObjectRot_DC(index, Float:rx, Float:ry, Float:rz)
232
+ {
233
+ if(index < 0 || index >= MAX_CA_OBJECTS) return -1;
234
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
235
+ if(Iter_Contains(CA_Objects, index))
236
+ {
237
+ if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_OBJECT) SetObjectRot(CA_ObjectList[index][ObjectID], rx, ry, rz);
238
+ #if defined STREAMER_TYPE_OBJECT
239
+ else if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_DYNAMIC) SetDynamicObjectRot(STREAMER_TAG_OBJECT:CA_ObjectList[index][ObjectID], rx, ry, rz);
240
+ #endif
241
+ CA_SetObjectRot(CA_ObjectList[index][ColdAndreadsID], rx, ry, rz);
242
+ }
243
+ #else
244
+ if(CA_ObjectList[index][ObjectUsed])
245
+ {
246
+ if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_OBJECT) SetObjectRot(CA_ObjectList[index][ObjectID], rx, ry, rz);
247
+ #if defined STREAMER_TYPE_OBJECT
248
+ else if(CA_ObjectList[index][ObjectType] == OBJECT_TYPE_DYNAMIC) SetDynamicObjectRot(STREAMER_TAG_OBJECT:CA_ObjectList[index][ObjectID], rx, ry, rz);
249
+ #endif
250
+ CA_SetObjectRot(CA_ObjectList[index][ColdAndreadsID], rx, ry, rz);
251
+ return 1;
252
+ }
253
+ #endif
254
+ return -1;
255
+ }
256
+ stock CA_DestroyAllObjects_DC()
257
+ {
258
+ #if defined _Y_ITERATE_LOCAL_VERSION || defined _FOREACH_LOCAL_VERSION
259
+ foreach(new i : CA_Objects)
260
+ {
261
+ if(CA_ObjectList[i][ObjectType] == OBJECT_TYPE_OBJECT) i = CA_DestroyObject_DC(i);
262
+ }
263
+ #else
264
+ for(new i = 0; i < MAX_CA_OBJECTS; i++)
265
+ {
266
+ if(CA_ObjectList[i][ObjectUsed])
267
+ {
268
+ if(CA_ObjectList[i][ObjectType] == OBJECT_TYPE_OBJECT) CA_DestroyObject_DC(i);
269
+ }
270
+ }
271
+ #endif
272
+ }
273
+ stock CA_FindZ_For2DCoord(Float:x, Float:y, &Float:z)
274
+ {
275
+ if(CA_RayCastLine(x, y, 700.0, x, y, -1000.0, x, y, z)) return 1;
276
+ return 0;
277
+ }
278
+ stock CA_RayCastExplode(Float:cX, Float:cY, Float:cZ, Float:Radius, Float:intensity = 20.0, Float:collisions[][3])
279
+ {
280
+ if(intensity < 1.0 || intensity > 360.0 || (((360.0 / intensity) - floatround((360.0 / intensity), floatround_floor)) * intensity))
281
+ return 0;
282
+ new index, Float:LAT, Float:LON, Float:x, Float:y, Float:z;
283
+ for(new Float:lat = -180.0, Float:lon = -90.0; lat < 180.0; lat += (intensity * 0.75))
284
+ {
285
+ for(lon = -90.0; lon < 90.0; lon += intensity)
286
+ {
287
+ LAT = lat * 3.141593 / 180.0;
288
+ LON = lon * 3.141593 / 180.0;
289
+ x = -Radius * floatcos(LAT) * floatcos(LON);
290
+ y = Radius * floatcos(LAT) * floatsin(LON);
291
+ z = Radius * floatsin(LAT);
292
+ if(CA_RayCastLine(cX, cY, cZ, cX + x, cY + y, cZ + z, x, y, z))
293
+ {
294
+ collisions[index][0] = x;
295
+ collisions[index][1] = y;
296
+ collisions[index][2] = z;
297
+ index++;
298
+ }
299
+ }
300
+ }
301
+ return index;
302
+ }
303
+ stock CA_IsPlayerOnSurface(playerid, Float:tolerance = 1.5)
304
+ {
305
+ new Float:x, Float:y, Float:z;
306
+ GetPlayerPos(playerid, x, y, z);
307
+ if(!CA_RayCastLine(x, y, z, x, y, z-tolerance, x, y, z))
308
+ return 0;
309
+ return 1;
310
+ }
311
+ stock CA_IsVehicleOnSurface(vehicleid, Float:tolerance = 1.5)
312
+ {
313
+ new Float:x, Float:y, Float:z;
314
+ GetVehiclePos(vehicleid, x, y, z);
315
+ if(!CA_RayCastLine(x, y, z, x, y, z-tolerance, x, y, z))
316
+ return 0;
317
+ return 1;
318
+ }
319
+ stock CA_RemoveBarriers()
320
+ {
321
+ static const BarrierIDS[] = {
322
+ 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512, 4513,
323
+ 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523,
324
+ 4524, 4525, 4526, 4527, 16436, 16437, 16438, 16439, 1662
325
+ };
326
+ for(new i = 0; i < sizeof(BarrierIDS); i++)
327
+ CA_RemoveBuilding(BarrierIDS[i], 0.0, 0.0, 0.0, 4242.6407);
328
+ return 1;
329
+ }
330
+ stock CA_RemoveBreakableBuildings()
331
+ {
332
+ static const BreakableIDs[] = {
333
+ 625, 626, 627, 628, 629, 630, 631, 632, 633, 642, 643, 644, 646, 650, 716, 717, 737, 738, 792, 858, 881, 882, 883,
334
+ 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 904, 905, 941, 955, 956, 959, 961, 990, 993, 996, 1209,
335
+ 1211, 1213, 1219, 1220, 1221, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1235, 1238, 1244, 1251,
336
+ 1255, 1257, 1262, 1264, 1265, 1270, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1293,
337
+ 1294, 1297, 1300, 1302, 1315, 1328, 1329, 1330, 1338, 1350, 1351, 1352, 1370, 1373, 1374, 1375, 1407, 1408, 1409,
338
+ 1410, 1411, 1412, 1413, 1414, 1415, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1428, 1429, 1431,
339
+ 1432, 1433, 1436, 1437, 1438, 1440, 1441, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1456, 1457,
340
+ 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476,
341
+ 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1514, 1517, 1520, 1534, 1543, 1544, 1545, 1551, 1553, 1554, 1558, 1564,
342
+ 1568, 1582, 1583, 1584, 1588, 1589, 1590, 1591, 1592, 1645, 1646, 1647, 1654, 1664, 1666, 1667, 1668, 1669, 1670,
343
+ 1672, 1676, 1684, 1686, 1775, 1776, 1949, 1950, 1951, 1960, 1961, 1962, 1975, 1976, 1977, 2647, 2663, 2682, 2683,
344
+ 2885, 2886, 2887, 2900, 2918, 2920, 2925, 2932, 2933, 2942, 2943, 2945, 2947, 2958, 2959, 2966, 2968, 2971, 2977,
345
+ 2987, 2988, 2989, 2991, 2994, 3006, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3029, 3032, 3036, 3058, 3059, 3067,
346
+ 3083, 3091, 3221, 3260, 3261, 3262, 3263, 3264, 3265, 3267, 3275, 3276, 3278, 3280, 3281, 3282, 3302, 3374, 3409,
347
+ 3460, 3516, 3794, 3795, 3797, 3853, 3855, 3864, 3884, 11103, 12840, 16627, 16628, 16629, 16630, 16631, 16632,
348
+ 16633, 16634, 16635, 16636, 16732, 17968
349
+ };
350
+ for(new i = 0; i < sizeof(BreakableIDs); i++)
351
+ CA_RemoveBuilding(BreakableIDs[i], 0.0, 0.0, 0.0, 4242.6407);
352
+ return 1;
353
+ }
354
+ stock CA_IsPlayerInWater(playerid, &Float:depth, &Float:playerdepth)
355
+ {
356
+ new Float:x, Float:y, Float:z, Float:retx[10], Float:rety[10], Float:retz[10], Float: retdist[10], modelids[10];
357
+ GetPlayerPos(playerid, x, y, z);
358
+ new collisions = CA_RayCastMultiLine(x, y, z+1000.0, x, y, z-1000.0, retx, rety, retz, retdist, modelids, 10);
359
+ if(collisions > 0)
360
+ {
361
+ for(new i = 0, j = 0; i < collisions; i++)
362
+ {
363
+ if(modelids[i] == WATER_OBJECT)
364
+ {
365
+ depth = FLOAT_INFINITY;
366
+ for(j = 0; j < collisions; j++)
367
+ {
368
+ if(retz[j] < depth)
369
+ depth = retz[j];
370
+ }
371
+ depth = retz[i] - depth;
372
+ if(depth < 0.001 && depth > -0.001)
373
+ depth = 100.0;
374
+ playerdepth = retz[i] - z;
375
+ if(playerdepth < -2.0)
376
+ return 0;
377
+ return 1;
378
+ }
379
+ }
380
+ }
381
+ return 0;
382
+ }
383
+ stock CA_IsVehicleInWater(vehicleid, &Float:depth, &Float:vehicledepth)
384
+ {
385
+ new Float:x, Float:y, Float:z, Float:retx[10], Float:rety[10], Float:retz[10], Float:retdist[10], modelids[10];
386
+ GetVehiclePos(vehicleid, x, y, z);
387
+ new collisions = CA_RayCastMultiLine(x, y, z + 1000.0, x, y, z - 1000.0, retx, rety, retz, retdist, modelids, 10);
388
+ if(collisions)
389
+ {
390
+ for(new i = 0, j = 0; i < collisions; i++)
391
+ {
392
+ if(modelids[i] == WATER_OBJECT)
393
+ {
394
+ depth = FLOAT_INFINITY;
395
+ for(j = 0; j < collisions; j++)
396
+ {
397
+ if(retz[j] < depth)
398
+ depth = retz[j];
399
+ }
400
+ depth = retz[i] - depth;
401
+ if(depth < 0.001 && depth > -0.001)
402
+ depth = 100.0;
403
+ vehicledepth = retz[i] - z;
404
+ if(vehicledepth < -2.0)
405
+ return 0;
406
+ return 1;
407
+ }
408
+ }
409
+ }
410
+ return 0;
411
+ }
412
+ stock CA_IsPlayerNearWater(playerid, Float:dist = 3.0, Float:height = 3.0)
413
+ {
414
+ new Float:x, Float:y, Float:z, Float:tmp;
415
+ GetPlayerPos(playerid, x, y, z);
416
+ for(new i; i < 6; i++)
417
+ if(CA_RayCastLine(x + (dist * floatsin(i * 60.0, degrees)), y + (dist * floatcos(i * 60.0, degrees)), z + height, x + (dist * floatsin(i * 60.0, degrees)), y + (dist * floatcos(i * 60.0, degrees)), z - height, tmp, tmp, tmp) == WATER_OBJECT)
418
+ return 1;
419
+ return 0;
420
+ }
421
+ stock CA_IsVehicleNearWater(vehicleid, Float:dist = 3.0, Float:height = 3.0)
422
+ {
423
+ new Float:x, Float:y, Float:z, Float:tmp;
424
+ GetVehiclePos(vehicleid, x, y, z);
425
+ for(new i; i < 6; i++)
426
+ if(CA_RayCastLine(x + (dist * floatsin(i * 60.0, degrees)), y + (dist * floatcos(i * 60.0, degrees)), z + height, x + (dist * floatsin(i * 60.0, degrees)), y + (dist * floatcos(i * 60.0, degrees)), z - height, tmp, tmp, tmp) == WATER_OBJECT)
427
+ return 1;
428
+ return 0;
429
+ }
430
+ stock CA_IsPlayerFacingWater(playerid, Float:dist = 3.0, Float:height = 3.0)
431
+ {
432
+ new Float:x, Float:y, Float:z, Float:r, Float:tmp;
433
+ GetPlayerPos(playerid, x, y, z);
434
+ GetPlayerFacingAngle(playerid, r);
435
+ if(CA_RayCastLine(x + (dist * floatsin(-r, degrees)), y + (dist * floatcos(-r, degrees)), z, x + (dist * floatsin(-r, degrees)), y + (dist * floatcos(-r, degrees)), z - height, tmp, tmp, tmp) == WATER_OBJECT)
436
+ return 1;
437
+ return 0;
438
+ }
439
+ stock CA_IsVehicleFacingWater(vehicleid, Float:dist = 3.0, Float:height = 3.0)
440
+ {
441
+ new Float:x, Float:y, Float:z, Float:r, Float:tmp;
442
+ GetVehiclePos(vehicleid, x, y, z);
443
+ GetVehicleZAngle(vehicleid, r);
444
+ if(CA_RayCastLine(x + (dist * floatsin(-r, degrees)), y + (dist * floatcos(-r, degrees)), z, x + (dist * floatsin(-r, degrees)), y + (dist * floatcos(-r, degrees)), z - height, tmp, tmp, tmp) == WATER_OBJECT)
445
+ return 1;
446
+ return 0;
447
+ }
448
+ stock CA_IsPlayerBlocked(playerid, Float:dist = 1.5, Float:height = 0.5)
449
+ {
450
+ new Float:x, Float:y, Float:z, Float:endx, Float:endy, Float:fa;
451
+ GetPlayerPos(playerid, x, y, z);
452
+ z -= 1.0 + height;
453
+ GetPlayerFacingAngle(playerid, fa);
454
+ endx = (x + dist * floatsin(-fa, degrees));
455
+ endy = (y + dist * floatcos(-fa, degrees));
456
+ if(CA_RayCastLine(x, y, z, endx, endy, z, x, y, z))
457
+ return 1;
458
+ return 0;
459
+ }
460
+ stock CA_IsVehicleBlocked(vehicleid, Float:dist = 1.5, Float:height = 0.5)
461
+ {
462
+ new Float:x, Float:y, Float:z, Float:endx, Float:endy, Float:za;
463
+ GetVehiclePos(vehicleid, x, y, z);
464
+ z -= 1.0 + height;
465
+ GetVehicleZAngle(vehicleid, za);
466
+ endx = (x + dist * floatsin(-za, degrees));
467
+ endy = (y + dist * floatcos(-za, degrees));
468
+ if(CA_RayCastLine(x, y, z, endx, endy, z, x, y, z))
469
+ return 1;
470
+ return 0;
471
+ }
472
+ stock Float:CA_GetRoomHeight(Float:x, Float:y, Float:z)
473
+ {
474
+ new Float:fx, Float:fy, Float:fz, Float:cx, Float:cy, Float:cz;
475
+ if(CA_RayCastLine(x, y, z, x, y, z - 1000.0, fx, fy, fz))
476
+ {
477
+ if(CA_RayCastLine(x, y, z, x, y, z + 1000.0, cx, cy, cz))
478
+ return floatsqroot(((fx - cx) * (fx - cx)) + ((fy - cy) * (fy - cy)) + ((fz - cz) * (fz - cz)));
479
+ }
480
+ return 0.0;
481
+ }
482
+ stock Float:CA_GetRoomCenter(Float:x, Float:y, Float:z, &Float:m_x, &Float:m_y)
483
+ {
484
+ new Float:pt1x, Float:pt1y,
485
+ Float:pt2x, Float:pt2y,
486
+ Float:pt3x, Float:pt3y,
487
+ Float:tmp;
488
+ if(!CA_RayCastLine(x, y, z, x + 1000.0 * floatcos(0.0, degrees), y + 1000.0 * floatsin(0.0, degrees), z, pt1x, pt1y, tmp) ||
489
+ !CA_RayCastLine(x, y, z, x + 1000.0 * floatcos(120.0, degrees), y + 1000.0 * floatsin(120.0, degrees), z, pt2x, pt2y, tmp) ||
490
+ !CA_RayCastLine(x, y, z, x + 1000.0 * floatcos(-120.0, degrees), y + 1000.0 * floatsin(-120.0, degrees), z, pt3x, pt3y, tmp))
491
+ return -1.0;
492
+ new Float:yDelta_a = pt2y - pt1y,
493
+ Float:xDelta_a = pt2x - pt1x,
494
+ Float:yDelta_b = pt3y - pt2y,
495
+ Float:xDelta_b = pt3x - pt2x;
496
+ if (floatabs(xDelta_a) <= 0.000000001 && floatabs(yDelta_b) <= 0.000000001) {
497
+ m_x = 0.5 * (pt2x + pt3x);
498
+ m_y = 0.5 * (pt1y + pt2y);
499
+ return VectorSize(m_x - pt1x, m_y - pt1y, 0.0);
500
+ }
501
+ new Float:aSlope = yDelta_a / xDelta_a,
502
+ Float:bSlope = yDelta_b / xDelta_b;
503
+ if (floatabs(aSlope-bSlope) <= 0.000000001)
504
+ return -1.0;
505
+ m_x = (aSlope * bSlope * (pt1y - pt3y) + bSlope * (pt1x + pt2x) - aSlope * (pt2x + pt3x)) / (2.0 * (bSlope - aSlope));
506
+ m_y = -1.0 * (m_x - (pt1x + pt2x) / 2.0) / aSlope + (pt1y + pt2y) / 2.0;
507
+ return VectorSize(m_x - pt1x, m_y - pt1y, 0.0);
508
+ }
509
+ stock CA_GetObjectID(const index)
510
+ {
511
+ if (!(0 <= index < sizeof(CA_ObjectList)))
512
+ {
513
+ return -1;
514
+ }
515
+ if (!CA_IsValidObject(index))
516
+ {
517
+ return -2;
518
+ }
519
+ return CA_ObjectList[index][ObjectID];
520
+ }
521
+ stock CA_GetObjectType(const index)
522
+ {
523
+ if (!(0 <= index < sizeof(CA_ObjectList)))
524
+ {
525
+ return -1;
526
+ }
527
+ if (!CA_IsValidObject(index))
528
+ {
529
+ return -2;
530
+ }
531
+ return CA_ObjectList[index][ObjectType];
532
+ }
533
+ stock CA_GetCollisionObjectID(const index)
534
+ {
535
+ if (!(0 <= index < sizeof(CA_ObjectList)))
536
+ {
537
+ return -1;
538
+ }
539
+ if (!CA_IsValidObject(index))
540
+ {
541
+ return -2;
542
+ }
543
+ return CA_ObjectList[index][ColdAndreadsID];
544
+ }
545
+ public OnFilterScriptExit()
546
+ {
547
+ CA_DestroyAllObjects_DC();
548
+ if (funcidx("CA_OnFilterScriptExit") != -1)
549
+ {
550
+ return CallLocalFunction("CA_OnFilterScriptExit", "");
551
+ }
552
+ return 1;
553
+ }
554
+ #if defined _ALS_OnFilterScriptExit
555
+ #undef OnFilterScriptExit
556
+ #else
557
+ #define _ALS_OnFilterScriptExit
558
+ #endif
559
+ #define OnFilterScriptExit CA_OnFilterScriptExit
560
+ forward CA_OnFilterScriptExit();
561
+ public OnGameModeExit()
562
+ {
563
+ CA_DestroyAllObjects_DC();
564
+ if (funcidx("CA_OnGameModeExit") != -1)
565
+ {
566
+ return CallLocalFunction("CA_OnGameModeExit", "");
567
+ }
568
+ return 1;
569
+ }
570
+ #if defined _ALS_OnGameModeExit
571
+ #undef OnGameModeExit
572
+ #else
573
+ #define _ALS_OnGameModeExit
574
+ #endif
575
+ #define OnGameModeExit CA_OnGameModeExit
576
+ forward CA_OnGameModeExit();
crashdetect.inc ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined CRASHDETECT_INC
2
+ #endinput
3
+ #endif
4
+ #define CRASHDETECT_INC
5
+ #define PrintAmxBacktrace PrintBacktrace
6
+ #define GetAmxBacktrace GetBacktrace
7
+ native PrintBacktrace();
8
+ native PrintNativeBacktrace();
9
+ native GetBacktrace(string[], size = sizeof(string));
10
+ native GetNativeBacktrace(string[], size = sizeof(string));
11
+ forward OnRuntimeError(code, &bool:suppress);
12
+ stock bool:IsCrashDetectPresent() {
13
+ #emit zero.pri
14
+ #emit lctrl 0xFF
15
+ #emit not
16
+ #emit not
17
+ #emit retn
18
+ return false;
19
+ }
20
+ stock SetCrashDetectLongCallTime(us_time) {
21
+ #emit load.s.pri us_time
22
+ #emit sctrl 0xFE
23
+ }
24
+ stock GetCrashDetectLongCallTime() {
25
+ #emit zero.pri
26
+ #emit lctrl 0xFE
27
+ #emit retn
28
+ return 0;
29
+ }
30
+ stock DisableCrashDetectLongCall() {
31
+ #emit const.pri 32
32
+ #emit sctrl 0xFF
33
+ }
34
+ stock EnableCrashDetectLongCall() {
35
+ #emit const.pri 34
36
+ #emit sctrl 0xFF
37
+ }
38
+ stock ResetCrashDetectLongCallTime() {
39
+ #emit const.pri 36
40
+ #emit sctrl 0xFF
41
+ }
42
+ stock RestartCrashDetectLongCall() {
43
+ #emit const.pri 40
44
+ #emit sctrl 0xFF
45
+ }
46
+ stock bool:IsCrashDetectLongCallEnabled() {
47
+ #emit zero.pri
48
+ #emit lctrl 0xFF
49
+ #emit shr.c.pri 1
50
+ #emit const.alt 1
51
+ #emit and
52
+ #emit retn
53
+ return false;
54
+ }
55
+ stock bool:HasCrashDetectLongCall() {
56
+ #emit zero.pri
57
+ #emit lctrl 0xFF
58
+ #emit shr.c.pri 5
59
+ #emit const.alt 1
60
+ #emit and
61
+ #emit retn
62
+ return false;
63
+ }
64
+ stock GetCrashDetectDefaultTime() {
65
+ #emit lctrl 0xFE
66
+ #emit move.alt
67
+ #emit const.pri 36
68
+ #emit sctrl 0xFF
69
+ #emit lctrl 0xFE
70
+ #emit xchg
71
+ #emit sctrl 0xFE
72
+ #emit move.pri
73
+ #emit retn
74
+ return 0;
75
+ }
76
+ stock DisableCrashDetectAddr0() {
77
+ #emit const.pri 64
78
+ #emit sctrl 0xFF
79
+ }
80
+ stock EnableCrashDetectAddr0() {
81
+ #emit const.pri 192
82
+ #emit sctrl 0xFF
83
+ }
84
+ stock bool:IsCrashDetectAddr0Enabled() {
85
+ #emit zero.pri
86
+ #emit lctrl 0xFF
87
+ #emit shr.c.pri 7
88
+ #emit const.alt 1
89
+ #emit and
90
+ #emit retn
91
+ return false;
92
+ }
93
+ stock bool:HasCrashDetectAddr0() {
94
+ #emit zero.pri
95
+ #emit lctrl 0xFF
96
+ #emit shr.c.pri 6
97
+ #emit const.alt 1
98
+ #emit and
99
+ #emit retn
100
+ return false;
101
+ }
easyDialog.inc ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _easyDialog_included
2
+ #endinput
3
+ #endif
4
+ #define _easyDialog_included
5
+ #if !defined isnull
6
+ #define isnull(%1) \
7
+ ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
8
+ #endif
9
+ #if !defined HidePlayerDialog
10
+ #define HidePlayerDialog(%1) \
11
+ ShowPlayerDialog(%1, -1, 0, " ", " ", " ", " ")
12
+ #endif
13
+ #define Dialog:%0(%1) \
14
+ forward dialog_%0(%1); public dialog_%0(%1)
15
+ #define Dialog_Show(%0,%1, \
16
+ Dialog_Open(%0, #%1,
17
+ #define Dialog_Opened(%0) \
18
+ (CallRemoteFunction("Dialog_IsOpened", "i", (%0)))
19
+ #if !defined _INC_open_mp
20
+ #if !defined DIALOG_STYLE
21
+ #define DIALOG_STYLE: _:
22
+ #endif
23
+ #endif
24
+ static
25
+ s_DialogName[MAX_PLAYERS][32 char],
26
+ bool: s_DialogOpened[MAX_PLAYERS]
27
+ ;
28
+ forward OnDialogPerformed(playerid, const dialog[], response, success);
29
+ forward @dialog_format(); @dialog_format() {
30
+ new emptyString[] = '\1';
31
+ format(emptyString, sizeof(emptyString), emptyString);
32
+ }
33
+ forward Dialog_IsOpened(playerid);
34
+ public Dialog_IsOpened(playerid) {
35
+ return (s_DialogOpened[playerid]);
36
+ }
37
+ stock Dialog_Close(playerid) {
38
+ s_DialogName[playerid]{0} = 0;
39
+ s_DialogOpened[playerid] = false;
40
+ return HidePlayerDialog(playerid);
41
+ }
42
+ stock Dialog_Open(playerid, const function[], DIALOG_STYLE:style, const caption[], const info[], const button1[], const button2[], {Float,_}:...) {
43
+ static
44
+ string[4096],
45
+ args
46
+ ;
47
+ if (!strlen(info)) {
48
+ return 0;
49
+ }
50
+ if ((args = numargs()) > 7) {
51
+ while (--args >= 7) {
52
+ #emit LCTRL 5
53
+ #emit LOAD.alt args
54
+ #emit SHL.C.alt 2
55
+ #emit ADD.C 12
56
+ #emit ADD
57
+ #emit LOAD.I
58
+ #emit PUSH.pri
59
+ }
60
+ #emit PUSH.S info
61
+ #emit PUSH.C 4096
62
+ #emit PUSH.C string
63
+ #emit LOAD.S.pri 8
64
+ #emit CONST.alt 16
65
+ #emit SUB
66
+ #emit PUSH.pri
67
+ #emit SYSREQ.C format
68
+ #emit LCTRL 5
69
+ #emit SCTRL 4
70
+ ShowPlayerDialog(playerid, 32700, style, caption, string, button1, button2);
71
+ }
72
+ else {
73
+ ShowPlayerDialog(playerid, 32700, style, caption, info, button1, button2);
74
+ }
75
+ s_DialogOpened[playerid] = true;
76
+ strpack(s_DialogName[playerid], function, 32 char);
77
+ return 1;
78
+ }
79
+ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
80
+ static
81
+ s_Public = cellmax;
82
+ if (s_Public == cellmax) {
83
+ s_Public = funcidx("OnDialogPerformed");
84
+ }
85
+ for (new i = 0, l = strlen(inputtext); i < l; i ++) {
86
+ if (inputtext[i] == '%') {
87
+ inputtext[i] = '#';
88
+ }
89
+ }
90
+ if (dialogid == 32700 && strlen(s_DialogName[playerid]) > 0) {
91
+ new
92
+ string[40];
93
+ strcat(string, "dialog_");
94
+ strcat(string, s_DialogName[playerid]);
95
+ Dialog_Close(playerid);
96
+ if ((s_Public == -1) || (CallLocalFunction("OnDialogPerformed", "dsdd", playerid, string[7], response, funcidx(string) != -1))) {
97
+ CallLocalFunction(string, "ddds", playerid, response, listitem, (!inputtext[0]) ? ("\1") : (inputtext));
98
+ }
99
+ }
100
+ #if defined DR_OnDialogResponse
101
+ return DR_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
102
+ #else
103
+ return 0;
104
+ #endif
105
+ }
106
+ #if defined _ALS_OnDialogResponse
107
+ #undef OnDialogResponse
108
+ #else
109
+ #define _ALS_OnDialogResponse
110
+ #endif
111
+ #define OnDialogResponse DR_OnDialogResponse
112
+ #if defined DR_OnDialogResponse
113
+ forward DR_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
114
+ #endif
fixes.inc ADDED
The diff for this file is too large to render. See raw diff
 
foreach.inc ADDED
@@ -0,0 +1,515 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _FOREACH_LOCAL_VERSION
2
+ #endinput
3
+ #endif
4
+ #define _FOREACH_LOCAL_VERSION 19
5
+ #if defined _FOREACH_INC_TEST
6
+ #endinput
7
+ #endif
8
+ #define _FOREACH_INC_TEST
9
+ #if !defined _samp_included
10
+ #error "Please include a_samp or a_npc before foreach"
11
+ #endif
12
+ #if defined SendChat || defined FOREACH_NO_PLAYERS
13
+ #define BOTSYNC_IS_BOT (true)
14
+ #endif
15
+ #if defined IsPlayerNPC
16
+ #define _FOREACH_BOT
17
+ #endif
18
+ #define ITER_NONE -1
19
+ #define _Y_ITER_ARRAY: _:_Y_ITER_C0:
20
+ #define _Y_ITER_ARRAY_SIZE(%1) _:_Y_ITER_C1:_Y_ITER_C2:sizeof %1@YSII_Ag-1
21
+ #define _Y_ITER_C0:%0[%1]@YSII_%4g%3) %0@YSII_%4g[%1]%3)
22
+ #define _Y_ITER_C1:_Y_ITER_C2:%0[%1]@YSII_Ag%3) %0@YSII_Ag[]%3)
23
+ #define _Y_ITER_C2:sizeof%0(%1)@YSII_Ag-1;_:(%2=_Y_ITER_ARRAY:%3(%4)@YSII_Ag[%5])!=_Y_ITER_ARRAY_SIZE(%6);) -1;_:(%2=%3@YSII_Ag(%4,%5))!=-1;)
24
+ #define _Y_ITER_C3:%0[%1]@YSII_Cg,%2[%3]@YSII_Ag[%4]={%5} _Y_ITER_C3:%0@YSII_Cg[%1],%0@YSII_Ag[%1][%4]
25
+ #if !defined BOTSYNC_IS_BOT
26
+ static stock
27
+ YSI_g_sCallbacks = 0;
28
+ forward Iter_OPDCInternal(playerid);
29
+ #if !defined FOREACH_I_Vehicle
30
+ #define FOREACH_I_Vehicle 1
31
+ #endif
32
+ #else
33
+ #if !defined FOREACH_I_Vehicle
34
+ #define FOREACH_I_Vehicle 0
35
+ #endif
36
+ #endif
37
+ #define IteratorArray:%1[%2]<%3> %1@YSII_Cg[%2],%1@YSII_Ag[%2][%3+1]
38
+ #define Iterator:%1<%2> _Y_ITER_C3:%1@YSII_Cg,%1@YSII_Ag[(%2)+1]={(%2)*2,(%2)*2-1,...}
39
+ #define iterator%0<%1> new Iterator:%0<%1>
40
+ #define Iter_Init(%1) \
41
+ Iter_InitInternal(%1@YSII_Ag,sizeof %1@YSII_Ag,sizeof %1@YSII_Ag[]-1)
42
+ #define Iter_Add(%1,%2) Iter_AddInternal(_Y_ITER_ARRAY:%1@YSII_Cg,_Y_ITER_ARRAY:%1@YSII_Ag,%2,_Y_ITER_ARRAY_SIZE(%1))
43
+ #define Iter_Free(%1) Iter_FreeInternal(_Y_ITER_ARRAY:%1@YSII_Ag,_Y_ITER_ARRAY_SIZE(%1))
44
+ #define Iter_Remove(%1,%2) Iter_RemoveInternal(_Y_ITER_ARRAY:%1@YSII_Cg,_Y_ITER_ARRAY:%1@YSII_Ag,%2,_Y_ITER_ARRAY_SIZE(%1))
45
+ #define Iter_Contains(%1,%2) Iter_ContainsInternal(_Y_ITER_ARRAY:%1@YSII_Ag,%2,_Y_ITER_ARRAY_SIZE(%1))
46
+ #define Iter_SafeRemove(%1,%2,%3) Iter_SafeRemoveInternal(_Y_ITER_ARRAY:%1@YSII_Cg,_Y_ITER_ARRAY:%1@YSII_Ag,%2,%3,_Y_ITER_ARRAY_SIZE(%1))
47
+ #define Iter_Random(%1) Iter_RandomInternal(_Y_ITER_ARRAY:%1@YSII_Cg,_Y_ITER_ARRAY:%1@YSII_Ag,_Y_ITER_ARRAY_SIZE(%1))
48
+ #define Iter_Count(%1) (_Y_ITER_ARRAY:%1@YSII_Cg)
49
+ #define Iter_Clear(%1) Iter_ClearInternal(_Y_ITER_ARRAY:%1@YSII_Cg,_Y_ITER_ARRAY:%1@YSII_Ag,_Y_ITER_ARRAY_SIZE(%1))
50
+ #if !defined BOTSYNC_IS_BOT
51
+ new
52
+ Iterator:Player<MAX_PLAYERS>,
53
+ Iterator:Actor<MAX_ACTORS>;
54
+ #if FOREACH_I_Vehicle
55
+ new Iterator:Vehicle<MAX_VEHICLES>;
56
+ #endif
57
+ #if defined _FOREACH_BOT && !defined FOREACH_NO_BOTS
58
+ new
59
+ Iterator:Bot<MAX_PLAYERS>,
60
+ Iterator:Character<MAX_PLAYERS>;
61
+ #define NPC@YSII_Cg Bot@YSII_Cg
62
+ #define NPC@YSII_Ag Bot@YSII_Ag
63
+ #endif
64
+ #endif
65
+ static stock
66
+ YSI_gsOnPlayerConnect[] = "Iter_OnPlayerConnect",
67
+ YSI_gsOnPlayerDisconnect[] = "Iter_OnPlayerDisconnect",
68
+ YSI_gsOnGameModeInit[] = "Iter_OnGameModeInit",
69
+ YSI_OnFilterScriptInit[] = "Iter_OnFilterScriptInit",
70
+ YSI_gsSpecifier@[] = "",
71
+ YSI_gsSpecifier@i[] = "i";
72
+ #define foreach%1(%0) for(new Y_FOREACH_SECOND|||Y_FOREACH_THIRD|||%0|||)
73
+ #define new%0|||%9|||%1:%2||| %9|||%0|||%1|||%2|||
74
+ #define Y_FOREACH_THIRD|||%0|||%1|||%2||| %1=Y_FOREACH_FIFTH|||Y_FOREACH_FOURTH|||%1:%2|||
75
+ #define Y_FOREACH_FOURTH|||%0=Y_FOREACH_FIFTH|||%1|||%2||| new Y_FOREACH_SIXTH;%0|||Y_FOREACH_SEVENTH|||%2|||
76
+ #define Y_FOREACH_SEVENTH|||%9Y_FOREACH_SIXTH;%0|||%1|||%2||| new %0:%1=%0:(_Y_ITER_ARRAY_SIZE(%2));_:(%1=%0:_Y_ITER_ARRAY:%2@YSII_Ag[_:%1])!=_Y_ITER_ARRAY_SIZE(%2);
77
+ #define Y_FOREACH_SIXTH;%0|||Y_FOREACH_SEVENTH|||%2||| %0=_Y_ITER_ARRAY_SIZE(%2);_:(%0=_Y_ITER_ARRAY:%2@YSII_Ag[%0])!=_Y_ITER_ARRAY_SIZE(%2);
78
+ #define Y_FOREACH_FIFTH|||Y_FOREACH_FOURTH|||%1:%2||| _Y_ITER_ARRAY_SIZE(%2);_:(%1=_Y_ITER_ARRAY:%2@YSII_Ag[%1])!=_Y_ITER_ARRAY_SIZE(%2);
79
+ #define Y_FOREACH_SECOND|||Y_FOREACH_THIRD|||%1,%2||| %2=_Y_ITER_ARRAY_SIZE(%1);_:(%2=_Y_ITER_ARRAY:%1@YSII_Ag[%2])!=_Y_ITER_ARRAY_SIZE(%1);
80
+ #define foreachex(%1,%2) foreach(%2:%1)
81
+ stock Iter_ScriptInit()
82
+ {
83
+ Iter_Clear(Player);
84
+ #if defined _FOREACH_BOT && !defined FOREACH_NO_BOTS
85
+ Iter_Clear(Bot);
86
+ Iter_Clear(Character);
87
+ #endif
88
+ #if FOREACH_I_Vehicle
89
+ Iter_Clear(Vehicle);
90
+ for(new vehicleid = 1; vehicleid != MAX_VEHICLES; ++vehicleid) {
91
+ if(!GetVehicleModel(vehicleid)) {
92
+ continue;
93
+ }
94
+ Iter_Add(Vehicle, vehicleid);
95
+ }
96
+ #endif
97
+ Iter_Clear(Actor);
98
+ for(new actorid = 0; actorid != MAX_ACTORS; ++actorid) {
99
+ if(!IsValidActor(actorid)) {
100
+ continue;
101
+ }
102
+ Iter_Add(Actor, actorid);
103
+ }
104
+ if(funcidx(YSI_gsOnPlayerDisconnect) != -1) {
105
+ YSI_g_sCallbacks |= 1;
106
+ }
107
+ if(funcidx(YSI_gsOnPlayerConnect) != -1) {
108
+ YSI_g_sCallbacks |= 2;
109
+ }
110
+ }
111
+ #if !defined BOTSYNC_IS_BOT
112
+ public OnFilterScriptInit()
113
+ {
114
+ Iter_ScriptInit();
115
+ #if defined _FOREACH_BOT && !defined FOREACH_NO_BOTS
116
+ Bot@YSII_Cg = _Y_ITER_C3:0;
117
+ Character@YSII_Cg = _Y_ITER_C3:0;
118
+ new
119
+ lastBot = MAX_PLAYERS,
120
+ lastCharacter = MAX_PLAYERS;
121
+ #endif
122
+ Player@YSII_Cg = _Y_ITER_C3:0;
123
+ new
124
+ lastPlayer = MAX_PLAYERS;
125
+ for(new i = 0; i != MAX_PLAYERS; ++i) {
126
+ if(IsPlayerConnected(i)) {
127
+ #if defined _FOREACH_BOT
128
+ if(!IsPlayerNPC(i)) {
129
+ Player@YSII_Ag[lastPlayer] = i;
130
+ ++Player@YSII_Cg;
131
+ lastPlayer = i;
132
+ }
133
+ #if !defined FOREACH_NO_BOTS
134
+ else {
135
+ Bot@YSII_Ag[lastBot] = i;
136
+ ++Bot@YSII_Cg;
137
+ lastBot = i;
138
+ }
139
+ #pragma tabsize 4
140
+ Character@YSII_Ag[lastCharacter] = i;
141
+ ++Character@YSII_Cg;
142
+ lastCharacter = i;
143
+ #endif
144
+ #else
145
+ Player@YSII_Ag[lastPlayer] = i;
146
+ ++Player@YSII_Cg;
147
+ lastPlayer = i;
148
+ #endif
149
+ } else {
150
+ #if defined _FOREACH_BOT && !defined FOREACH_NO_BOTS
151
+ Bot@YSII_Ag[i] = MAX_PLAYERS + 1;
152
+ Character@YSII_Ag[i] = MAX_PLAYERS + 1;
153
+ #endif
154
+ Player@YSII_Ag[i] = MAX_PLAYERS + 1;
155
+ }
156
+ }
157
+ #if defined _FOREACH_BOT && !defined FOREACH_NO_BOTS
158
+ Bot@YSII_Ag[lastPlayer] = MAX_PLAYERS;
159
+ Character@YSII_Ag[lastPlayer] = MAX_PLAYERS;
160
+ #endif
161
+ Player@YSII_Ag[lastPlayer] = MAX_PLAYERS;
162
+ CallLocalFunction(YSI_OnFilterScriptInit, YSI_gsSpecifier@);
163
+ return 1;
164
+ }
165
+ #if defined _ALS_OnFilterScriptInit
166
+ #undef OnFilterScriptInit
167
+ #else
168
+ #define _ALS_OnFilterScriptInit
169
+ #endif
170
+ #define OnFilterScriptInit Iter_OnFilterScriptInit
171
+ forward OnFilterScriptInit();
172
+ #endif
173
+ #if !defined BOTSYNC_IS_BOT
174
+ public OnGameModeInit()
175
+ {
176
+ Iter_ScriptInit();
177
+ #if defined _FOREACH_BOT && !defined FOREACH_NO_BOTS
178
+ Bot@YSII_Cg = _Y_ITER_C3:0;
179
+ Bot@YSII_Ag[MAX_PLAYERS] = MAX_PLAYERS;
180
+ Character@YSII_Ag[MAX_PLAYERS] = MAX_PLAYERS;
181
+ Character@YSII_Cg = _Y_ITER_C3:0;
182
+ new
183
+ lastBot = MAX_PLAYERS,
184
+ lastCharacter = MAX_PLAYERS;
185
+ #endif
186
+ Player@YSII_Cg = _Y_ITER_C3:0;
187
+ Player@YSII_Ag[MAX_PLAYERS] = MAX_PLAYERS;
188
+ new
189
+ lastPlayer = MAX_PLAYERS;
190
+ for(new i = 0; i != MAX_PLAYERS; ++i) {
191
+ if(IsPlayerConnected(i)) {
192
+ #if defined _FOREACH_BOT
193
+ if(!IsPlayerNPC(i)) {
194
+ Player@YSII_Ag[lastPlayer] = i;
195
+ ++Player@YSII_Cg;
196
+ lastPlayer = i;
197
+ }
198
+ #if !defined FOREACH_NO_BOTS
199
+ else {
200
+ Bot@YSII_Ag[lastBot] = i;
201
+ ++Bot@YSII_Cg;
202
+ lastBot = i;
203
+ }
204
+ #pragma tabsize 4
205
+ Character@YSII_Ag[lastCharacter] = i;
206
+ ++Character@YSII_Cg;
207
+ lastCharacter = i;
208
+ #endif
209
+ #else
210
+ Player@YSII_Ag[lastPlayer] = i;
211
+ ++Player@YSII_Cg;
212
+ lastPlayer = i;
213
+ #endif
214
+ } else {
215
+ #if defined _FOREACH_BOT && !defined FOREACH_NO_BOTS
216
+ Bot@YSII_Ag[i] = MAX_PLAYERS + 1;
217
+ Character@YSII_Ag[i] = MAX_PLAYERS + 1;
218
+ #endif
219
+ Player@YSII_Ag[i] = MAX_PLAYERS + 1;
220
+ }
221
+ }
222
+ #if defined _FOREACH_BOT && !defined FOREACH_NO_BOTS
223
+ Bot@YSII_Ag[lastPlayer] = MAX_PLAYERS;
224
+ Character@YSII_Ag[lastPlayer] = MAX_PLAYERS;
225
+ #endif
226
+ Player@YSII_Ag[lastPlayer] = MAX_PLAYERS;
227
+ CallLocalFunction(YSI_gsOnGameModeInit, YSI_gsSpecifier@);
228
+ return 1;
229
+ }
230
+ #if defined _ALS_OnGameModeInit
231
+ #undef OnGameModeInit
232
+ #else
233
+ #define _ALS_OnGameModeInit
234
+ #endif
235
+ #define OnGameModeInit Iter_OnGameModeInit
236
+ forward OnGameModeInit();
237
+ #endif
238
+ #if !defined BOTSYNC_IS_BOT
239
+ public OnPlayerConnect(playerid)
240
+ {
241
+ #if defined _FOREACH_BOT
242
+ if(!IsPlayerNPC(playerid)) {
243
+ Iter_Add(Player, playerid);
244
+ }
245
+ #if !defined FOREACH_NO_BOTS
246
+ else {
247
+ Iter_Add(Bot, playerid);
248
+ }
249
+ #pragma tabsize 4
250
+ Iter_Add(Character, playerid);
251
+ #endif
252
+ #else
253
+ Iter_Add(Player, playerid);
254
+ #endif
255
+ if(YSI_g_sCallbacks & 2) {
256
+ CallLocalFunction(YSI_gsOnPlayerConnect, YSI_gsSpecifier@i, playerid);
257
+ }
258
+ return 1;
259
+ }
260
+ #if defined _ALS_OnPlayerConnect
261
+ #undef OnPlayerConnect
262
+ #else
263
+ #define _ALS_OnPlayerConnect
264
+ #endif
265
+ #define OnPlayerConnect Iter_OnPlayerConnect
266
+ forward OnPlayerConnect(playerid);
267
+ #endif
268
+ #if !defined BOTSYNC_IS_BOT
269
+ public OnPlayerDisconnect(playerid, reason)
270
+ {
271
+ if(YSI_g_sCallbacks & 1) {
272
+ CallLocalFunction(YSI_gsOnPlayerDisconnect, "ii", playerid, reason);
273
+ }
274
+ SetTimerEx("Iter_OPDCInternal", 0, false, YSI_gsSpecifier@i, playerid);
275
+ return 1;
276
+ }
277
+ #if defined _ALS_OnPlayerDisconnect
278
+ #undef OnPlayerDisconnect
279
+ #else
280
+ #define _ALS_OnPlayerDisconnect
281
+ #endif
282
+ #define OnPlayerDisconnect Iter_OnPlayerDisconnect
283
+ forward OnPlayerDisconnect(playerid, reason);
284
+ #endif
285
+ #if !defined BOTSYNC_IS_BOT
286
+ public Iter_OPDCInternal(playerid)
287
+ {
288
+ if(IsPlayerConnected(playerid)) {
289
+ return;
290
+ }
291
+ #if defined _FOREACH_BOT
292
+ if(!IsPlayerNPC(playerid)) {
293
+ Iter_Remove(Player, playerid);
294
+ }
295
+ #if !defined FOREACH_NO_BOTS
296
+ else {
297
+ Iter_Remove(Bot, playerid);
298
+ }
299
+ #pragma tabsize 4
300
+ Iter_Remove(Character, playerid);
301
+ #endif
302
+ #else
303
+ Iter_Remove(Player, playerid);
304
+ #endif
305
+ }
306
+ #endif
307
+ #if FOREACH_I_Vehicle
308
+ stock Iter_CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren = 0)
309
+ {
310
+ new
311
+ ret = CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay, !!addsiren);
312
+ if(ret != INVALID_VEHICLE_ID && ret != 0) {
313
+ Iter_Add(Vehicle, ret);
314
+ }
315
+ return ret;
316
+ }
317
+ #if defined _ALS_CreateVehicle
318
+ #undef CreateVehicle
319
+ #else
320
+ #define _ALS_CreateVehicle
321
+ #endif
322
+ #define CreateVehicle Iter_CreateVehicle
323
+ stock Iter_AddStaticVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2)
324
+ {
325
+ new
326
+ ret = AddStaticVehicle(modelid, x, y, z, angle, color1, color2);
327
+ if(ret != INVALID_VEHICLE_ID) {
328
+ Iter_Add(Vehicle, ret);
329
+ }
330
+ return ret;
331
+ }
332
+ #if defined _ALS_AddStaticVehicle
333
+ #undef AddStaticVehicle
334
+ #else
335
+ #define _ALS_AddStaticVehicle
336
+ #endif
337
+ #define AddStaticVehicle Iter_AddStaticVehicle
338
+ stock Iter_AddStaticVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren = 0)
339
+ {
340
+ new
341
+ ret = AddStaticVehicleEx(modelid, x, y, z, angle, color1, color2, respawn_delay, !!addsiren);
342
+ if(ret != INVALID_VEHICLE_ID) {
343
+ Iter_Add(Vehicle, ret);
344
+ }
345
+ return ret;
346
+ }
347
+ #if defined _ALS_AddStaticVehicleEx
348
+ #undef AddStaticVehicleEx
349
+ #else
350
+ #define _ALS_AddStaticVehicleEx
351
+ #endif
352
+ #define AddStaticVehicleEx Iter_AddStaticVehicleEx
353
+ stock DestroyVehicleSafe(&vehicleid)
354
+ {
355
+ new success = DestroyVehicle(vehicleid);
356
+ Iter_SafeRemove(Vehicle, vehicleid, vehicleid);
357
+ return success;
358
+ }
359
+ stock Iter_DestroyVehicle(vehicleid)
360
+ {
361
+ Iter_Remove(Vehicle, vehicleid);
362
+ return DestroyVehicle(vehicleid);
363
+ }
364
+ #if defined _ALS_DestroyVehicle
365
+ #undef DestroyVehicle
366
+ #else
367
+ #define _ALS_DestroyVehicle
368
+ #endif
369
+ #define DestroyVehicle Iter_DestroyVehicle
370
+ #endif
371
+ #if !defined BOTSYNC_IS_BOT
372
+ stock Iter_CreateActor(modelid, Float:x, Float:y, Float:z, Float:zAngle)
373
+ {
374
+ new
375
+ ret = CreateActor(modelid, x, y, z, zAngle);
376
+ if(ret != INVALID_ACTOR_ID) {
377
+ Iter_Add(Actor, ret);
378
+ }
379
+ return ret;
380
+ }
381
+ #if defined _ALS_CreateActor
382
+ #undef CreateActor
383
+ #else
384
+ #define _ALS_CreateActor
385
+ #endif
386
+ #define CreateActor Iter_CreateActor
387
+ stock DestroyActorSafe(&actorid)
388
+ {
389
+ new success = DestroyActor(actorid);
390
+ Iter_SafeRemove(Actor, actorid, actorid);
391
+ return success;
392
+ }
393
+ stock Iter_DestroyActor(actorid)
394
+ {
395
+ Iter_Remove(Actor, actorid);
396
+ return DestroyActor(actorid);
397
+ }
398
+ #if defined _ALS_DestroyActor
399
+ #undef DestroyActor
400
+ #else
401
+ #define _ALS_DestroyActor
402
+ #endif
403
+ #define DestroyActor Iter_DestroyActor
404
+ #endif
405
+ stock Iter_RandomInternal(count, const array[], size)
406
+ {
407
+ if(count == 0) {
408
+ return ITER_NONE;
409
+ }
410
+ new
411
+ rnd = random(count),
412
+ cur = array[size];
413
+ while(cur != size) {
414
+ if(rnd-- == 0) {
415
+ return cur;
416
+ }
417
+ cur = array[cur];
418
+ }
419
+ return ITER_NONE;
420
+ }
421
+ stock Iter_FreeInternal(const array[], size)
422
+ {
423
+ for(new i = 0; i != size; ++i) {
424
+ if(array[i] > size) {
425
+ return i;
426
+ }
427
+ }
428
+ return ITER_NONE;
429
+ }
430
+ stock Iter_AddInternal(&count, array[], value, size)
431
+ {
432
+ if(0 <= value < size && array[value] > size) {
433
+ new
434
+ last = size,
435
+ next = array[last];
436
+ while(next < value) {
437
+ last = next;
438
+ next = array[last];
439
+ }
440
+ array[last] = value;
441
+ array[value] = next;
442
+ ++count;
443
+ return 1;
444
+ }
445
+ return 0;
446
+ }
447
+ stock Iter_RemoveInternal(&count, array[], value, size)
448
+ {
449
+ new
450
+ last;
451
+ return Iter_SafeRemoveInternal(count, array, value, last, size);
452
+ }
453
+ stock Iter_SafeRemoveInternal(&count, array[], value, &last, size)
454
+ {
455
+ if(0 <= value < size && array[value] <= size) {
456
+ last = size;
457
+ new
458
+ next = array[last];
459
+ while(next < size) {
460
+ if(next == value) {
461
+ array[last] = array[value];
462
+ array[value] = size + 1;
463
+ --count;
464
+ return 1;
465
+ }
466
+ last = next;
467
+ next = array[last];
468
+ }
469
+ }
470
+ return 0;
471
+ }
472
+ stock Iter_ContainsInternal(const array[], value, size)
473
+ {
474
+ return 0 <= value < size && array[value] <= size;
475
+ }
476
+ stock Iter_ClearInternal(&count, array[], size)
477
+ {
478
+ for(new i = 0, t = size + 1; i < size; ++i) {
479
+ array[i] = t;
480
+ }
481
+ array[size] = size;
482
+ count = 0;
483
+ }
484
+ stock Iter_InitInternal(arr[][], s0, s1)
485
+ {
486
+ for(new i = 0, t = s1 + 1; i < s0; ++i) {
487
+ for(new j = 0; j < s1; ++j) {
488
+ arr[i][j] = t;
489
+ }
490
+ arr[i][s1] = s1;
491
+ }
492
+ }
493
+ stock Iter_PrevInternal(array[], size, slot)
494
+ {
495
+ if(0 <= slot <= size && array[slot] <= size) {
496
+ for(new last = slot; last--; ) {
497
+ if(array[last] == slot) {
498
+ return last;
499
+ }
500
+ }
501
+ }
502
+ return size;
503
+ }
504
+ #define Iter_Begin(%1) (_Y_ITER_ARRAY_SIZE(%1))
505
+ #define Iter_Start Iter_Begin
506
+ #define Iter_End(%1) (_Y_ITER_ARRAY_SIZE(%1))
507
+ #define Iter_Finish Iter_End
508
+ #define Iter_First(%1) (_Y_ITER_ARRAY:%1@YSII_Ag[_Y_ITER_ARRAY_SIZE(%1)])
509
+ #define Iter_Last(%1) Iter_PrevInternal(_Y_ITER_ARRAY:%1@YSII_Ag,_Y_ITER_ARRAY_SIZE(%1),_Y_ITER_ARRAY_SIZE(%1))
510
+ #define Iter_Next(%1,%2) (_Y_ITER_ARRAY:%1@YSII_Ag[(%2)])
511
+ #define Iter_Prev(%1,%2) Iter_PrevInternal(_Y_ITER_ARRAY:%1@YSII_Ag,_Y_ITER_ARRAY_SIZE(%1),(%2))
512
+ #define Iter_Previous Iter_Prev
513
+ #define Iter_InternalArray(%1) (_Y_ITER_ARRAY:%1@YSII_Ag)
514
+ #define _Y_ITER_INT_SIZE:%0(%2[%1]@YSII_Ag)) %0(%2@YSII_Ag[]))
515
+ #define Iter_InternalSize(%1) (_:_Y_ITER_INT_SIZE:sizeof (%1@YSII_Ag))
formatex.inc ADDED
@@ -0,0 +1,427 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include <a_samp>
2
+ #if defined FORMAT_EXTRA_TAGS
3
+ #define FORMAT_TAGS _, PlayerText3D, Text, Text3D, Menu, DB, DBResult, File, Float, FORMAT_EXTRA_TAGS
4
+ #else
5
+ #define FORMAT_TAGS _, PlayerText3D, Text, Text3D, Menu, DB, DBResult, File, Float
6
+ #endif
7
+ #if !defined FORMAT_BUFFER_SIZE
8
+ #define FORMAT_BUFFER_SIZE 2048
9
+ #endif
10
+ #if !defined FORMAT_PRINT_BUFFER_SIZE
11
+ #define FORMAT_PRINT_BUFFER_SIZE 512
12
+ #endif
13
+ #if !defined FORMAT_CUSTOM_SPEC_BUFFER_SIZE
14
+ #define FORMAT_CUSTOM_SPEC_BUFFER_SIZE 512
15
+ #endif
16
+ #if !defined FORMAT_REPLACE_NATIVES
17
+ #define FORMAT_REPLACE_NATIVES true
18
+ #endif
19
+ #define FormatSpecifier<'%1'>(%2[%3],%4) FMAT@1:F@%1(%2[FORMAT_CUSTOM_SPEC_BUFFER_SIZE],FMAT@2:___unused,%4)
20
+ #define FMAT@2:___unused,%1[ %1[
21
+ #define FMAT@1:%1(%2) forward %1(%2); public %1(%2)
22
+ static stock
23
+ gs_CustomFormatFunctions[127] = {-1, ...},
24
+ bool:gs_bIsInitialized = false
25
+ ;
26
+ forward __fmt_funcinc();
27
+ public __fmt_funcinc() {
28
+ new szOutput[1];
29
+ format(szOutput, 0, "");
30
+ }
31
+ static stock InitializeFormatSpecifiers() {
32
+ new
33
+ szFunctionName[4 char] = !"F@_",
34
+ iIndex,
35
+ iFunctionAddress
36
+ ;
37
+ gs_bIsInitialized = true;
38
+ for (new c = '@'; c <= 'z'; c++) {
39
+ if (c == 'Z' + 1)
40
+ c = '_';
41
+ else if (c == '_' + 1)
42
+ c = 'a';
43
+ szFunctionName{2} = c;
44
+ if (-1 != (iIndex = funcidx(szFunctionName))) {
45
+ #emit LCTRL 1
46
+ #emit NEG
47
+ #emit MOVE.alt
48
+ #emit ADD.C 32
49
+ #emit STOR.S.pri iFunctionAddress
50
+ #emit LREF.S.pri iFunctionAddress
51
+ #emit ADD
52
+ #emit LOAD.S.alt iIndex
53
+ #emit SHL.C.alt 3
54
+ #emit ADD
55
+ #emit STOR.S.pri iFunctionAddress
56
+ #emit LREF.S.pri iFunctionAddress
57
+ #emit STOR.S.pri iFunctionAddress
58
+ gs_CustomFormatFunctions[c] = iFunctionAddress;
59
+ }
60
+ }
61
+ }
62
+ stock formatex(szOutput[], iLength = sizeof(szOutput), const szFormatString[], {FORMAT_TAGS}:...) {
63
+ static
64
+ s_szBuffer[FORMAT_BUFFER_SIZE],
65
+ bool:s_bIsInCustomSpecifier = false
66
+ ;
67
+ if (s_bIsInCustomSpecifier) {
68
+ new
69
+ iNumArgs,
70
+ i
71
+ ;
72
+ #emit LOAD.S.pri 8
73
+ #emit STOR.S.pri iNumArgs
74
+ #emit SHR.C.pri 2
75
+ #emit STOR.S.pri i
76
+ while (--i >= 0) {
77
+ #emit LOAD.S.pri i
78
+ #emit SHL.C.pri 2
79
+ #emit ADD.C 12
80
+ #emit MOVE.alt
81
+ #emit LCTRL 5
82
+ #emit ADD
83
+ #emit LOAD.I
84
+ #emit PUSH.pri
85
+ }
86
+ #emit LOAD.S.pri iNumArgs
87
+ #emit PUSH.pri
88
+ #emit MOVE.alt
89
+ #emit SYSREQ.C format
90
+ #emit CONST.pri 4
91
+ #emit ADD
92
+ #emit MOVE.alt
93
+ #emit LCTRL 4
94
+ #emit ADD
95
+ #emit SCTRL 4
96
+ } else {
97
+ new
98
+ iPos = -1,
99
+ iArg = 12 + (3 * 4),
100
+ iArgCount,
101
+ iAddress,
102
+ iArgValue,
103
+ aiArgs[128],
104
+ i
105
+ ;
106
+ if (!gs_bIsInitialized)
107
+ InitializeFormatSpecifiers();
108
+ iLength = min(FORMAT_BUFFER_SIZE, iLength);
109
+ s_szBuffer[0] = 0;
110
+ strunpack(s_szBuffer, szFormatString);
111
+ while (-1 != (iPos = strfind(s_szBuffer, !"%", _, ++iPos))) {
112
+ while (s_szBuffer[++iPos]) {
113
+ if (1 <= s_szBuffer[iPos] < sizeof(gs_CustomFormatFunctions) && gs_CustomFormatFunctions[s_szBuffer[iPos]] != -1) {
114
+ new
115
+ iFunc = gs_CustomFormatFunctions[s_szBuffer[iPos]]
116
+ ;
117
+ static
118
+ s_szCustomFormatBuffer[FORMAT_CUSTOM_SPEC_BUFFER_SIZE]
119
+ ;
120
+ strdel(s_szBuffer, iPos - 1, iPos + 1);
121
+ s_szCustomFormatBuffer[0] = 0;
122
+ #emit LCTRL 5
123
+ #emit LOAD.S.alt iArg
124
+ #emit ADD
125
+ #emit LOAD.I
126
+ #emit MOVE.alt
127
+ #emit LOAD.I
128
+ #emit PUSH.pri
129
+ #emit PUSH.alt
130
+ iArg += 4;
131
+ s_bIsInCustomSpecifier = true;
132
+ #emit PUSH.C s_szCustomFormatBuffer
133
+ #emit PUSH.C 12
134
+ #emit LCTRL 6
135
+ #emit ADD.C 28
136
+ #emit PUSH.pri
137
+ #emit LOAD.S.pri iFunc
138
+ #emit SCTRL 6
139
+ s_bIsInCustomSpecifier = false;
140
+ strins(s_szBuffer, s_szCustomFormatBuffer, iPos - 1);
141
+ break;
142
+ }
143
+ switch (s_szBuffer[iPos]) {
144
+ case '*', 'i', 'd', 'x', 'h', 'c', 's', 'f', 'b', 'q': {
145
+ #emit LCTRL 5
146
+ #emit LOAD.S.alt iArg
147
+ #emit ADD
148
+ #emit LOAD.I
149
+ #emit STOR.S.pri iAddress
150
+ #emit MOVE.pri
151
+ #emit ADD.C 4
152
+ #emit STOR.S.pri iArg
153
+ aiArgs[iArgCount++] = iAddress;
154
+ if (s_szBuffer[iPos] == '*')
155
+ continue;
156
+ break;
157
+ }
158
+ case 'u': {
159
+ new
160
+ szBuffer[11]
161
+ ;
162
+ #emit LCTRL 5
163
+ #emit LOAD.S.alt iArg
164
+ #emit ADD
165
+ #emit LOAD.I
166
+ #emit LOAD.I
167
+ #emit STOR.S.pri iArgValue
168
+ #emit MOVE.pri
169
+ #emit ADD.C 4
170
+ #emit STOR.S.pri iArg
171
+ strdel(s_szBuffer, iPos - 1, iPos + 1);
172
+ if (!iArgValue) {
173
+ strins(s_szBuffer, "0", iPos - 1);
174
+ } else {
175
+ new
176
+ j = sizeof(szBuffer) - 1
177
+ ;
178
+ while (iArgValue) {
179
+ #emit ADDR.alt szBuffer
180
+ #emit LOAD.S.pri j
181
+ #emit DEC.pri
182
+ #emit STOR.S.pri j
183
+ #emit IDXADDR
184
+ #emit PUSH.pri
185
+ #emit LOAD.S.pri iArgValue
186
+ #emit CONST.alt 10
187
+ #emit UDIV
188
+ #emit STOR.S.pri iArgValue
189
+ #emit CONST.pri '0'
190
+ #emit ADD
191
+ #emit POP.alt
192
+ #emit STOR.I
193
+ }
194
+ strins(s_szBuffer, szBuffer[j], iPos - 1);
195
+ }
196
+ }
197
+ case '0' .. '9', ' ', '.':
198
+ continue;
199
+ case '%':
200
+ break;
201
+ default: {
202
+ break;
203
+ }
204
+ }
205
+ }
206
+ }
207
+ i = iArgCount;
208
+ while (--i >= 0) {
209
+ #emit ADDR.alt aiArgs
210
+ #emit LOAD.S.pri i
211
+ #emit LIDX
212
+ #emit PUSH.pri
213
+ #emit STOR.S.pri iAddress
214
+ }
215
+ #emit PUSH.C s_szBuffer
216
+ #emit PUSH.S iLength
217
+ #emit PUSH.S szOutput
218
+ #emit LOAD.S.pri iArgCount
219
+ #emit SHL.C.pri 2
220
+ #emit ADD.C 12
221
+ #emit PUSH.pri
222
+ #emit MOVE.alt
223
+ #emit SYSREQ.C format
224
+ #emit CONST.pri 4
225
+ #emit ADD
226
+ #emit MOVE.alt
227
+ #emit LCTRL 4
228
+ #emit ADD
229
+ #emit SCTRL 4
230
+ }
231
+ return 1;
232
+ }
233
+ stock printfex(const szFormatString[], {FORMAT_TAGS}:...) {
234
+ const
235
+ iBufferSize = FORMAT_PRINT_BUFFER_SIZE
236
+ ;
237
+ static
238
+ s_szBuffer[FORMAT_PRINT_BUFFER_SIZE]
239
+ ;
240
+ new
241
+ iNumArgs = numargs(),
242
+ i = iNumArgs - 1
243
+ ;
244
+ while (--i >= 0) {
245
+ #emit LOAD.S.pri i
246
+ #emit SHL.C.pri 2
247
+ #emit ADD.C 16
248
+ #emit MOVE.alt
249
+ #emit LCTRL 5
250
+ #emit ADD
251
+ #emit LOAD.I
252
+ #emit PUSH.pri
253
+ }
254
+ #emit PUSH.S szFormatString
255
+ #emit PUSH.C iBufferSize
256
+ #emit PUSH.C s_szBuffer
257
+ #emit LOAD.S.pri iNumArgs
258
+ #emit SHL.C.pri 2
259
+ #emit ADD.C 8
260
+ #emit PUSH.pri
261
+ #emit LCTRL 6
262
+ #emit ADD.C 28
263
+ #emit PUSH.pri
264
+ #emit CONST.pri formatex
265
+ #emit SCTRL 6
266
+ print(s_szBuffer);
267
+ }
268
+ #if !defined FORMAT_NO_DEFAULT_SPECIFIERS
269
+ #if !defined FORMAT_NO_DEFAULT_SPECIFIER_C
270
+ FormatSpecifier<'C'>(output[], color) {
271
+ format(output, sizeof(output), "{%06x}", color >>> 8);
272
+ }
273
+ #endif
274
+ #if !defined FORMAT_NO_DEFAULT_SPECIFIER_p
275
+ FormatSpecifier<'p'>(output[], playerid) {
276
+ if (0 <= playerid < GetMaxPlayers() && IsPlayerConnected(playerid))
277
+ GetPlayerName(playerid, output, sizeof(output));
278
+ else
279
+ strcat(output, "<UNKNOWN>");
280
+ }
281
+ #endif
282
+ #if !defined FORMAT_NO_DEFAULT_SPECIFIER_P
283
+ FormatSpecifier<'P'>(output[], playerid) {
284
+ if (0 <= playerid < GetMaxPlayers() && IsPlayerConnected(playerid)) {
285
+ format(output, sizeof(output), "{%06x}", GetPlayerColor(playerid) >>> 8);
286
+ GetPlayerName(playerid, output[8], sizeof(output) - 8);
287
+ } else
288
+ strcat(output, "{FFFFFF}<UNKNOWN>");
289
+ }
290
+ #endif
291
+ #if !defined FORMAT_NO_DEFAULT_SPECIFIER_W
292
+ FormatSpecifier<'W'>(output[], weapon) {
293
+ static const
294
+ s_WeaponNames[][] = {
295
+ {!"Fists" }, {!"Brass Knuckles" }, {!"Golf club" },
296
+ {!"Nightstick" }, {!"Knife" }, {!"Baseball Bat" },
297
+ {!"Shovel" }, {!"Pool Cue" }, {!"Katana" },
298
+ {!"Chainsaw" }, {!"Purple Dildo" }, {!"Dildo" },
299
+ {!"Vibrator" }, {!"Silver Vibrator" }, {!"Flowers" },
300
+ {!"Cane" }, {!"Grenade" }, {!"Tear Gas" },
301
+ {!"Molotov Cocktail" }, {!"" }, {!"" },
302
+ {!"" }, {!"9mm" }, {!"Silenced 9mm" },
303
+ {!"Desert Eagle" }, {!"Shotgun" }, {!"Sawnoff Shotgun" },
304
+ {!"Combat Shotgun" }, {!"Micro Uzi" }, {!"MP5" },
305
+ {!"AK-47" }, {!"M4" }, {!"Tec-9" },
306
+ {!"Country Rifle" }, {!"Sniper Rifle" }, {!"RPG" },
307
+ {!"HS Rocket" }, {!"Flamethrower" }, {!"Minigun" },
308
+ {!"Satchel Charge" }, {!"Detonator" }, {!"Spraycan" },
309
+ {!"Fire Extinguisher" }, {!"Camera" }, {!"Nightvision Goggles" },
310
+ {!"Thermal Goggles" }, {!"Parachute" }, {!"Fake Pistol" },
311
+ {!"" }, {!"Vehicle" }, {!"Helikill" },
312
+ {!"Explosion" }, {!"" }, {!"Drown" },
313
+ {!"Collision" }, {!"Splat" }, {!"Unknown" }
314
+ }
315
+ ;
316
+ if (0 <= weapon < sizeof(s_WeaponNames))
317
+ strcat(output, s_WeaponNames[weapon]);
318
+ else
319
+ strcat(output, "Unknown");
320
+ }
321
+ #endif
322
+ #if !defined FORMAT_NO_DEFAULT_SPECIFIER_w
323
+ FormatSpecifier<'w'>(output[], weapon) {
324
+ static const
325
+ s_WeaponNamesLowercaseSingular[][] = {
326
+ {!"fists" }, {!"brass knuckles" }, {!"a golfclub" },
327
+ {!"a nightstick" }, {!"a knife" }, {!"a baseball bat" },
328
+ {!"a shovel" }, {!"a pool cue" }, {!"a katana" },
329
+ {!"a chainsaw" }, {!"a purple dildo" }, {!"a dildo" },
330
+ {!"a vibrator" }, {!"a silver vibrator" }, {!"flowers" },
331
+ {!"a cane" }, {!"a grenade" }, {!"tear gas" },
332
+ {!"a molotov cocktail" }, {!"" }, {!"" },
333
+ {!"" }, {!"a 9mm" }, {!"a silenced 9mm"},
334
+ {!"a desert eagle" }, {!"a shotgun" }, {!"swanoff shotgun" },
335
+ {!"a combat shotgun" }, {!"a micro uzi" }, {!"an mp5" },
336
+ {!"an ak-47" }, {!"an m4" }, {!"a tec-9" },
337
+ {!"a country rifle" }, {!"a sniper rifle" }, {!"an rpg" },
338
+ {!"a hs rpg" }, {!"a flamethrower" }, {!"a minigun" },
339
+ {!"a satchel charge" }, {!"a detonator" }, {!"a spraycan" },
340
+ {!"a fire extinguisher" }, {!"a camera" }, {!"nightvision" },
341
+ {!"an infrared" }, {!"a parachute" }, {!"a fake pistol" },
342
+ {!"" }, {!"a vehicle" }, {!"a helikill" },
343
+ {!"an explosion" }, {!"" }, {!"drowning" },
344
+ {!"a collision" }, {!"a splat" }, {!"something unknown"}
345
+ }
346
+ ;
347
+ if (0 <= weapon < sizeof(s_WeaponNamesLowercaseSingular))
348
+ strcat(output, s_WeaponNamesLowercaseSingular[weapon]);
349
+ else
350
+ strcat(output, "something unknown");
351
+ }
352
+ #endif
353
+ #define FORMAT_NO_DEFAULT_SPECIFIER_v
354
+ FormatSpecifier<'v'>(output[], modelid) {
355
+ static const
356
+ s_VehicleNames[][] = {
357
+ {!"Landstalker" }, {!"Bravura" }, {!"Buffalo" }, {!"Linerunner" },
358
+ {!"Perrenial" }, {!"Sentinel" }, {!"Dumper" }, {!"Firetruck" },
359
+ {!"Trashmaster" }, {!"Stretch" }, {!"Manana" }, {!"Infernus" },
360
+ {!"Voodoo" }, {!"Pony" }, {!"Mule" }, {!"Cheetah" },
361
+ {!"Ambulance" }, {!"Leviathan" }, {!"Moonbeam" }, {!"Esperanto" },
362
+ {!"Taxi" }, {!"Washington" }, {!"Bobcat" }, {!"Mr Whoopee" },
363
+ {!"BF Injection" }, {!"Hunter" }, {!"Premier" }, {!"Enforcer" },
364
+ {!"Securicar" }, {!"Banshee" }, {!"Predator" }, {!"Bus" },
365
+ {!"Rhino" }, {!"Barracks" }, {!"Hotknife" }, {!"Trailer 1" },
366
+ {!"Previon" }, {!"Coach" }, {!"Cabbie" }, {!"Stallion" },
367
+ {!"Rumpo" }, {!"RC Bandit" }, {!"Romero" }, {!"Packer" },
368
+ {!"Monster" }, {!"Admiral" }, {!"Squalo" }, {!"Seasparrow" },
369
+ {!"Pizzaboy" }, {!"Tram" }, {!"Trailer 2" }, {!"Turismo" },
370
+ {!"Speeder" }, {!"Reefer" }, {!"Tropic" }, {!"Flatbed" },
371
+ {!"Yankee" }, {!"Caddy" }, {!"Solair" }, {!"Berkley's RC Van" },
372
+ {!"Skimmer" }, {!"PCJ-600" }, {!"Faggio" }, {!"Freeway" },
373
+ {!"RC Baron" }, {!"RC Raider" }, {!"Glendale" }, {!"Oceanic" },
374
+ {!"Sanchez" }, {!"Sparrow" }, {!"Patriot" }, {!"Quad" },
375
+ {!"Coastguard" }, {!"Dinghy" }, {!"Hermes" }, {!"Sabre" },
376
+ {!"Rustler" }, {!"ZR-350" }, {!"Walton" }, {!"Regina" },
377
+ {!"Comet" }, {!"BMX" }, {!"Burrito" }, {!"Camper" },
378
+ {!"Marquis" }, {!"Baggage" }, {!"Dozer" }, {!"Maverick" },
379
+ {!"News Chopper" }, {!"Rancher" }, {!"FBI Rancher" }, {!"Virgo" },
380
+ {!"Greenwood" }, {!"Jetmax" }, {!"Hotring" }, {!"Sandking" },
381
+ {!"Blista Compact" }, {!"Police Maverick" }, {!"Boxville" }, {!"Benson" },
382
+ {!"Mesa" }, {!"RC Goblin" }, {!"Hotring Racer A" }, {!"Hotring Racer B" },
383
+ {!"Bloodring Banger" }, {!"Rancher" }, {!"Super GT" }, {!"Elegant" },
384
+ {!"Journey" }, {!"Bike" }, {!"Mountain Bike" }, {!"Beagle" },
385
+ {!"Cropdust" }, {!"Stunt" }, {!"Tanker" }, {!"Roadtrain" },
386
+ {!"Nebula" }, {!"Majestic" }, {!"Buccaneer" }, {!"Shamal" },
387
+ {!"Hydra" }, {!"FCR-900" }, {!"NRG-500" }, {!"HPV1000" },
388
+ {!"Cement Truck" }, {!"Tow Truck" }, {!"Fortune" }, {!"Cadrona" },
389
+ {!"FBI Truck" }, {!"Willard" }, {!"Forklift" }, {!"Tractor" },
390
+ {!"Combine" }, {!"Feltzer" }, {!"Remington" }, {!"Slamvan" },
391
+ {!"Blade" }, {!"Freight" }, {!"Streak" }, {!"Vortex" },
392
+ {!"Vincent" }, {!"Bullet" }, {!"Clover" }, {!"Sadler" },
393
+ {!"Firetruck LA" }, {!"Hustler" }, {!"Intruder" }, {!"Primo" },
394
+ {!"Cargobob" }, {!"Tampa" }, {!"Sunrise" }, {!"Merit" },
395
+ {!"Utility" }, {!"Nevada" }, {!"Yosemite" }, {!"Windsor" },
396
+ {!"Monster A" }, {!"Monster B" }, {!"Uranus" }, {!"Jester" },
397
+ {!"Sultan" }, {!"Stratum" }, {!"Elegy" }, {!"Raindance" },
398
+ {!"RC Tiger" }, {!"Flash" }, {!"Tahoma" }, {!"Savanna" },
399
+ {!"Bandito" }, {!"Freight Flat" }, {!"Streak Carriage" }, {!"Kart" },
400
+ {!"Mower" }, {!"Duneride" }, {!"Sweeper" }, {!"Broadway" },
401
+ {!"Tornado" }, {!"AT-400" }, {!"DFT-30" }, {!"Huntley" },
402
+ {!"Stafford" }, {!"BF-400" }, {!"Newsvan" }, {!"Tug" },
403
+ {!"Trailer 3" }, {!"Emperor" }, {!"Wayfarer" }, {!"Euros" },
404
+ {!"Hotdog" }, {!"Club" }, {!"Freight Carriage" }, {!"Trailer 3" },
405
+ {!"Andromada" }, {!"Dodo" }, {!"RC Cam" }, {!"Launch" },
406
+ {!"Police Car (LSPD)"}, {!"Police Car (SFPD)"}, {!"Police Car (LVPD)"}, {!"Police Ranger" },
407
+ {!"Picador" }, {!"S.W.A.T. Van" }, {!"Alpha" }, {!"Phoenix" },
408
+ {!"Glendale" }, {!"Sadler" }, {!"Luggage Trailer A"}, {!"Luggage Trailer B"},
409
+ {!"Stair Trailer" }, {!"Boxville" }, {!"Farm Plow" }, {!"Utility Trailer" }
410
+ }
411
+ ;
412
+ if (0 <= (modelid -= 400) < sizeof(s_VehicleNames))
413
+ strcat(output, s_VehicleNames[modelid]);
414
+ else
415
+ strcat(output, "Unknown");
416
+ }
417
+ #endif
418
+ #if !defined FORMAT_NO_DEFAULT_SPECIFIER_X
419
+ FormatSpecifier<'X'>(output[], value) {
420
+ format(output, sizeof(output), "%02x%06x", value >>> 24, value & 0xFFFFFF);
421
+ }
422
+ #endif
423
+ #endif
424
+ #if FORMAT_REPLACE_NATIVES
425
+ #define format formatex
426
+ #define printf printfex
427
+ #endif
logger.inc ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _inc_logger
2
+ #undef _inc_logger
3
+ #endif
4
+ #if defined _logger_included
5
+ #endinput
6
+ #endif
7
+ #define _logger_included
8
+ #include <a_samp>
9
+ #include <crashdetect>
10
+ #if !defined MAX_EVENT_FIELDS
11
+ #define MAX_EVENT_FIELDS (32)
12
+ #endif
13
+ #if !defined MAX_FIELD_NAME
14
+ #define MAX_FIELD_NAME (16)
15
+ #endif
16
+ #if !defined MAX_FIELD_VALUE
17
+ #define MAX_FIELD_VALUE (256)
18
+ #endif
19
+ #define MAX_FIELD_LENGTH (MAX_FIELD_NAME + 3 + MAX_FIELD_VALUE)
20
+ #define MAX_EVENT_LENGTH (MAX_EVENT_FIELDS * MAX_FIELD_LENGTH)
21
+ forward LOGGER_FIELD:Logger_I(const field[], value);
22
+ forward LOGGER_FIELD:Logger_B(const field[], value);
23
+ forward LOGGER_FIELD:Logger_X(const field[], value);
24
+ forward LOGGER_FIELD:Logger_F(const field[], Float:value);
25
+ forward LOGGER_FIELD:Logger_S(const field[], const value[]);
26
+ static
27
+ FieldBuffer[MAX_FIELD_LENGTH],
28
+ EventBuffer[MAX_EVENT_LENGTH];
29
+ stock Logger_Log(const text[], LOGGER_FIELD:...) {
30
+ new total = numargs();
31
+ format(EventBuffer, sizeof EventBuffer, "lvl=\"info\" %s",
32
+ _:Logger_S("msg", text)
33
+ );
34
+ if (total == 1) {
35
+ print(EventBuffer);
36
+ return;
37
+ }
38
+ for(new arg = 1; arg < total && arg < MAX_EVENT_FIELDS; ++arg) {
39
+ new field[MAX_FIELD_LENGTH];
40
+ for(new ch; ch < MAX_FIELD_LENGTH; ++ch) {
41
+ field[ch] = getarg(arg, ch);
42
+ if(field[ch] == EOS) {
43
+ strcat(EventBuffer, " ");
44
+ strcat(EventBuffer, field);
45
+ break;
46
+ }
47
+ }
48
+ }
49
+ print(EventBuffer);
50
+ }
51
+ stock Logger_Dbg(const handler[], const text[], LOGGER_FIELD:...) {
52
+ if(GetSVarInt(handler) == 0) {
53
+ return;
54
+ }
55
+ new total = numargs();
56
+ format(EventBuffer, sizeof EventBuffer, "lvl=\"debug\" %s",
57
+ _:Logger_S("msg", text)
58
+ );
59
+ if (total == 2) {
60
+ print(EventBuffer);
61
+ return;
62
+ }
63
+ for(new arg = 2; arg < total && arg < MAX_EVENT_FIELDS; ++arg) {
64
+ new field[MAX_FIELD_LENGTH];
65
+ for(new ch; ch < MAX_FIELD_LENGTH; ++ch) {
66
+ field[ch] = getarg(arg, ch);
67
+ if(field[ch] == EOS) {
68
+ strcat(EventBuffer, " ");
69
+ strcat(EventBuffer, field);
70
+ break;
71
+ }
72
+ }
73
+ }
74
+ print(EventBuffer);
75
+ }
76
+ stock Logger_Err(const text[], LOGGER_FIELD:...) {
77
+ new total = numargs();
78
+ format(EventBuffer, sizeof EventBuffer, "lvl=\"error\" %s",
79
+ _:Logger_S("msg", text)
80
+ );
81
+ if (total == 1) {
82
+ _PrintBufferAmxBacktrace();
83
+ return;
84
+ }
85
+ for(new arg = 1; arg < total && arg < MAX_EVENT_FIELDS; ++arg) {
86
+ new field[MAX_FIELD_LENGTH];
87
+ for(new ch; ch < MAX_FIELD_LENGTH; ++ch) {
88
+ field[ch] = getarg(arg, ch);
89
+ if(field[ch] == EOS) {
90
+ strcat(EventBuffer, " ");
91
+ strcat(EventBuffer, field);
92
+ break;
93
+ }
94
+ }
95
+ }
96
+ _PrintBufferAmxBacktrace();
97
+ }
98
+ stock Logger_Fatal(const text[], LOGGER_FIELD:...) {
99
+ new total = numargs();
100
+ format(EventBuffer, sizeof EventBuffer, "lvl=\"fatal\" %s",
101
+ _:Logger_S("msg", text)
102
+ );
103
+ if (total == 1) {
104
+ _PrintBufferAmxBacktrace();
105
+ return;
106
+ }
107
+ for(new arg = 1; arg < total && arg < MAX_EVENT_FIELDS; ++arg) {
108
+ new field[MAX_FIELD_LENGTH];
109
+ for(new ch; ch < MAX_FIELD_LENGTH; ++ch) {
110
+ field[ch] = getarg(arg, ch);
111
+ if(field[ch] == EOS) {
112
+ strcat(EventBuffer, " ");
113
+ strcat(EventBuffer, field);
114
+ break;
115
+ }
116
+ }
117
+ }
118
+ _PrintBufferAmxBacktrace(true);
119
+ }
120
+ static stock _PrintBufferAmxBacktrace(bool:crash = false) {
121
+ print(EventBuffer);
122
+ PrintAmxBacktrace();
123
+ if(crash) {
124
+ new File:f = fopen("nonexistentfile", io_read), tmp[1];
125
+ fread(f, tmp);
126
+ fclose(f);
127
+ }
128
+ }
129
+ stock Logger_ToggleDebug(const handler[], bool:toggle) {
130
+ if(toggle) {
131
+ SetSVarInt(handler, 1);
132
+ } else {
133
+ DeleteSVar(handler);
134
+ }
135
+ return 1;
136
+ }
137
+ stock LOGGER_FIELD:Logger_I(const field[], value) {
138
+ format(FieldBuffer, sizeof(FieldBuffer), "%s=%d", field, value);
139
+ return LOGGER_FIELD:FieldBuffer;
140
+ }
141
+ stock LOGGER_FIELD:Logger_B(const field[], value) {
142
+ format(FieldBuffer, sizeof(FieldBuffer), "%s=%b", field, value);
143
+ return LOGGER_FIELD:FieldBuffer;
144
+ }
145
+ stock LOGGER_FIELD:Logger_X(const field[], value) {
146
+ format(FieldBuffer, sizeof(FieldBuffer), "%s=%x", field, value);
147
+ return LOGGER_FIELD:FieldBuffer;
148
+ }
149
+ stock LOGGER_FIELD:Logger_F(const field[], Float:value) {
150
+ format(FieldBuffer, sizeof(FieldBuffer), "%s=%f", field, value);
151
+ return LOGGER_FIELD:FieldBuffer;
152
+ }
153
+ stock LOGGER_FIELD:Logger_S(const field[], const value[]) {
154
+ new quoted[MAX_FIELD_VALUE];
155
+ Logger_EscapeQuote(value, MAX_FIELD_VALUE, quoted, MAX_FIELD_VALUE);
156
+ format(FieldBuffer, sizeof(FieldBuffer), "%s=\"%s\"", field, quoted);
157
+ return LOGGER_FIELD:FieldBuffer;
158
+ }
159
+ stock LOGGER_FIELD:Logger_A(const field[], const value[], len = sizeof value) {
160
+ new array[MAX_FIELD_VALUE];
161
+ format(array, sizeof array, "%d", array, value[0]);
162
+ for(new i = 1; i < len; i++) {
163
+ format(array, sizeof array, "%s, %d", array, value[i]);
164
+ }
165
+ format(FieldBuffer, sizeof(FieldBuffer), "%s=\"[%s]\"", field, array);
166
+ return LOGGER_FIELD:FieldBuffer;
167
+ }
168
+ stock LOGGER_FIELD:Logger_P(playerid) {
169
+ if(!IsPlayerConnected(playerid)) {
170
+ format(FieldBuffer, sizeof(FieldBuffer), "player=\"(disconnected)\"");
171
+ } else {
172
+ new name[MAX_PLAYER_NAME];
173
+ GetPlayerName(playerid, name, MAX_PLAYER_NAME);
174
+ format(FieldBuffer, sizeof(FieldBuffer), "player=\"%s\"", name);
175
+ }
176
+ return LOGGER_FIELD:FieldBuffer;
177
+ }
178
+ stock Logger_EscapeQuote(const input[], inputLen, output[], outputLen) {
179
+ new j;
180
+ for(new i; input[i] != EOS && i < inputLen && j < (outputLen - 1); ++i) {
181
+ if(input[i] == '"') {
182
+ output[j++] = '\\';
183
+ }
184
+ output[j++] = input[i];
185
+ }
186
+ output[j] = EOS;
187
+ }
mapandreas.inc ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #define MAP_ANDREAS_MODE_NONE 0
2
+ #define MAP_ANDREAS_MODE_MINIMAL 1
3
+ #define MAP_ANDREAS_MODE_MEDIUM 2
4
+ #define MAP_ANDREAS_MODE_FULL 3
5
+ #define MAP_ANDREAS_MODE_NOBUFFER 4
6
+ #define MAP_ANDREAS_ERROR_SUCCESS 0
7
+ #define MAP_ANDREAS_ERROR_FAILURE 1
8
+ #define MAP_ANDREAS_ERROR_MEMORY 2
9
+ #define MAP_ANDREAS_ERROR_DATA_FILES 3
10
+ #define MAP_ANDREAS_ERROR_INVALID_AREA 4
11
+ native MapAndreas_Init(mode, name[]="", len=sizeof(name));
12
+ native MapAndreas_FindZ_For2DCoord(Float:X, Float:Y, &Float:Z);
13
+ native MapAndreas_FindAverageZ(Float:X, Float:Y, &Float:Z);
14
+ native MapAndreas_Unload();
15
+ native MapAndreas_SetZ_For2DCoord(Float:X, Float:Y, Float:Z);
16
+ native MapAndreas_SaveCurrentHMap(name[]);
progress2.inc ADDED
@@ -0,0 +1,627 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _inc_progress2
2
+ #undef _inc_progress2
3
+ #endif
4
+ #if defined _progress2_included
5
+ #endinput
6
+ #endif
7
+ #define _progress2_included
8
+ #tryinclude <open.mp>
9
+ #if !defined _INC_open_mp
10
+ #include <a_samp>
11
+ #if !defined PlayerTextDrawBoxColour
12
+ #define PlayerTextDrawBoxColour PlayerTextDrawBoxColor
13
+ #endif
14
+ #endif
15
+ #tryinclude <logger>
16
+ #tryinclude <YSI_Data\y_iterate>
17
+ #tryinclude <YSI_Coding\y_hooks>
18
+ #if defined MAX_PLAYER_BARS
19
+ #if (MAX_PLAYER_BARS - PlayerBar:0)==PlayerBar:0
20
+ #error You forgot to set value of MAX_PLAYER_BARS. Type something like: #define MAX_PLAYER_BARS (PlayerBar:30).
21
+ #endif
22
+ #if (MAX_PLAYER_BARS < PlayerBar:1)
23
+ #error You are trying to allocate invalid number of PlayerBars. Set value of MAX_PLAYER_BARS greather than 0.
24
+ #elseif MAX_PLAYER_BARS > PlayerBar:(MAX_PLAYER_TEXT_DRAWS / 3)
25
+ #error You are trying to allocate too many PlayerBars. Set value of MAX_PLAYER_BARS below or equals to (MAX_PLAYER_TEXT_DRAWS/3).
26
+ #endif
27
+ #else
28
+ #define MAX_PLAYER_BARS (PlayerBar:(_:MAX_PLAYER_TEXT_DRAWS / 3))
29
+ #endif
30
+ #define INVALID_PLAYER_BAR_VALUE (Float:0xFFFFFFFF)
31
+ #define INVALID_PLAYER_BAR_ID (PlayerBar:-1)
32
+ enum progressbar_direction {
33
+ BAR_DIRECTION_RIGHT,
34
+ BAR_DIRECTION_LEFT,
35
+ BAR_DIRECTION_HORIZONTAL_FROM_0,
36
+ BAR_DIRECTION_UP,
37
+ BAR_DIRECTION_DOWN,
38
+ BAR_DIRECTION_VERTICAL_FROM_0,
39
+ };
40
+ enum E_BAR_DATA {
41
+ bool:is_created,
42
+ bool:pbar_show,
43
+ Float:pbar_posX,
44
+ Float:pbar_posY,
45
+ Float:pbar_width,
46
+ Float:pbar_height,
47
+ pbar_colour,
48
+ Float:pbar_minValue,
49
+ Float:pbar_maxValue,
50
+ Float:pbar_progressValue,
51
+ Float:E_PADDING_X,
52
+ Float:E_PADDING_Y,
53
+ progressbar_direction:pbar_direction
54
+ }
55
+ static const Float:direction_size_mult[] = {
56
+ 1.0,
57
+ -1.0,
58
+ 1.0,
59
+ -1.0,
60
+ 1.0,
61
+ -1.0
62
+ };
63
+ enum E_BAR_TEXT_DRAW {
64
+ PlayerText:pbar_back,
65
+ PlayerText:pbar_fill,
66
+ PlayerText:pbar_main
67
+ }
68
+ enum E_PROGRESSBAR_BOUNDRY {
69
+ Float:E_PBAR_BACKGROUND_POS_X,
70
+ Float:E_PBAR_BACKGROUND_POS_Y,
71
+ Float:E_PBAR_BACKGROUND_RIGHT,
72
+ Float:E_PBAR_BACKGROUND_HEIGHT,
73
+ Float:E_PBAR_FILLER_POS_X,
74
+ Float:E_PBAR_FILLER_POS_Y,
75
+ Float:E_PBAR_FILLER_RIGHT,
76
+ Float:E_PBAR_FILLER_HEIGHT,
77
+ Float:E_PBAR_VALUE_POS_X,
78
+ Float:E_PBAR_VALUE_POS_Y,
79
+ Float:E_PBAR_VALUE_RIGHT,
80
+ Float:E_PBAR_VALUE_HEIGHT,
81
+ };
82
+ static PlayerText:pbar_TextDraw[MAX_PLAYERS][MAX_PLAYER_BARS][E_BAR_TEXT_DRAW];
83
+ new
84
+ #if(defined _INC_y_iterate)
85
+ Iterator:pbar_Index[MAX_PLAYERS]<PlayerBar:(_:MAX_PLAYER_BARS)>,
86
+ #endif
87
+ pbar_Data[MAX_PLAYERS][MAX_PLAYER_BARS][E_BAR_DATA]
88
+ ;
89
+ static bool:is_progressbar_initialised = false;
90
+ stock PlayerBarUI_ResetPlayerItem(const playerid, const PlayerBar:barid) {
91
+ pbar_TextDraw[playerid][barid][pbar_back] = PlayerText:INVALID_TEXT_DRAW;
92
+ pbar_TextDraw[playerid][barid][pbar_fill] = PlayerText:INVALID_TEXT_DRAW;
93
+ pbar_TextDraw[playerid][barid][pbar_main] = PlayerText:INVALID_TEXT_DRAW;
94
+ pbar_Data[playerid][barid][is_created] = false;
95
+ }
96
+ stock PlayerBarUI_ResetPlayer(const playerid) {
97
+ for(new PlayerBar:barid = PlayerBar:0; barid < MAX_PLAYER_BARS; ++barid) {
98
+ PlayerBarUI_ResetPlayerItem(playerid, barid);
99
+ }
100
+ }
101
+ stock PlayerBarUI_ResetAll() {
102
+ for(new playerid = 0; playerid < MAX_PLAYERS; ++playerid) {
103
+ PlayerBarUI_ResetPlayer(playerid);
104
+ }
105
+ is_progressbar_initialised = true;
106
+ }
107
+ stock PlayerBar:PlayerBarUI_FindFree(const playerid) {
108
+ for(new PlayerBar:barid = PlayerBar:0; barid < MAX_PLAYER_BARS; ++barid) {
109
+ if( !pbar_Data[playerid][barid][is_created] ) {
110
+ return barid;
111
+ }
112
+ }
113
+ return INVALID_PLAYER_BAR_ID;
114
+ }
115
+ static stock bool:PlayerBarUI_isNeedToDrawValue(const progressbar_direction:direction, const Float:cur_value, const Float:min_value, const Float:max_value) {
116
+ if( direction == BAR_DIRECTION_HORIZONTAL_FROM_0 || direction == BAR_DIRECTION_VERTICAL_FROM_0 ) {
117
+ if( max_value < 0.0 ) {
118
+ return (cur_value < max_value);
119
+ } else if( min_value > 0.0 ) {
120
+ return (cur_value > min_value);
121
+ } else {
122
+ return (floatabs(cur_value) > 0.001 * (max_value - min_value));
123
+ }
124
+ } else {
125
+ return (cur_value > min_value);
126
+ }
127
+ }
128
+ forward PlayerBar:CreatePlayerProgressBar(
129
+ const playerid,
130
+ const Float:x, const Float:y,
131
+ const Float:width = 55.5, const Float:height = 3.2,
132
+ const colour = 0xFF1C1CFF,
133
+ const Float:max = 100.0,
134
+ const progressbar_direction:direction = BAR_DIRECTION_RIGHT
135
+ );
136
+ forward Float:GetPlayerProgressBarValue(const playerid, const PlayerBar:barid);
137
+ stock PlayerBar:CreatePlayerProgressBar(
138
+ const playerid,
139
+ const Float:x, const Float:y,
140
+ const Float:width = 55.5, const Float:height = 3.2,
141
+ const colour = 0xFF1C1CFF,
142
+ const Float:max = 100.0,
143
+ const progressbar_direction:direction = BAR_DIRECTION_RIGHT
144
+ ) {
145
+ if( !IsPlayerConnected(playerid) ) {
146
+ #if(defined _logger_included)
147
+ Logger_Err("attempt to create player progress bar for invalid player",
148
+ Logger_I("playerid", playerid));
149
+ #endif
150
+ return INVALID_PLAYER_BAR_ID;
151
+ }
152
+ if( !is_progressbar_initialised ) {
153
+ PlayerBarUI_ResetAll();
154
+ }
155
+ #if(defined _INC_y_iterate)
156
+ new PlayerBar:barid = PlayerBar:Iter_Free(pbar_Index[playerid]);
157
+ if( barid == PlayerBar:ITER_NONE ) {
158
+ #if(defined _logger_included)
159
+ Logger_Err("MAX_PLAYER_BARS limit reached.");
160
+ #endif
161
+ return INVALID_PLAYER_BAR_ID;
162
+ }
163
+ #else
164
+ new PlayerBar:barid = PlayerBarUI_FindFree(playerid);
165
+ if( barid == INVALID_PLAYER_BAR_ID ) {
166
+ #if(defined _logger_included)
167
+ Logger_Err("MAX_PLAYER_BARS limit reached.");
168
+ #endif
169
+ return INVALID_PLAYER_BAR_ID;
170
+ }
171
+ #endif
172
+ pbar_TextDraw[playerid][barid][pbar_back] = PlayerText:INVALID_TEXT_DRAW;
173
+ pbar_TextDraw[playerid][barid][pbar_fill] = PlayerText:INVALID_TEXT_DRAW;
174
+ pbar_TextDraw[playerid][barid][pbar_main] = PlayerText:INVALID_TEXT_DRAW;
175
+ pbar_Data[playerid][barid][is_created] = true;
176
+ pbar_Data[playerid][barid][pbar_show] = false;
177
+ pbar_Data[playerid][barid][pbar_posX] = x;
178
+ pbar_Data[playerid][barid][pbar_posY] = y;
179
+ pbar_Data[playerid][barid][pbar_width] = width;
180
+ pbar_Data[playerid][barid][pbar_height] = height;
181
+ pbar_Data[playerid][barid][pbar_colour] = colour;
182
+ pbar_Data[playerid][barid][pbar_minValue] = 0.0;
183
+ pbar_Data[playerid][barid][pbar_maxValue] = max;
184
+ pbar_Data[playerid][barid][pbar_progressValue] = 0.0;
185
+ pbar_Data[playerid][barid][pbar_direction] = direction;
186
+ pbar_Data[playerid][barid][E_PADDING_X] = 1.2;
187
+ pbar_Data[playerid][barid][E_PADDING_Y] = 1.0;
188
+ #if(defined _INC_y_iterate)
189
+ Iter_Add(pbar_Index[playerid], barid);
190
+ #endif
191
+ _progress2_renderBar(playerid, barid);
192
+ return barid;
193
+ }
194
+ stock DestroyPlayerProgressBar(const playerid, const PlayerBar:barid) {
195
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
196
+ return 0;
197
+ }
198
+ _ptextdraw_destroy_array(playerid, pbar_TextDraw[playerid][barid]);
199
+ pbar_Data[playerid][barid][is_created] = false;
200
+ #if(defined _INC_y_iterate)
201
+ Iter_Remove(pbar_Index[playerid], barid);
202
+ #endif
203
+ return 1;
204
+ }
205
+ stock bool:IsPlayerProgressBarVisible(const playerid, const PlayerBar:barid) {
206
+ return (IsValidPlayerProgressBar(playerid, barid) && pbar_Data[playerid][barid][pbar_show]);
207
+ }
208
+ stock ShowPlayerProgressBar(const playerid, const PlayerBar:barid) {
209
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
210
+ return 0;
211
+ }
212
+ pbar_Data[playerid][barid][pbar_show] = true;
213
+ PlayerTextDrawShow(playerid, pbar_TextDraw[playerid][barid][pbar_back]);
214
+ PlayerTextDrawShow(playerid, pbar_TextDraw[playerid][barid][pbar_fill]);
215
+ PlayerTextDrawShow(playerid, pbar_TextDraw[playerid][barid][pbar_main]);
216
+ return 1;
217
+ }
218
+ stock HidePlayerProgressBar(const playerid, const PlayerBar:barid) {
219
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
220
+ return 0;
221
+ }
222
+ pbar_Data[playerid][barid][pbar_show] = false;
223
+ PlayerTextDrawHide(playerid, pbar_TextDraw[playerid][barid][pbar_back]);
224
+ PlayerTextDrawHide(playerid, pbar_TextDraw[playerid][barid][pbar_fill]);
225
+ PlayerTextDrawHide(playerid, pbar_TextDraw[playerid][barid][pbar_main]);
226
+ return 1;
227
+ }
228
+ stock IsValidPlayerProgressBar(const playerid, const PlayerBar:barid) {
229
+ #if(defined _INC_y_iterate)
230
+ return Iter_Contains(pbar_Index[playerid], barid);
231
+ #else
232
+ if( INVALID_PLAYER_BAR_ID < barid && barid < MAX_PLAYER_BARS ) {
233
+ return pbar_Data[playerid][barid][is_created];
234
+ }
235
+ return false;
236
+ #endif
237
+ }
238
+ stock GetPlayerProgressBarPos(const playerid, const PlayerBar:barid, &Float:x, &Float:y) {
239
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
240
+ return 0;
241
+ }
242
+ x = pbar_Data[playerid][barid][pbar_posX];
243
+ y = pbar_Data[playerid][barid][pbar_posY];
244
+ return 1;
245
+ }
246
+ stock SetPlayerProgressBarPos(const playerid, const PlayerBar:barid, const Float:x, const Float:y) {
247
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
248
+ return false;
249
+ }
250
+ pbar_Data[playerid][barid][pbar_posX] = x;
251
+ pbar_Data[playerid][barid][pbar_posY] = y;
252
+ _progress2_renderBar(playerid, barid);
253
+ return true;
254
+ }
255
+ stock Float:GetPlayerProgressBarWidth(const playerid, const PlayerBar:barid) {
256
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
257
+ return INVALID_PLAYER_BAR_VALUE;
258
+ }
259
+ return pbar_Data[playerid][barid][pbar_width];
260
+ }
261
+ stock SetPlayerProgressBarWidth(const playerid, const PlayerBar:barid, const Float:width) {
262
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
263
+ return 0;
264
+ }
265
+ pbar_Data[playerid][barid][pbar_width] = width;
266
+ _progress2_renderBar(playerid, barid);
267
+ return 1;
268
+ }
269
+ stock Float:GetPlayerProgressBarHeight(const playerid, const PlayerBar:barid) {
270
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
271
+ return INVALID_PLAYER_BAR_VALUE;
272
+ }
273
+ return pbar_Data[playerid][barid][pbar_height];
274
+ }
275
+ stock SetPlayerProgressBarHeight(const playerid, const PlayerBar:barid, const Float:height) {
276
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
277
+ return 0;
278
+ }
279
+ pbar_Data[playerid][barid][pbar_height] = height;
280
+ _progress2_renderBar(playerid, barid);
281
+ return 1;
282
+ }
283
+ stock GetPlayerProgressBarColour(const playerid, const PlayerBar:barid) {
284
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
285
+ return 0;
286
+ }
287
+ return pbar_Data[playerid][barid][pbar_colour];
288
+ }
289
+ stock SetPlayerProgressBarColour(const playerid, const PlayerBar:barid, const colour) {
290
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
291
+ return 0;
292
+ }
293
+ pbar_Data[playerid][barid][pbar_colour] = colour;
294
+ PlayerTextDrawBoxColour(playerid, pbar_TextDraw[playerid][barid][pbar_back], 0x00000000 | (colour & 0x000000FF));
295
+ PlayerTextDrawBoxColour(playerid, pbar_TextDraw[playerid][barid][pbar_fill], (colour & 0xFFFFFF00) | (0x66 & ((colour & 0x000000FF) / 2)));
296
+ PlayerTextDrawBoxColour(playerid, pbar_TextDraw[playerid][barid][pbar_main], colour);
297
+ return 1;
298
+ }
299
+ stock Float:GetPlayerProgressBarMinValue(const playerid, const PlayerBar:barid) {
300
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
301
+ return INVALID_PLAYER_BAR_VALUE;
302
+ }
303
+ return pbar_Data[playerid][barid][pbar_minValue];
304
+ }
305
+ stock SetPlayerProgressBarMinValue(const playerid, const PlayerBar:barid, const Float:min_value) {
306
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
307
+ return 0;
308
+ }
309
+ pbar_Data[playerid][barid][pbar_minValue] = min_value;
310
+ SetPlayerProgressBarValue(playerid, barid, pbar_Data[playerid][barid][pbar_progressValue]);
311
+ return 1;
312
+ }
313
+ stock Float:GetPlayerProgressBarMaxValue(const playerid, const PlayerBar:barid) {
314
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
315
+ return INVALID_PLAYER_BAR_VALUE;
316
+ }
317
+ return pbar_Data[playerid][barid][pbar_maxValue];
318
+ }
319
+ stock SetPlayerProgressBarMaxValue(const playerid, const PlayerBar:barid, const Float:max) {
320
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
321
+ return 0;
322
+ }
323
+ pbar_Data[playerid][barid][pbar_maxValue] = max;
324
+ SetPlayerProgressBarValue(playerid, barid, pbar_Data[playerid][barid][pbar_progressValue]);
325
+ return 1;
326
+ }
327
+ stock SetPlayerProgressBarValue(const playerid, const PlayerBar:barid, Float:value) {
328
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
329
+ return 0;
330
+ }
331
+ new
332
+ boundary[E_PROGRESSBAR_BOUNDRY],
333
+ Float:min_value = pbar_Data[playerid][barid][pbar_minValue],
334
+ Float:max_value = pbar_Data[playerid][barid][pbar_maxValue],
335
+ progressbar_direction:direction = pbar_Data[playerid][barid][pbar_direction],
336
+ bool:draw_main,
337
+ color = pbar_Data[playerid][barid][pbar_colour],
338
+ PlayerText:ptd_main = pbar_TextDraw[playerid][barid][pbar_main]
339
+ ;
340
+ if( value < min_value ) {
341
+ value = min_value;
342
+ } else if( value > max_value ) {
343
+ value = max_value;
344
+ }
345
+ pbar_Data[playerid][barid][pbar_progressValue] = value;
346
+ draw_main = PlayerBarUI_isNeedToDrawValue(direction, value, min_value, max_value);
347
+ PlayerBarUI_computeBoundry(playerid, barid, boundary);
348
+ #if defined PlayerTextDrawSetPos
349
+ {
350
+ PlayerTextDrawSetPos(playerid, ptd_main, boundary[E_PBAR_VALUE_POS_X], boundary[E_PBAR_VALUE_POS_Y]);
351
+ PlayerTextDrawTextSize(playerid, ptd_main, boundary[E_PBAR_VALUE_RIGHT], 0.0);
352
+ PlayerTextDrawLetterSize(playerid, ptd_main, 1.0, boundary[E_PBAR_VALUE_HEIGHT]);
353
+ PlayerTextDrawUseBox(playerid, ptd_main, draw_main);
354
+ }
355
+ #else
356
+ {
357
+ PlayerTextDrawDestroy(playerid, ptd_main);
358
+ ptd_main = CreatePlayerTextDraw(
359
+ playerid,
360
+ boundary[E_PBAR_VALUE_POS_X],
361
+ boundary[E_PBAR_VALUE_POS_Y],
362
+ "_"
363
+ );
364
+ new PlayerText:ptd_back = pbar_TextDraw[playerid][barid][pbar_back],
365
+ PlayerText:ptd_fill = pbar_TextDraw[playerid][barid][pbar_fill]
366
+ ;
367
+ if(
368
+ (ptd_fill != PlayerText:INVALID_TEXT_DRAW && ptd_fill < ptd_main) ||
369
+ (ptd_back != PlayerText:INVALID_TEXT_DRAW && ptd_back < ptd_main)
370
+ ) {
371
+ PlayerTextDrawTextSize(playerid, ptd_main, boundary[E_PBAR_VALUE_RIGHT], 0.0);
372
+ PlayerTextDrawLetterSize(playerid, ptd_main, 1.0, boundary[E_PBAR_VALUE_HEIGHT]);
373
+ PlayerTextDrawUseBox(playerid, ptd_main, draw_main);
374
+ pbar_TextDraw[playerid][barid][pbar_main] = ptd_main;
375
+ } else {
376
+ PlayerTextDrawDestroy(playerid, ptd_back);
377
+ PlayerTextDrawDestroy(playerid, ptd_fill);
378
+ PlayerTextDrawDestroy(playerid, ptd_main);
379
+ PlayerBarUI_createGeometry(playerid, barid, boundary, color, draw_main);
380
+ }
381
+ }
382
+ #endif
383
+ SetPlayerProgressBarColour(playerid, barid, color);
384
+ if( pbar_Data[playerid][barid][pbar_show] ) {
385
+ ShowPlayerProgressBar(playerid, barid);
386
+ }
387
+ return 1;
388
+ }
389
+ stock Float:GetPlayerProgressBarValue(const playerid, const PlayerBar:barid) {
390
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
391
+ return INVALID_PLAYER_BAR_VALUE;
392
+ }
393
+ return pbar_Data[playerid][barid][pbar_progressValue];
394
+ }
395
+ stock progressbar_direction:GetPlayerProgressBarDirection(const playerid, const PlayerBar:barid) {
396
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
397
+ return progressbar_direction:BAR_DIRECTION_RIGHT;
398
+ }
399
+ return pbar_Data[playerid][barid][pbar_direction];
400
+ }
401
+ stock SetPlayerProgressBarDirection(const playerid, const PlayerBar:barid, const progressbar_direction:direction) {
402
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
403
+ return 0;
404
+ }
405
+ pbar_Data[playerid][barid][pbar_direction] = direction;
406
+ _progress2_renderBar(playerid, barid);
407
+ return 1;
408
+ }
409
+ stock GetPlayerProgressBarPadding(const playerid, const PlayerBar:barid, &Float:padding_x, &Float:padding_y) {
410
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
411
+ return 0;
412
+ }
413
+ padding_x = pbar_Data[playerid][barid][E_PADDING_X];
414
+ padding_y = pbar_Data[playerid][barid][E_PADDING_Y];
415
+ return 1;
416
+ }
417
+ stock SetPlayerProgressBarPadding(const playerid, const PlayerBar:barid, const Float:padding_x, const Float:padding_y) {
418
+ if( !IsValidPlayerProgressBar(playerid, barid) ) {
419
+ return 0;
420
+ }
421
+ pbar_Data[playerid][barid][E_PADDING_X] = padding_x;
422
+ pbar_Data[playerid][barid][E_PADDING_Y] = padding_y;
423
+ _progress2_renderBar(playerid, barid);
424
+ return 1;
425
+ }
426
+ static PlayerBarUI_createGeometry(const playerid, const PlayerBar:barid, const boundary[E_PROGRESSBAR_BOUNDRY], const color, const bool:draw_main) {
427
+ new PlayerText:ptd_back, PlayerText:ptd_fill, PlayerText:ptd_main;
428
+ ptd_back = CreatePlayerTextDraw(playerid, boundary[E_PBAR_BACKGROUND_POS_X], boundary[E_PBAR_BACKGROUND_POS_Y], "_");
429
+ PlayerTextDrawTextSize (playerid, ptd_back, boundary[E_PBAR_BACKGROUND_RIGHT], 0.0);
430
+ PlayerTextDrawLetterSize (playerid, ptd_back, 1.0, boundary[E_PBAR_BACKGROUND_HEIGHT]);
431
+ PlayerTextDrawUseBox (playerid, ptd_back, true);
432
+ ptd_fill = CreatePlayerTextDraw(playerid, boundary[E_PBAR_FILLER_POS_X], boundary[E_PBAR_FILLER_POS_Y], "_");
433
+ PlayerTextDrawTextSize (playerid, ptd_fill, boundary[E_PBAR_FILLER_RIGHT], 0.0);
434
+ PlayerTextDrawLetterSize (playerid, ptd_fill, 1.0, boundary[E_PBAR_FILLER_HEIGHT]);
435
+ PlayerTextDrawUseBox (playerid, ptd_fill, true);
436
+ ptd_main = CreatePlayerTextDraw(playerid, boundary[E_PBAR_VALUE_POS_X], boundary[E_PBAR_VALUE_POS_Y], "_");
437
+ PlayerTextDrawTextSize(playerid, ptd_main, boundary[E_PBAR_VALUE_RIGHT], 0.0);
438
+ PlayerTextDrawLetterSize(playerid, ptd_main, 1.0, boundary[E_PBAR_VALUE_HEIGHT]);
439
+ PlayerTextDrawUseBox (playerid, ptd_main, draw_main);
440
+ pbar_TextDraw[playerid][barid][pbar_back] = ptd_back;
441
+ pbar_TextDraw[playerid][barid][pbar_fill] = ptd_fill;
442
+ pbar_TextDraw[playerid][barid][pbar_main] = ptd_main;
443
+ SetPlayerProgressBarColour(playerid, barid, color);
444
+ }
445
+ _progress2_renderBar(const playerid, const PlayerBar:barid) {
446
+ if(
447
+ !IsPlayerConnected(playerid) ||
448
+ !IsValidPlayerProgressBar(playerid, barid)
449
+ ) {
450
+ return false;
451
+ }
452
+ new
453
+ PlayerText:old_textdraw_array[E_BAR_TEXT_DRAW],
454
+ boundary[E_PROGRESSBAR_BOUNDRY],
455
+ Float:min_value = pbar_Data[playerid][barid][pbar_minValue],
456
+ Float:max_value = pbar_Data[playerid][barid][pbar_maxValue],
457
+ Float:cur_value = pbar_Data[playerid][barid][pbar_progressValue],
458
+ progressbar_direction:direction = pbar_Data[playerid][barid][pbar_direction],
459
+ bool:draw_main,
460
+ color = pbar_Data[playerid][barid][pbar_colour],
461
+ PlayerText:ptd_back,
462
+ PlayerText:ptd_fill,
463
+ PlayerText:ptd_main
464
+ ;
465
+ old_textdraw_array = pbar_TextDraw[playerid][barid];
466
+ _ptextdraw_destroy_array(playerid, old_textdraw_array);
467
+ draw_main = PlayerBarUI_isNeedToDrawValue(direction, cur_value, min_value, max_value);
468
+ PlayerBarUI_computeBoundry(playerid, barid, boundary);
469
+ PlayerBarUI_createGeometry(playerid, barid, boundary, color, draw_main);
470
+ ptd_back = pbar_TextDraw[playerid][barid][pbar_main];
471
+ ptd_fill = pbar_TextDraw[playerid][barid][pbar_fill];
472
+ ptd_main = pbar_TextDraw[playerid][barid][pbar_back];
473
+ {
474
+ new E_BAR_TEXT_DRAW:td_slot_old,
475
+ E_BAR_TEXT_DRAW:td_slot_new,
476
+ PlayerText:old_textdraw_item
477
+ ;
478
+ for(td_slot_old = E_BAR_TEXT_DRAW:0; td_slot_old < E_BAR_TEXT_DRAW:sizeof(old_textdraw_array); ++td_slot_old) {
479
+ old_textdraw_item = old_textdraw_array[td_slot_old];
480
+ for(td_slot_new = E_BAR_TEXT_DRAW:0; td_slot_new < E_BAR_TEXT_DRAW:sizeof(old_textdraw_array); ++td_slot_new) {
481
+ if(
482
+ old_textdraw_item != ptd_back &&
483
+ old_textdraw_item != ptd_fill &&
484
+ old_textdraw_item != ptd_main
485
+ ) {
486
+ PlayerTextDrawHide(playerid, old_textdraw_item);
487
+ }
488
+ }
489
+ }
490
+ }
491
+ if( pbar_Data[playerid][barid][pbar_show] ) {
492
+ ShowPlayerProgressBar(playerid, barid);
493
+ }
494
+ return true;
495
+ }
496
+ #if(defined _INC_y_hooks)
497
+ hook OnScriptInit() {
498
+ PlayerBarUI_ResetAll();
499
+ #if(defined _INC_y_iterate)
500
+ Iter_Init(pbar_Index);
501
+ #endif
502
+ }
503
+ hook OnPlayerDisconnect(playerid, reason) {
504
+ #if(defined _INC_y_iterate)
505
+ Iter_Clear(pbar_Index[playerid]);
506
+ #endif
507
+ }
508
+ hook OnScriptExit() {
509
+ for(new i = 0; i < MAX_PLAYERS; i++) {
510
+ if( IsPlayerConnected(i) ) {
511
+ DestroyAllPlayerProgressBars(i);
512
+ }
513
+ }
514
+ }
515
+ #endif
516
+ stock DestroyAllPlayerProgressBars(const playerid) {
517
+ for(new PlayerBar:i = PlayerBar:0; i < MAX_PLAYER_BARS; i++) {
518
+ DestroyPlayerProgressBar(playerid, i);
519
+ }
520
+ return 1;
521
+ }
522
+ static stock bar_getRatios(const progressbar_direction:direction, const Float:cur_value, const Float:min_value, const Float:max_value, &Float:ratio_from, &Float:ratio_to) {
523
+ new Float:range_value = max_value - min_value;
524
+ if( direction == BAR_DIRECTION_HORIZONTAL_FROM_0 || direction == BAR_DIRECTION_VERTICAL_FROM_0 ) {
525
+ if( max_value < 0.0 ) {
526
+ ratio_from = 1.0;
527
+ } else if( min_value > 0.0 ) {
528
+ ratio_from = 0.0;
529
+ } else {
530
+ ratio_from = -min_value / range_value;
531
+ }
532
+ } else {
533
+ ratio_from = 0.0;
534
+ }
535
+ ratio_to = (cur_value - min_value) / range_value;
536
+ }
537
+ static stock _ptextdraw_destroy_array(const playerid, const PlayerText:ptd_array[E_BAR_TEXT_DRAW]) {
538
+ for(new E_BAR_TEXT_DRAW:ptd_slot = E_BAR_TEXT_DRAW:0; ptd_slot < E_BAR_TEXT_DRAW:3; ++ptd_slot) {
539
+ PlayerTextDrawDestroy(playerid, ptd_array[ptd_slot]);
540
+ }
541
+ }
542
+ static stock _normalise_range_f(&Float:value_a, &Float:value_b) {
543
+ if( value_a > value_b ) {
544
+ new Float:temp_value = value_b;
545
+ value_b = value_a;
546
+ value_a = temp_value;
547
+ }
548
+ }
549
+ static stock PlayerBarUI_computeBoundry(const playerid, const PlayerBar:barid, boundary[E_PROGRESSBAR_BOUNDRY]) {
550
+ new
551
+ Float:pos_x, Float:pos_y,
552
+ Float:padding_x, Float:padding_y,
553
+ Float:width = pbar_Data[playerid][barid][pbar_width],
554
+ Float:height = pbar_Data[playerid][barid][pbar_height],
555
+ Float:min_value = pbar_Data[playerid][barid][pbar_minValue],
556
+ Float:max_value = pbar_Data[playerid][barid][pbar_maxValue],
557
+ Float:cur_value = pbar_Data[playerid][barid][pbar_progressValue],
558
+ progressbar_direction:direction = pbar_Data[playerid][barid][pbar_direction],
559
+ Float:outer_pos_x2, Float:outer_pos_y2,
560
+ Float:inner_pos_x1, Float:inner_pos_y1,
561
+ Float:inner_pos_x2, Float:inner_pos_y2,
562
+ Float:inner_size_x, Float:inner_size_y,
563
+ Float:value_pos_x1, Float:value_pos_y1,
564
+ Float:value_pos_x2, Float:value_pos_y2,
565
+ Float:size_multiplier = direction_size_mult[direction],
566
+ bool:is_vertical = (direction > BAR_DIRECTION_HORIZONTAL_FROM_0),
567
+ Float:ratio_from, Float:ratio_to
568
+ ;
569
+ GetPlayerProgressBarPos(playerid, barid, pos_x, pos_y);
570
+ GetPlayerProgressBarPadding(playerid, barid, padding_x, padding_y);
571
+ outer_pos_x2 = pos_x + width;
572
+ outer_pos_y2 = pos_y + height;
573
+ inner_pos_x1 = pos_x + padding_x;
574
+ inner_pos_x2 = outer_pos_x2 - padding_x;
575
+ inner_pos_y1 = pos_y + padding_y;
576
+ inner_pos_y2 = outer_pos_y2 - padding_y;
577
+ inner_size_x = inner_pos_x2 - inner_pos_x1;
578
+ inner_size_y = inner_pos_y2 - inner_pos_y1;
579
+ bar_getRatios(direction, cur_value, min_value, max_value, ratio_from, ratio_to);
580
+ ratio_from *= size_multiplier;
581
+ ratio_to *= size_multiplier;
582
+ if( is_vertical ) {
583
+ value_pos_x1 = inner_pos_x1;
584
+ value_pos_x2 = inner_pos_x2;
585
+ } else {
586
+ value_pos_y1 = inner_pos_y1;
587
+ value_pos_y2 = inner_pos_y2;
588
+ }
589
+ switch(direction) {
590
+ case BAR_DIRECTION_RIGHT: { value_pos_x1 = inner_pos_x1; }
591
+ case BAR_DIRECTION_LEFT: { value_pos_x1 = inner_pos_x2; }
592
+ case BAR_DIRECTION_HORIZONTAL_FROM_0: { value_pos_x1 = inner_pos_x1; }
593
+ case BAR_DIRECTION_UP: { value_pos_y1 = inner_pos_y2; }
594
+ case BAR_DIRECTION_DOWN: { value_pos_y1 = inner_pos_y1; }
595
+ case BAR_DIRECTION_VERTICAL_FROM_0: { value_pos_y1 = inner_pos_y2; }
596
+ }
597
+ if( is_vertical ) {
598
+ value_pos_y2 = value_pos_y1;
599
+ value_pos_y1 += inner_size_y * ratio_from;
600
+ value_pos_y2 += inner_size_y * ratio_to;
601
+ } else {
602
+ value_pos_x2 = value_pos_x1;
603
+ value_pos_x1 += inner_size_x * ratio_from;
604
+ value_pos_x2 += inner_size_x * ratio_to;
605
+ }
606
+ {
607
+ _normalise_range_f(value_pos_x1, value_pos_x2);
608
+ _normalise_range_f(value_pos_y1, value_pos_y2);
609
+ }
610
+ new Float:correction_x = 1.25;
611
+ value_pos_x1 += correction_x;
612
+ value_pos_x2 -= correction_x;
613
+ inner_pos_x1 += correction_x;
614
+ inner_pos_x2 -= correction_x;
615
+ boundary[E_PBAR_BACKGROUND_POS_X] = pos_x;
616
+ boundary[E_PBAR_BACKGROUND_POS_Y] = pos_y;
617
+ boundary[E_PBAR_BACKGROUND_RIGHT] = outer_pos_x2;
618
+ boundary[E_PBAR_BACKGROUND_HEIGHT] = 0.1 * (outer_pos_y2 - pos_y);
619
+ boundary[E_PBAR_FILLER_POS_X] = inner_pos_x1;
620
+ boundary[E_PBAR_FILLER_POS_Y] = inner_pos_y1;
621
+ boundary[E_PBAR_FILLER_RIGHT] = inner_pos_x2;
622
+ boundary[E_PBAR_FILLER_HEIGHT] = 0.1 * (inner_pos_y2 - inner_pos_y1);
623
+ boundary[E_PBAR_VALUE_POS_X] = value_pos_x1;
624
+ boundary[E_PBAR_VALUE_POS_Y] = value_pos_y1;
625
+ boundary[E_PBAR_VALUE_RIGHT] = value_pos_x2;
626
+ boundary[E_PBAR_VALUE_HEIGHT] = 0.1 * (value_pos_y2 - value_pos_y1);
627
+ }
samp_logger_version.inc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ #define SAMP_LOGGER_VERSION_MAJOR (1)
2
+ #define SAMP_LOGGER_VERSION_MINOR (3)
3
+ #define SAMP_LOGGER_VERSION_PATCH (1)
sscanf2.inc ADDED
@@ -0,0 +1,793 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _INC_SSCANF
2
+ #endinput
3
+ #endif
4
+ #define _INC_SSCANF
5
+ #if !defined _samp_included
6
+ #error Please include <a_npc> or <a_samp> first.
7
+ #endif
8
+ #define SSCANF_STATIC__
9
+ #if defined __PawnBuild
10
+ #if __PawnBuild == 11
11
+ #undef SSCANF_STATIC__
12
+ #define SSCANF_STATIC__ static
13
+ #endif
14
+ #else
15
+ #if !defined SSCANF_NO_NICE_FEATURES
16
+ #error sscanf utilises community compiler features. Use `#define SSCANF_NO_NICE_FEATURES` to live without (if you can call that living) or better yet download it here: github.com/pawn-lang/compiler/releases
17
+ #endif
18
+ #endif
19
+ #if defined GetDistanceFromMeToPoint
20
+ static stock SSCANF_NPC = 1;
21
+ #define SSCANF_NPC (1)
22
+ #pragma library sscanf
23
+ #else
24
+ static stock SSCANF_NPC = 0;
25
+ #define SSCANF_NPC (0)
26
+ #endif
27
+ static stock SSCANF_VERSION_MAJOR = 2;
28
+ #define SSCANF_VERSION_MAJOR 2
29
+ static stock SSCANF_VERSION_MINOR = 13;
30
+ #define SSCANF_VERSION_MINOR 13
31
+ static stock SSCANF_VERSION_BUILD = 8;
32
+ #define SSCANF_VERSION_BUILD 8
33
+ static stock SSCANF_VERSION_STRING[] = #SSCANF_VERSION_MAJOR "." #SSCANF_VERSION_MINOR "." #SSCANF_VERSION_BUILD;
34
+ #define SSCANF_VERSION_STRING #SSCANF_VERSION_MAJOR "." #SSCANF_VERSION_MINOR "." #SSCANF_VERSION_BUILD
35
+ forward BCD(number);
36
+ #define BCD(%0) (_:MORE_BCD:NO_MORE_BCD:%0.$0)
37
+ #define MORE_BCD:NO_MORE_BCD:%0.%1$%2) MORE_BCD:NO_MORE_BCD:%1$(%2) << 8 | DO_BCD(%0))
38
+ #define NO_MORE_BCD:$
39
+ #define DO_BCD(%0) _:(%0) / 10 << 4 | _:(%0) % 10
40
+ const SSCANF_VERSION = BCD(SSCANF_VERSION_MAJOR.SSCANF_VERSION_MINOR.SSCANF_VERSION_BUILD);
41
+ stock const SSCANF_VERSION_BCD = SSCANF_VERSION;
42
+ #define sscanf_%0\32; sscanf_
43
+ #define SSCANF:%0(%1) forward sscanf_%0(%1);public sscanf_%0(%1)
44
+ #define @kustom()%0(%1) forward sscanf_%0(%1);public sscanf_%0(%1)
45
+ #if defined sscanf && !defined SSCANF_GetClosestString
46
+ #error sscanf already defined, or used before inclusion.
47
+ #endif
48
+ native SSCANF__(const file[], const line, const data[], const format[], {T_WEAPON, Float, _}:...);
49
+ native UNFORMAT__(const file[], const line, const data[], const format[], {T_WEAPON, Float, _}:...) = SSCANF__;
50
+ native SSCANF_Init(players, invalid, len);
51
+ native SSCANF_Join(playerid, const name[], bool:npc);
52
+ native SSCANF_Leave(playerid);
53
+ native bool:SSCANF_IsConnected(playerid);
54
+ native SSCANF_Levenshtein(const string1[], const string2[]);
55
+ native Float:SSCANF_TextSimilarity(const string1[], const string2[]);
56
+ native SSCANF_GetOption(const name[]) = SSCANF_Option;
57
+ native SSCANF_GetOption__(const name[]) = SSCANF_Option;
58
+ native SSCANF_SetOption(const name[], {_, Float}:value) = SSCANF_Option;
59
+ native SSCANF_SetOption__(const name[], {_, Float}:value) = SSCANF_Option;
60
+ forward SSCANF_Option(const name[], {_, Float}:value = -1);
61
+ #define SSCANF_Option SSCANF_GetOption__
62
+ #define SSCANF_GetOption__(%0,%1) SSCANF_SetOption__(%0,%1)
63
+ #define _ALS_SSCANF_Option
64
+ #define _ALS_SSCANF_GetOption__
65
+ native SSCANF_VersionString(version[], size = sizeof (version)) = SSCANF_Version;
66
+ native SSCANF_VersionString__(version[], size = sizeof (version)) = SSCANF_Version;
67
+ native SSCANF_VersionBCD() = SSCANF_Version;
68
+ native SSCANF_VersionBCD__() = SSCANF_Version;
69
+ static stock SSCANF_Version(version[] = "", size = sizeof (version))
70
+ {
71
+ return SSCANF_VERSION_BCD;
72
+ }
73
+ #define SSCANF_Version SSCANF_VersionString__
74
+ #define SSCANF_VersionString__() SSCANF_VersionBCD__()
75
+ #define _ALS_SSCANF_Version
76
+ #define _ALS_SSCANF_VersionString__
77
+ #if defined __PawnBuild
78
+ #pragma warning push
79
+ #pragma warning disable 234
80
+ #endif
81
+ #pragma deprecated - include <sscanf2> first.
82
+ forward sscanf(const data[], const format[], {T_WEAPON, Float, _}:...);
83
+ #if defined __PawnBuild
84
+ #pragma warning pop
85
+ #endif
86
+ #if defined __PawnBuild
87
+ #define sscanf( SSCANF__(__file,__line,
88
+ #else
89
+ #define sscanf( SSCANF__(SSCANF_UNK_,-1,
90
+ #endif
91
+ #if defined __PawnBuild
92
+ #pragma warning push
93
+ #pragma warning disable 234
94
+ #endif
95
+ #pragma deprecated - include <sscanf2> first.
96
+ forward unformat(const data[], const format[], {T_WEAPON, Float, _}:...);
97
+ #if defined __PawnBuild
98
+ #pragma warning pop
99
+ #endif
100
+ #if defined __PawnBuild
101
+ #define unformat( SSCANF__(__file,__line,
102
+ #else
103
+ #define unformat( SSCANF__(SSCANF_FOM_,-1,
104
+ #endif
105
+ stock const SSCANF_UNK_[] = "sscanf";
106
+ stock const SSCANF_FOM_[] = "unformat";
107
+ stock const SSCANF_EXT_[] = "extract";
108
+ stock const SSCANF_QUIET[] = "SSCANF_QUIET";
109
+ stock const OLD_DEFAULT_NAME[] = "OLD_DEFAULT_NAME";
110
+ stock const MATCH_NAME_PARTIAL[] = "MATCH_NAME_PARTIAL";
111
+ stock const CELLMIN_ON_MATCHES[] = "CELLMIN_ON_MATCHES";
112
+ stock const OLD_DEFAULT_KUSTOM[] = "OLD_DEFAULT_KUSTOM";
113
+ stock const OLD_DEFAULT_CUSTOM[] = "OLD_DEFAULT_CUSTOM";
114
+ stock const SSCANF_COLOUR_FORMS[] = "SSCANF_COLOUR_FORMS";
115
+ stock const SSCANF_ALPHA[] = "SSCANF_ALPHA";
116
+ stock const SSCANF_ARGB[] = "SSCANF_ARGB";
117
+ stock const MATCH_NAME_FIRST[] = "MATCH_NAME_FIRST";
118
+ stock const MATCH_NAME_SIMILARITY[] = "MATCH_NAME_SIMILARITY";
119
+ static stock SSCANF_gInit = 0;
120
+ #if !defined CHAIN_ORDER
121
+ #define CHAIN_ORDER() 0
122
+ #endif
123
+ #define CHAIN_HOOK(%0) forward @CO_%0();public @CO_%0(){return CHAIN_ORDER()+1;}
124
+ #define CHAIN_NEXT(%0) @CO_%0
125
+ #define CHAIN_FORWARD:%0_%2(%1)=%3; \
126
+ forward %0_%2(%1); \
127
+ public %0_%2(%1) <_ALS : _ALS_x0, _ALS : _ALS_x1> { return (%3); } \
128
+ public %0_%2(%1) <> { return (%3); }
129
+ #define CHAIN_PUBLIC:%0(%1) %0(%1) <_ALS : _ALS_go>
130
+ CHAIN_HOOK(SSCANF)
131
+ #undef CHAIN_ORDER
132
+ #define CHAIN_ORDER CHAIN_NEXT(SSCANF)
133
+ static stock _SSCANF_IncludeStates() <_ALS : _ALS_x0, _ALS : _ALS_x1, _ALS : _ALS_x2, _ALS : _ALS_x3> {}
134
+ static stock _SSCANF_IncludeStates() <_ALS : _ALS_go> {}
135
+ #if SSCANF_NPC && !defined SSCANF_NO_PLAYERS
136
+ forward SSCANF_PlayerCheck();
137
+ #endif
138
+ native SSCANF_SetTimer(const funcname[], interval, bool:repeating) = SetTimer;
139
+ #if !defined __PawnBuild
140
+ forward SSCANF_RunInit();
141
+ static stock SSCANF_RunInit0()
142
+ {
143
+ }
144
+ #endif
145
+ static stock SSCANF_RunInit()
146
+ {
147
+ #if SSCANF_NPC
148
+ state _ALS : _ALS_go;
149
+ SSCANF_Init(MAX_PLAYERS, INVALID_PLAYER_ID, MAX_PLAYER_NAME);
150
+ #if !defined SSCANF_NO_PLAYERS
151
+ SSCANF_PlayerCheck();
152
+ SSCANF_SetTimer("SSCANF_PlayerCheck", 0, true);
153
+ #endif
154
+ #else
155
+ state _ALS : _ALS_go;
156
+ if ((SSCANF_gInit = SSCANF_Init(GetMaxPlayers(), INVALID_PLAYER_ID, MAX_PLAYER_NAME)) == 1)
157
+ {
158
+ new
159
+ name[MAX_PLAYER_NAME + 1];
160
+ for (new i = 0; i != MAX_PLAYERS; ++i)
161
+ {
162
+ if (IsPlayerConnected(i) && !SSCANF_IsConnected(i))
163
+ {
164
+ GetPlayerName(i, name, sizeof (name));
165
+ SSCANF_Join(i, name, bool:IsPlayerNPC(i));
166
+ }
167
+ }
168
+ }
169
+ #endif
170
+ }
171
+ #if SSCANF_NPC
172
+ public OnNPCModeInit()
173
+ {
174
+ SSCANF_RunInit();
175
+ SSCANF_OnNPCModeInit();
176
+ return 1;
177
+ }
178
+ #if defined _ALS_OnNPCModeInit
179
+ #undef OnNPCModeInit
180
+ #else
181
+ #define _ALS_OnNPCModeInit
182
+ #endif
183
+ #define OnNPCModeInit(%0) CHAIN_PUBLIC:SSCANF_OnNPCModeInit(%0)
184
+ CHAIN_FORWARD:SSCANF_OnNPCModeInit() = 1;
185
+ #else
186
+ const SSCANF_STATIC__ SSCANF_OnNPCModeInit = 0;
187
+ #define SSCANF_OnNPCModeInit
188
+ #endif
189
+ #if SSCANF_NPC && !defined SSCANF_NO_PLAYERS
190
+ public SSCANF_PlayerCheck()
191
+ {
192
+ new
193
+ name[MAX_PLAYER_NAME + 1];
194
+ for (new i = 0; i != MAX_PLAYERS; ++i)
195
+ {
196
+ if (IsPlayerConnected(i))
197
+ {
198
+ if (!SSCANF_IsConnected(i))
199
+ {
200
+ GetPlayerName(i, name, sizeof (name));
201
+ SSCANF_Join(i, name, false);
202
+ }
203
+ }
204
+ else
205
+ {
206
+ if (SSCANF_IsConnected(i))
207
+ {
208
+ SSCANF_Leave(i);
209
+ }
210
+ }
211
+ }
212
+ }
213
+ #else
214
+ const SSCANF_STATIC__ SSCANF_PlayerCheck = 0;
215
+ #define SSCANF_PlayerCheck
216
+ #endif
217
+ #define SSCANF_BRACKETS ()
218
+ forward OnScriptInit SSCANF_BRACKETS;
219
+ #undef SSCANF_BRACKETS
220
+ #if SSCANF_NPC
221
+ const SSCANF_STATIC__ SSCANF_OnScriptInit = 0;
222
+ #define SSCANF_OnScriptInit
223
+ #else
224
+ public OnScriptInit()
225
+ {
226
+ if (!SSCANF_gInit)
227
+ {
228
+ SSCANF_RunInit();
229
+ }
230
+ SSCANF_OnScriptInit();
231
+ return 1;
232
+ }
233
+ #if defined _ALS_OnScriptInit
234
+ #undef OnScriptInit
235
+ #else
236
+ #define _ALS_OnScriptInit
237
+ #endif
238
+ #define OnScriptInit(%0) CHAIN_PUBLIC:SSCANF_OnScriptInit(%0)
239
+ CHAIN_FORWARD:SSCANF_OnScriptInit() = 1;
240
+ #endif
241
+ #if SSCANF_NPC
242
+ const SSCANF_STATIC__ SSCANF_OnFilterScriptInit = 0;
243
+ #define SSCANF_OnFilterScriptInit
244
+ #else
245
+ public OnFilterScriptInit()
246
+ {
247
+ if (!SSCANF_gInit)
248
+ {
249
+ SSCANF_RunInit();
250
+ }
251
+ SSCANF_OnFilterScriptInit();
252
+ return 1;
253
+ }
254
+ #if defined _ALS_OnFilterScriptInit
255
+ #undef OnFilterScriptInit
256
+ #else
257
+ #define _ALS_OnFilterScriptInit
258
+ #endif
259
+ #define OnFilterScriptInit(%0) CHAIN_PUBLIC:SSCANF_OnFilterScriptInit(%0)
260
+ CHAIN_FORWARD:SSCANF_OnFilterScriptInit() = 1;
261
+ #endif
262
+ #if SSCANF_NPC
263
+ const SSCANF_STATIC__ SSCANF_OnGameModeInit = 0;
264
+ #define SSCANF_OnGameModeInit
265
+ #else
266
+ public OnGameModeInit()
267
+ {
268
+ if (!SSCANF_gInit)
269
+ {
270
+ SSCANF_RunInit();
271
+ }
272
+ SSCANF_OnGameModeInit();
273
+ return 1;
274
+ }
275
+ #if defined _ALS_OnGameModeInit
276
+ #undef OnGameModeInit
277
+ #else
278
+ #define _ALS_OnGameModeInit
279
+ #endif
280
+ #define OnGameModeInit(%0) CHAIN_PUBLIC:SSCANF_OnGameModeInit(%0)
281
+ CHAIN_FORWARD:SSCANF_OnGameModeInit() = 1;
282
+ #endif
283
+ forward OnCachedInit();
284
+ #if SSCANF_NPC
285
+ const SSCANF_STATIC__ SSCANF_OnCachedInit = 0;
286
+ #define SSCANF_OnCachedInit
287
+ #else
288
+ public OnCachedInit()
289
+ {
290
+ SSCANF_RunInit();
291
+ SSCANF_OnCachedInit();
292
+ return 1;
293
+ }
294
+ #if defined _ALS_OnCachedInit
295
+ #undef OnCachedInit
296
+ #else
297
+ #define _ALS_OnCachedInit
298
+ #endif
299
+ #define OnCachedInit(%0) CHAIN_PUBLIC:SSCANF_OnCachedInit(%0)
300
+ CHAIN_FORWARD:SSCANF_OnCachedInit() = 1;
301
+ #endif
302
+ #if SSCANF_NPC
303
+ const SSCANF_STATIC__ SSCANF_OnPlayerConnect = 0;
304
+ #define SSCANF_OnPlayerConnect
305
+ #else
306
+ public OnPlayerConnect(playerid)
307
+ {
308
+ if (SSCANF_gInit == 1)
309
+ {
310
+ new
311
+ name[MAX_PLAYER_NAME + 1];
312
+ GetPlayerName(playerid, name, sizeof(name));
313
+ SSCANF_Join(playerid, name, bool:IsPlayerNPC(playerid));
314
+ }
315
+ SSCANF_OnPlayerConnect(playerid);
316
+ return 1;
317
+ }
318
+ #if defined _ALS_OnPlayerConnect
319
+ #undef OnPlayerConnect
320
+ #else
321
+ #define _ALS_OnPlayerConnect
322
+ #endif
323
+ #define OnPlayerConnect(%0) CHAIN_PUBLIC:SSCANF_OnPlayerConnect(%0)
324
+ CHAIN_FORWARD:SSCANF_OnPlayerConnect(playerid) = 1;
325
+ #endif
326
+ #if SSCANF_NPC
327
+ const SSCANF_STATIC__ SSCANF_OnPlayerDisconnect = 0;
328
+ #define SSCANF_OnPlayerDisconnect
329
+ #else
330
+ public OnPlayerDisconnect(playerid, reason)
331
+ {
332
+ SSCANF_OnPlayerDisconnect(playerid, reason);
333
+ if (SSCANF_gInit == 1)
334
+ {
335
+ SSCANF_Leave(playerid);
336
+ }
337
+ return 1;
338
+ }
339
+ #if defined _ALS_OnPlayerDisconnect
340
+ #undef OnPlayerDisconnect
341
+ #else
342
+ #define _ALS_OnPlayerDisconnect
343
+ #endif
344
+ #define OnPlayerDisconnect(%0) CHAIN_PUBLIC:SSCANF_OnPlayerDisconnect(%0)
345
+ CHAIN_FORWARD:SSCANF_OnPlayerDisconnect(playerid, reason) = 1;
346
+ #endif
347
+ #define SSCANF_Init
348
+ #define SSCANF_Join
349
+ #define SSCANF_Leave
350
+ #define SSCANF_IsConnected
351
+ #if defined __PawnBuild
352
+ #define extract%0->%1; EXTRN%1;UNFORMAT__(__file,__line,_:EXTRV:EXTRX:%0,""#,%1,,);
353
+ #else
354
+ #define extract%0->%1; EXTRN%1;UNFORMAT__(SSCANF_EXT_,-1,_:EXTRV:EXTRX:%0,""#,%1,,);
355
+ #endif
356
+ #define UNFORMAT__(%7,%8,_:EXTRV:EXTRX:%0,""#,%1);%2else if (UNFORMAT__(%7,%8,_:EXTRV:EXTRX:%0,""#,%1))
357
+ #define EXTRV:EXTRX:%0<%3>%4#,%9new%1,%2) EXTRZ:EXTRY:%0%4#P<%3>,|||%1|||%2)
358
+ #define EXTRZ:EXTRY:%0#P<,> EXTRY:%0"P<,>"#
359
+ #define EXTRX:%0#,%9new%1,%2) EXTRY:%0#,|||%1|||%2)
360
+ #define EXTRY: EXTR8:EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:
361
+ #define EXTR8:EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0#%1,%2|||%6:%3=%9|||%4) %6_EXTRO:%0#%1,%2|||%3=%9|||%4)
362
+ #define EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0#%1,%2|||%3=%9|||%4) __EXTRO:%0#%1,%2|||%3=%9|||%4)
363
+ #define EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0#%1,%2|||%6:%3[%7]|||%4) %6_EXTRW:%0#%1,%2|||%3[%7]|||%4)
364
+ #define EXTR1:EXTR2:EXTR3:EXTR4:%0#%1,%2|||%3[%7]|||%4) __EXTRW:%0#%1,%2|||%3[%7]|||%4)
365
+ #define EXTR2:EXTR3:EXTR4:%0#%1,%2|||%6:%3|||%4) %6_EXTRN:%0#%1,%2|||%3|||%4)
366
+ #define EXTR3:EXTR4:%0#%1,,%2||||||%4) %0#%1,%2)
367
+ #define EXTR4:%0#%1,%2|||%3|||%4) __EXTRN:%0#%1,%2|||%3|||%4)
368
+ #define __EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1I"("#%9")"#,%2,%3|||%4|||%5)
369
+ #define Float_EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1F"("#%9")"#,%2,%3|||%4|||%5)
370
+ #define player_EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1U"("#%9")"#,%2,%3|||%4|||%5)
371
+ #define string_EXTRO:%0#%1,%2|||%3[%7]=%9|||%4,%5) EXTRY:%0#%1S"("#%9")[*]",%2,(%7),%3|||%4|||%5)
372
+ #define __EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1i,%2,%3|||%4|||%5)
373
+ #define Float_EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1f,%2,%3|||%4|||%5)
374
+ #define player_EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1u,%2,%3|||%4|||%5)
375
+ #define __EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<i>[*],%2,(%7),%3|||%4|||%5)
376
+ #define Float_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<f>[*],%2,(%7),%3|||%4|||%5)
377
+ #define player_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<u>[*],%2,(%7),%3|||%4|||%5)
378
+ #define string_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1s[*],%2,(%7),%3|||%4|||%5)
379
+ #define EXTRN%0new%1; new%1;
380
+ #if !defined string
381
+ #define string:
382
+ #endif
383
+ #define player:%0;UNFORMAT__(%1) %0;UNFORMAT__(%1)
384
+ #define hex:%0;UNFORMAT__(%1) %0;UNFORMAT__(%1)
385
+ #define hex_EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1H"("#%9")"#,%2,%3|||%4|||%5)
386
+ #define hex_EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1h,%2,%3|||%4|||%5)
387
+ #define hex_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<h>[*],%2,(%7),%3|||%4|||%5)
388
+ #define bin:%0;UNFORMAT__(%1) %0;UNFORMAT__(%1)
389
+ #define bin_EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1B"("#%9")"#,%2,%3|||%4|||%5)
390
+ #define bin_EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1b,%2,%3|||%4|||%5)
391
+ #define bin_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<b>[*],%2,(%7),%3|||%4|||%5)
392
+ #define colour:%0;UNFORMAT__(%1) %0;UNFORMAT__(%1)
393
+ #define colour_EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1M"("#%9")"#,%2,%3|||%4|||%5)
394
+ #define colour_EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1m,%2,%3|||%4|||%5)
395
+ #define colour_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<m>[*],%2,(%7),%3|||%4|||%5)
396
+ #define kustom:%0<%1> %0
397
+ #define kustom_EXTRO:%0#%1,%2|||%3<%8>=%9|||%4,%5) EXTRY:%0#%1K<%8>"("#%9")"#,%2,%3|||%4|||%5)
398
+ #define kustom_EXTRN:%0#%1,%2|||%3<%8>|||%4,%5) EXTRY:%0#%1k<%8>,%2,%3|||%4|||%5)
399
+ stock SSCANF_GetSimilarString(const input[], const candidates[][], Float:threshold = 0.111111, count = sizeof (candidates))
400
+ {
401
+ new
402
+ closest = cellmin,
403
+ Float:distance;
404
+ while (count--)
405
+ {
406
+ distance = SSCANF_TextSimilarity(input, candidates[count]);
407
+ if (distance >= threshold)
408
+ {
409
+ closest = count,
410
+ threshold = distance;
411
+ }
412
+ }
413
+ return closest;
414
+ }
415
+ stock SSCANF_GetSimilarValue(const input[], const candidates[][], const results[], fail = cellmin, Float:threshold = 0.111111, count = sizeof (candidates), check = sizeof (results))
416
+ {
417
+ assert(count == check);
418
+ new closest = SSCANF_GetSimilarString(input, candidates, threshold, count);
419
+ if (closest == cellmin)
420
+ {
421
+ return fail;
422
+ }
423
+ return results[closest];
424
+ }
425
+ #if defined __PawnBuild
426
+ #pragma warning push
427
+ #pragma warning disable 234
428
+ #endif
429
+ #pragma deprecated Use `SSCANF_GetSimilarString` for more human results.
430
+ stock SSCANF_GetClosestString(const input[], const candidates[][], threshold = cellmax, count = sizeof (candidates))
431
+ {
432
+ new
433
+ closest = cellmin,
434
+ distance;
435
+ while (count--)
436
+ {
437
+ distance = SSCANF_Levenshtein(input, candidates[count]);
438
+ if (distance < threshold)
439
+ {
440
+ closest = count,
441
+ threshold = distance;
442
+ }
443
+ }
444
+ return closest;
445
+ }
446
+ #if defined __PawnBuild
447
+ #pragma warning pop
448
+ #endif
449
+ #if defined __PawnBuild
450
+ #pragma warning push
451
+ #pragma warning disable 234
452
+ #endif
453
+ #pragma deprecated Use `SSCANF_GetSimilarValue` for more human results.
454
+ stock SSCANF_GetClosestValue(const input[], const candidates[][], const results[], fail = cellmin, threshold = cellmax, count = sizeof (candidates), check = sizeof (results))
455
+ {
456
+ assert(count == check);
457
+ new closest = SSCANF_GetClosestString(input, candidates, threshold, count);
458
+ if (closest == cellmin)
459
+ {
460
+ return fail;
461
+ }
462
+ return results[closest];
463
+ }
464
+ #if defined __PawnBuild
465
+ #pragma warning pop
466
+ #endif
467
+ #if defined SSCANF_NO_K_WEAPON
468
+ native SSCANF_no_k_weapon();
469
+ #define SSCANF_no_k_weapon()
470
+ #else
471
+ SSCANF:weapon(const string[])
472
+ {
473
+ static const results[] = {
474
+ 0, 0, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25,
475
+ 26, 27, 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46
476
+ };
477
+ static const candidates[][] = {
478
+ "Fists",
479
+ "Unarmed",
480
+ "Knuckles",
481
+ "Knuckledusters",
482
+ "Brass Knuckles",
483
+ "Golf Club",
484
+ "Night Stick",
485
+ "Knife",
486
+ "Baseball Bat",
487
+ "Shovel",
488
+ "Pool cue",
489
+ "Katana",
490
+ "Chainsaw",
491
+ "Purple Dildo",
492
+ "White Dildo",
493
+ "Long White Dildo",
494
+ "White Dildo 2",
495
+ "Flowers",
496
+ "Cane",
497
+ "Grenades",
498
+ "Tear Gas",
499
+ "Molotovs",
500
+ "Pistol",
501
+ "Silenced Pistol",
502
+ "Desert Eagle",
503
+ "Shotgun",
504
+ "Sawn Off Shotgun",
505
+ "Combat Shotgun",
506
+ "Micro Uzi",
507
+ "Mac 10",
508
+ "MP5",
509
+ "AK47",
510
+ "M4",
511
+ "Tec9",
512
+ "Rifle",
513
+ "Sniper Rifle",
514
+ "RPG",
515
+ "Missile Launcher",
516
+ "Flame Thrower",
517
+ "Minigun",
518
+ "Sachel Charges",
519
+ "Detonator",
520
+ "Spray Paint",
521
+ "Fire Extinguisher",
522
+ "Camera",
523
+ "Nightvision Goggles",
524
+ "Thermal Goggles",
525
+ "Parachute"
526
+ };
527
+ if ('0' <= string[0] <= '9')
528
+ {
529
+ new
530
+ ret = strval(string);
531
+ if (0 <= ret <= 18 || 22 <= ret <= 46)
532
+ {
533
+ return ret;
534
+ }
535
+ }
536
+ else
537
+ {
538
+ return SSCANF_GetSimilarValue(string, candidates, results, -1);
539
+ }
540
+ return -1;
541
+ }
542
+ #endif
543
+ #if defined SSCANF_NO_K_VEHICLE
544
+ native SSCANF_no_k_vehicle();
545
+ #define SSCANF_no_k_vehicle()
546
+ #else
547
+ SSCANF:vehicle(const string[])
548
+ {
549
+ static const results[] = {
550
+ 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417,
551
+ 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435,
552
+ 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453,
553
+ 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471,
554
+ 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489,
555
+ 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507,
556
+ 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525,
557
+ 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543,
558
+ 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561,
559
+ 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579,
560
+ 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597,
561
+ 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611
562
+ };
563
+ static const candidates[][] = {
564
+ "Landstalker",
565
+ "Bravura",
566
+ "Buffalo",
567
+ "Linerunner",
568
+ "Perennial",
569
+ "Sentinel",
570
+ "Dumper",
571
+ "Firetruck",
572
+ "Trashmaster",
573
+ "Stretch",
574
+ "Manana",
575
+ "Infernus",
576
+ "Voodoo",
577
+ "Pony",
578
+ "Mule",
579
+ "Cheetah",
580
+ "Ambulance",
581
+ "Leviathan",
582
+ "Moonbeam",
583
+ "Esperanto",
584
+ "Taxi",
585
+ "Washington",
586
+ "Bobcat",
587
+ "Mr Whoopee",
588
+ "BF Injection",
589
+ "Hunter",
590
+ "Premier",
591
+ "Enforcer",
592
+ "Securicar",
593
+ "Banshee",
594
+ "Predator",
595
+ "Bus",
596
+ "Rhino",
597
+ "Barracks",
598
+ "Hotknife",
599
+ "Article Trailer",
600
+ "Previon",
601
+ "Coach",
602
+ "Cabbie",
603
+ "Stallion",
604
+ "Rumpo",
605
+ "RC Bandit",
606
+ "Romero",
607
+ "Packer",
608
+ "Monster",
609
+ "Admiral",
610
+ "Squalo",
611
+ "Seasparrow",
612
+ "Pizzaboy",
613
+ "Tram",
614
+ "Article Trailer 2",
615
+ "Turismo",
616
+ "Speeder",
617
+ "Reefer",
618
+ "Tropic",
619
+ "Flatbed",
620
+ "Yankee",
621
+ "Caddy",
622
+ "Solair",
623
+ "Topfun Van (Berkley's RC)",
624
+ "Skimmer",
625
+ "PCJ-600",
626
+ "Faggio",
627
+ "Freeway",
628
+ "RC Baron",
629
+ "RC Raider",
630
+ "Glendale",
631
+ "Oceanic",
632
+ "Sanchez",
633
+ "Sparrow",
634
+ "Patriot",
635
+ "Quad",
636
+ "Coastguard",
637
+ "Dinghy",
638
+ "Hermes",
639
+ "Sabre",
640
+ "Rustler",
641
+ "ZR-350",
642
+ "Walton",
643
+ "Regina",
644
+ "Comet",
645
+ "BMX",
646
+ "Burrito",
647
+ "Camper",
648
+ "Marquis",
649
+ "Baggage",
650
+ "Dozer",
651
+ "Maverick",
652
+ "SAN News Maverick",
653
+ "Rancher",
654
+ "FBI Rancher",
655
+ "Virgo",
656
+ "Greenwood",
657
+ "Jetmax",
658
+ "Hotring Racer",
659
+ "Sandking",
660
+ "Blista Compact",
661
+ "Police Maverick",
662
+ "Boxville",
663
+ "Benson",
664
+ "Mesa",
665
+ "RC Goblin",
666
+ "Hotring Racer \"A\"",
667
+ "Hotring Racer \"B\"",
668
+ "Bloodring Banger",
669
+ "Rancher Lure",
670
+ "Super GT",
671
+ "Elegant",
672
+ "Journey",
673
+ "Bike",
674
+ "Mountain Bike",
675
+ "Beagle",
676
+ "Cropduster",
677
+ "Stuntplane",
678
+ "Tanker",
679
+ "Roadtrain",
680
+ "Nebula",
681
+ "Majestic",
682
+ "Buccaneer",
683
+ "Shamal",
684
+ "Hydra",
685
+ "FCR-900",
686
+ "NRG-500",
687
+ "HPV1000",
688
+ "Cement Truck",
689
+ "Towtruck",
690
+ "Fortune",
691
+ "Cadrona",
692
+ "FBI Truck",
693
+ "Willard",
694
+ "Forklift",
695
+ "Tractor",
696
+ "Combine Harvester",
697
+ "Feltzer",
698
+ "Remington",
699
+ "Slamvan",
700
+ "Blade",
701
+ "Freight (Train)",
702
+ "Brownstreak (Train)",
703
+ "Vortex",
704
+ "Vincent",
705
+ "Bullet",
706
+ "Clover",
707
+ "Sadler",
708
+ "Firetruck LA",
709
+ "Hustler",
710
+ "Intruder",
711
+ "Primo",
712
+ "Cargobob",
713
+ "Tampa",
714
+ "Sunrise",
715
+ "Merit",
716
+ "Utility Van",
717
+ "Nevada",
718
+ "Yosemite",
719
+ "Windsor",
720
+ "Monster \"A\"",
721
+ "Monster \"B\"",
722
+ "Uranus",
723
+ "Jester",
724
+ "Sultan",
725
+ "Stratum",
726
+ "Elegy",
727
+ "Raindance",
728
+ "RC Tiger",
729
+ "Flash",
730
+ "Tahoma",
731
+ "Savanna",
732
+ "Bandito",
733
+ "Freight Flat Trailer (Train)",
734
+ "Streak Trailer (Train)",
735
+ "Kart",
736
+ "Mower",
737
+ "Dune",
738
+ "Sweeper",
739
+ "Broadway",
740
+ "Tornado",
741
+ "AT400",
742
+ "DFT-30",
743
+ "Huntley",
744
+ "Stafford",
745
+ "BF-400",
746
+ "Newsvan",
747
+ "Tug",
748
+ "Petrol Trailer",
749
+ "Emperor",
750
+ "Wayfarer",
751
+ "Euros",
752
+ "Hotdog",
753
+ "Club",
754
+ "Freight Box Trailer (Train)",
755
+ "Article Trailer 3",
756
+ "Andromada",
757
+ "Dodo",
758
+ "RC Cam",
759
+ "Launch",
760
+ "Police Car (LSPD)",
761
+ "Police Car (SFPD)",
762
+ "Police Car (LVPD)",
763
+ "Police Ranger",
764
+ "Picador",
765
+ "S.W.A.T.",
766
+ "Alpha",
767
+ "Phoenix",
768
+ "Glendale Shit",
769
+ "Sadler Shit",
770
+ "Baggage Trailer \"A\"",
771
+ "Baggage Trailer \"B\"",
772
+ "Tug Stairs Trailer",
773
+ "Boxville",
774
+ "Farm Trailer",
775
+ "Utility Trailer"
776
+ };
777
+ if ('0' <= string[0] <= '9')
778
+ {
779
+ new
780
+ ret = strval(string);
781
+ if (400 <= ret <= 611)
782
+ {
783
+ return ret;
784
+ }
785
+ }
786
+ else
787
+ {
788
+ return SSCANF_GetSimilarValue(string, candidates, results, -1);
789
+ }
790
+ return -1;
791
+ }
792
+ #endif
793
+ #define SSCANF__(%0:...) BAD_sscanf(%0:...)
streamer.inc ADDED
@@ -0,0 +1,371 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined _streamer_included
2
+ #endinput
3
+ #endif
4
+ #define _streamer_included
5
+ #include <a_samp>
6
+ #define STREAMER_TYPE_OBJECT (0)
7
+ #define STREAMER_TYPE_PICKUP (1)
8
+ #define STREAMER_TYPE_CP (2)
9
+ #define STREAMER_TYPE_RACE_CP (3)
10
+ #define STREAMER_TYPE_MAP_ICON (4)
11
+ #define STREAMER_TYPE_3D_TEXT_LABEL (5)
12
+ #define STREAMER_TYPE_AREA (6)
13
+ #define STREAMER_TYPE_ACTOR (7)
14
+ #define STREAMER_AREA_TYPE_CIRCLE (0)
15
+ #define STREAMER_AREA_TYPE_CYLINDER (1)
16
+ #define STREAMER_AREA_TYPE_SPHERE (2)
17
+ #define STREAMER_AREA_TYPE_RECTANGLE (3)
18
+ #define STREAMER_AREA_TYPE_CUBOID (4)
19
+ #define STREAMER_AREA_TYPE_POLYGON (5)
20
+ #define STREAMER_OBJECT_TYPE_GLOBAL (0)
21
+ #define STREAMER_OBJECT_TYPE_PLAYER (1)
22
+ #define STREAMER_OBJECT_TYPE_DYNAMIC (2)
23
+ #define STREAMER_MAX_TYPES (8)
24
+ #define STREAMER_MAX_AREA_TYPES (6)
25
+ #define STREAMER_MAX_OBJECT_TYPES (3)
26
+ #define INVALID_STREAMER_ID (0)
27
+ #if !defined FLOAT_INFINITY
28
+ #define FLOAT_INFINITY (Float:0x7F800000)
29
+ #endif
30
+ #if defined STREAMER_ENABLE_TAGS
31
+ #define STREAMER_TAG_OBJECT DynamicObject
32
+ #define STREAMER_TAG_OBJECT_ALT {DynamicObject,_}
33
+ #define STREAMER_TAG_PICKUP DynamicPickup
34
+ #define STREAMER_TAG_CP DynamicCP
35
+ #define STREAMER_TAG_RACE_CP DynamicRaceCP
36
+ #define STREAMER_TAG_MAP_ICON DynamicMapIcon
37
+ #define STREAMER_TAG_3D_TEXT_LABEL DynamicText3D
38
+ #define STREAMER_TAG_AREA DynamicArea
39
+ #define STREAMER_TAG_ACTOR DynamicActor
40
+ #define STREAMER_ALL_TAGS {DynamicObject,DynamicPickup,DynamicCP,DynamicRaceCP,DynamicMapIcon,DynamicText3D,DynamicArea,DynamicActor,_}
41
+ #else
42
+ #define STREAMER_TAG_OBJECT _
43
+ #define STREAMER_TAG_OBJECT_ALT _
44
+ #define STREAMER_TAG_PICKUP _
45
+ #define STREAMER_TAG_CP _
46
+ #define STREAMER_TAG_RACE_CP _
47
+ #define STREAMER_TAG_MAP_ICON _
48
+ #define STREAMER_TAG_AREA _
49
+ #define STREAMER_TAG_ACTOR _
50
+ #if defined STREAMER_REMOVE_TEXT3D_TAG
51
+ #define STREAMER_TAG_3D_TEXT_LABEL _
52
+ #define STREAMER_ALL_TAGS _
53
+ #else
54
+ #if defined STREAMER_USE_DYNAMIC_TEXT3D_TAG
55
+ #define STREAMER_TAG_3D_TEXT_LABEL DynamicText3D
56
+ #define STREAMER_ALL_TAGS {DynamicText3D,_}
57
+ #else
58
+ #define STREAMER_TAG_3D_TEXT_LABEL Text3D
59
+ #define STREAMER_ALL_TAGS {Text3D,_}
60
+ #endif
61
+ #endif
62
+ #endif
63
+ #if !defined STREAMER_OBJECT_SD
64
+ #define STREAMER_OBJECT_SD 300.0
65
+ #endif
66
+ #if !defined STREAMER_OBJECT_DD
67
+ #define STREAMER_OBJECT_DD 0.0
68
+ #endif
69
+ #if !defined STREAMER_PICKUP_SD
70
+ #define STREAMER_PICKUP_SD 200.0
71
+ #endif
72
+ #if !defined STREAMER_CP_SD
73
+ #define STREAMER_CP_SD 200.0
74
+ #endif
75
+ #if !defined STREAMER_RACE_CP_SD
76
+ #define STREAMER_RACE_CP_SD 200.0
77
+ #endif
78
+ #if !defined STREAMER_MAP_ICON_SD
79
+ #define STREAMER_MAP_ICON_SD 200.0
80
+ #endif
81
+ #if !defined STREAMER_3D_TEXT_LABEL_SD
82
+ #define STREAMER_3D_TEXT_LABEL_SD 200.0
83
+ #endif
84
+ #if !defined STREAMER_ACTOR_SD
85
+ #define STREAMER_ACTOR_SD 200.0
86
+ #endif
87
+ public Streamer_IncludeFileVersion = 0x296;
88
+ #pragma unused Streamer_IncludeFileVersion
89
+ enum
90
+ {
91
+ E_STREAMER_AREA_ID,
92
+ E_STREAMER_ATTACHED_OBJECT,
93
+ E_STREAMER_ATTACHED_PLAYER,
94
+ E_STREAMER_ATTACHED_VEHICLE,
95
+ E_STREAMER_ATTACH_OFFSET_X,
96
+ E_STREAMER_ATTACH_OFFSET_Y,
97
+ E_STREAMER_ATTACH_OFFSET_Z,
98
+ E_STREAMER_ATTACH_R_X,
99
+ E_STREAMER_ATTACH_R_Y,
100
+ E_STREAMER_ATTACH_R_Z,
101
+ E_STREAMER_ATTACH_X,
102
+ E_STREAMER_ATTACH_Y,
103
+ E_STREAMER_ATTACH_Z,
104
+ E_STREAMER_COLOR,
105
+ E_STREAMER_DRAW_DISTANCE,
106
+ E_STREAMER_EXTRA_ID,
107
+ E_STREAMER_HEALTH,
108
+ E_STREAMER_INTERIOR_ID,
109
+ E_STREAMER_INVULNERABLE,
110
+ E_STREAMER_MAX_X,
111
+ E_STREAMER_MAX_Y,
112
+ E_STREAMER_MAX_Z,
113
+ E_STREAMER_MIN_X,
114
+ E_STREAMER_MIN_Y,
115
+ E_STREAMER_MIN_Z,
116
+ E_STREAMER_MODEL_ID,
117
+ E_STREAMER_MOVE_R_X,
118
+ E_STREAMER_MOVE_R_Y,
119
+ E_STREAMER_MOVE_R_Z,
120
+ E_STREAMER_MOVE_SPEED,
121
+ E_STREAMER_MOVE_X,
122
+ E_STREAMER_MOVE_Y,
123
+ E_STREAMER_MOVE_Z,
124
+ E_STREAMER_NEXT_X,
125
+ E_STREAMER_NEXT_Y,
126
+ E_STREAMER_NEXT_Z,
127
+ E_STREAMER_PLAYER_ID,
128
+ E_STREAMER_PRIORITY,
129
+ E_STREAMER_ROTATION,
130
+ E_STREAMER_R_X,
131
+ E_STREAMER_R_Y,
132
+ E_STREAMER_R_Z,
133
+ E_STREAMER_SIZE,
134
+ E_STREAMER_STREAM_DISTANCE,
135
+ E_STREAMER_STYLE,
136
+ E_STREAMER_SYNC_ROTATION,
137
+ E_STREAMER_TEST_LOS,
138
+ E_STREAMER_TYPE,
139
+ E_STREAMER_WORLD_ID,
140
+ E_STREAMER_X,
141
+ E_STREAMER_Y,
142
+ E_STREAMER_Z
143
+ }
144
+ #define E_STREAMER_CUSTOM(%0) ((%0) | 0x40000000 & ~0x80000000)
145
+ native Streamer_GetTickRate();
146
+ native Streamer_SetTickRate(rate);
147
+ native Streamer_GetPlayerTickRate(playerid);
148
+ native Streamer_SetPlayerTickRate(playerid, rate);
149
+ native Streamer_ToggleChunkStream(toggle);
150
+ native Streamer_IsToggleChunkStream();
151
+ native Streamer_GetChunkTickRate(type, playerid = -1);
152
+ native Streamer_SetChunkTickRate(type, rate, playerid = -1);
153
+ native Streamer_GetChunkSize(type);
154
+ native Streamer_SetChunkSize(type, size);
155
+ native Streamer_GetMaxItems(type);
156
+ native Streamer_SetMaxItems(type, items);
157
+ native Streamer_GetVisibleItems(type, playerid = -1);
158
+ native Streamer_SetVisibleItems(type, items, playerid = -1);
159
+ native Streamer_GetRadiusMultiplier(type, &Float:multiplier, playerid = -1);
160
+ native Streamer_SetRadiusMultiplier(type, Float:multiplier, playerid = -1);
161
+ native Streamer_GetTypePriority(types[], maxtypes = sizeof types);
162
+ native Streamer_SetTypePriority(const types[], maxtypes = sizeof types);
163
+ native Streamer_GetCellDistance(&Float:distance);
164
+ native Streamer_SetCellDistance(Float:distance);
165
+ native Streamer_GetCellSize(&Float:size);
166
+ native Streamer_SetCellSize(Float:size);
167
+ native Streamer_ToggleItemStatic(type, STREAMER_ALL_TAGS:id, toggle);
168
+ native Streamer_IsToggleItemStatic(type, STREAMER_ALL_TAGS:id);
169
+ native Streamer_ToggleItemInvAreas(type, STREAMER_ALL_TAGS:id, toggle);
170
+ native Streamer_IsToggleItemInvAreas(type, STREAMER_ALL_TAGS:id);
171
+ native Streamer_ToggleItemCallbacks(type, STREAMER_ALL_TAGS:id, toggle);
172
+ native Streamer_IsToggleItemCallbacks(type, STREAMER_ALL_TAGS:id);
173
+ native Streamer_ToggleErrorCallback(toggle);
174
+ native Streamer_IsToggleErrorCallback();
175
+ native Streamer_AmxUnloadDestroyItems(toggle);
176
+ native Streamer_ProcessActiveItems();
177
+ native Streamer_ToggleIdleUpdate(playerid, toggle);
178
+ native Streamer_IsToggleIdleUpdate(playerid);
179
+ native Streamer_ToggleCameraUpdate(playerid, toggle);
180
+ native Streamer_IsToggleCameraUpdate(playerid);
181
+ native Streamer_ToggleItemUpdate(playerid, type, toggle);
182
+ native Streamer_IsToggleItemUpdate(playerid, type);
183
+ native Streamer_GetLastUpdateTime(&Float:time);
184
+ native Streamer_Update(playerid, type = -1);
185
+ native Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, type = -1, compensatedtime = -1, freezeplayer = 1);
186
+ native Streamer_GetFloatData(type, STREAMER_ALL_TAGS:id, data, &Float:result);
187
+ native Streamer_SetFloatData(type, STREAMER_ALL_TAGS:id, data, Float:value);
188
+ native Streamer_GetIntData(type, STREAMER_ALL_TAGS:id, data);
189
+ native Streamer_SetIntData(type, STREAMER_ALL_TAGS:id, data, value);
190
+ native Streamer_RemoveIntData(type, STREAMER_ALL_TAGS:id, data);
191
+ native Streamer_HasIntData(type, STREAMER_ALL_TAGS:id, data);
192
+ native Streamer_GetArrayData(type, STREAMER_ALL_TAGS:id, data, dest[], maxdest = sizeof dest);
193
+ native Streamer_SetArrayData(type, STREAMER_ALL_TAGS:id, data, const src[], maxsrc = sizeof src);
194
+ native Streamer_IsInArrayData(type, STREAMER_ALL_TAGS:id, data, value);
195
+ native Streamer_AppendArrayData(type, STREAMER_ALL_TAGS:id, data, value);
196
+ native Streamer_RemoveArrayData(type, STREAMER_ALL_TAGS:id, data, value);
197
+ native Streamer_HasArrayData(type, STREAMER_ALL_TAGS:id, data);
198
+ native Streamer_GetArrayDataLength(type, STREAMER_ALL_TAGS:id, data);
199
+ native Streamer_GetUpperBound(type);
200
+ native Streamer_GetDistanceToItem(Float:x, Float:y, Float:z, type, STREAMER_ALL_TAGS:id, &Float:distance, dimensions = 3);
201
+ native Streamer_ToggleItem(playerid, type, STREAMER_ALL_TAGS:id, toggle);
202
+ native Streamer_IsToggleItem(playerid, type, STREAMER_ALL_TAGS:id);
203
+ native Streamer_ToggleAllItems(playerid, type, toggle, const exceptions[] = { -1 }, maxexceptions = sizeof exceptions);
204
+ native Streamer_GetItemInternalID(playerid, type, STREAMER_ALL_TAGS:streamerid);
205
+ native Streamer_GetItemStreamerID(playerid, type, internalid);
206
+ native Streamer_IsItemVisible(playerid, type, STREAMER_ALL_TAGS:id);
207
+ native Streamer_DestroyAllVisibleItems(playerid, type, serverwide = 1);
208
+ native Streamer_CountVisibleItems(playerid, type, serverwide = 1);
209
+ native Streamer_DestroyAllItems(type, serverwide = 1);
210
+ native Streamer_CountItems(type, serverwide = 1);
211
+ native Streamer_GetNearbyItems(Float:x, Float:y, Float:z, type, STREAMER_ALL_TAGS:items[], maxitems = sizeof items, Float:range = 300.0, worldid = -1);
212
+ native Streamer_GetAllVisibleItems(playerid, type, STREAMER_ALL_TAGS:items[], maxitems = sizeof items);
213
+ native Streamer_GetItemPos(type, STREAMER_ALL_TAGS:id, &Float:x, &Float:y, &Float:z);
214
+ native Streamer_SetItemPos(type, STREAMER_ALL_TAGS:id, Float:x, Float:y, Float:z);
215
+ native Streamer_GetItemOffset(type, STREAMER_ALL_TAGS:id, &Float:x, &Float:y, &Float:z);
216
+ native Streamer_SetItemOffset(type, STREAMER_ALL_TAGS:id, Float:x, Float:y, Float:z);
217
+ native STREAMER_TAG_OBJECT:CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0);
218
+ native DestroyDynamicObject(STREAMER_TAG_OBJECT:objectid);
219
+ native IsValidDynamicObject(STREAMER_TAG_OBJECT:objectid);
220
+ native GetDynamicObjectPos(STREAMER_TAG_OBJECT:objectid, &Float:x, &Float:y, &Float:z);
221
+ native SetDynamicObjectPos(STREAMER_TAG_OBJECT:objectid, Float:x, Float:y, Float:z);
222
+ native GetDynamicObjectRot(STREAMER_TAG_OBJECT:objectid, &Float:rx, &Float:ry, &Float:rz);
223
+ native SetDynamicObjectRot(STREAMER_TAG_OBJECT:objectid, Float:rx, Float:ry, Float:rz);
224
+ native GetDynamicObjectNoCameraCol(STREAMER_TAG_OBJECT:objectid);
225
+ native SetDynamicObjectNoCameraCol(STREAMER_TAG_OBJECT:objectid);
226
+ native MoveDynamicObject(STREAMER_TAG_OBJECT:objectid, Float:x, Float:y, Float:z, Float:speed, Float:rx = -1000.0, Float:ry = -1000.0, Float:rz = -1000.0);
227
+ native StopDynamicObject(STREAMER_TAG_OBJECT:objectid);
228
+ native IsDynamicObjectMoving(STREAMER_TAG_OBJECT:objectid);
229
+ native AttachCameraToDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid);
230
+ native AttachDynamicObjectToObject(STREAMER_TAG_OBJECT:objectid, attachtoid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz, syncrotation = 1);
231
+ native AttachDynamicObjectToPlayer(STREAMER_TAG_OBJECT:objectid, playerid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz);
232
+ native AttachDynamicObjectToVehicle(STREAMER_TAG_OBJECT:objectid, vehicleid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz);
233
+ native EditDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid);
234
+ native IsDynamicObjectMaterialUsed(STREAMER_TAG_OBJECT:objectid, materialindex);
235
+ native RemoveDynamicObjectMaterial(STREAMER_TAG_OBJECT:objectid, materialindex);
236
+ native GetDynamicObjectMaterial(STREAMER_TAG_OBJECT:objectid, materialindex, &modelid, txdname[], texturename[], &materialcolor, maxtxdname = sizeof txdname, maxtexturename = sizeof texturename);
237
+ native SetDynamicObjectMaterial(STREAMER_TAG_OBJECT:objectid, materialindex, modelid, const txdname[], const texturename[], materialcolor = 0);
238
+ native IsDynamicObjectMaterialTextUsed(STREAMER_TAG_OBJECT:objectid, materialindex);
239
+ native RemoveDynamicObjectMaterialText(STREAMER_TAG_OBJECT:objectid, materialindex);
240
+ native GetDynamicObjectMaterialText(STREAMER_TAG_OBJECT:objectid, materialindex, text[], &materialsize, fontface[], &fontsize, &bold, &fontcolor, &backcolor, &textalignment, maxtext = sizeof text, maxfontface = sizeof fontface);
241
+ native SetDynamicObjectMaterialText(STREAMER_TAG_OBJECT:objectid, materialindex, const text[], materialsize = OBJECT_MATERIAL_SIZE_256x128, const fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
242
+ native STREAMER_TAG_OBJECT:GetPlayerCameraTargetDynObject(playerid);
243
+ native STREAMER_TAG_PICKUP:CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_PICKUP_SD, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0);
244
+ native DestroyDynamicPickup(STREAMER_TAG_PICKUP:pickupid);
245
+ native IsValidDynamicPickup(STREAMER_TAG_PICKUP:pickupid);
246
+ native STREAMER_TAG_CP:CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_CP_SD, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0);
247
+ native DestroyDynamicCP(STREAMER_TAG_CP:checkpointid);
248
+ native IsValidDynamicCP(STREAMER_TAG_CP:checkpointid);
249
+ native IsPlayerInDynamicCP(playerid, STREAMER_TAG_CP:checkpointid);
250
+ native STREAMER_TAG_CP:GetPlayerVisibleDynamicCP(playerid);
251
+ native STREAMER_TAG_RACE_CP:CreateDynamicRaceCP(type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_RACE_CP_SD, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0);
252
+ native DestroyDynamicRaceCP(STREAMER_TAG_RACE_CP:checkpointid);
253
+ native IsValidDynamicRaceCP(STREAMER_TAG_RACE_CP:checkpointid);
254
+ native IsPlayerInDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP:checkpointid);
255
+ native STREAMER_TAG_RACE_CP:GetPlayerVisibleDynamicRaceCP(playerid);
256
+ native STREAMER_TAG_MAP_ICON:CreateDynamicMapIcon(Float:x, Float:y, Float:z, type, color, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_MAP_ICON_SD, style = MAPICON_LOCAL, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0);
257
+ native DestroyDynamicMapIcon(STREAMER_TAG_MAP_ICON:iconid);
258
+ native IsValidDynamicMapIcon(STREAMER_TAG_MAP_ICON:iconid);
259
+ native STREAMER_TAG_3D_TEXT_LABEL:CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_3D_TEXT_LABEL_SD, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0);
260
+ native DestroyDynamic3DTextLabel(STREAMER_TAG_3D_TEXT_LABEL:id);
261
+ native IsValidDynamic3DTextLabel(STREAMER_TAG_3D_TEXT_LABEL:id);
262
+ native GetDynamic3DTextLabelText(STREAMER_TAG_3D_TEXT_LABEL:id, text[], maxtext = sizeof text);
263
+ native UpdateDynamic3DTextLabelText(STREAMER_TAG_3D_TEXT_LABEL:id, color, const text[]);
264
+ native STREAMER_TAG_AREA:CreateDynamicCircle(Float:x, Float:y, Float:size, worldid = -1, interiorid = -1, playerid = -1, priority = 0);
265
+ native STREAMER_TAG_AREA:CreateDynamicCylinder(Float:x, Float:y, Float:minz, Float:maxz, Float:size, worldid = -1, interiorid = -1, playerid = -1, priority = 0);
266
+ native STREAMER_TAG_AREA:CreateDynamicSphere(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, priority = 0);
267
+ native STREAMER_TAG_AREA:CreateDynamicRectangle(Float:minx, Float:miny, Float:maxx, Float:maxy, worldid = -1, interiorid = -1, playerid = -1, priority = 0);
268
+ native STREAMER_TAG_AREA:CreateDynamicCuboid(Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz, worldid = -1, interiorid = -1, playerid = -1, priority = 0);
269
+ native STREAMER_TAG_AREA:CreateDynamicCube(Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz, worldid = -1, interiorid = -1, playerid = -1, priority = 0);
270
+ native STREAMER_TAG_AREA:CreateDynamicPolygon(const Float:points[], Float:minz = -FLOAT_INFINITY, Float:maxz = FLOAT_INFINITY, maxpoints = sizeof points, worldid = -1, interiorid = -1, playerid = -1, priority = 0);
271
+ native DestroyDynamicArea(STREAMER_TAG_AREA:areaid);
272
+ native IsValidDynamicArea(STREAMER_TAG_AREA:areaid);
273
+ native GetDynamicAreaType(STREAMER_TAG_AREA:areaid);
274
+ native GetDynamicPolygonPoints(STREAMER_TAG_AREA:areaid, Float:points[], maxpoints = sizeof points);
275
+ native GetDynamicPolygonNumberPoints(STREAMER_TAG_AREA:areaid);
276
+ native IsPlayerInDynamicArea(playerid, STREAMER_TAG_AREA:areaid, recheck = 0);
277
+ native IsPlayerInAnyDynamicArea(playerid, recheck = 0);
278
+ native IsAnyPlayerInDynamicArea(STREAMER_TAG_AREA:areaid, recheck = 0);
279
+ native IsAnyPlayerInAnyDynamicArea(recheck = 0);
280
+ native GetPlayerDynamicAreas(playerid, STREAMER_TAG_AREA:areas[], maxareas = sizeof areas);
281
+ native GetPlayerNumberDynamicAreas(playerid);
282
+ native IsPointInDynamicArea(STREAMER_TAG_AREA:areaid, Float:x, Float:y, Float:z);
283
+ native IsPointInAnyDynamicArea(Float:x, Float:y, Float:z);
284
+ native IsLineInDynamicArea(STREAMER_TAG_AREA:areaid, Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2);
285
+ native IsLineInAnyDynamicArea(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2);
286
+ native GetDynamicAreasForPoint(Float:x, Float:y, Float:z, STREAMER_TAG_AREA:areas[], maxareas = sizeof areas);
287
+ native GetNumberDynamicAreasForPoint(Float:x, Float:y, Float:z);
288
+ native GetDynamicAreasForLine(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, STREAMER_TAG_AREA:areas[], maxareas = sizeof areas);
289
+ native GetNumberDynamicAreasForLine(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2);
290
+ native AttachDynamicAreaToObject(STREAMER_TAG_AREA:areaid, STREAMER_TAG_OBJECT_ALT:objectid, type = STREAMER_OBJECT_TYPE_DYNAMIC, playerid = INVALID_PLAYER_ID, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
291
+ native AttachDynamicAreaToPlayer(STREAMER_TAG_AREA:areaid, playerid, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
292
+ native AttachDynamicAreaToVehicle(STREAMER_TAG_AREA:areaid, vehicleid, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
293
+ native ToggleDynAreaSpectateMode(STREAMER_TAG_AREA:areaid, toggle);
294
+ native IsToggleDynAreaSpectateMode(STREAMER_TAG_AREA:areaid);
295
+ native STREAMER_TAG_ACTOR:CreateDynamicActor(modelid, Float:x, Float:y, Float:z, Float:r, invulnerable = true, Float:health = 100.0, worldid = 0, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_ACTOR_SD, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0);
296
+ native DestroyDynamicActor(STREAMER_TAG_ACTOR:actorid);
297
+ native IsValidDynamicActor(STREAMER_TAG_ACTOR:actorid);
298
+ native IsDynamicActorStreamedIn(STREAMER_TAG_ACTOR:actorid, forplayerid);
299
+ native GetDynamicActorVirtualWorld(STREAMER_TAG_ACTOR:actorid);
300
+ native SetDynamicActorVirtualWorld(STREAMER_TAG_ACTOR:actorid, vworld);
301
+ native GetDynamicActorAnimation(STREAMER_TAG_ACTOR:actorid, animlib[], animname[], &Float:fdelta, &loop, &lockx, &locky, &freeze, &time, maxanimlib = sizeof animlib, maxanimname = sizeof animname);
302
+ native ApplyDynamicActorAnimation(STREAMER_TAG_ACTOR:actorid, const animlib[], const animname[], Float:fdelta, loop, lockx, locky, freeze, time);
303
+ native ClearDynamicActorAnimations(STREAMER_TAG_ACTOR:actorid);
304
+ native GetDynamicActorFacingAngle(STREAMER_TAG_ACTOR:actorid, &Float:ang);
305
+ native SetDynamicActorFacingAngle(STREAMER_TAG_ACTOR:actorid, Float:ang);
306
+ native GetDynamicActorPos(STREAMER_TAG_ACTOR:actorid, &Float:x, &Float:y, &Float:z);
307
+ native SetDynamicActorPos(STREAMER_TAG_ACTOR:actorid, Float:x, Float:y, Float:z);
308
+ native GetDynamicActorHealth(STREAMER_TAG_ACTOR:actorid, &Float:health);
309
+ native SetDynamicActorHealth(STREAMER_TAG_ACTOR:actorid, Float:health);
310
+ native SetDynamicActorInvulnerable(STREAMER_TAG_ACTOR:actorid, invulnerable = true);
311
+ native IsDynamicActorInvulnerable(STREAMER_TAG_ACTOR:actorid);
312
+ native STREAMER_TAG_ACTOR:GetPlayerTargetDynamicActor(playerid);
313
+ native STREAMER_TAG_ACTOR:GetPlayerCameraTargetDynActor(playerid);
314
+ native STREAMER_TAG_OBJECT:CreateDynamicObjectEx(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas);
315
+ native STREAMER_TAG_PICKUP:CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = STREAMER_PICKUP_SD, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas);
316
+ native STREAMER_TAG_CP:CreateDynamicCPEx(Float:x, Float:y, Float:z, Float:size, Float:streamdistance = STREAMER_CP_SD, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas);
317
+ native STREAMER_TAG_RACE_CP:CreateDynamicRaceCPEx(type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size, Float:streamdistance = STREAMER_RACE_CP_SD, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas);
318
+ native STREAMER_TAG_MAP_ICON:CreateDynamicMapIconEx(Float:x, Float:y, Float:z, type, color, style = MAPICON_LOCAL, Float:streamdistance = STREAMER_MAP_ICON_SD, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas);
319
+ native STREAMER_TAG_3D_TEXT_LABEL:CreateDynamic3DTextLabelEx(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, Float:streamdistance = STREAMER_3D_TEXT_LABEL_SD, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0,
320
+ maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas);
321
+ native STREAMER_TAG_AREA:CreateDynamicCircleEx(Float:x, Float:y, Float:size, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
322
+ native STREAMER_TAG_AREA:CreateDynamicCylinderEx(Float:x, Float:y, Float:minz, Float:maxz, Float:size, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
323
+ native STREAMER_TAG_AREA:CreateDynamicSphereEx(Float:x, Float:y, Float:z, Float:size, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
324
+ native STREAMER_TAG_AREA:CreateDynamicRectangleEx(Float:minx, Float:miny, Float:maxx, Float:maxy, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
325
+ native STREAMER_TAG_AREA:CreateDynamicCuboidEx(Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
326
+ native STREAMER_TAG_AREA:CreateDynamicCubeEx(Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
327
+ native STREAMER_TAG_AREA:CreateDynamicPolygonEx(const Float:points[], Float:minz = -FLOAT_INFINITY, Float:maxz = FLOAT_INFINITY, maxpoints = sizeof points, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
328
+ native STREAMER_TAG_ACTOR:CreateDynamicActorEx(modelid, Float:x, Float:y, Float:z, Float:r, invulnerable = 1, Float:health = 100.0, Float:streamdistance = STREAMER_ACTOR_SD, const worlds[] = { 0 }, const interiors[] = { -1 }, const players[] = { -1 }, const STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas);
329
+ native Streamer_CallbackHook(callback, {Float,_}:...);
330
+ native Streamer_TickRate(rate);
331
+ native Streamer_MaxItems(type, items);
332
+ native Streamer_VisibleItems(type, items, playerid = -1);
333
+ native Streamer_CellDistance(Float:distance);
334
+ native Streamer_CellSize(Float:size);
335
+ native DestroyAllDynamicObjects();
336
+ native CountDynamicObjects();
337
+ native DestroyAllDynamicPickups();
338
+ native CountDynamicPickups();
339
+ native DestroyAllDynamicCPs();
340
+ native CountDynamicCPs();
341
+ native DestroyAllDynamicRaceCPs();
342
+ native CountDynamicRaceCPs();
343
+ native DestroyAllDynamicMapIcons();
344
+ native CountDynamicMapIcons();
345
+ native DestroyAllDynamic3DTextLabels();
346
+ native CountDynamic3DTextLabels();
347
+ native DestroyAllDynamicAreas();
348
+ native CountDynamicAreas();
349
+ native TogglePlayerDynamicCP(playerid, STREAMER_TAG_CP:checkpointid, toggle);
350
+ native TogglePlayerAllDynamicCPs(playerid, toggle, const exceptions[] = { -1 }, maxexceptions = sizeof exceptions);
351
+ native TogglePlayerDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP:checkpointid, toggle);
352
+ native TogglePlayerAllDynamicRaceCPs(playerid, toggle, const exceptions[] = { -1 }, maxexceptions = sizeof exceptions);
353
+ native TogglePlayerDynamicArea(playerid, STREAMER_TAG_AREA:areaid, toggle);
354
+ native TogglePlayerAllDynamicAreas(playerid, toggle, const exceptions[] = { -1 }, maxexceptions = sizeof exceptions);
355
+ forward OnDynamicObjectMoved(STREAMER_TAG_OBJECT:objectid);
356
+ forward OnPlayerEditDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
357
+ forward OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z);
358
+ forward OnPlayerShootDynamicObject(playerid, weaponid, STREAMER_TAG_OBJECT:objectid, Float:x, Float:y, Float:z);
359
+ forward OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP:pickupid);
360
+ forward OnPlayerEnterDynamicCP(playerid, STREAMER_TAG_CP:checkpointid);
361
+ forward OnPlayerLeaveDynamicCP(playerid, STREAMER_TAG_CP:checkpointid);
362
+ forward OnPlayerEnterDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP:checkpointid);
363
+ forward OnPlayerLeaveDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP:checkpointid);
364
+ forward OnPlayerEnterDynamicArea(playerid, STREAMER_TAG_AREA:areaid);
365
+ forward OnPlayerLeaveDynamicArea(playerid, STREAMER_TAG_AREA:areaid);
366
+ forward OnPlayerGiveDamageDynamicActor(playerid, STREAMER_TAG_ACTOR:actorid, Float:amount, weaponid, bodypart);
367
+ forward OnDynamicActorStreamIn(STREAMER_TAG_ACTOR:actorid, forplayerid);
368
+ forward OnDynamicActorStreamOut(STREAMER_TAG_ACTOR:actorid, forplayerid);
369
+ forward Streamer_OnItemStreamIn(type, STREAMER_ALL_TAGS:id, forplayerid);
370
+ forward Streamer_OnItemStreamOut(type, STREAMER_ALL_TAGS:id, forplayerid);
371
+ forward Streamer_OnPluginError(const error[]);
strlib.inc ADDED
@@ -0,0 +1,1088 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #if defined STRLIB_INC
2
+ #endinput
3
+ #endif
4
+ #define STRLIB_INC
5
+ #include <a_samp>
6
+ #if !defined STRLIB_BUFFER_SIZE
7
+ #define STRLIB_BUFFER_SIZE 2048
8
+ #endif
9
+ #if !defined STRLIB_RETURN_SIZE
10
+ #define STRLIB_RETURN_SIZE 128
11
+ #endif
12
+ #if !defined STRLIB_USE_FORMATEX
13
+ #if defined __fmt_funcinc
14
+ #if !defined FormatSpecifier
15
+ #error Please include formatex before strlib.
16
+ #endif
17
+ #define STRLIB_USE_FORMATEX true
18
+ #else
19
+ #define STRLIB_USE_FORMATEX false
20
+ #endif
21
+ #endif
22
+ enum trim_edges {
23
+ trim_left = 1,
24
+ trim_right = 2,
25
+ trim_both = trim_left | trim_right
26
+ };
27
+ enum string_edges {
28
+ edge_left = 1,
29
+ edge_right = 2,
30
+ edge_both = edge_left | edge_right
31
+ };
32
+ forward sprintf(const fmat[], {Float, _}:...);
33
+ forward strgetfirstc(const string[]);
34
+ forward strgetc(const string[], index);
35
+ forward strsize(const string[]);
36
+ forward bool:isempty(const string[]);
37
+ forward bool:isequal(const str1[], const str2[], bool:ignorecase = false);
38
+ forward strdistance(const str1[], const str2[], bool:ignorecase = false);
39
+ forward strexplode(output[][], const input[], const delimiter[] = !",", limit = cellmax, bool:trim = true, bool:ignorecase = false, size1 = sizeof(output), size2 = sizeof(output[]));
40
+ forward strimplode(const glue[], output[], maxlength = sizeof(output), ...);
41
+ forward strreplace(string[], const search[], const replacement[], bool:ignorecase = false, pos = 0, limit = -1, maxlength = sizeof(string));
42
+ forward strtrim(string[], const chars[] = !"", string_edges:edge = edge_both);
43
+ forward strpad(string[], length, const substr[] = !" ", string_edges:edge = edge_both, bool:trim_first = true, const trim_chars[] = !"", maxlength = sizeof(string), const input[] = !"");
44
+ forward strwrap(const left[], string[], const right[], maxlength = sizeof(string));
45
+ forward strcount(const string[], const sub[], bool:ignorecase = false, bool:count_overlapped = false);
46
+ forward bool:strfromliteral(output[], const input[], &pos = 0, maxlength = sizeof(output));
47
+ forward strtoliteral(output[], const input[], maxlength = sizeof(output), bool:paranoid = true);
48
+ forward strfrombin(output[], const input[], inputlength = sizeof(input), maxlength = sizeof(output));
49
+ forward strtobin(output[], const input[], maxlength = sizeof(output));
50
+ forward strcatmid(dest[], const source[], start = 0, end = -1, maxlength = sizeof(dest));
51
+ forward utf8encode(dest[], const source[], maxlength = sizeof(dest));
52
+ forward utf8decode(dest[], const source[], maxlength = sizeof(dest));
53
+ forward strurldecode(output[], const input[], maxlength = sizeof(output));
54
+ forward strurlencode(output[], const input[], maxlength = sizeof(output), bool:pack = false);
55
+ forward ret_strcatmid(const string[], const source[], start = 0, end = -1);
56
+ forward ret_strfrombin(const input[], inputlength = sizeof(input));
57
+ forward ret_strimplode(const glue[], ...);
58
+ forward ret_strreplace(const string[], const search[], const replacement[], bool:ignorecase = false, pos = 0, limit = -1);
59
+ forward ret_strfromliteral(const input[], &pos = 0);
60
+ forward ret_strtoliteral(const input[], bool:paranoid = true);
61
+ forward ret_strtrim(const string[], const chars[] = !"", string_edges:edge = edge_both);
62
+ forward ret_strpad(const string[], length, const substr[] = !" ", string_edges:edge = edge_both, bool:trim_first = true, const trim_chars[] = !"");
63
+ forward ret_strwrap(const left[], const string[], const right[]);
64
+ forward ret_strurldecode(const input[]);
65
+ forward ret_strurlencode(const input[], bool:pack = false);
66
+ forward ret_utf8encode(const input[]);
67
+ forward ret_utf8decode(const input[]);
68
+ forward ret_strpack(const source[]);
69
+ forward ret_strunpack(const source[]);
70
+ forward ret_strcat(const string1[], const string2[]);
71
+ forward ret_strmid(const source[], start, end);
72
+ forward ret_strins(const string[], const substr[], pos, maxlength = sizeof(string));
73
+ forward ret_strdel(const string[], start, end);
74
+ forward ret_valstr(value, bool:pack = false);
75
+ forward ret_GetPlayerName(playerid, bool:pack = false);
76
+ stock
77
+ g_StrlibBuffer[2048]
78
+ ;
79
+ forward _strlib_funcinc();
80
+ public _strlib_funcinc() {
81
+ new temp[1];
82
+ format(!temp, 0, !temp);
83
+ strcat(temp, temp);
84
+ strpack(temp, temp);
85
+ strunpack(temp, temp);
86
+ }
87
+ static stock RedirectArgument(arg, ...) {
88
+ #emit LOAD.S.pri 0
89
+ #emit ADD.C 12
90
+ #emit LOAD.S.alt arg
91
+ #emit SHL.C.alt 2
92
+ #emit ADD
93
+ #emit MOVE.alt
94
+ #emit LOAD.S.pri 16
95
+ #emit STOR.I
96
+ }
97
+ static stock CopyArgumentToHeap(arg, bool:pack = false, const argptr[] = "") {
98
+ new arg_address, address;
99
+ #emit LOAD.S.pri 0
100
+ #emit ADD.C 12
101
+ #emit LOAD.S.alt arg
102
+ #emit SHL.C.alt 2
103
+ #emit ADD
104
+ #emit LOAD.I
105
+ #emit STOR.S.pri arg_address
106
+ #emit STOR.S.pri argptr
107
+ if (pack) {
108
+ new bytes = ((strlen(argptr) + 1 + 3) / 4) * 4;
109
+ #emit LCTRL 2
110
+ #emit STOR.S.pri address
111
+ #emit LOAD.S.alt bytes
112
+ #emit ADD
113
+ #emit SCTRL 2
114
+ #emit LOAD.S.pri bytes
115
+ #emit SHR.C.pri 2
116
+ #emit PUSH.pri
117
+ #emit PUSH.S arg_address
118
+ #emit PUSH.S address
119
+ #emit PUSH.C 12
120
+ #emit SYSREQ.C strpack
121
+ #emit STACK 16
122
+ } else {
123
+ new bytes = (strlen(argptr) + 1) * 4;
124
+ #emit LCTRL 2
125
+ #emit STOR.S.pri address
126
+ #emit LOAD.S.alt bytes
127
+ #emit ADD
128
+ #emit SCTRL 2
129
+ #emit LOAD.S.pri bytes
130
+ #emit SHR.C.pri 2
131
+ #emit PUSH.pri
132
+ #emit PUSH.S arg_address
133
+ #emit PUSH.S address
134
+ #emit PUSH.C 12
135
+ #emit SYSREQ.C strunpack
136
+ #emit STACK 16
137
+ }
138
+ #emit LOAD.S.pri 0
139
+ #emit ADD.C 12
140
+ #emit LOAD.S.alt arg
141
+ #emit SHL.C.alt 2
142
+ #emit ADD
143
+ #emit MOVE.alt
144
+ #emit LOAD.S.pri address
145
+ #emit STOR.I
146
+ return address;
147
+ }
148
+ static stock RestoreHeapToAddress(address) {
149
+ #emit LOAD.S.pri address
150
+ #emit SCTRL 2
151
+ }
152
+ static stock IsOverlapping(const str1[], size1 = sizeof(str1), const str2[], size2 = sizeof(str2)) {
153
+ new addr1, addr2;
154
+ if (size1 == -1) {
155
+ size1 = strsize(str1);
156
+ } else {
157
+ size1 *= 4;
158
+ }
159
+ if (size2 == -1) {
160
+ size2 = strsize(str2);
161
+ } else {
162
+ size2 *= 4;
163
+ }
164
+ #emit LOAD.S.pri str1
165
+ #emit STOR.S.pri addr1
166
+ #emit LOAD.S.pri str2
167
+ #emit STOR.S.pri addr2
168
+ return (addr1 < addr2 + size2) && (addr2 < addr1 + size1);
169
+ }
170
+ #if !defined ispacked
171
+ #define ispacked(%1) \
172
+ ((%1)[0] > 255)
173
+ #endif
174
+ stock strgetfirstc(const string[]) {
175
+ return ispacked(string) ? string{0} : string[0];
176
+ }
177
+ stock strgetc(const string[], index) {
178
+ if (index < 0)
179
+ return '\0';
180
+ new len = strlen(string);
181
+ if (index >= len)
182
+ return '\0';
183
+ return ispacked(string) ? string{index} : string[index];
184
+ }
185
+ stock strsize(const string[]) {
186
+ new len = strlen(string);
187
+ if (ispacked(string))
188
+ return len + 1;
189
+ return (len + 1) * 4;
190
+ }
191
+ stock bool:isempty(const string[]) {
192
+ if (ispacked(string))
193
+ return string{0} == '\0';
194
+ else
195
+ return string[0] == '\0';
196
+ }
197
+ stock bool:isequal(const str1[], const str2[], bool:ignorecase = false) {
198
+ new
199
+ c1 = (str1[0] > 255) ? str1{0} : str1[0],
200
+ c2 = (str2[0] > 255) ? str2{0} : str2[0]
201
+ ;
202
+ if (!c1 != !c2)
203
+ return false;
204
+ return !strcmp(str1, str2, ignorecase);
205
+ }
206
+ stock strdistance(const str1[], const str2[], bool:ignorecase = false) {
207
+ if(isequal(str1, str2, ignorecase))
208
+ return 0;
209
+ static data[128][128];
210
+ new bool:pack1 = ispacked(str1),
211
+ bool:pack2 = ispacked(str2);
212
+ new size1 = strlen(str1),
213
+ size2 = strlen(str2);
214
+ if (size1 == 0)
215
+ return size2;
216
+ if (size2 == 0)
217
+ return size1;
218
+ for (new i; i <= size1; i++)
219
+ data[i][0] = i;
220
+ for (new j; j <= size2; j++)
221
+ data[0][j] = j;
222
+ for (new j = 1; j <= size2; j++) {
223
+ for (new i = 1; i <= size1; i++) {
224
+ new char1 = pack1 ? str1{i - 1} : str1[i - 1],
225
+ char2 = pack2 ? str2{j - 1} : str2[j - 1];
226
+ if(ignorecase) {
227
+ if (65 <= char1 <= 90)
228
+ char1 += 32;
229
+ if (65 <= char2 <= 90)
230
+ char2 += 32;
231
+ }
232
+ if (char1 == char2)
233
+ data[i][j] = data[i - 1][j - 1];
234
+ else {
235
+ new l1 = data[i - 1][j] + 1,
236
+ l2 = data[i][j - 1] + 1,
237
+ l3 = data[i - 1][j - 1] + 1;
238
+ l2 = (l1 > l2 ? l2 : l1);
239
+ data[i][j] = (l3 > l2 ? l2 : l3);
240
+ }
241
+ }
242
+ }
243
+ return data[size1][size2];
244
+ }
245
+ stock strimplode(const glue[], output[], maxlength = sizeof(output), ...) {
246
+ new args = numargs();
247
+ output[0] = '\0';
248
+ for (new arg = 3; arg < args; arg++) {
249
+ if (arg != 3)
250
+ strcat(output, glue, maxlength);
251
+ {
252
+ #emit LCTRL 5
253
+ #emit ADD.C 12
254
+ #emit LOAD.S.alt arg
255
+ #emit SHL.C.alt 2
256
+ #emit ADD
257
+ #emit LOAD.I
258
+ #emit PUSH.S maxlength
259
+ #emit PUSH.pri
260
+ #emit PUSH.S output
261
+ #emit PUSH.C 12
262
+ #emit SYSREQ.C strcat
263
+ #emit STACK 16
264
+ }
265
+ }
266
+ }
267
+ stock strexplode(output[][], const input[], const delimiter[] = !",", limit = cellmax, bool:trim = true, bool:ignorecase = false, size1 = sizeof(output), size2 = sizeof(output[])) {
268
+ if (!size1 || !size2) {
269
+ printf("(strexplode) ERROR: size1 = %d, size2 = %d. Can't be 0.", size1, size2);
270
+ return 0;
271
+ }
272
+ if (isempty(delimiter)) {
273
+ print(!"(strexplode) ERROR: delimiter is empty.");
274
+ return 0;
275
+ }
276
+ if (trim) {
277
+ new i = -1;
278
+ if (ispacked(input)) {
279
+ while (input{++i}) {
280
+ if (input{i} > ' ') {
281
+ i = -1;
282
+ break;
283
+ }
284
+ }
285
+ } else {
286
+ while (input[++i]) {
287
+ if (input[i] > ' ') {
288
+ i = -1;
289
+ break;
290
+ }
291
+ }
292
+ }
293
+ if (i != -1)
294
+ return 0;
295
+ } else if (isempty(input)) {
296
+ return 0;
297
+ }
298
+ if (limit == 0) {
299
+ return 0;
300
+ } else if (limit == cellmax) {
301
+ limit = 0;
302
+ }
303
+ new
304
+ pos = 0,
305
+ next,
306
+ bool:packed = ispacked(input),
307
+ dlen = strlen(delimiter),
308
+ count = 0,
309
+ end
310
+ ;
311
+ while (pos != -1) {
312
+ ++count;
313
+ if (limit > 0 && count >= limit) {
314
+ next = -1;
315
+ } else {
316
+ next = strfind(input, delimiter, ignorecase, pos);
317
+ }
318
+ end = (next == -1) ? cellmax : next;
319
+ if (trim) {
320
+ if (end == cellmax)
321
+ end = strlen(input);
322
+ if (packed) {
323
+ while (0 < input{pos} <= ' ') pos++;
324
+ while (end > 0 && input{end - 1} <= ' ') end--;
325
+ } else {
326
+ while (0 < input[pos] <= ' ') pos++;
327
+ while (end > 0 && input[end - 1] <= ' ') end--;
328
+ }
329
+ }
330
+ strmid(output[count - 1], input, pos, end, size2);
331
+ if (count >= size1 || next == -1 || (limit < 0 && count >= -limit))
332
+ break;
333
+ pos = next + dlen;
334
+ }
335
+ return count;
336
+ }
337
+ stock strreplace(string[], const search[], const replacement[], bool:ignorecase = false, pos = 0, limit = -1, maxlength = sizeof(string)) {
338
+ if (limit == 0)
339
+ return 0;
340
+ new
341
+ sublen = strlen(search),
342
+ replen = strlen(replacement),
343
+ bool:packed = ispacked(string),
344
+ maxlen = maxlength,
345
+ len = strlen(string),
346
+ count = 0
347
+ ;
348
+ if (packed)
349
+ maxlen *= 4;
350
+ if (!sublen)
351
+ return 0;
352
+ while (-1 != (pos = strfind(string, search, ignorecase, pos))) {
353
+ strdel(string, pos, pos + sublen);
354
+ len -= sublen;
355
+ if (replen && len + replen < maxlen) {
356
+ strins(string, replacement, pos, maxlength);
357
+ pos += replen;
358
+ len += replen;
359
+ }
360
+ if (limit != -1 && ++count >= limit)
361
+ break;
362
+ }
363
+ return count;
364
+ }
365
+ stock strtrim(string[], const chars[] = !"", string_edges:edge = edge_both) {
366
+ new bool:packed = ispacked(string);
367
+ if (!strgetfirstc(chars)) {
368
+ if (edge & edge_left) {
369
+ new i = 0;
370
+ if (packed)
371
+ while (0 < string{i} <= ' ') i++;
372
+ else
373
+ while (0 < string[i] <= ' ') i++;
374
+ if (i) {
375
+ strdel(string, 0, i);
376
+ }
377
+ }
378
+ if (edge & edge_right) {
379
+ new i = strlen(string);
380
+ if (i) {
381
+ if (packed) {
382
+ while (--i && 0 < string{i} <= ' ') {}
383
+ string{i + 1} = '\0';
384
+ } else {
385
+ while (--i && 0 < string[i] <= ' ') {}
386
+ string[i + 1] = '\0';
387
+ }
388
+ }
389
+ }
390
+ } else {
391
+ if (edge & edge_left) {
392
+ new i = 0, sub[2];
393
+ if (packed) {
394
+ while ((sub[0] = string{i})) {
395
+ if (strfind(chars, sub) == -1)
396
+ break;
397
+ i++;
398
+ }
399
+ if (i) {
400
+ strdel(string, 0, i);
401
+ }
402
+ } else {
403
+ while ((sub[0] = string[i])) {
404
+ if (strfind(chars, sub) == -1)
405
+ break;
406
+ i++;
407
+ }
408
+ if (i) strdel(string, 0, i);
409
+ }
410
+ }
411
+ if (edge & edge_right) {
412
+ new i = strlen(string), sub[2];
413
+ if (i >= 0) {
414
+ if (packed) {
415
+ while (i--) {
416
+ sub[0] = string{i};
417
+ if (strfind(chars, sub) == -1)
418
+ break;
419
+ }
420
+ string{i + 1} = '\0';
421
+ } else {
422
+ while (i--) {
423
+ sub[0] = string[i];
424
+ if (strfind(chars, sub) == -1)
425
+ break;
426
+ }
427
+ string[i + 1] = '\0';
428
+ }
429
+ }
430
+ }
431
+ }
432
+ }
433
+ stock strpad(string[], length, const substr[] = !" ", string_edges:edge = edge_both, bool:trim_first = true, const trim_chars[] = !"", maxlength = sizeof(string), const input[] = !"") {
434
+ if (trim_first) {
435
+ strtrim(string, trim_chars, edge);
436
+ }
437
+ new
438
+ heap,
439
+ length_left = 0,
440
+ length_right = 0,
441
+ len = strlen(string),
442
+ sublen = strlen(substr),
443
+ bool:packed,
444
+ bool:subpacked = ispacked(substr)
445
+ ;
446
+ if (len > length)
447
+ return;
448
+ else
449
+ length -= len;
450
+ #emit LOAD.S.pri string
451
+ #emit STOR.S.pri input
452
+ heap = CopyArgumentToHeap(7);
453
+ string[0] = '\0';
454
+ len = 0;
455
+ switch (edge) {
456
+ case edge_left:
457
+ length_left = length;
458
+ case edge_right:
459
+ length_right = length;
460
+ default:
461
+ length_left = length / 2, length_right = length - length_left;
462
+ }
463
+ if (length_left) {
464
+ while (len < length_left) {
465
+ if (subpacked)
466
+ strcat(string, substr, length_left * 4);
467
+ else
468
+ strcat(string, substr, length_left + 1);
469
+ len += sublen;
470
+ }
471
+ if (subpacked)
472
+ string{length_left} = 0;
473
+ }
474
+ strcat(string, input, maxlength);
475
+ if (length_right) {
476
+ len = strlen(string);
477
+ length_right += len;
478
+ packed = ispacked(string);
479
+ while (len < length_right) {
480
+ if (packed)
481
+ strcat(string, substr, length_right / 4 + 1);
482
+ else
483
+ strcat(string, substr, length_right + 1);
484
+ len += sublen;
485
+ }
486
+ if (packed)
487
+ string{length_right + 1} = 0;
488
+ }
489
+ RestoreHeapToAddress(heap);
490
+ }
491
+ stock strwrap(const left[], string[], const right[], maxlength = sizeof(string)) {
492
+ strins(string, left, 0, maxlength);
493
+ strcat(string, right, maxlength);
494
+ }
495
+ stock strcount(const string[], const sub[], bool:ignorecase = false, bool:count_overlapped = false) {
496
+ new
497
+ increment = count_overlapped ? 1 : strlen(sub),
498
+ pos = -increment,
499
+ count = 0
500
+ ;
501
+ while (-1 != (pos = strfind(string, sub, ignorecase, pos + increment)))
502
+ count++;
503
+ return count;
504
+ }
505
+ stock bool:strfromliteral(output[], const input[], &pos = 0, maxlength = sizeof(output)) {
506
+ new
507
+ length = strlen(input),
508
+ c,
509
+ outlen = 0,
510
+ heap = 0
511
+ ;
512
+ if (!length)
513
+ return true;
514
+ if (IsOverlapping(output, maxlength, input, -1))
515
+ heap = CopyArgumentToHeap(1);
516
+ output[0] = '\0';
517
+ if (input[0] == '"')
518
+ pos++;
519
+ for (;; pos++) {
520
+ if (outlen >= maxlength - 1 || pos >= length)
521
+ break;
522
+ c = input[pos];
523
+ switch (c) {
524
+ case '"': break;
525
+ case '\\': {}
526
+ default: {
527
+ output[outlen++] = c;
528
+ continue;
529
+ }
530
+ }
531
+ if (pos == length - 1)
532
+ goto return_false;
533
+ c = input[++pos];
534
+ switch (c) {
535
+ case '"',
536
+ '\'',
537
+ '\\',
538
+ '%': output[outlen++] = c;
539
+ case 'a': output[outlen++] = '\a';
540
+ case 'b': output[outlen++] = '\b';
541
+ case 'e': output[outlen++] = '\e';
542
+ case 'f': output[outlen++] = '\f';
543
+ case 'r': output[outlen++] = '\r';
544
+ case 'n': output[outlen++] = '\n';
545
+ case 't': output[outlen++] = '\t';
546
+ case 'v': output[outlen++] = '\v';
547
+ case 'x': {
548
+ new val = 0;
549
+ if (c == length - 1)
550
+ goto return_false;
551
+ while ((c = input[pos + 1])) {
552
+ if ('a' <= c <= 'f' || 'A' <= c <= 'F') {
553
+ val = (val << 4) + (tolower(c) - 'a' + 10);
554
+ } else if ('0' <= c <= '9') {
555
+ val = (val << 4) + (c - '0');
556
+ } else {
557
+ break;
558
+ }
559
+ pos++;
560
+ }
561
+ if (c == ';')
562
+ pos++;
563
+ output[outlen++] = val;
564
+ }
565
+ case '0' .. '9': {
566
+ new val = 0;
567
+ while ((c = input[pos])) {
568
+ if ('0' <= c <= '9') {
569
+ val = val * 10 + (c - '0');
570
+ } else {
571
+ break;
572
+ }
573
+ pos++;
574
+ }
575
+ if (c != ';') pos--;
576
+ output[outlen++] = val;
577
+ }
578
+ default: {
579
+ goto return_false;
580
+ }
581
+ }
582
+ }
583
+ output[outlen] = '\0';
584
+ pos++;
585
+ new bool:ret = true;
586
+ #pragma unused ret
587
+ goto return_true;
588
+ return_false:
589
+ ret = false;
590
+ return_true:
591
+ if (heap)
592
+ RestoreHeapToAddress(heap);
593
+ return ret;
594
+ }
595
+ stock strtoliteral(output[], const input[], maxlength = sizeof(output), bool:paranoid = true) {
596
+ new i, c, outlen, heap = 0;
597
+ if (IsOverlapping(output, maxlength, input, -1))
598
+ heap = CopyArgumentToHeap(1);
599
+ output[outlen++] = '"';
600
+ for (i = 0; (c = input[i]); i++) {
601
+ if (maxlength - outlen <= 3) {
602
+ outlen = min(outlen, maxlength - 2);
603
+ break;
604
+ }
605
+ switch (c) {
606
+ case ' ', '!', '#' .. '[', ']', '^' .. '~':
607
+ output[outlen++] = c;
608
+ case '"': strunpack(output[outlen], !"\\\"", 3), outlen += 2;
609
+ case '\a': strunpack(output[outlen], !"\\a" , 3), outlen += 2;
610
+ case '\b': strunpack(output[outlen], !"\\b" , 3), outlen += 2;
611
+ case '\e': strunpack(output[outlen], !"\\e" , 3), outlen += 2;
612
+ case '\f': strunpack(output[outlen], !"\\f" , 3), outlen += 2;
613
+ case '\r': strunpack(output[outlen], !"\\r" , 3), outlen += 2;
614
+ case '\n': strunpack(output[outlen], !"\\n" , 3), outlen += 2;
615
+ case '\t': strunpack(output[outlen], !"\\t" , 3), outlen += 2;
616
+ case '\v': strunpack(output[outlen], !"\\v" , 3), outlen += 2;
617
+ case '\\': strunpack(output[outlen], !"\\\\" , 3), outlen += 2;
618
+ default: {
619
+ if (!paranoid && 0x80 <= c <= 0xFF) {
620
+ output[outlen++] = c;
621
+ continue;
622
+ }
623
+ if (maxlength - outlen <= 8)
624
+ break;
625
+ format(output[outlen], 7, "\\x%03x;", c);
626
+ outlen += 6;
627
+ }
628
+ }
629
+ }
630
+ output[outlen++] = '"';
631
+ output[outlen] = '\0';
632
+ if (heap)
633
+ RestoreHeapToAddress(heap);
634
+ }
635
+ stock strfrombin(output[], const input[], inputlength = sizeof(input), maxlength = sizeof(output)) {
636
+ static const hex_chars[] = "0123456789ABCDEF";
637
+ new outlen = 0, heap = 0;
638
+ if (IsOverlapping(output, maxlength, input, -1))
639
+ heap = CopyArgumentToHeap(1);
640
+ for (new i = 0; i < inputlength; i++) {
641
+ if (maxlength - outlen <= 7) {
642
+ outlen = min(outlen, maxlength - 1);
643
+ break;
644
+ }
645
+ new input_cell = input[i];
646
+ output[outlen++] = hex_chars[(input_cell ) >>> 28];
647
+ output[outlen++] = hex_chars[(input_cell & 0x0F000000) >>> 24];
648
+ output[outlen++] = hex_chars[(input_cell & 0x00F00000) >>> 20];
649
+ output[outlen++] = hex_chars[(input_cell & 0x000F0000) >>> 16];
650
+ output[outlen++] = hex_chars[(input_cell & 0x0000F000) >>> 12];
651
+ output[outlen++] = hex_chars[(input_cell & 0x00000F00) >>> 8];
652
+ output[outlen++] = hex_chars[(input_cell & 0x000000F0) >>> 4];
653
+ output[outlen++] = hex_chars[(input_cell & 0x0000000F) ];
654
+ }
655
+ output[outlen] = '\0';
656
+ if (heap)
657
+ RestoreHeapToAddress(heap);
658
+ }
659
+ stock strtobin(output[], const input[], maxlength = sizeof(output)) {
660
+ new len = strlen(input), outlen = 0, heap = 0;
661
+ if (IsOverlapping(output, maxlength, input, -1))
662
+ heap = CopyArgumentToHeap(1);
663
+ for (new i = 0; i < len;) {
664
+ if (outlen >= maxlength || i > len - 8) {
665
+ break;
666
+ }
667
+ new c, out = 0;
668
+ #define ADD_OUT(%1) \
669
+ c = input[i++]; out |= (('a' <= c <= 'f' || 'A' <= c <= 'F') ? (tolower(c) - 'a' + 10) : (c - '0')) << %1
670
+ ADD_OUT(28);
671
+ ADD_OUT(24);
672
+ ADD_OUT(20);
673
+ ADD_OUT(16);
674
+ ADD_OUT(12);
675
+ ADD_OUT(8);
676
+ ADD_OUT(4);
677
+ ADD_OUT(0);
678
+ #undef ADD_OUT
679
+ output[outlen++] = out;
680
+ }
681
+ if (heap)
682
+ RestoreHeapToAddress(heap);
683
+ return outlen;
684
+ }
685
+ stock strurlencode(output[], const input[], maxlength = sizeof(output), bool:pack = false) {
686
+ static const hex_chars[] = "0123456789ABCDEF";
687
+ new
688
+ len = strlen(input),
689
+ bool:packed = ispacked(input),
690
+ outlen = 0,
691
+ heap = 0
692
+ ;
693
+ if (IsOverlapping(output, maxlength, input, -1))
694
+ heap = CopyArgumentToHeap(1, packed);
695
+ if (pack)
696
+ maxlength *= 4;
697
+ for (new i = 0; i < len; i++) {
698
+ if (maxlength - outlen <= 1)
699
+ break;
700
+ new c = packed ? input{i} : input[i];
701
+ switch (c) {
702
+ case 'a' .. 'z', 'A' .. 'Z', '0' .. '9', '_': {
703
+ if (pack)
704
+ output{outlen++} = c;
705
+ else
706
+ output[outlen++] = c;
707
+ }
708
+ case ' ': {
709
+ if (pack)
710
+ output{outlen++} = '+';
711
+ else
712
+ output[outlen++] = '+';
713
+ }
714
+ default: {
715
+ if (maxlength - outlen <= 3)
716
+ break;
717
+ if (pack) {
718
+ output{outlen++} = '%';
719
+ output{outlen++} = hex_chars[(c & 0xF0) >>> 4];
720
+ output{outlen++} = hex_chars[c & 0x0F];
721
+ } else {
722
+ output[outlen++] = '%';
723
+ output[outlen++] = hex_chars[(c & 0xF0) >>> 4];
724
+ output[outlen++] = hex_chars[c & 0x0F];
725
+ }
726
+ }
727
+ }
728
+ }
729
+ if (pack)
730
+ output{outlen} = '\0';
731
+ else
732
+ output[outlen] = '\0';
733
+ if (heap)
734
+ RestoreHeapToAddress(heap);
735
+ }
736
+ stock strurldecode(output[], const input[], maxlength = sizeof(output)) {
737
+ new prev_pos = 0, pos = 0, inputlen = strlen(input), len, heap = 0;
738
+ if (IsOverlapping(output, maxlength, input, -1))
739
+ heap = CopyArgumentToHeap(1);
740
+ output[0] = '\0';
741
+ while (-1 != (pos = strfind(input, "%", _, pos))) {
742
+ static str[2];
743
+ new c;
744
+ if (prev_pos != pos) {
745
+ len = strlen(output);
746
+ strcatmid(output, input, prev_pos, pos, maxlength);
747
+ strreplace(output, "+", " ", _, len, _, maxlength);
748
+ }
749
+ if (inputlen < pos + 3)
750
+ goto func_end;
751
+ str[0] = 0;
752
+ c = input[pos + 1]; str[0] |= (('a' <= c <= 'f' || 'A' <= c <= 'F') ? (tolower(c) - 'a' + 10) : (c - '0')) << 4;
753
+ c = input[pos + 2]; str[0] |= (('a' <= c <= 'f' || 'A' <= c <= 'F') ? (tolower(c) - 'a' + 10) : (c - '0'));
754
+ strcat(output, str, maxlength);
755
+ prev_pos = (pos += 3);
756
+ }
757
+ len = strlen(output);
758
+ strcatmid(output, input, prev_pos, _, maxlength);
759
+ strreplace(output, "+", " ", _, len, _, maxlength);
760
+ func_end:
761
+ if (heap)
762
+ RestoreHeapToAddress(heap);
763
+ }
764
+ stock strcatmid(dest[], const source[], start = 0, end = -1, maxlength = sizeof(dest)) {
765
+ new heap = 0;
766
+ if (IsOverlapping(dest, maxlength, source, -1))
767
+ heap = CopyArgumentToHeap(1);
768
+ if (start == 0 && end == -1) {
769
+ strcat(dest, source, maxlength);
770
+ } else {
771
+ if (end == -1)
772
+ end = strlen(source);
773
+ if (ispacked(dest)) {
774
+ new len = strlen(dest);
775
+ if (ispacked(source)) {
776
+ strunpack(g_StrlibBuffer, source);
777
+ strcat(dest, g_StrlibBuffer[start], min(maxlength, (len + end - start) / 4 + 1));
778
+ } else {
779
+ strcat(dest, source[start], min(maxlength, (len + end - start) / 4 + 1));
780
+ }
781
+ dest{len + end - start} = '\0';
782
+ } else {
783
+ if (ispacked(source)) {
784
+ strunpack(g_StrlibBuffer, source);
785
+ strcat(dest, g_StrlibBuffer[start], min(maxlength, strlen(dest) + end - start + 1));
786
+ } else {
787
+ strcat(dest, source[start], min(maxlength, strlen(dest) + end - start + 1));
788
+ }
789
+ }
790
+ }
791
+ if (heap)
792
+ RestoreHeapToAddress(heap);
793
+ }
794
+ stock utf8encode(dest[], const source[], maxlength = sizeof(dest)) {
795
+ new heap = 0;
796
+ if (IsOverlapping(dest, maxlength, source, -1)) {
797
+ heap = CopyArgumentToHeap(1);
798
+ }
799
+ new len = strlen(source);
800
+ new packed = ispacked(source);
801
+ dest[0] = '\0';
802
+ new idx = 0;
803
+ for (new i = 0; i < len; i++) {
804
+ new c = packed ? source{i} : source[i];
805
+ if (c >= 0x80) {
806
+ if (c > 0x4000000) {
807
+ dest[idx++] = 0b11111100 | ((c >>> 30) & 0b00000001);
808
+ dest[idx++] = 0b10000000 | ((c >>> 24) & 0b00111111);
809
+ dest[idx++] = 0b10000000 | ((c >>> 18) & 0b00111111);
810
+ dest[idx++] = 0b10000000 | ((c >>> 12) & 0b00111111);
811
+ dest[idx++] = 0b10000000 | ((c >>> 6) & 0b00111111);
812
+ dest[idx++] = 0b10000000 | (c & 0b00111111);
813
+ } else if (c > 0x200000) {
814
+ dest[idx++] = 0b11111000 | ((c >>> 24) & 0b00000011);
815
+ dest[idx++] = 0b10000000 | ((c >>> 18) & 0b00111111);
816
+ dest[idx++] = 0b10000000 | ((c >>> 12) & 0b00111111);
817
+ dest[idx++] = 0b10000000 | ((c >>> 6) & 0b00111111);
818
+ dest[idx++] = 0b10000000 | (c & 0b00111111);
819
+ } else if (c > 0x10000) {
820
+ dest[idx++] = 0b11110000 | ((c >>> 18) & 0b00000111);
821
+ dest[idx++] = 0b10000000 | ((c >>> 12) & 0b00111111);
822
+ dest[idx++] = 0b10000000 | ((c >>> 6) & 0b00111111);
823
+ dest[idx++] = 0b10000000 | (c & 0b00111111);
824
+ } else if (c > 0x800) {
825
+ dest[idx++] = 0b11100000 | ((c >>> 12) & 0b00001111);
826
+ dest[idx++] = 0b10000000 | ((c >>> 6) & 0b00111111);
827
+ dest[idx++] = 0b10000000 | (c & 0b00111111);
828
+ } else {
829
+ dest[idx++] = 0b11000000 | ((c >>> 6) & 0b00011111);
830
+ dest[idx++] = 0b10000000 | (c & 0b00111111);
831
+ }
832
+ } else if (c > 0) {
833
+ dest[idx++] = c;
834
+ }
835
+ }
836
+ dest[idx] = '\0';
837
+ if (heap) {
838
+ RestoreHeapToAddress(heap);
839
+ }
840
+ }
841
+ stock utf8decode(dest[], const source[], maxlength = sizeof(dest)) {
842
+ new heap = 0;
843
+ if (IsOverlapping(dest, maxlength, source, -1)) {
844
+ heap = CopyArgumentToHeap(1);
845
+ }
846
+ new len = strlen(source);
847
+ dest[0] = '\0';
848
+ new idx = 0;
849
+ for (new i = 0; i < len; i++) {
850
+ new c = source[i];
851
+ if (c & 0b10000000) {
852
+ if (c & 0b11100000 == 0b11000000) {
853
+ if (i + 1 >= len) continue;
854
+ dest[idx++] = (c & 0b00011111) << 6 | (source[++i] & 0b00111111);
855
+ } else if (c & 0b11110000 == 0b11100000) {
856
+ if (i + 2 >= len) continue;
857
+ dest[idx++] = (c & 0b00001111) << 12 |
858
+ (source[++i] & 0b00111111) << 6 |
859
+ (source[++i] & 0b00111111);
860
+ } else if (c & 0b11111000 == 0b11110000) {
861
+ if (i + 3 >= len) continue;
862
+ dest[idx++] = (c & 0b00000111) << 18 |
863
+ (source[++i] & 0b00111111) << 12 |
864
+ (source[++i] & 0b00111111) << 6 |
865
+ (source[++i] & 0b00111111);
866
+ } else if (c & 0b11111100 == 0b11111000) {
867
+ if (i + 4 >= len) continue;
868
+ dest[idx++] = (c & 0b00000011) << 24 |
869
+ (source[++i] & 0b00111111) << 18 |
870
+ (source[++i] & 0b00111111) << 12 |
871
+ (source[++i] & 0b00111111) << 6 |
872
+ (source[++i] & 0b00111111);
873
+ } else if (c & 0b11111110 == 0b11111100) {
874
+ if (i + 5 >= len) continue;
875
+ dest[idx++] = (c & 0b00000001) << 30 |
876
+ (source[++i] & 0b00111111) << 24 |
877
+ (source[++i] & 0b00111111) << 18 |
878
+ (source[++i] & 0b00111111) << 12 |
879
+ (source[++i] & 0b00111111) << 6 |
880
+ (source[++i] & 0b00111111);
881
+ }
882
+ } else {
883
+ dest[idx++] = c;
884
+ }
885
+ }
886
+ dest[idx] = 0;
887
+ if (heap) {
888
+ RestoreHeapToAddress(heap);
889
+ }
890
+ }
891
+ stock ret_strcatmid(const string[], const source[], start = 0, end = -1) {
892
+ new output[STRLIB_RETURN_SIZE];
893
+ strcat(output, string);
894
+ strcatmid(output, source, start, end);
895
+ return output;
896
+ }
897
+ stock ret_strfrombin(const input[], inputlength = sizeof(input)) {
898
+ new output[STRLIB_RETURN_SIZE];
899
+ strfrombin(output, input, inputlength);
900
+ return output;
901
+ }
902
+ stock ret_strimplode(const glue[], ...) {
903
+ new output[STRLIB_RETURN_SIZE];
904
+ const maxlength = sizeof(output);
905
+ new args = numargs();
906
+ for (new arg = 1; arg < args; arg++) {
907
+ if (arg != 1)
908
+ strcat(output, glue, maxlength);
909
+ {
910
+ #emit LCTRL 5
911
+ #emit ADD.C 12
912
+ #emit LOAD.S.alt arg
913
+ #emit SHL.C.alt 2
914
+ #emit ADD
915
+ #emit LOAD.I
916
+ #emit PUSH.C maxlength
917
+ #emit PUSH.pri
918
+ #emit PUSH.ADR output
919
+ #emit PUSH.C 12
920
+ #emit SYSREQ.C strcat
921
+ #emit STACK 16
922
+ }
923
+ }
924
+ #emit LOAD.S.pri 8
925
+ #emit ADD.C 12
926
+ #emit MOVE.alt
927
+ #emit LCTRL 5
928
+ #emit ADD
929
+ #emit LOAD.I
930
+ #emit STOR.S.pri 20
931
+ return output;
932
+ }
933
+ stock ret_strreplace(const string[], const search[], const replacement[], bool:ignorecase = false, pos = 0, limit = -1) {
934
+ new output[STRLIB_RETURN_SIZE];
935
+ strcat(output, string);
936
+ strreplace(output, search, replacement, ignorecase, pos, limit);
937
+ return output;
938
+ }
939
+ stock ret_strfromliteral(const input[], &pos = 0) {
940
+ new output[STRLIB_RETURN_SIZE];
941
+ strcat(output, input);
942
+ strfromliteral(output, input, pos);
943
+ return output;
944
+ }
945
+ stock ret_strtoliteral(const input[], bool:paranoid = true) {
946
+ new output[STRLIB_RETURN_SIZE];
947
+ strcat(output, input);
948
+ strtoliteral(output, input, paranoid);
949
+ return output;
950
+ }
951
+ stock ret_strtrim(const string[], const chars[] = !"", string_edges:edge = edge_both) {
952
+ new output[STRLIB_RETURN_SIZE];
953
+ strcat(output, string);
954
+ strtrim(output, chars, edge);
955
+ return output;
956
+ }
957
+ stock ret_strpad(const string[], length, const substr[] = !" ", string_edges:edge = edge_both, bool:trim_first = true, const trim_chars[] = !"") {
958
+ new output[STRLIB_RETURN_SIZE];
959
+ strcat(output, string);
960
+ strpad(output, length, substr, edge, trim_first, trim_chars);
961
+ return output;
962
+ }
963
+ stock ret_strwrap(const left[], const string[], const right[]) {
964
+ new output[STRLIB_RETURN_SIZE];
965
+ strcat(output, left);
966
+ strcat(output, string);
967
+ strcat(output, right);
968
+ return output;
969
+ }
970
+ stock ret_strurldecode(const input[]) {
971
+ new output[STRLIB_RETURN_SIZE];
972
+ strcat(output, input);
973
+ strurldecode(output, input);
974
+ return output;
975
+ }
976
+ stock ret_strurlencode(const input[], bool:pack = false) {
977
+ new output[STRLIB_RETURN_SIZE];
978
+ strcat(output, input);
979
+ strurlencode(output, input, _, pack);
980
+ return output;
981
+ }
982
+ stock ret_utf8encode(const input[]) {
983
+ new output[STRLIB_RETURN_SIZE];
984
+ utf8encode(output, input);
985
+ return output;
986
+ }
987
+ stock ret_utf8decode(const input[]) {
988
+ new output[STRLIB_RETURN_SIZE];
989
+ utf8decode(output, input);
990
+ return output;
991
+ }
992
+ stock ret_strpack(const source[]) {
993
+ new output[STRLIB_RETURN_SIZE];
994
+ strpack(output, source);
995
+ return output;
996
+ }
997
+ stock ret_strunpack(const source[]) {
998
+ new output[STRLIB_RETURN_SIZE];
999
+ strunpack(output, source);
1000
+ return output;
1001
+ }
1002
+ stock ret_strcat(const string1[], const string2[]) {
1003
+ new output[STRLIB_RETURN_SIZE];
1004
+ strcat(output, string1);
1005
+ strcat(output, string2);
1006
+ return output;
1007
+ }
1008
+ stock ret_strmid(const source[], start, end) {
1009
+ new output[STRLIB_RETURN_SIZE];
1010
+ strmid(output, source, start, end);
1011
+ return output;
1012
+ }
1013
+ stock ret_strins(const string[], const substr[], pos, maxlength = sizeof(string)) {
1014
+ new output[STRLIB_RETURN_SIZE];
1015
+ strcat(output, string);
1016
+ strins(output, substr, pos);
1017
+ return output;
1018
+ }
1019
+ stock ret_strdel(const string[], start, end) {
1020
+ new output[STRLIB_RETURN_SIZE];
1021
+ strcat(output, string);
1022
+ strdel(output, start, end);
1023
+ return output;
1024
+ }
1025
+ stock ret_valstr(value, bool:pack = false) {
1026
+ new output[STRLIB_RETURN_SIZE];
1027
+ format(output, sizeof(output), "%d", value);
1028
+ if (pack)
1029
+ strpack(output, output);
1030
+ return output;
1031
+ }
1032
+ stock ret_GetPlayerName(playerid, bool:pack = false) {
1033
+ new output[MAX_PLAYER_NAME];
1034
+ GetPlayerName(playerid, output, sizeof(output));
1035
+ if (pack)
1036
+ strpack(output, output);
1037
+ return output;
1038
+ }
1039
+ stock sprintf(const fmat[], {Float, _}:...) {
1040
+ static output[STRLIB_RETURN_SIZE], frm_header[3], heap;
1041
+ const output_size = sizeof(output);
1042
+ if (ispacked(fmat)) {
1043
+ heap = CopyArgumentToHeap(0);
1044
+ } else {
1045
+ heap = 0;
1046
+ }{}
1047
+ #emit LCTRL 5
1048
+ #emit CONST.alt frm_header
1049
+ #emit MOVS 12
1050
+ #emit LOAD.S.alt 8
1051
+ #emit ADD.C 12
1052
+ #emit SCTRL 4
1053
+ #emit PUSH.C output_size
1054
+ #emit PUSH.C output
1055
+ #emit MOVE.pri
1056
+ #emit ADD.C 8
1057
+ #emit PUSH.pri
1058
+ #if !STRLIB_USE_FORMATEX
1059
+ const formatex = 0;
1060
+ goto do_sysreq;
1061
+ #endif
1062
+ #emit LCTRL 6
1063
+ #emit ADD.C 36
1064
+ #emit PUSH.pri
1065
+ #emit CONST.pri formatex
1066
+ #emit SCTRL 6
1067
+ #if !STRLIB_USE_FORMATEX
1068
+ do_sysreq:
1069
+ #endif
1070
+ #emit SYSREQ.C format
1071
+ #emit LCTRL 5
1072
+ #emit SCTRL 4
1073
+ #emit MOVE.alt
1074
+ #emit CONST.pri frm_header
1075
+ #emit MOVS 12
1076
+ if (heap) {
1077
+ RestoreHeapToAddress(heap);
1078
+ }{}
1079
+ #emit LOAD.S.pri 8
1080
+ #emit ADD.C 12
1081
+ #emit MOVE.alt
1082
+ #emit LCTRL 5
1083
+ #emit ADD
1084
+ #emit LOAD.I
1085
+ #emit STOR.S.pri 20
1086
+ return output;
1087
+ #pragma unused fmat
1088
+ }
timerfix.inc ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #define KillTimer_ KillTimer
2
+ native IsValidTimer(timerid);
3
+ native GetActiveTimers();
4
+ native KillPlayerTimer(timerid) = KillTimer;
5
+ native KillPlayerTimers(playerid);
6
+ native SetTimer_(func[], interval, delay, count);
7
+ native SetTimerEx_(func[], interval, delay, count, format[], {Float, _}:...);
8
+ native SetPlayerTimer(playerid, func[], interval, repeating);
9
+ native SetPlayerTimerEx(playerid, func[], interval, repeating, const format[], {Float,_}:...);
10
+ native SetPlayerTimer_(playerid, func[], interval, delay, count);
11
+ native SetPlayerTimerEx_(playerid, func[], interval, delay, count, format[], {Float, _}:...);
12
+ native GetTimerFunctionName(timerid, func[]);
13
+ native SetTimerInterval(timerid, interval);
14
+ native GetTimerInterval(timerid);
15
+ native GetTimerIntervalLeft(timerid);
16
+ native SetTimerDelay(timerid, delay);
17
+ native SetTimerCount(timerid, count);
18
+ native GetTimerCallsLeft(timerid);
19
+ public OnPlayerDisconnect(playerid, reason) {
20
+ KillPlayerTimers(playerid);
21
+ #if defined TIMERFIX_OnPlayerDisconnect
22
+ return TIMERFIX_OnPlayerDisconnect(playerid, reason);
23
+ #else
24
+ return 1;
25
+ #endif
26
+ }
27
+ #if defined _ALS_OnPlayerDisconnect
28
+ #undef OnPlayerDisconnect
29
+ #else
30
+ #define _ALS_OnPlayerDisconnect
31
+ #endif
32
+ #define OnPlayerDisconnect TIMERFIX_OnPlayerDisconnect
33
+ #if defined TIMERFIX_OnPlayerDisconnect
34
+ forward TIMERFIX_OnPlayerDisconnect(playerid, reason);
35
+ #endif
weapon-config.inc ADDED
The diff for this file is too large to render. See raw diff