forked from pawn-lang/sa-mp-fixes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfixes.inc
13545 lines (12458 loc) · 418 KB
/
fixes.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
========================================================
fixes.inc - Community patch for buggy SA:MP functions.
========================================================
*//**
<!--
<transition target[^/]+/>
:::::::: README ::::::::
To read the generated XML output, copy `pawndoc.xsl` to `pawno/xml/`.
This information goes very close to the top of the generated XML documentation
(because of include dependency orders), but doesn't appear in the visual output.
There is a bug in the compiler related to outputting documentation on state
transitions (<a href="https://github.com/Zeex/pawn/issues/184" />). So after
generation of the XML file, you should clean it up with the following RegEx
replacement:
Search: <transition target[^/]+/>
Replace: (nothing)
This works 99% of the time, though you may get one where the corrupted target
includes the character `/`, in which case you should manually delete them. Note
that YSI now includes manual documentation for transitions, but these all
include the parameter `keep="true"`, which exists simply to not match that
RegEx. I also put the search at the top of this block so it is easier to find
in the output code.
-->
*//**
* <library name="fixes.inc"
* description="Community patches for buggy SA:MP functions.">
*
* <section>
* Introduction
* </section>
*
* <p>SA:MP is beta software written by a small team in their spare time, thus
* it has bugs (as does all software). Some of these have been known for a long
* time but are low priority due to their minor effects, others go undiscovered
* for a long time. Many of these bugs have solutions which can be implemented
* in PAWN (and this may be simpler than implementing them in the SA:MP source
* code). This include aims to collect fixes for as many of these bugs as
* possible from the community (i.e. anyone who has a fix) together in to one
* easy to use place for everyone's benefit.</p>
*
* <section>
* Use
* </section>
*
* <p>To use this, simply include it after the default SA:MP functions, but
* before third party includes:</p>
*
* <code>
* #include <a_samp> <br />
* // Any default re-definitions should go here. <br />
* //#undef MAX_PLAYERS <br />
* //#define MAX_PLAYERS 10 <br />
* #include <fixes> <br />
* #include <other>
* </code>
*
* <p>To disable any fix for whatever reason simply do:</p>
*
* <code>#define FIX_<name> 0</code>
*
* <p>For example, to disable all the file.inc fixes if you always correctly
* check the file handle, do:</p>
*
* <code>
* #include <a_samp> <br />
* #define FIX_file_inc 0 <br />
* #include <fixes> <br />
* #include <other>
* </code>
*
* <p>All the names of the fixes are single words, and are all listed with their
* fix descriptions below.</p>
*
* <p>If you only have one script running on your server (i.e. no
* FilterScripts), you can use this define to improve the fixes.inc code:</p>
*
* <code>
* #include <a_samp> <br />
* #define FIXES_Single 1 <br />
* #include <fixes> <br />
* #include <other>
* </code>
*
* <section>
* Fixes
* </section>
*
* <fixeslist>
* <fix name="GetPlayerColor">
* <problem>
* Returns "0" if "SetPlayerColor" has never been called.
* </problem>
* <solution>
* Call "SetPlayerColor" in "OnPlayerConnect".
* </solution>
* <see>OnPlayerConnect</see>
* <author >KoczkaHUN</author>
* </fix>
*
* <fix name="FILTERSCRIPT">
* <problem>
* Despite the fact that is in every new script, many people dont'
* define "FILTERSCRIPT" where appropriate.
* </problem>
* <solution>
* Provide an "IS_FILTERSCRIPT" variable (note the naming to
* match the original macro).
* </solution>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <see>OnFilterScriptInit</see>
* <see>OnGameModeInit</see>
* </fix>
*
* <fix name="SpawnPlayer">
* <problem>
* Kills the player if they are in a vehicle.
* </problem>
* <solution>
* Remove the from the vehicle.
* </solution>
* <see>FIXES_SpawnPlayer</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="SetPlayerName">
* <problem>
* Using "SetPlayerName" when the new name only differs from the old
* name in case does not alter the name at all.
* </problem>
* <solution>
* Change their name twice - once to "_FIXES TEMP NAME" and then
* to the actual required name.
* </solution>
* <see>OnPlayerConnect</see>
* <see>FIXES_SetPlayerName</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* <author href="https://github.com/simonepri/" >simonepri</author>
* </fix>
*
* <fix name="GetPlayerSkin">
* <problem>
* Returns the new skin after "SetSpawnInfo" is called but before the
* player actually respawns to get the new skin.
* </problem>
* <solution>
* Record the skin in "OnPlayerSpawn" and always return that one.
*
* </solution>
* <see>OnPlayerSpawn</see>
* <see>FIXES_GetPlayerSkin</see>
* <see>FIXES_SetPlayerSkin</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="GetWeaponName" fixed="0.3.7">
* <problem>
* Returns nothing for 18, 44, and 45.
* </problem>
* <solution>
* Return the correct names (<c>Molotov Cocktail</c>, <c>Thermal
* Goggles</c>, and <c>Night vision Goggles</c>).
* </solution>
* <see>FIXES_GetWeaponName</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="SetPlayerWorldBounds">
* <problem>
* Aiming can bypass the edge.
* </problem>
* <solution>
* Check for the player leaving the area and reset them to their last
* good position if they leave the area (aiming or not).
* </solution>
* <see>OnPlayerUpdate</see>
* <see>FIXES_SetPlayerWorldBounds</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="TogglePlayerControllable">
* <problem>
* Other players see you moving on the spot.
* </problem>
* <solution>
* Return 0 in OnPlayerUpdate.
* </solution>
* <see>FIXES_TogglePlayerControllable</see>
* <see>OnPlayerUpdate</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=876854" />
* </fix>
*
* <fix name="HydraSniper">
* <problem>
* Entering military aircraft with a sniper rifle messes up views.
* </problem>
* <solution>
* Set their armed weapon to fists.
* </solution>
* <see>OnPlayerStateChange</see>
* <see>FIXES_GivePlayerWeapon</see>
* <see>FIXES_SetPlayerArmedWeapon</see>
* <author >funky1234</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=965644" />
* </fix>
*
* <fix name="IsPlayerInCheckpoint">
* <problem>
* Function returns an undefined value if it is called before any other
* checkpoint functions are called to initialise the value.
* </problem>
* <solution>
* Call "DisablePlayerCheckpoint" when they connect.
* </solution>
* <see>OnPlayerConnect</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="IsPlayerInRaceCheckpoint">
* <problem>
* Function returns an undefined value if it is called before any other
* race checkpoint functions are called to initialise the value.
* </problem>
* <solution>
* Call "DisablePlayerRaceCheckpoint" when they connect.
* </solution>
* <see>OnPlayerConnect</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="GetPlayerWeapon">
* <problem>
* Returns the old value after entering in a vehicle.
* </problem>
* <solution>
* If "SetPlayerArmedWeapon" and other similar functions is called in a
* vehicle, store the new value and return that instead.
* </solution>
* <see>OnPlayerStateChange</see>
* <see>FIXES_SetPlayerArmedWeapon</see>
* <see>FIXES_GetPlayerWeapon</see>
* <see>FIXES_GivePlayerWeapon</see>
* <see>FIXES_ResetPlayerWeapons</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <author href="https://github.com/ronixtey/" >ronixtey</author>
* </fix>
*
* <fix name="PutPlayerInVehicle">
* <problem>
* If this is used on a passenger the driver of their old vehicle
* doesn't see them in their new vehicle.
* </problem>
* <solution>
* Remove them from the vehicle first.
* </solution>
* <see>OnPlayerStateChange</see>
* <see>FIXES_PutPlayerInVehicle</see>
* <author >leong124</author>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=1265965" />
* </fix>
*
* <fix name="KEY_AIM">
* <problem>
* "KEY_AIM" isn't defined by default.
* </problem>
* <solution>
* Define it.
* </solution>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="SetPlayerCheckpoint">
* <problem>
* If a checkpoint is already set it will use the size of that
* checkpoint instead of the new one.
* </problem>
* <solution>
* Call "DisablePlayerCheckpoint" before setting the checkpoint.
* </solution>
* <see>FIXES_SetPlayerCheckpoint</see>
* <author href="https://github.com/ziggi/" >ziggi</author>
* </fix>
*
* <fix name="SetPlayerRaceCheckpoint">
* <problem>
* If a checkpoint is already set it will use the size of that
* checkpoint instead of the new one.
* </problem>
* <solution>
* Call "DisablePlayerRaceCheckpoint" before setting the checkpoint.
* </solution>
* <see>FIXES_SetPlayerRaceCheckpoint</see>
* <author href="https://github.com/ziggi/" >ziggi</author>
* </fix>
*
* <fix name="TextDrawCreate">
* <problem>
* Crashes on a blank string.
* </problem>
* <solution>
* Intercept blank strings.
* </solution>
* <see>FIXES_TextDrawCreate</see>
* <author >wups</author>
* </fix>
*
* <fix name="TextDrawCreate_2">
* <problem>
* If the last character in the text is a space (" "), the text will all
* be blank.
* </problem>
* <solution>
* Remove space characters from the end of the string.
* </solution>
* <see>FIXES_TextDrawCreate</see>
* <author href="https://github.com/ziggi/" >ziggi</author>
* <post href="https://github.com/Open-GTO/sa-mp-fixes/issues/55" />
* </fix>
*
* <fix name="TextDrawSetString">
* <problem>
* Crashes on a blank string and size greater than 1024.
* </problem>
* <solution>
* Intercept blank strings and truncate long strings.
* </solution>
* <see>FIXES_TextDrawSetString</see>
* <author >TomTrox</author>
* </fix>
*
* <fix name="TextDrawSetString_2">
* <problem>
* If the last character in the text is a space (" "), the text will all
* be blank.
* </problem>
* <solution>
* Remove space characters from the end of the string.
* </solution>
* <see>FIXES_TextDrawSetString</see>
* <author href="https://github.com/ziggi/" >ziggi</author>
* <post href="https://github.com/Open-GTO/sa-mp-fixes/issues/55" />
* </fix>
*
* <fix name="CreatePlayerTextDraw">
* <problem>
* Crashes on a blank string.
* </problem>
* <solution>
* Intercept blank strings.
* </solution>
* <see>FIXES_CreatePlayerTextDraw</see>
* <author >wups</author>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="CreatePlayerTextDraw_2">
* <problem>
* If the last character in the text is a space (" "), the text will all
* be blank.
* </problem>
* <solution>
* Remove space characters from the end of the string.
* </solution>
* <see>FIXES_CreatePlayerTextDraw</see>
* <author href="https://github.com/ziggi/" >ziggi</author>
* <post href="https://github.com/Open-GTO/sa-mp-fixes/issues/55" />
* </fix>
*
* <fix name="PlayerTextDrawSetString">
* <problem>
* Crashes on a blank string and size greater than 1024.
* </problem>
* <solution>
* Intercept blank strings and truncate long strings.
* </solution>
* <see>FIXES_PlayerTextDrawSetString</see>
* <author >TomTrox</author>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="PlayerTextDrawSetString_2">
* <problem>
* If the last character in the text is a space (" "), the text will all
* be blank.
* </problem>
* <solution>
* Remove space characters from the end of the string.
* </solution>
* <see>FIXES_PlayerTextDrawSetString</see>
* <author href="https://github.com/ziggi/" >ziggi</author>
* <post href="https://github.com/Open-GTO/sa-mp-fixes/issues/55" />
* </fix>
*
* <fix name="AllowInteriorWeapons">
* <problem>
* Does nothing.
* </problem>
* <solution>
* Set the player's weapon to fists in an interior.
* </solution>
* <see>FIXES_AllowInteriorWeapons</see>
* <see>OnGameModeInit</see>
* <see>OnPlayerUpdate</see>
* <author >KoczkaHUN</author>
* </fix>
*
* <fix name="OnPlayerEnterVehicle">
* <problem>
* Crashes other players when people enter an invalid seat.
* </problem>
* <solution>
* Desync the people with invalid seats.
* </solution>
* <see>OnPlayerStateChange</see>
* <see>OnPlayerUpdate</see>
* <author >RyDeR`</author>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <author href="https://github.com/NexiusTailer">NexiusTailer</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=1410296" />
* </fix>
*
* <fix name="OnPlayerEnterVehicle_2">
* <problem>
* Crashes the server when hacks enter an invalid vehicle.
* </problem>
* <solution>
* Desync the people with invalid vehicles.
* </solution>
* <see>OnPlayerEnterVehicle</see>
* <author >im</author>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="OnPlayerEnterVehicle_3">
* <problem>
* No player animation when trying to enter the driver door of a locked
* vehicle
* </problem>
* <solution>
* Leave the door unlocked and activate an animation when the player
* attemps to enter a 'locked' vehicle.
* </solution>
* <see>OnPlayerEnterVehicle</see>
* <author href="https://github.com/ziggi" >ziggi</author>
* <author href="https://github.com/rt-2" >rt-2</author>
* <post href="http://forum.sa-mp.com/showthread.php?t=560019" />
* </fix>
*
* <fix name="AllowTeleport">
* <problem>
* 0.3dRC9 removed "AllowPlayerTeleport" and "AllowAdminTeleport" in
* favour of "OnPlayerClickMap". Some scripts used the old code and.
* </problem>
* <solution>
* Teleport the player in "OnPlayerClickMap".
* </solution>
* <see>OnPlayerClickMap</see>
* <see>FIXES_AllowPlayerTeleport</see>
* <see>FIXES_AllowAdminTeleport</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="SetPlayerSpecialAction">
* <problem>
* Removing jetpacks from players by setting their special action to 0
* causes the sound to stay until death.
* </problem>
* <solution>
* Call "ClearAnimations" before "SetPlayerSpecialAction".
* </solution>
* <see>FIXES_SetPlayerSpecialAction</see>
* <author >MP2</author>
* </fix>
*
* <fix name="OnDialogResponse" fixed="0.3e RC6">
* <problem>
* Cheaters can spoof the dialogid they are using to respond to ones
* they can't actually see.
* </problem>
* <solution>
* Store the displayed dialogid and use that instead.
* </solution>
* <see>FIXES_OnDialogResponse</see>
* <see>FIXES_ShowPlayerDialog</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="GetPlayerDialog" disabled="true">
* <problem>
* This function doesn't exist. Fixed for hidden dialogs.
* </problem>
* <solution>
* Add it.
* </solution>
* <see>FIXES_GetPlayerDialog</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <author href="https://github.com/simonepri/" >simonepri</author>
* </fix>
*
* <fix name="PlayerDialogResponse">
* <problem>
* A player's dialog doesn't hide when the gamemode restarts, causing
* the server to print "Warning: PlayerDialogResponse PlayerId: 0
* dialog ID doesn't match last sent dialog ID".
* </problem>
* <solution>
* Hide it.
* </solution>
* <see>OnPlayerConnect</see>
* <see>OnGameModeExit</see>
* <author href="https://github.com/simonepri/" >simonepri</author>
* </fix>
*
* <fix name="SetSpawnInfo">
* <problem>
* Kicks the player if "SpawnPlayer" is called before "SetSpawnInfo".
* </problem>
* <solution>
* Call "SetSpawnInfo" at least once.
* </solution>
* <see>OnPlayerConnect</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="SetSpawnInfo_2">
* <problem>
* Does not set the correct team after spawn.
* </problem>
* <solution>
* Call "SetPlayerTeam" when they spawn.
* </solution>
* <see>OnPlayerSpawn</see>
* <author href="http://forum.sa-mp.com/member.php?u=24012" >NaS</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=3994248" />
* </fix>
*
* <fix name="SetPlayerSkin">
* <problem>
* Breaks sitting on bikes.
* </problem>
* <solution>
* Put them back in the vehicle after setting their skin.
* </solution>
* <see>FIXES_SetPlayerSkin</see>
* <author >CyNiC</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=1756094" />
* </fix>
*
* <fix name="HideMenuForPlayer">
* <problem>
* Crashes when passed an invalid menu ID.
* </problem>
* <solution>
* Don't hide it when passed an invalid menu.
* </solution>
* <see>FIXES_HideMenuForPlayer</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=1787297" />
* </fix>
*
* <fix name="valstr">
* <problem>
* Crashes on large numbers.
* </problem>
* <solution>
* Use "format" instead.
* </solution>
* <see>FIXES_valstr</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="fclose">
* <problem>
* Crashes on an invalid handle.
* </problem>
* <solution>
* Check for an invalid handle.
* </solution>
* <see>FIXES_fclose</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="fwrite">
* <problem>
* Crashes on an invalid handle.
* </problem>
* <solution>
* Check for an invalid handle.
* </solution>
* <see>FIXES_fwrite</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="fread">
* <problem>
* Crashes on an invalid handle.
* </problem>
* <solution>
* Check for an invalid handle.
* </solution>
* <see>FIXES_fread</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="fputchar">
* <problem>
* Crashes on an invalid handle.
* </problem>
* <solution>
* Check for an invalid handle.
* </solution>
* <see>FIXES_fputchar</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="fgetchar">
* <problem>
* Crashes on an invalid handle.
* </problem>
* <solution>
* Check for an invalid handle.
* </solution>
* <see>FIXES_fgetchar</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="fblockwrite">
* <problem>
* Crashes on an invalid handle.
* </problem>
* <solution>
* Check for an invalid handle.
* </solution>
* <see>FIXES_fblockwrite</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="fblockread">
* <problem>
* Crashes on an invalid handle.
* </problem>
* <solution>
* Check for an invalid handle.
* </solution>
* <see>FIXES_fblockread</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="fseek">
* <problem>
* Crashes on an invalid handle.
* </problem>
* <solution>
* Check for an invalid handle.
* </solution>
* <see>FIXES_fseek</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="flength">
* <problem>
* Crashes on an invalid handle.
* </problem>
* <solution>
* Check for an invalid handle.
* </solution>
* <see>FIXES_flength</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="file_inc" disabled="true">
* <problem>
* Includes or excludes all the file function fixes together (can cause
* major overhead).
* </problem>
* <solution>
* Optionally group them all under one define.
* </solution>
* <see>FIX_file_inc</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="SetPlayerAttachedObject">
* <problem>
* Doesn't remove objects when the mode ends.
* </problem>
* <solution>
* Remove them.
* </solution>
* <see>OnPlayerDisconnect</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="OnPlayerDeath">
* <problem>
* Clients get stuck when they die with an animation applied.
* </problem>
* <solution>
* Clear their animations.
* </solution>
* <see>OnPlayerDeath</see>
* <see>OnPlayerUpdate</see>
* <author >h02</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=1641144" />
* </fix>
*
* <fix name="strins">
* <problem>
* Ignores the "maxlength" parameter causing possible crashes.
* </problem>
* <solution>
* Manually check the length.
* </solution>
* <see>FIXES_strins</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* <author href="https://github.com/Y-Less" >Y_Less</author>
* </fix>
*
* <fix name="IsPlayerConnected">
* <problem>
* Only uses the lower two bytes of a passed ID.
* </problem>
* <solution>
* Mask the numbers.
* </solution>
* <see>FIXES_IsPlayerConnected</see>
* <author href="https://github.com/oscar-broman/" >Slice</author>
* </fix>
*
* <fix name="TrainExit">
* <problem>
* When getting out of a train entered by "PutPlayerInVehicle", the
* camera does not reset properly.
* </problem>
* <solution>
* Reset the camera.
* </solution>
* <see>FIXES_PutPlayerInVehicle</see>
* <see>FIXES_OnPlayerStateChange</see>
* <author >Terminator3</author>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="Kick" fixed="0.3x">
* <problem>
* Calling "Kick" in "OnPlayerConnect" doesn't work properly.
* </problem>
* <solution>
* Defer it.
* </solution>
* <see>OnPlayerConnect</see>
* <see>FIXES_Kick</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=1989453" />
* </fix>
*
* <fix name="OnVehicleMod">
* <problem>
* Crashes other players when invalid mods are applied.
* </problem>
* <solution>
* Desync the player.
* </solution>
* <see>OnVehicleMod</see>
* <author href="https://github.com/JernejL/" >JernejL</author>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=1671500" />
* </fix>
*
* <fix name="random" disabled="true">
* <problem>
* Doesn't work with negative numbers.
* </problem>
* <solution>
* Invert then reinvert.
* </solution>
* <see>FIXES_random</see>
* <author href="https://github.com/simonepri/" >simonepri</author>
* </fix>
*
* <fix name="sleep">
* <problem>
* Leaks bytes from the stack.
* </problem>
* <solution>
* Call a function to store the correct value.
* </solution>
* <see>FIXES_sleep</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="AddMenuItem">
* <problem>
* Crashes when passed an invalid menu ID.
* </problem>
* <solution>
* Don't hide it when passed an invalid menu.
* </solution>
* <see>FIXES_AddMenuItem</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="SetMenuColumnHeader">
* <problem>
* Crashes when passed an invalid menu ID.
* </problem>
* <solution>
* Don't hide it when passed an invalid menu.
* </solution>
* <see>FIXES_SetMenuColumnHeader</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="ShowMenuForPlayer">
* <problem>
* Crashes when passed an invalid menu ID.
* </problem>
* <solution>
* Don't hide it when passed an invalid menu.
* </solution>
* <see>FIXES_ShowMenuForPlayer</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="HideMenuForPlayer">
* <problem>
* Crashes when passed an invalid menu ID.
* </problem>
* <solution>
* Don't hide it when passed an invalid menu.
* </solution>
* <see>FIXES_HideMenuForPlayer</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <post href="http://forum.sa-mp.com/showpost.php?p=1787297" />
* </fix>
*
* <fix name="HideMenuForPlayer_2" disabled="true">
* <problem>
* Ignores the "menuid" parameter.
* </problem>
* <solution>
* Only hide the correct menu.
* </solution>
* <see>FIXES_HideMenuForPlayer</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="DisableMenu">
* <problem>
* Crashes when passed an invalid menu ID.
* </problem>
* <solution>
* Don't hide it when passed an invalid menu.
* </solution>
* <see>FIXES_DisableMenu</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="DisableMenuRow">
* <problem>
* Crashes when passed an invalid menu ID.
* </problem>
* <solution>
* Don't hide it when passed an invalid menu.
* </solution>
* <see>FIXES_DisableMenuRow</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="Menus">
* <problem>
* All menu function fixes are included separately for major overhead.
* </problem>
* <solution>
* Optionally group them all under one define.
* </solution>
* <see>FIX_Menus</see>
* <see>_FIX_Menus</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="GetPlayerMenu">
* <problem>
* Returns previous menu when none is displayed.
* </problem>
* <solution>
* Return the correct value.
* </solution>
* <see>FIXES_GetPlayerMenu</see>
* <see>OnPlayerSelectedMenuRow</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="GetPlayerInterior">
* <problem>
* Always returns 0 for NPCs.
* </problem>
* <solution>
* Return the correct value.
* </solution>
* <see>FIXES_GetPlayerInterior</see>
* <see>FIXES_SetPlayerInterior</see>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* <author href="https://github.com/simonepri/" >simonepri</author>
* </fix>
*
* <fix name="ClearAnimations">
* <problem>
* Use ClearAnimation while you are in a vehicle cause the player exit
* from it.
* </problem>
* <solution>
* Apply an animation instead of clear animation.
* </solution>
* <see>FIXES_ClearAnimations</see>
* <author href="https://github.com/simonepri/" >simonepri</author>
* </fix>
*
* <fix name="ClearAnimations_2">
* <problem>
* ClearAnimations doesn't do anything when the animation ends if we
* pass 1 for the freeze parameter in ApplyAnimation.
* </problem>
* <solution>
* Apply an idle animation for stop and then use ClearAnimation.
* </solution>
* <see>FIXES_ClearAnimations</see>
* <author href="https://github.com/simonepri/" >simonepri</author>
* </fix>
*
* <fix name="DriveBy">
* <problem>
* If you press KEY_CROUCH while you're passenger and if you are armed,
* the player start to aim; if you repress KEY_CROUCH the player don't
* return in vehicle.
* </problem>
* <solution>
* Apply the animation to return the player in the vehicle.
* </solution>
* <see>OnPlayerKeyStateChange</see>
* <author href="https://github.com/simonepri/" >simonepri</author>
* </fix>
*
* <fix name="SilentTeleport">
* <problem>
* Player teleports silently while trying to enter a vehicle as that vehicle teleports/changes original interior.
* </problem>
* <solution>
* Stop the player from teleporting by using 'ClearAnimations' before the teleport happens.
* </solution>
* <see>OnPlayerEnterVehicle</see>
* <see>OnPlayerInteriorChange</see>
* <author href="https://github.com/RogueDrifter/" >RogueDrifter</author>
* </fix>
*
* <fix name="GangZoneCreate">
* <problem>
* Gang zones bug on the main map for players at certain angles relative
* to them.
* </problem>
* <solution>
* Set a non floating value for the gang zone co-ordinate.
* </solution>
* <see>FIXES_GangZoneCreate</see>
* <author href="https://github.com/simonepri/" >simonepri</author>
* <author href="https://github.com/Y-Less/" >Y_Less</author>
* </fix>
*
* <fix name="SPECIAL_ACTION_PISSING">
* <problem>
* "SPECIAL_ACTION_PISSING" isn't defined by default.
* </problem>
* <solution>
* Define it.
* </solution>
* <author href="https://github.com/simonepri/" >simonepri</author>
* </fix>
*
* <fix name="IsValidVehicle">
* <problem>
* "IsValidVehicle" isn't defined by default.
* </problem>
* <solution>
* Define it.
* </solution>
* <author href="https://github.com/simonepri/" >simonepri</author>
* </fix>
*
* <fix name="ApplyAnimation">
* <problem>
* Passing an invalid animation library in ApplyAnimation causes a