alidexter001 4 năm trước cách đây
mục cha
commit
c314b73b65
57 tập tin đã thay đổi với 16167 bổ sung28269 xóa
  1. BIN
      gamemodes/Mikko.amx
  2. 1776 1773
      gamemodes/Mikko.pwn
  3. 22 0
      gamemodes/rus.txt
  4. 85 154
      pawno/include/Dini.inc
  5. 49 169
      pawno/include/OPSP.inc
  6. 2 2
      pawno/include/SII.inc
  7. 38 38
      pawno/include/SKY.inc
  8. 640 1013
      pawno/include/YSI.inc
  9. 23 63
      pawno/include/YSI/internal/y_automasters.inc
  10. 10 23
      pawno/include/YSI/internal/y_classgroups.inc
  11. 7 18
      pawno/include/YSI/internal/y_funcinc.inc
  12. 134 983
      pawno/include/YSI/internal/y_grouponce.inc
  13. 10 17
      pawno/include/YSI/internal/y_grouprevert.inc
  14. 309 618
      pawno/include/YSI/internal/y_groupsecond.inc
  15. 50 16
      pawno/include/YSI/internal/y_groupsingle.inc
  16. 17 12
      pawno/include/YSI/internal/y_nogroups.inc
  17. 7 8
      pawno/include/YSI/internal/y_overridemaster.inc
  18. 15 145
      pawno/include/YSI/internal/y_shortfunc.inc
  19. 0 331
      pawno/include/YSI/internal/y_version.inc
  20. 113 423
      pawno/include/YSI/y_als.inc
  21. 38 62
      pawno/include/YSI/y_bintree.inc
  22. 32 127
      pawno/include/YSI/y_bit.inc
  23. 437 438
      pawno/include/YSI/y_classes.inc
  24. 8 9
      pawno/include/YSI/y_colors.inc
  25. 1286 172
      pawno/include/YSI/y_colours.inc
  26. 182 328
      pawno/include/YSI/y_commands.inc
  27. 24 128
      pawno/include/YSI/y_debug.inc
  28. 11 26
      pawno/include/YSI/y_files.inc
  29. 80 51
      pawno/include/YSI/y_flooding.inc
  30. 51 138
      pawno/include/YSI/y_groups.inc
  31. 956 24
      pawno/include/YSI/y_hooks.inc
  32. 81 392
      pawno/include/YSI/y_ini.inc
  33. 235 504
      pawno/include/YSI/y_iterate.inc
  34. 241 290
      pawno/include/YSI/y_master.inc
  35. 51 127
      pawno/include/YSI/y_playerarray.inc
  36. 16 1027
      pawno/include/YSI/y_stringhash.inc
  37. 126 202
      pawno/include/YSI/y_td.inc
  38. 44 182
      pawno/include/YSI/y_testing.inc
  39. 170 417
      pawno/include/YSI/y_timers.inc
  40. 34 368
      pawno/include/YSI/y_utils.inc
  41. 95 324
      pawno/include/YSI/y_xml.inc
  42. 46 231
      pawno/include/a_mysql.inc
  43. 31 20
      pawno/include/a_zones.inc
  44. 59 79
      pawno/include/audio.inc
  45. 12 8062
      pawno/include/fixes.inc
  46. 416 573
      pawno/include/foreach.inc
  47. 6 360
      pawno/include/mSelection.inc
  48. 163 131
      pawno/include/progress.inc
  49. 2 2
      pawno/include/sii.inc
  50. 312 306
      pawno/include/sscanf2.inc
  51. 5 12
      pawno/include/streamer.inc
  52. 6330 6332
      pawno/include/weapon-config.inc
  53. 640 1013
      pawno/include/ysi.inc
  54. BIN
      pawno/pawncc.exe
  55. 6 6
      pawno/settings.ini
  56. BIN
      samp-npc
  57. 634 0
      scriptfiles/users/Dr_Smelly.ini

BIN
gamemodes/Mikko.amx


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1776 - 1773
gamemodes/Mikko.pwn


+ 22 - 0
gamemodes/rus.txt

@@ -1,2 +1,24 @@
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(10215) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(10277) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(12459) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(12479) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(13143) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(14115) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(14118) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(19002) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(36037) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(37594) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(37619) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(41661) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(41665) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(41671) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(48697) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(48828) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(48829) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(48887) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(50735) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(52277) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(53814) : íåïðàâèëüíàÿ òàáóëÿöèÿ
+C:\Users\WILLIAM CHEW\Desktop\Mikko\gamemodes\Mikko.pwn(59088) : íåïðàâèëüíàÿ òàáóëÿöèÿ
 Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2016, ITB CompuPhase
 

+ 85 - 154
pawno/include/Dini.inc

@@ -1,15 +1,14 @@
 /*
- *            Dini 1.6
- *       (c) Copyright 2006-2008 by DracoBlue
+ *            Dini 1.5.1
+ *       (c) Copyright 2006 by DracoBlue
  *
  * @author    : DracoBlue (http://dracoblue.com)
  * @date      : 13th May 2006
- * @update    : 16th Sep 2008
+ * @update    : 3rd June 2007
+ * @require   : DUtils 1.8
  *
  * This file is provided as is (no warranties).
  *
- * It's released under the terms of MIT.
- *
  * Feel free to use it, a little message in
  * about box is honouring thing, isn't it?
  *
@@ -20,70 +19,64 @@
 #endif
 
 #define _dini_included
-#pragma library dini
+#pragma library dutils
 
-#if defined MAX_STRING
-#define DINI_MAX_STRING MAX_STRING
-#else
-#define DINI_MAX_STRING 255
-#endif
+#include <dutils>
 
-stock dini_Exists(filename[]) {
-	return fexist(filename);
+stock  dini_Exists(filename[]) {
+	if (fexist(filename)) return true;
+	return false;
 }
 
-stock dini_Remove(filename[]) {
-	return fremove(filename);
+stock  dini_Remove(filename[]) {
+	if (!fexist(filename)) return false;
+	fremove(filename);
+	return true;
 }
 
-stock dini_Create(filename[]) {
-	if (fexist(filename)) return false;
+stock  dini_Create(filename[]) {
 	new File:fhnd;
+	if (fexist(filename)) return false;
 	fhnd=fopen(filename,io_write);
-	if (fhnd) {
-		fclose(fhnd);
-		return true;
-	}
-	return false;
+	fclose(fhnd);
+	return true;
 }
 
-stock dini_Set(filename[],key[],value[]) {
-	// If we have no key, it can't be set
-	// we also have no chance to set the value, if all together is bigger then the max string
-	new key_length = strlen(key);
-	new value_length = strlen(value);
-	if (key_length==0 || key_length+value_length+2>DINI_MAX_STRING) return false;
-	
+stock  dini_PRIVATE_ExtractKey(line[]) {
+	new tmp[MAX_STRING];
+	tmp[0]=0;
+	if (strfind(line,"=",true)==-1) return tmp;
+	set(tmp,strlower(ret_memcpy(line,0,strfind(line,"=",true))));
+	return tmp;
+}
+
+stock  dini_PRIVATE_ExtractValue(line[]) {
+    new tmp[MAX_STRING];
+    tmp[0]=0;
+    if (strfind(line,"=",true)==-1) {
+        return tmp;
+    }
+    set(tmp,ret_memcpy(line,strfind(line,"=",true)+1,strlen(line)));
+    return tmp;
+}
+
+stock  dini_Set(filename[],key[],value[]) {
 	new File:fohnd, File:fwhnd;
-	new tmpres[DINI_MAX_STRING];
 	new bool:wasset=false;
-	
-	// Let's remove the old *.part file if there was one.
+	new tmpres[MAX_STRING];
+	if (key[0]==0) return false; /* If we have no sign in key, it can't be set*/
 	format(tmpres,sizeof(tmpres),"%s.part",filename);
-	fremove(tmpres);
-	
-	// We'll open the source file.
 	fohnd=fopen(filename,io_read);
 	if (!fohnd) return false;
-	
+	fremove(tmpres);
 	fwhnd=fopen(tmpres,io_write);
-	if (!fwhnd) {
-		// we can't open the second file for writing, so .. let's close the open one and exit.
-		fclose(fohnd);
-		return false;
-	}
-	
+	//  if (!fwhnd) return false;
 	while (fread(fohnd,tmpres)) {
-		if (
-			!wasset
-			&& tmpres[key_length]=='='
-			&& !strcmp(tmpres, key, true, key_length)	
-		) {
-				// We've got what needs to be replaced!
-				format(tmpres,sizeof(tmpres),"%s=%s",key,value);
-				wasset=true;
-		} else {
-			DINI_StripNewLine(tmpres);
+		StripNewLine(tmpres);
+		if ((!wasset)&&(equal(dini_PRIVATE_ExtractKey(tmpres),key,true))) {
+			/* We've got what needs to be replaced! */
+			format(tmpres,sizeof(tmpres),"%s=%s",key,value);
+			wasset=true;
 		}
 		fwrite(fwhnd,tmpres);
 		fwrite(fwhnd,"\r\n");
@@ -99,111 +92,88 @@ stock dini_Set(filename[],key[],value[]) {
 	fclose(fwhnd);
 
 	format(tmpres,sizeof(tmpres),"%s.part",filename);
-	if (DINI_fcopytextfile(tmpres,filename)) {
+	if (fcopytextfile(tmpres,filename)) {
 		return fremove(tmpres);
 	}
 	return false;
 }
 
 
-stock dini_IntSet(filename[],key[],value) {
-   new valuestring[DINI_MAX_STRING];
-   format(valuestring,DINI_MAX_STRING,"%d",value);
+stock  dini_IntSet(filename[],key[],value) {
+   new valuestring[MAX_STRING];
+   format(valuestring,sizeof(valuestring),"%d",value);
    return dini_Set(filename,key,valuestring);
 }
 
-stock dini_Int(filename[],key[]) {
+stock  dini_Int(filename[],key[]) {
    return strval(dini_Get(filename,key));
 }
 
-stock dini_FloatSet(filename[],key[],Float:value) {
-   new valuestring[DINI_MAX_STRING];
-   format(valuestring,DINI_MAX_STRING,"%f",value);
+stock  dini_FloatSet(filename[],key[],Float:value) {
+   new valuestring[MAX_STRING];
+   format(valuestring,sizeof(valuestring),"%f",value);
    return dini_Set(filename,key,valuestring);
 }
 
-stock Float:dini_Float(filename[],key[]) {
+stock  Float:dini_Float(filename[],key[]) {
    return floatstr(dini_Get(filename,key));
 }
 
-stock dini_Bool(filename[],key[]) {
+stock  dini_Bool(filename[],key[]) {
    return strval(dini_Get(filename,key));
 }
 
-stock dini_BoolSet(filename[],key[],value) {
-	if (value) {
-		return dini_Set(filename,key,"1");
-	}
-	return dini_Set(filename,key,"0");
+stock  dini_BoolSet(filename[],key[],value) {
+   new valuestring[MAX_STRING];
+   format(valuestring,sizeof(valuestring),"%d",value);
+   return dini_Set(filename,key,valuestring);
 }
 
-stock dini_Unset(filename[],key[]) {
-	// If we have no key, it can't be set
-	// we also have no chance to unset the key, if all together is bigger then the max string
-	new key_length = strlen(key);
-	if (key_length==0 || key_length+2>DINI_MAX_STRING) return false;
-	
+stock  dini_Unset(filename[],key[]) {
 	new File:fohnd, File:fwhnd;
-	new tmpres[DINI_MAX_STRING];
-	
-	// Let's remove the old *.part file if there was one.
-	format(tmpres,DINI_MAX_STRING,"%s.part",filename);
-	fremove(tmpres);
-	
-	// We'll open the source file.
+	new tmpres[MAX_STRING];
+	format(tmpres,sizeof(tmpres),"%s.part",filename);
 	fohnd=fopen(filename,io_read);
 	if (!fohnd) return false;
-	
+	fremove(tmpres);
 	fwhnd=fopen(tmpres,io_write);
-	if (!fwhnd) {
-		// we can't open the second file for writing, so .. let's close the open one and exit.
-		fclose(fohnd);
-		return false;
-	}
-	
+	//  if (!fwhnd) return false;
 	while (fread(fohnd,tmpres)) {
-		if (
-			tmpres[key_length]=='='
-			&& !strcmp(tmpres, key, true, key_length)	
-		) {
-				// We've got what needs to be removed!
+		StripNewLine(tmpres);
+		if (equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) {
+			/* We've got what needs to be removed! */
 		} else {
-			DINI_StripNewLine(tmpres);
+			format(tmpres,sizeof(tmpres),"%s",tmpres);
 			fwrite(fwhnd,tmpres);
 			fwrite(fwhnd,"\r\n");
 		}
 	}
-	
+
 	fclose(fohnd);
 	fclose(fwhnd);
 
-	format(tmpres,DINI_MAX_STRING,"%s.part",filename);
-	if (DINI_fcopytextfile(tmpres,filename)) {
+	format(tmpres,sizeof(tmpres),"%s.part",filename);
+	if (fcopytextfile(tmpres,filename)) {
 		return fremove(tmpres);
 	}
 	return false;
 }
 
-stock dini_Get(filename[],key[]) {
-	new tmpres[DINI_MAX_STRING];
-	
-	new key_length = strlen(key);
-	if (key_length==0 || key_length+2>DINI_MAX_STRING) return tmpres;
-	
+stock  dini_Get(filename[],key[]) {
 	new File:fohnd;
+	new tmpres[MAX_STRING];
+	new tmpres2[MAX_STRING];
+	tmpres[0]=0;
 	fohnd=fopen(filename,io_read);
 	if (!fohnd) return tmpres;
-	
 	while (fread(fohnd,tmpres)) {
-		if (
-			tmpres[key_length]=='='
-			&& !strcmp(tmpres, key, true, key_length)	
-		) {
+		StripNewLine(tmpres);
+		if (equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) {
 			/* We've got what we need */
-			DINI_StripNewLine(tmpres);
-			strmid(tmpres, tmpres, key_length + 1, strlen(tmpres), DINI_MAX_STRING);
+			tmpres2[0]=0;
+			strcat(tmpres2,dini_PRIVATE_ExtractValue(tmpres));
 			fclose(fohnd);
-			return tmpres;
+			return tmpres2;
 		}
 	}
 	fclose(fohnd);
@@ -211,21 +181,15 @@ stock dini_Get(filename[],key[]) {
 }
 
 
-stock dini_Isset(filename[],key[]) {
-	new key_length = strlen(key);
-	if (key_length==0 || key_length+2>DINI_MAX_STRING) return false;
-	
+stock  dini_Isset(filename[],key[]) {
 	new File:fohnd;
+	new tmpres[MAX_STRING];
 	fohnd=fopen(filename,io_read);
 	if (!fohnd) return false;
-	
-	new tmpres[DINI_MAX_STRING];
 	while (fread(fohnd,tmpres)) {
-		if (
-				tmpres[key_length]=='='
-			&&  !strcmp(tmpres, key, true, key_length)	
-		) {
-			// We've got what we need
+		StripNewLine(tmpres);
+		if (equal(dini_PRIVATE_ExtractKey(tmpres),key,true)) {
+			/* We've got what we need */
 			fclose(fohnd);
 			return true;
 		}
@@ -233,36 +197,3 @@ stock dini_Isset(filename[],key[]) {
 	fclose(fohnd);
 	return false;
 }
-
-
-
-stock DINI_StripNewLine(string[]) {
-	new len = strlen(string);
-	if (string[0]==0) return ;
-	if ((string[len - 1] == '\n') || (string[len - 1] == '\r')) {
-		string[len - 1] = 0;
-		if (string[0]==0) return ;
-		if ((string[len - 2] == '\n') || (string[len - 2] == '\r')) string[len - 2] = 0;
-	}
-}
-
-stock DINI_fcopytextfile(oldname[],newname[]) {
-	new File:ohnd,File:nhnd;
-	if (!fexist(oldname)) return false;
-	ohnd=fopen(oldname,io_read);
-	if (!ohnd) return false;
-	nhnd=fopen(newname,io_write);
-	if (!nhnd) {
-		fclose(ohnd);
-		return false;
-	}
-	new tmpres[DINI_MAX_STRING];
-	while (fread(ohnd,tmpres)) {
-		DINI_StripNewLine(tmpres);
-		format(tmpres,sizeof(tmpres),"%s\r\n",tmpres);
-		fwrite(nhnd,tmpres);
-	}
-	fclose(ohnd);
-	fclose(nhnd);
-	return true;
-}

+ 49 - 169
pawno/include/OPSP.inc

@@ -1,8 +1,7 @@
 /********************************************
- * OnPlayerShootPlayer! V8.3	            *
- * Credits: wups			  				*
- * Double-O-Seven for CrossProduct system   *
- * Nero3D for GetPlayerCameraWeaponVector   *
+ * OnPlayerShootPlayer! V5.0	            *
+ * Credits: wups,			    *
+ * Double-O-Seven for his HS functions      *
  ********************************************/
 
 // include
@@ -19,6 +18,9 @@
 	#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
 	#define __SSCANF_FOREACH__
 #endif
+#if defined FILTERSCRIPT
+	#error "OnPlayerShootPlayer ERROR: You must include it in your game mode, not in your filterscript!"
+#endif
 #if !defined PRESSED
 	#define PRESSED(%0) \
 		(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
@@ -28,7 +30,7 @@
 		(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
 #endif
 // variables
-static 		
+static
 		Float:RL_phealth[MAX_PLAYERS],
 		Float:RL_parmour[MAX_PLAYERS],
 		bool:RL_Shooting[MAX_PLAYERS],
@@ -41,134 +43,19 @@ static
 // forwards
 forward OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost);
 
-
-/*--------------------------------------------------------------------------------------------------
-	Function:
-		AdjustVector
-	Params:
-		& Float: vX - x Vector to adjust
-		& Float: vY - y Vector to adjust
-		& Float: vZ - z Vector to adjust
-		Float: oX - x Offset Vector
-		Float: oY - y Offset Vector
-		const Float: oZ - z Offset Vector
-	Return:
-		-
-	Notes:
-		Adjust the vector with the offset
---------------------------------------------------------------------------------------------------*/
-
-stock AdjustVector(& Float: vX, & Float: vY, & Float: vZ, Float: oX, Float: oY, const Float: oZ) { // Credits Nero_3D
-	static
-		Float: Angle;
-	Angle = -atan2(vX, vY);
-	if(45.0 < Angle) {
-		oX ^= oY;
-		oY ^= oX;
-		oX ^= oY;
-		if(90.0 < Angle) {
-			oX *= -1;
-			if(135.0 < Angle) {
-				oX *= -1;
-				oX ^= oY;
-				oY ^= oX;
-				oX ^= oY;
-				oX *= -1;
-			}
-		}
-	} else if(Angle < 0.0) {
-		oY *= -1;
-		if(Angle < -45.0) {
-			oX *= -1;
-			oX ^= oY;
-			oY ^= oX;
-			oX ^= oY;
-			oX *= -1;
-			if(Angle < -90.0) {
-				oX *= -1;
-				if(Angle < -135.0) {
-					oX ^= oY;
-					oY ^= oX;
-					oX ^= oY;
-				}
-			}
-		}
-	}
-	vX += oX,
-	vY += oY;
-	vZ += oZ;
-	return false;
-}
-/*--------------------------------------------------------------------------------------------------
-	Function:
-		GetPlayerCameraWeaponVector
-	Params:
-		playerid - Player to get the weapon vector of
-		& Float: vX - x Vector variable
-		& Float: vY - y Vector variable
-		& Float: vZ - z Vector variable
-	Return:
-		If the player is connected
-	Notes:
-		Gets the weapon vector of the player
-
-native GetPlayerCameraWeaponVector(playerid, & Float: vX, & Float: vY, & Float: vZ);
---------------------------------------------------------------------------------------------------*/
-stock GetPlayerCameraWeaponVector(playerid, & Float: vX, & Float: vY, & Float: vZ) { // Credits Nero_3D
-	static
-		weapon;
-	if(21 < (weapon = GetPlayerWeapon(playerid)) < 39) {
-		GetPlayerCameraFrontVector(playerid, vX, vY, vZ);
-		switch(weapon) {
-			case WEAPON_SNIPER, WEAPON_ROCKETLAUNCHER, WEAPON_HEATSEEKER: {}
-			case WEAPON_RIFLE: {
-				AdjustVector(vX, vY, vZ, 0.016204, 0.009899, 0.047177);
-			}
-			case WEAPON_AK47, WEAPON_M4: {
-				AdjustVector(vX, vY, vZ, 0.026461, 0.013070, 0.069079);
-			}
-			default: {
-				AdjustVector(vX, vY, vZ, 0.043949, 0.015922, 0.103412);
-			}
-		}
-		return true;
-	}
-	else
-		GetPlayerCameraFrontVector(playerid, vX, vY, vZ);
-	return false;
-}
-stock crossp(Float:v1x, Float:v1y, Float:v1z, Float:v2x, Float:v2y, Float:v2z, &Float:output)
-{
-	new
-		Float:c1 = (v1y * v2z) - (v1z * v2y),
-		Float:c2 = (v1z * v2x) - (v1x * v2z),
-		Float:c3 = (v1x * v2y) - (v1y * v2x);
-	output = floatsqroot ((c1 * c1) + (c2 * c2) + (c3 * c3));
-	return 0;
-}
-stock GetDistanceFromPointToLine(&Float:distance, Float:line_vector_x, Float:line_vector_y, Float:line_vector_z, Float:line_x, Float:line_y, Float:line_z, Float:point_x, Float:point_y, Float:point_z)
-{
-	//A line is defined by a point (which is on the line (line_x/y/z)) and a vector which defines the direction (line_vector_x/y/z).
-	static Float:output;
-	crossp(line_vector_x, line_vector_y, line_vector_z, point_x - line_x, point_y - line_y, point_z - line_z, output);//Cross product of 2 vectors.
-	distance = output / floatsqroot ((line_vector_x * line_vector_x) + (line_vector_y * line_vector_y) + (line_vector_z * line_vector_z));
-	return 0;
-}
-
-
 public OnPlayerUpdate(playerid)
 {
 	static  Float:RL_HP,
 			Float:RL_Armour;
 	GetPlayerHealth(playerid,RL_HP);
 	GetPlayerArmour(playerid,RL_Armour);
-	if(RL_HP != RL_phealth[playerid] || RL_Armour != RL_parmour[playerid])
+	if(RL_HP < RL_phealth[playerid] || RL_Armour < RL_parmour[playerid])
 	{
 		if(RL_UpdatedHealth[playerid])
 			RL_UpdatedHealth[playerid]=false;
 		else
 		{
-			new 
+			static
 					Float:RL_PlayerPos[3],
 					Float:RL_Distance,
 					Float:RL_CameraPos[3],
@@ -183,11 +70,10 @@ public OnPlayerUpdate(playerid)
 				{
 					if(i != playerid)
 					{
+						GetPlayerCameraFrontVector(i, RL_CameraVectors[0], RL_CameraVectors[1], RL_CameraVectors[2]);
+						GetPlayerCameraPos(i, RL_CameraPos[0], RL_CameraPos[1], RL_CameraPos[2]);
 						if(IsPlayerInRangeOfPoint(i,200.0,RL_PlayerPos[0], RL_PlayerPos[1], RL_PlayerPos[2]))
 						{
-							GetPlayerCameraWeaponVector(i, RL_CameraVectors[0], RL_CameraVectors[1], RL_CameraVectors[2]);
-							
-							GetPlayerCameraPos(i, RL_CameraPos[0], RL_CameraPos[1], RL_CameraPos[2]);
 							GetDistanceFromPointToLine(RL_Distance, RL_CameraVectors[0], RL_CameraVectors[1], RL_CameraVectors[2], RL_CameraPos[0], RL_CameraPos[1], RL_CameraPos[2], RL_PlayerPos[0], RL_PlayerPos[1], RL_PlayerPos[2]);
 							if(RL_Distance < 2.5)
 							{
@@ -205,11 +91,28 @@ public OnPlayerUpdate(playerid)
 	return (RL_OPUP)?CallLocalFunction("RL_OnPlayerUpdate","i",playerid):1;
 }
 // Functions
+stock crossp(Float:v1x, Float:v1y, Float:v1z, Float:v2x, Float:v2y, Float:v2z, &Float:output)
+{
+	new
+		Float:c1 = (v1y * v2z) - (v1z * v2y),
+		Float:c2 = (v1z * v2x) - (v1x * v2z),
+		Float:c3 = (v1x * v2y) - (v1y * v2x);
+	output = floatsqroot ((c1 * c1) + (c2 * c2) + (c3 * c3));
+	return 0;
+}
 
+stock GetDistanceFromPointToLine(&Float:distance, Float:line_vector_x, Float:line_vector_y, Float:line_vector_z, Float:line_x, Float:line_y, Float:line_z, Float:point_x, Float:point_y, Float:point_z)
+{
+	//A line is defined by a point (which is on the line (line_x/y/z)) and a vector which defines the direction (line_vector_x/y/z).
+	static Float:output;
+	crossp(line_vector_x, line_vector_y, line_vector_z, point_x - line_x, point_y - line_y, point_z - line_z, output);//Cross product of 2 vectors.
+	distance = output / floatsqroot ((line_vector_x * line_vector_x) + (line_vector_y * line_vector_y) + (line_vector_z * line_vector_z));
+	return 0;
+}
 // SetPlayerHealth
 stock SetPlayerHealthEx(playerid, Float:health)
 {
-//	RL_phealth[playerid]=health;
+	RL_phealth[playerid]=health;
 	RL_UpdatedHealth[playerid]=true;
 	return SetPlayerHealth(playerid, health);
 }
@@ -219,7 +122,7 @@ stock SetPlayerHealthEx(playerid, Float:health)
 // SetPlayerArmour
 stock SetPlayerArmourEx(playerid, Float:armour)
 {
-//	RL_parmour[playerid]=armour;
+	RL_parmour[playerid]=armour;
 	RL_UpdatedHealth[playerid]=true;
 	return SetPlayerArmour(playerid, armour);
 }
@@ -263,7 +166,7 @@ public OnPlayerStateChange(playerid, newstate, oldstate)
 			RL_UpdatedHealth[playerid]=false;
 		else
 		{
-			new
+			static
 					Float:RL_PlayerPos[3],
 					Float:RL_Distance,
 					Float:RL_CameraPos[3],
@@ -272,8 +175,6 @@ public OnPlayerStateChange(playerid, newstate, oldstate)
 					Float:RL_HP,
 					Float:RL_Armour
 					;
-			GetPlayerHealth(playerid,RL_HP);
-			GetPlayerArmour(playerid,RL_Armour);
 			RL_Tick = (GetTickCount()-1000);
 			GetPlayerPos(playerid, RL_PlayerPos[0], RL_PlayerPos[1], RL_PlayerPos[2]);
 			foreach(Player,i)
@@ -282,7 +183,7 @@ public OnPlayerStateChange(playerid, newstate, oldstate)
 				{
 					if(i != playerid)
 					{
-						GetPlayerCameraWeaponVector(i, RL_CameraVectors[0], RL_CameraVectors[1], RL_CameraVectors[2]);
+						GetPlayerCameraFrontVector(i, RL_CameraVectors[0], RL_CameraVectors[1], RL_CameraVectors[2]);
 						GetPlayerCameraPos(i, RL_CameraPos[0], RL_CameraPos[1], RL_CameraPos[2]);
 						if(IsPlayerInRangeOfPoint(i,200.0,RL_PlayerPos[0], RL_PlayerPos[1], RL_PlayerPos[2]))
 						{
@@ -297,7 +198,7 @@ public OnPlayerStateChange(playerid, newstate, oldstate)
 				}
 			}
 		}
-		
+
 	}
 	RL_Shooting[playerid]=false;
 	RL_Released[playerid]=GetTickCount();
@@ -312,7 +213,6 @@ public OnPlayerStateChange(playerid, newstate, oldstate)
 
 forward RL_OnPlayerStateChange(playerid,newstate, oldstate);
 
-
 // OnPlayerConnect
 public OnPlayerConnect(playerid)
 {
@@ -329,41 +229,21 @@ public OnPlayerConnect(playerid)
 #define OnPlayerConnect RL_OnPlayerConnect
 
 forward RL_OnPlayerConnect(playerid);
-#if !defined FILTERSCRIPT
-	// OnGameModeInit
-	public OnGameModeInit()
-	{
-		RL_OPUP = (funcidx("RL_OnPlayerUpdate") != -1);
-		RL_OPSC = (funcidx("RL_OnPlayerStateChange") != -1);
-		RL_OPKSC = (funcidx("RL_OnPlayerKeyStateChange") != -1);
-		RL_OPC = (funcidx("RL_OnPlayerConnect") != -1);
-		return (funcidx("RL_OnGameModeInit") != -1)?CallLocalFunction("RL_OnGameModeInit",""):1;
-	}
-	#if defined _ALS_OnGameModeInit
-		#undef OnGameModeInit
-	#else
-		#define _ALS_OnGameModeInit
-	#endif
-	#define OnGameModeInit RL_OnGameModeInit
-	forward RL_OnGameModeInit();
+
+// OnGameModeInit
+public OnGameModeInit()
+{
+	RL_OPUP = (funcidx("RL_OnPlayerUpdate") != -1);
+	RL_OPSC = (funcidx("RL_OnPlayerStateChange") != -1);
+	RL_OPKSC = (funcidx("RL_OnPlayerKeyStateChange") != -1);
+	RL_OPC = (funcidx("RL_OnPlayerConnect") != -1);
+	return (funcidx("RL_OnGameModeInit") != -1)?CallLocalFunction("RL_OnGameModeInit",""):1;
+}
+#if defined _ALS_OnGameModeInit
+	#undef OnGameModeInit
 #else
-	// OnFilterScriptInit
-	public OnFilterScriptInit()
-	{
-		RL_OPUP = (funcidx("RL_OnPlayerUpdate") != -1);
-		RL_OPSC = (funcidx("RL_OnPlayerStateChange") != -1);
-		RL_OPKSC = (funcidx("RL_OnPlayerKeyStateChange") != -1);
-		RL_OPC = (funcidx("RL_OnPlayerConnect") != -1);
-		return (funcidx("RL_OnFilterScriptInit") != -1)?CallLocalFunction("RL_OnFilterScriptInit",""):1;
-	}
-	#if defined _ALS_OnFilterScriptInit
-		#undef OnFilterScriptInit
-	#else
-		#define _ALS_OnFilterScriptInit
-	#endif
-	#define OnFilterScriptInit RL_OnFilterScriptInit. 
-	forward RL_OnFilterScriptInit();
+	#define _ALS_OnGameModeInit
 #endif
-
-
-// The end.
+#define OnGameModeInit RL_OnGameModeInit
+forward RL_OnGameModeInit();
+// The end.

+ 2 - 2
pawno/include/SII.inc

@@ -11,12 +11,12 @@
 #if defined MAX_STRING
 	#define INI_MAX_VALUE MAX_STRING
 #else
-	#define INI_MAX_VALUE 256
+	#define INI_MAX_VALUE 128
 #endif
 #define INI_MAX_KEY 24
 #define INI_MAX_LINE (INI_MAX_KEY + INI_MAX_VALUE + 3)
 #define INI_MAX_FILENAME 256
-#define INI_MAX_LINES 768
+#define INI_MAX_LINES 256
 
 
 enum E_CACHE

+ 38 - 38
pawno/include/SKY.inc

@@ -1,38 +1,38 @@
-#if defined _INC_SKY
-    #endinput
-#endif
-#define _INC_SKY
-
-// Make a player appear to spawn for all players but himself
-native SpawnPlayerForWorld(playerid);
-// Keep re-sending the last received sync data
-native FreezeSyncData(playerid, bool:toggle);
-// Set the HP bar (warning: affects GetPlayerHealth)
-native SetFakeHealth(playerid, health);
-// Set the armour bar (warning: affects GetPlayerArmour)
-native SetFakeArmour(playerid, armour);
-// Force a specific facing angle to sync for other players
-native SetFakeFacingAngle(playerid, Float:angle = Float:0x7FFFFFFF);
-// Disable stealth-knife sync (only the player doing it will see it happen)
-native SetKnifeSync(toggle);
-// Make a player appear dead for other players
-native SendDeath(playerid);
-// Set the last animation data
-native SetLastAnimationData(playerid, data);
-// Send the last sync data
-// If an animation is specified, it will be similar to ApplyAnimation
-native SendLastSyncData(playerid, toplayerid, animation = 0);
-// Clear animations for another player only
-native ClearAnimationsForPlayer(playerid, forplayerid);
-// Disable infinity ammo bugs and other bugs (some bugs still work)
-native SetDisableSyncBugs(toggle);
-// Make the weapon state always synced as WEAPONSTATE_MORE_BULLETS
-native SetInfiniteAmmoSync(playerid, toggle);
-// Stop syncing keys for a player
-native SetKeySyncBlocked(playerid, toggle);
-// Same as YSF (renamed to avoid problems)
-native TextDrawSetPosition(Text:text, Float:x, Float:y);
-// Same as YSF (renamed to avoid problems)
-native PlayerTextDrawSetPosition(playerid, PlayerText:text, Float:x, Float:y);
-// Set the string of a TextDraw per-player
-native TextDrawSetStringForPlayer(Text:text, playerid, const string[]);
+#if defined _INC_SKY
+    #endinput
+#endif
+#define _INC_SKY
+
+// Make a player appear to spawn for all players but himself
+native SpawnPlayerForWorld(playerid);
+// Keep re-sending the last received sync data
+native FreezeSyncData(playerid, bool:toggle);
+// Set the HP bar (warning: affects GetPlayerHealth)
+native SetFakeHealth(playerid, health);
+// Set the armour bar (warning: affects GetPlayerArmour)
+native SetFakeArmour(playerid, armour);
+// Force a specific facing angle to sync for other players
+native SetFakeFacingAngle(playerid, Float:angle = Float:0x7FFFFFFF);
+// Disable stealth-knife sync (only the player doing it will see it happen)
+native SetKnifeSync(toggle);
+// Make a player appear dead for other players
+native SendDeath(playerid);
+// Set the last animation data
+native SetLastAnimationData(playerid, data);
+// Send the last sync data
+// If an animation is specified, it will be similar to ApplyAnimation
+native SendLastSyncData(playerid, toplayerid, animation = 0);
+// Clear animations for another player only
+native ClearAnimationsForPlayer(playerid, forplayerid);
+// Disable infinity ammo bugs and other bugs (some bugs still work)
+native SetDisableSyncBugs(toggle);
+// Make the weapon state always synced as WEAPONSTATE_MORE_BULLETS
+native SetInfiniteAmmoSync(playerid, toggle);
+// Stop syncing keys for a player
+native SetKeySyncBlocked(playerid, toggle);
+// Same as YSF (renamed to avoid problems)
+native TextDrawSetPosition(Text:text, Float:x, Float:y);
+// Same as YSF (renamed to avoid problems)
+native PlayerTextDrawSetPosition(playerid, PlayerText:text, Float:x, Float:y);
+// Set the string of a TextDraw per-player
+native TextDrawSetStringForPlayer(Text:text, playerid, const string[]);

+ 640 - 1013
pawno/include/YSI.inc

@@ -1,1022 +1,649 @@
-/*----------------------------------------------------------------------------*\
-                                        =======================================
-                                          YSI - YSI Server Includes functions
-                                        =======================================
+/*----------------------------------------------------------------------------*-
+					=======================
+					Y Sever Includes - Main
+					=======================
 Description:
-        Lists all the functions available in YSI for PAWNO.
+	Main include to use the YSI script libraries.  Simply add:
+	
+	#include <YSI>
+	
+	to the top of your script to get the full power of all the YSI libraries
+	and the functions and features they expose.
 Legal:
-        Version: MPL 1.1
-       
-        The contents of this file are subject to the Mozilla Public License Version
-        1.1 (the "License"); you may not use this file except in compliance with
-        the License. You may obtain a copy of the License at
-        http://www.mozilla.org/MPL/
-       
-        Software distributed under the License is distributed on an "AS IS" basis,
-        WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-        for the specific language governing rights and limitations under the
-        License.
-       
-        The Original Code is the YSI group include.
-       
-        The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-        Portions created by the Initial Developer are Copyright (C) 2011
-        the Initial Developer. All Rights Reserved.
-       
-        Contributors:
-                ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
-       
-        Thanks:
-                JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
-                ZeeX - Very productive conversations.
-                koolk - IsPlayerinAreaEx code.
-                TheAlpha - Danish translation.
-                breadfish - German translation.
-                Fireburn - Dutch translation.
-                yom - French translation.
-                50p - Polish translation.
-                Zamaroht - Spanish translation.
-                Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes
-                        for me to strive to better.
-                Pixels^ - Running XScripters where the idea was born.
-                Matite - Pestering me to release it and using it.
-       
-        Very special thanks to:
-                Thiadmer - PAWN, whose limits continue to amaze me!
-                Kye/Kalcor - SA:MP.
-                SA:MP Team past, present and future - SA:MP.
-       
+	Copyright (C) 2007 Alex "Y_Less" Cole
+
+	This program is free software; you can redistribute it and/or
+	modify it under the terms of the GNU General Public License
+	as published by the Free Software Foundation; either version 2
+	of the License, or (at your option) any later version.
+
+	This program is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with this program; if not, write to the Free Software
+	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+	MA 02110-1301, USA.
 Version:
-        1.0
+	0.1.3
 Changelog:
-        25/02/12:
-                First version
-\*----------------------------------------------------------------------------*/
- 
-#include <YSI\internal\y_version>
- 
-/*
- 
-native
-native __y_als__();
-native
-native
-native
- 
-*/
- 
-// CAN'T include by default.
-//#include <YSI\y_als>
- 
-/*
- 
-native
-native __y_amx__();
-native
-native
-native AMX_GetBaseCount(E_AMX_TABLE:table, &base, &count)
-native AMX_GetGlobalAddress(...);
-native AMX_Read(addr)
-native AMX_Write(addr, value)
-native AMX_ReadString(addr, str[], len = sizeof (str))
-native AMX_WriteString(addr, const str[], len = sizeof (str))
-native AMX_ReadArray(addr, dest[], len = sizeof (dest))
-native AMX_WriteArray(addr, const src[], len = sizeof (src))
-native
-native AMX_GetPublicEntry(idx, &buffer, const pattern[] = "")
-native AMX_GetNativeEntry(idx, &buffer, const pattern[] = "")
-native AMX_GetLibraryEntry(idx, &buffer, const pattern[] = "")
-native AMX_GetPubvarEntry(idx, &buffer, const pattern[] = "")
-native AMX_GetTagEntry(idx, &buffer, const pattern[] = "")
-native AMX_GetEntry(E_AMX_TABLE:table, idx, &buffer, const pattern[] = "")
-native
-native AMX_GetPublicEntryPrefix(idx, &buffer, pattern)
-native AMX_GetNativeEntryPrefix(idx, &buffer, pattern)
-native AMX_GetLibraryEntryPrefix(idx, &buffer, pattern)
-native AMX_GetPubvarEntryPrefix(idx, &buffer, pattern)
-native AMX_GetTagEntryPrefix(idx, &buffer, pattern)
-native AMX_GetEntryPrefix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
-native AMX_GetPublicEntrySuffix(idx, &buffer, pattern)
-native AMX_GetNativeEntrySuffix(idx, &buffer, pattern)
-native AMX_GetLibraryEntrySuffix(idx, &buffer, pattern)
-native AMX_GetPubvarEntrySuffix(idx, &buffer, pattern)
-native AMX_GetTagEntrySuffix(idx, &buffer, pattern)
-native AMX_GetEntrySuffix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
-native AMX_GetPublicName(idx, buffer[32], const pattern[] = "")
-native AMX_GetNativeName(idx, buffer[32], const pattern[] = "")
-native AMX_GetLibraryName(idx, buffer[32], const pattern[] = "")
-native AMX_GetPubvarName(idx, buffer[32], const pattern[] = "")
-native AMX_GetTagName(idx, buffer[32], const pattern[] = "")
-native AMX_GetName(E_AMX_TABLE:table, idx, buffer[32], const pattern[] = "")
-native
-native AMX_GetPublicNamePrefix(idx, buffer[32], pattern)
-native AMX_GetNativeNamePrefix(idx, buffer[32], pattern)
-native AMX_GetLibraryNamePrefix(idx, buffer[32], pattern)
-native AMX_GetPubvarNamePrefix(idx, buffer[32], pattern)
-native AMX_GetTagNamePrefix(idx, buffer[32], pattern)
-native AMX_GetNamePrefix(E_AMX_TABLE:table, idx, buffer[32], pattern)
-native
-native AMX_GetPublicNameSuffix(idx, buffer[32], pattern)
-native AMX_GetNativeNameSuffix(idx, buffer[32], pattern)
-native AMX_GetLibraryNameSuffix(idx, buffer[32], pattern)
-native AMX_GetPubvarNameSuffix(idx, buffer[32], pattern)
-native AMX_GetTagNameSuffix(idx, buffer[32], pattern)
-native AMX_GetNameSuffix(E_AMX_TABLE:table, idx, buffer[32], pattern)
-native
-native AMX_GetPublicPointer(idx, &buffer, const pattern[] = "")
-native AMX_GetNativePointer(idx, &buffer, const pattern[] = "")
-native AMX_GetLibraryPointer(idx, &buffer, const pattern[] = "")
-native AMX_GetPubvarPointer(idx, &buffer, const pattern[] = "")
-native AMX_GetTagPointer(idx, &buffer, const pattern[] = "")
-native AMX_GetPointer(E_AMX_TABLE:table, idx, &buffer, const pattern[] = "")
-native
-native AMX_GetPublicPointerPrefix(idx, &buffer, pattern)
-native AMX_GetNativePointerPrefix(idx, &buffer, pattern)
-native AMX_GetLibraryPointerPrefix(idx, &buffer, pattern)
-native AMX_GetPubvarPointerPrefix(idx, &buffer, pattern)
-native AMX_GetTagPointerPrefix(idx, &buffer, pattern)
-native AMX_GetPointerPrefix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
-native AMX_GetPublicPointerSuffix(idx, &buffer, pattern)
-native AMX_GetNativePointerSuffix(idx, &buffer, pattern)
-native AMX_GetLibraryPointerSuffix(idx, &buffer, pattern)
-native AMX_GetPubvarPointerSuffix(idx, &buffer, pattern)
-native AMX_GetTagPointerSuffix(idx, &buffer, pattern)
-native AMX_GetPointerSuffix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
-native AMX_GetPublicValue(idx, &buffer, const pattern[] = "")
-native AMX_GetNativeValue(idx, &buffer, const pattern[] = "")
-native AMX_GetLibraryValue(idx, &buffer, const pattern[] = "")
-native AMX_GetPubvarValue(idx, &buffer, const pattern[] = "")
-native AMX_GetTagValue(idx, &buffer, const pattern[] = "")
-native AMX_GetValue(E_AMX_TABLE:table, idx, &buffer, const pattern[] = "")
-native
-native AMX_GetPublicValuePrefix(idx, &buffer, pattern)
-native AMX_GetNativeValuePrefix(idx, &buffer, pattern)
-native AMX_GetLibraryValuePrefix(idx, &buffer, pattern)
-native AMX_GetPubvarValuePrefix(idx, &buffer, pattern)
-native AMX_GetTagValuePrefix(idx, &buffer, pattern)
-native AMX_GetValuePrefix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
-native AMX_GetPublicValueSuffix(idx, &buffer, pattern)
-native AMX_GetNativeValueSuffix(idx, &buffer, pattern)
-native AMX_GetLibraryValueSuffix(idx, &buffer, pattern)
-native AMX_GetPubvarValueSuffix(idx, &buffer, pattern)
-native AMX_GetTagValueSuffix(idx, &buffer, pattern)
-native AMX_GetValueSuffix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
- 
-*/
- 
-#include <YSI\y_amx>
- 
-/*
- 
-native
-native __y_areas__();
-native
-native
-native Area_AddCube(Float:x0, Float:y0, Float:z0, Float:x1, Float:y1, Float:z1);
-native Area_AddBox(Float:minx, Float:miny, Float:maxx, Float:maxy);
-native Area_AddCircle(Float:x, Float:y, Float:r, Float:h = FLOAT_INFINITY)
-native Area_AddSphere(Float:x, Float:y, Float:z, Float:r);
-native Area_AddPoly(Float:x1, Float:y1, Float:x2, Float:y2, Float:x3, Float:y3, Float:...);
-native Area_Delete(area);
-native Area_GetPlayerArea(playerid);
-native Area_SetPlayer(area, playerid, bool:set);
-native bool:Area_GetPlayer(area, playerid);
-native Area_SetAllPlayers(area, bool:set);
-native Area_SetWorld(area, world, bool:set);
-native bool:Area_GetWorld(area, world);
-native Area_SetAllWorlds(area, bool:set);
-native bool:Area_IsValid(area);
-native bool:Area_IsEmpty(area);
-native
- 
-*/
- 
-#include <YSI\y_areas>
- 
-/*
- 
-native
-native __y_bintree__();
-native
-native
-native Bintree_Generate(BinaryTree:output<>, input[][E_BINTREE_INPUT], size);
-native Bintree_Reset(BinaryTree:tree<>, pointer = 0);
-native Bintree_FindValue(BinaryTree:tree<>, value, &cont = 0, &old = 0);
-native Bintree_Add(BinaryTree:data<>, pointer, value, offset, maxsize = sizeof (data));
-native Bintree_Delete(BinaryTree:source<>, index, count);
-native Bintree_UpdatePointers(BinaryTree:data<>, offset, size, mod = -1);
-native
- 
-*/
- 
-#include <YSI\y_bintree>
- 
-/*
- 
-native
-native __y_bit__();
-native
-native
-native Bit_Set(BitArray:array<>, slot, bool:set);
-native Bit_SetAll(BitArray:array<>, bool:set, size = sizeof (array));
-native Bit_Get(BitArray:array<>, slot);
-native Bit_Let(BitArray:array<>, slot);
-native Bit_Vet(BitArray:array<>, slot);
-native Bit_Slot(value);
-native Bit_Mask(value);
-native Bit_GetCount(BitArray:array<>, size = sizeof (array));
-native Bit_Display(BitArray:array<>, size = sizeof (array));
-native Iterator:Bits(BitArray:array<>);
-native Iterator:Blanks(BitArray:array<>);
-native
-native bits();
-native bitsof();
-native
- 
-*/
- 
-#include <YSI\y_bit>
- 
-/*
- 
-native
-native __y_cell__();
-native
-native
-native Cell_ReverseBits({Float, _}:data);
-native Cell_ReverseNibbles({Float, _}:data);
-native Cell_ReverseBytes({Float, _}:data);
-native Cell_CountBits({Float, _}:data);
-native Cell_GetLowestBit({Float, _}:data);
-native Cell_GetLowestComponent({Float, _}:data);
-native
- 
-*/
- 
-#include <YSI\y_cell>
- 
-/*
- 
-native
-native __y_classes__();
-native
-native
-native Class_Add(skin, Float:x, Float:y, Float:z, Float:a, ...);
-native
-native Class_AddEx(Group:forgroup, Group:setgroup, skin, Float:x, Float:y, Float:z, Float:a, ...);
-native Class_AddForGroup(Group:group, skin, Float:x, Float:y, Float:z, Float:a, ...);
-native Class_AddWithGroupSet(Group:group, skin, Float:x, Float:y, Float:z, Float:a, ...);
-native Class_Enable(classid, bool:toggle);
-native Class_Delete(classid);
-native Class_SetPlayer(classid, playerid, bool:s);
-native bool:Class_GetPlayer(classid, playerid);
-native Class_Get(playerid);
-native Class_Goto(playerid, playerclass);
-native
-native Class_DisableSelection(playerid);
-native Class_DisableReselection(playerid);
-native Class_EnableReselection(playerid);
-native Class_ForceReselection(playerid);
-native Class_ReturnToSelection(playerid);
-native
- 
-*/
- 
-#include <YSI\y_classes>
- 
-/*
- 
-native
-native __y_colours__();
-native __y_colors__();
-native
-native
-native SetColoursCanHaveSpaces(bool:set);
-native SetColour(const name[], color);
-native SetColourHash(hash, color);
-native GetColour(const name[], alpha = 0xAA);
-native GetColourStream(const str[], &idx, alpha = 0xAA);
-native GetColourHash(hash, alpha = 0xAA);
-native
- 
-*/
- 
-#include <YSI\y_colours>
- 
-/*
- 
-native
-native __y_commands__();
-native
-native
-native Command_AddAlt(commandid, altname[]);
-native Command_AddAltNamed(command[], altname[]);
-native Command_SetPlayer(commandid, playerid, bool:set);
-native Command_SetPlayerNamed(command[], playerid, bool:set);
-native
-native Command_SetDeniedReturn(bool:set);
-native bool:Command_GetDeniedReturn();
-native Command_SetIllegalReturn(bool:set);
-native bool:Command_GetIllegalReturn();
-native Command_SetUnknownReturn(bool:set);
-native bool:Command_GetUnknownReturn();
-native Command_SetDisconnectReturn(bool:set);
-native bool:Command_GetDisconnectReturn();
-native
-native Command_GetID(command[]);
-native bool:Command_GetPlayer(commandid, playerid);
-native bool:Command_GetPlayerNamed(command[], playerid);
-native Command_Remove(commandid);
-native Command_RemoveNamed(command[]);
-native Command_ReProcess(playerid, cmdtext[], help);
-native Command_GetName(commandid);
-native Command_GetDisplay(commandid, playerid);
-native Command_GetDisplayNamed(command[], playerid);
-native Command_GetPlayerCommandCount(playerid);
-native Command_GetNext(index, playerid);
-native
-native Command_SetProvider(p);
-native Command_GetProvider();
-native Command_SetPlayerProvider(playerid, p);
-native Command_GetPlayerProvider(playerid);
-native
- 
-*/
- 
-#include <YSI\y_commands>
- 
-/*
- 
-native
-native __y_debug__();
-native
-native
-native P_level(str[], {Float, _}:...);
-native P_I(str[], {Float, _}:...);
-native P_W(str[], {Float, _}:...);
-native P_E(str[], {Float, _}:...);
-native P_F(str[], {Float, _}:...);
-native P_C(str[], {Float, _}:...);
-native
- 
-*/
- 
-#include <YSI\y_debug>
- 
-/*
- 
-native
-native __y_dialog__();
-native
-native
-native Dialog_Show(playerid, style, title[], caption[], button1[], button2[] = "", dialogid = -1);
-native Dialog_ShowCallback(playerid, using:callback[], style, title[], caption[], button1[], button2[] = "", dialogid = -1);
-native
-native Dialog_ObtainID();
-native Dialog_TryObtainID(id);
-native Dialog_Get(playerid);
-native Dialog_Garbage(dialogid);
-native Dialog_Free(dialogid);
-native Dialog_Set(playerid, dialogid);
-native Dialog_ShowCallbackData(playerid, callback[E_CALLBACK_DATA], style, title[], caption[], button1[], button2[] = "", dialogid = -1);
-native Dialog_Hide(playerid);
-native Dialog_SetCallback(dialogid, using:callback[]);
-native Dialog_SetCallbackData(dialogid, callback[E_CALLBACK_DATA]);
-native
- 
-*/
- 
-#include <YSI\y_dialog>
- 
-/*
- 
-native
-native __y_flooding__();
-native
-native
-native SetMaxConnections(max = -1, e_FLOOD_ACTION:action = e_FLOOD_ACTION_BLOCK)
-native
- 
-*/
- 
-#include <YSI\y_flooding>
- 
-/*
- 
-native
-native __y_groups__();
-native
-native
-native Group:Group_Create(name[]);
-native Group_Destroy(Group:group);
-native Group_SetPlayer(Group:group, playerid, bool:s);
-native bool:Group_GetPlayer(Group:group, playerid);
-native
-native Group_SetCommand(Group:group, commandid, bool:s);
-native Group_SetCommandDefault(Group:group, bool:s);
-native Group_SetGlobalCommand(commandid, bool:s);
-native Group_SetGlobalCommandDefault(bool:s);
-native
-native Group_SetArea(Group:group, area, bool:s);
-native Group_SetAreaDefault(Group:group, bool:s);
-native Group_SetGlobalArea(area, bool:s);
-native Group_SetGlobalAreaDefault(bool:s);
-native
-native Group_SetClass(Group:group, class, bool:s);
-native Group_SetClassDefault(Group:group, bool:s);
-native Group_SetGlobalClass(class, bool:s);
-native Group_SetGlobalCalssDefault(bool:s);
-native
-native Iterator:PlayerGroups(playerid)
-native Iterator:Group(Group:group)
-native
-native Group:Group_SetBalanced(playerid, Group:...)
-native Group_GetColour(Group:group);
-native Group_GetColor(Group:group);
-native Group_SetColour(Group:group, colour);
-native Group_SetColor(Group:group, color);
-native bool:Group_GetGang(Group:group);
-native Group_SetGang(Group:group, bool:set);
-native Group:Group_GetID(name[]);
-native Group_GetName(Group:group);
-native Group_SetName(Group:group, name[]);
-native
- 
-*/
- 
-#include <YSI\y_groups>
- 
-/*
- 
-native
-native __y_hooks__();
-native
-native
-native hook();
-native
- 
-*/
- 
-// Is included as then they can use hooks straight off.
-#include <YSI\y_hooks>
- 
-/*
- 
-native
-native __y_ini__();
-native
-native
-native bool:INI_ParseFile(fname[], remoteFormat[], bool:bFileFirst = false, bool:bExtra = false, extra = 0, bool:bLocal = true, bool:bPassTag = false, bool:bFilter = true, filter[] = "")
-native bool:INI_Load(filename[], bool:bExtra = false, extra = 0, bool:bLocal = true)
-native
-native INI_Int(name[], &dest);
-native INI_Float(name[], &Float:dest);
-native INI_Hex(name[], &dest);
-native INI_Bin(name[], &dest);
-native INI_String(name[], dest[], size);
-native
-native INI:INI_Open(filename[])
-native INI_Close(INI:file)
-native
-native INI_SetTag(INI:file, tag[])
-native INI_DeleteTag(INI:file, tag[])
-native INI_WriteArray(INI:file, const name[], data[], len)
-native INI_RemoveEntry(INI:file, name[])
-native INI_WriteString(INI:file, name[], data[])
-native INI_WriteInt(INI:file, name[], data)
-native INI_WriteHex(INI:file, name[], data)
-native INI_WriteBin(INI:file, name[], data)
-native INI_WriteBool(INI:file, name[], bool:data)
-native INI_WriteFloat(INI:file, name[], Float:data, accuracy = 6)
-native
- 
-*/
- 
-#include <YSI\y_ini>
- 
-/*
- 
-native
-native __y_inline__();
-native
-native
-native using();
-native inline();
-native
-native Callback_Get(callback:name, result[E_CALLBACK_DATA], expect = -1);
-native Callback_Release(const input[E_CALLBACK_DATA]);
-native Callback_Call(const input[E_CALLBACK_DATA], {Float, _}:...);
-native
- 
-*/
- 
-#include <YSI\y_inline>
- 
-/*
- 
-native
-native __y_iterate__();
-native
-native
-native Iter_Init(Iterator:arr[]<>);
-native Iter_Add(Iterator:iter<>, element);
-native Iter_Remove(Iterator:iter<>, element);
-native Iter_Contains(Iterator:iter<>, element);
-native Iter_SafeRemove(Iterator:iter<>, element, &ret);
-native Iter_Random(Iterator:iter<>);
-native Iter_Count(Iterator:iter<>);
-native Iter_Clear(Iterator:iter<>);
-native Iter_Free(Iterator:iter<>);
-native
-native foreach();
-native
-native Iter_Begin(Iterator:iter<>);
-native Iter_End(Iterator:iter<>);
-native Iter_First(Iterator:iter<>);
-native Iter_Last(Iterator:iter<>);
-native Iter_Next(Iterator:iter<>, cur);
-native Iter_Prev(Iterator:iter<>, cur);
-native
- 
-*/
- 
-#include <YSI\y_iterate>
- 
-/*
- 
-native
-native __y_languages__();
-native
-native
-native Language:Langs_Add(code[], name[]);
-native Language:Langs_SetPlayerLanguage(playerid, Language:l);
-native Language:Langs_GetPlayerLanguage(playerid);
-native
-native Language:Langs_AddLanguage(code[], name[]);
-native Langs_RemoveLanguage(Language:l);
-native Language:Langs_GetLanguage(identifier[]);
-native Language:Langs_GetLanguageCount();
-native Langs_GetLanguageCodes();
-native Langs_GetName(Language:l);
-native Langs_GetCode(Language:l);
-native bool:Langs_IsValid(Language:l);
-native Language:Langs_SetPlayerCode(playerid, code[]);
-native
- 
-*/
- 
-#include <YSI\y_languages>
- 
-/*
- 
-native
-native __y_lock__();
-native
-native
-native
- 
-*/
- 
-// DO NOT include by default!
-//#include <YSI\y_lock>
- 
-/*
- 
-native
-native __y_malloc__();
-native
-native
-native Alloc:malloc(size);
-native Alloc:calloc(size);
-native free(Alloc:slot);
-native
-native mget(Alloc:array, index);
-native mset(Alloc:array, index, value);
-native mgets(target[], length, Alloc:array, index);
-native msets(Alloc:array, index, const str[]);
-native
-native Malloc_SlotSize(Alloc:array);
-native Malloc_Get(Alloc:array, index);
-native Malloc_Set(Alloc:array, index, value);
-native Malloc_GetS(target[], length, Alloc:array, index);
-native Malloc_SetS(Alloc:array, index, const str[]);
-native Malloc_GetA(target[], length, Alloc:array, index);
-native Malloc_SetA(Alloc:array, index, const arr[], len);
-native
- 
-*/
- 
-#include <YSI\y_malloc>
- 
-/*
- 
-native
-native __y_master__();
-native
-native
-native Master_Caller();
-native
-native foreign();
-native global();
-native
- 
-*/
- 
-#include <YSI\y_master>
- 
-/*
- 
-native
-native __y_php__();
-native
-native
-native PHP_SendString(string:name[], string:value[], bool:priority = false);
-native PHP_SendFloat(string:name[], Float:value, bool:priority = false);
-native PHP_SendBool(string:name[], bool:value, bool:priority = false);
-native PHP_SendInt(string:name[], value, bool:priority = false);
-native
-native phpdata();
-native phpfunc();
-native
- 
-*/
- 
-// DO NOT include by default!
-//#include <YSI\y_php>
- 
-/*
- 
-native
-native __y_playerarray__();
-native
-native
-native PA_Init(PlayerArray:pa<>, bool:init = false, s = bits<MAX_PLAYERS>);
-native PA_FastInit(PlayerArray:pa<>);
-native PA_Set(PlayerArray:pa<>, slot, bool:set);
-native PA_Let(PlayerArray:pa<>, slot);
-native PA_Vet(PlayerArray:pa<>, slot);
-native PA_Get(PlayerArray:pa<>, slot);
-native PA_GetCount(PlayerArray:pa<>);
-native Iterator:PA(PlayerArray:pa<>);
-native
- 
-*/
- 
-#include <YSI\y_playerarray>
- 
-/*
- 
-native
-native __y_playerset__();
-native
-native
-native Iterator:PS(@PlayerSet:iter);
-native
- 
-*/
- 
-#include <YSI\y_playerset>
- 
-/*
- 
-native
-native __y_remote__();
-native
-native
-native remotefunc();
-native broadcastfunc();
-native localfunc();
-native targetfunc();
-native
- 
-*/
- 
-#include <YSI\y_remote>
- 
-/*
- 
-native
-native __y_scriptinit__();
-native
-native
-native
- 
-*/
- 
-#include <YSI\y_scriptinit>
- 
-/*
- 
-native
-native __y_stringhash__();
-native
-native
-native YHash(const str[], bool:sensitive = true, e_HASH_TYPE:type = hash_bernstein, len = -1, pack = false);
-native
- 
-*/
- 
-#include <YSI\y_stringhash>
- 
-/*
- 
-native
-native __y_svar__();
-native
-native
-native svar();
-native
- 
-*/
- 
-#include <YSI\y_svar>
- 
-/*
- 
-native
-native __y_td__();
-native
-native
-native Style:TD_Create(Float:x = 0.0, Float:y = 0.0, Float:letterX = 0.48, Float:letterY = 1.12, Float:textX = 1280.0, Float:textY = 1280.0, colour = 0xE1E1E1FF, boxColour = 0x80808080, bgColour = 0x000000FF, shadow = 2, outline = 0, align = _:td_align_none, font = 1, bool:proportional = false, bool:box = false, time = 0, name[] = "\1");
-native TD_Delete(Style:styleId);
-native
-native Text:TD_Display(text[], Style:id, Float:x = NAN, Float:y = NAN);
-native TD_Destroy(Text:textDraw);
-native TD_TextPosition(Text:textID, Float:x, Float:y);
-native TD_TextXPos(Text:textID, Float:x);
-native TD_TextYPos(Text:textID, Float:y);
-native TD_SetString(Text:td, text[]);
-native
-native TD_ShowForPlayer(playerid, Text:textDraw);
-native TD_HideForPlayer(playerid, Text:textDraw);
-native TD_ShowForAll(Text:textDraw);
-native TD_HideForAll(Text:textDraw);
-native Text:TD_DisplayForPlayer(playerid, text[], Style:id, Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayForAll(text[], Style:id, Float:x = NAN, Float:y = NAN);
-native
-native TD_StylePosition(Style:styleID, Float:x, Float:y);
-native TD_StyleXPos(Style:styleID, Float:x);
-native TD_StyleYPos(Style:styleID, Float:y);
-native TD_LetterSize(Style:styleID, Float:x, Float:y);
-native TD_LetterX(Style:styleID, Float:x);
-native TD_LetterY(Style:styleID, Float:y);
-native TD_TextSize(Style:styleID, Float:x, Float:y);
-native TD_TextX(Style:styleID, Float:x);
-native TD_TextY(Style:styleID, Float:y);
-native TD_Alignment(Style:styleID, alignment = _:td_align_none);
-native TD_Colour(Style:styleID, colour);
-native TD_Color(Style:styleID, color);
-native TD_UseBox(Style:styleID, bool:use);
-native TD_BoxColour(Style:styleID, colour);
-native TD_BoxColor(Style:styleID, color);
-native TD_SetShadow(Style:styleID, size);
-native TD_SetOutline(Style:styleID, size);
-native TD_BackgroundColour(Style:styleID, colour);
-native TD_BackgroundColor(Style:styleID, color);
-native TD_Font(Style:styleID, font);
-native TD_SetProportional(Style:styleID, bool:set);
-native TD_SetTime(Style:styleID, time, bool:existing = false);
-native
-native TD_Morph(Text:textDraw, Style:style, time, delay = 0);
-native TD_Link(Text:base, Text:other);
-native TD_Unlink(Text:td);
-native Style:TD_GetDisplayStyle(Text:td);
-native Text:TD_DisplayHashed(text[], hash, Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayHashedForPlayer(playerid, text[], hash, Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayHashedForAll(text[], hash, Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayNamed(text[], style[], Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayNamedForPlayer(playerid, text[], style[], Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayNamedForAll(text[], style[], Float:x = NAN, Float:y = NAN);
-native TD_Garbage(Text:textDraw);
-native TD_Parse(filename[]);
-native
-native Style:TD_GetNamed(name[]);
-native Style:TD_GetID(hash);
-native Style:TD_Clone(Style:styleID, name[] = "\1");
-native TD_GetStyleData(Style:styleID, ret[E_TD_DATA]);
-native TD_Name(Style:styleID, name[]);
-native
- 
-*/
- 
-#include <YSI\y_td>
- 
-/*
- 
-native
-native __y_testing__();
-native
-native
-native Testing_RunAll();
-native
- 
-*/
- 
-// DO NOT include by default!
-//#include <YSI\y_testing>
- 
-/*
- 
-native
-native __y_text__();
-native
-native
-native Text_Send(@PlayerSet:players, message[], {Float, _}:...);
-native
-native Text_MessageBox(@PlayerSet:players, using:callback[], title[], text[], button1[], button2[], {Float, _}:...);
-native Text_InputBox(@PlayerSet:players, using:callback[], title[], text[], button1[], button2[], {Float, _}:...);
-native Text_ListBox(@PlayerSet:players, using:callback[], title[], text[], button1[], button2[], {Float, _}:...);
-native Text_PasswordBox(@PlayerSet:players, using:callback[], title[], text[], button1[], button2[], {Float, _}:...);
-native Text_DialogBox(@PlayerSet:players, style, using:callback[], title[], text[], button1[], button2[], {Float, _}:...);
-native
- 
-*/
- 
-#include <YSI\y_text>
- 
-/*
- 
-native
-native __y_timers__();
-native
-native
-native stop();
-native defer();
-native repeat();
-native timer();
-native task();
-native ptask();
-native pause();
-native resume();
-native
- 
-*/
- 
-#include <YSI\y_timers>
- 
-/*
- 
-native
-native __y_users__();
-native
-native
-native Language:Player_GetPreloadLanguage(playerid);
-native Player_IsRegistered(playerid);
-native bool:Player_IsLoggedIn(playerid);
-native Player_GetYID(playerid);
-native
-native Player_RemoveEntry(name[]);
-native Player_WriteString(name[], data[]);
-native Player_WriteArray(const name[], data[], len);
-native Player_WriteInt(name[], data);
-native Player_WriteHex(name[], data);
-native Player_WriteBin(name[], data);
-native Player_WriteBool(name[], bool:data);
-native Player_WriteFloat(name[], Float:data, accuracy = 6);
-native Player_SetTag(tag[]);
-native Player_DeleteTag(tag[]);
-native
-native Player_TryLogin(playerid, password[]);
-native Player_ForceLogin(playerid);
-native Player_TryRegister(playerid, password[]);
-native Player_ChangePassword(playerid, password[]);
-native Player_TryGroup(playerid, other[], password[]);
-native Player_ForceGroup(playerid, other[]);
-native
-native Player_Reload(playerid);
-native Player_SetPreload(playerid, data[E_USER_PRELOAD]);
-native Player_Preload(name[], ret[E_USER_PRELOAD]);
-native
- 
-*/
- 
-#include <YSI\y_users>
- 
-/*
- 
-native
-native __y_utils__();
-native
-native
-native ceildiv(num, denom);
-native floordiv(num, denom);
-native isnull(str[]);
-native isodd(num);
+	18/06/07:
+		Updated YSI_text functions.
+	18/04/07:
+		Added new files.
+		Moved objects and checkpoints to YSI/Visual/.
+	17/04/07:
+		Added new files.
+	16/04/07:
+		Added native definitions
+	15/04/07:
+		First version
+Functions:
+	Public:
+		-
+	Core:
+		-
+	Stock:
+		-
+	Static:
+		-
+	Inline:
+		-
+	API:
+		-
+Callbacks:
+	-
+Definitions:
+	-
+Enums:
+	-
+Macros:
+	-
+Tags:
+	-
+Variables:
+	Global:
+		-
+	Static:
+		-
+Commands:
+	-
+Compile options:
+	_YSI_DEBUG - Use YSI/YSI_debug.own.
+	_YSI_MISC - Use YSI/YSI_misc.own.
+	_YSI_CORE_BIT - Use YSI/Core/YSI_bit.own.
+	_YSI_CORE_BINTREE - Use YSI/Core/YSI_bintree.own.
+	_YSI_CORE_INI - Use YSI/Core/YSI_INI.own.
+	_YSI_CORE_TEXT - Use YSI/Core/YSI_text.own.
+	_YSI_CORE_FORMAT - Use YSI/Core/YSI_format.own.
+	_YSI_CORE_LANGUAGES - Use YSI/Core/YSI_languages.own.
+	_YSI_CORE_COMMANDS - Use YSI/Core/YSI_commands.own.
+	_YSI_CORE_PLAYER - Use YSI/Core/YSI_player.own.
+	_YSI_SERVER_MODULES - Use YSI/Server/YSI_modules.own.
+	_YSI_VISUAL_OBJECTS - Use YSI/Visual/YSI_objects.own
+	_YSI_VISUAL_CHECKPOINTS - Use YSI/Visual/YSI_objects.own
+	_YSI_SYSTEM_DEFAULT - Use YSI/System/YSI_default.own.
+Operators:
+	-
+-*----------------------------------------------------------------------------*/
+
+#include <a_samp>
+
+#if defined _YSI_included
+	#endinput
+#endif
+#define _YSI_included
+
+/*----------------------------------------------------------------------------*-
+					===============
+					/YSI/ Libraries
+					===============
+-*----------------------------------------------------------------------------*/
+
+/*
+native _DEPENDECENCY_FUNCTIONS_();
+	native
+*/
+#include "YSI/YSI_dependencies.own"
+
+/*
+native _DEBUG_FUNCTIONS_();
+	native
+native Debug_Code_<level>(code);
+native Debug_Print_<level>(format[], {Float,_}:...);
+	native
+*/
+#if defined _YSI_DEBUG
+	#include "YSI/YSI_debug.own"
+#endif
+
+/*
+native _MISC_FUNCTIONS_();
+	native
+native ceildiv(num, div);
+native floordiv(num, div);
 native iseven(num);
-native strcpy(dest[], src[], maxlength = sizeof (dest));
-native StripNL(str[]);
-native endofline(line[], pos);
+native isodd(num);
 native chrfind(needle, haystack[], start = 0);
-native chrfindp(needle, haystack[], start = 0);
+native chrnfind(needle, haystack[], start = 0);
+native strcpy(dest[], source[], max, len = -1);
 native bernstein(string[]);
-native ishex(str[]);
-native unpack(const str[]);
-native GetIP(playerid);
-native getstring(addr);
-native getstringarg(addr);
-native isnumeric(str[]);
+native StripNL(str[]);
+native strconcat(...);
+native QuickSort(numbers[], arraySize);
+native chrtolower(chr);
+native strtolower(str[]);
 native hexstr(string[]);
-native bool:boolstr(string[]);
-native binstr(string[]);
-native memset(dest[], size = sizeof (dest), val = 0, blocksize = 8);
+native bool:binstr(string[]);
 native ReturnPlayerName(playerid);
-native ftouch(const filename[]);
-native
- 
-*/
- 
-#include <YSI\y_utils>
- 
-/*
- 
-native
-native __y_uvar__();
-native
-native
-native uvar();
-native
- 
-*/
- 
-#include <YSI\y_uvar>
- 
-/*
- 
-native
-native __y_va__();
-native
-native
-native va_printf(fmat[], va_start);
-native va_format(out[], size, fmat[], va_start);
-native va_strlen(arg);
-native va_getstring(dest[], arg, len = sizeof (dest));
-native
- 
-*/
- 
-#include <YSI\y_va>
- 
-/*
- 
-native
-native __y_writemem__();
-native
-native
-native WriteMem(addr, value);
-native
- 
-*/
- 
-#include <YSI\y_writemem>
- 
-/*
- 
-native
-native __y_xml__();
-native
-native
-native XML:XML_New();
-native XML_Destroy(XML:rule);
-native
-native XML_AddHandler(XML:rule, trigger[], function[]);
-native XML_RemoveHandler(XML:rule, trigger[]);
-native XML_Parse(XML:rule, filename[]);
-native XML_GetKeyValue(key[], value[]);
-native
-native XMLEntry:XML_AddParameter(XMLEntry:parent, tag[], value[] = "");
-native XMLEntry:XML_AddItem(tag[], name[] = "", XMLEntry:parent = XMLEntry:cellmax);
-native XMLEntry:XML_CreateEntry(tag[], name[] = "", XMLEntry:parent = XMLEntry:cellmax);
-native XMLEntry:XML_AddSubEntry(tag[], name[] = "", XMLEntry:parent = XMLEntry:cellmax);
-native XML_WriteItem(filename[], XMLEntry:item, bool:bIncludeXML = true, bool:bFavourShort = false);
-native XML_WriteEntry(filename[], XMLEntry:item, bool:bIncludeXML = true, bool:bFavourShort = false);
-naitve XML_RemoveItem(file[], tag[], name[]);
-naitve XML_ReplaceItem(file[], tag[], name[], replacement);
-native
- 
-*/
- 
-#include <YSI\y_xml>
- 
-/*
- 
-native
-native __y_zonepulse__();
-native
-native
-native GangZonePulse(@PlayerSet:players, zone, from, to, time, delay = ZONE_PULSE_STAGE_TIME, time2 = -1, delay2 = -1);
-native GangZonePulseForPlayer(playerid, zone, from, to, time, delay = ZONE_PULSE_STAGE_TIME, time2 = -1, delay2 = -1);
-native GangZonePulseForAll(zone, from, to, time, delay = ZONE_PULSE_STAGE_TIME, time2 = -1, delay2 = -1);
-native GangZoneStopPulse(@PlayerSet:players, zone);
-native GangZoneStopPulseForPlayer(playerid, zone);
-native GangZoneStopPulseForAll(zone);
-native
- 
-*/
- 
-#include <YSI\y_zonepulse>
+native ishex(str[]);
+native numstr(num);
+native chrtoupper(chr);
+native strtoupper(str[]);
+	native
+*/
+#if defined _YSI_MISC
+	#include "YSI/YSI_misc.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					====================
+					/YSI/Core/ Libraries
+					====================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _CORE_BIT_FUNCTIONS_();
+	native
+native Bit_Bits(num);
+native Bit_Get(Bit:array[], slot, size = sizeof (array));
+native Bit_Set(Bit:array[], slot, set, size = sizeof (array));
+native Bit_SetAll(Bit:array[], set, size = sizeof (array));
+native Bit_GetCount(Bit:array[], size = sizeof (array));
+native Bit_GetBits(Bit:array[], slot);
+	native
+*/
+#if defined _YSI_CORE_BIT
+	#include "YSI/Core/YSI_bit.own"
+#endif
+
+/*
+native _CORE_BINTREE_FUNCTIONS_();
+	native
+native Bintree_Sort(input[][E_BINTREE_INPUT], size);
+native Bintree_Fill(Bintree:output[][E_BINTREE_INPUT], data[][E_BINTREE_INPUT], size);
+native Bintree_Generate(Bintree:output[][E_BINTREE_TREE], input[][E_BINTREE_INPUT], size);
+native Bintree_Reset(Bintree:tree[][E_BINTREE_TREE], pointer = 0);
+native Bintree_FindValue(Bintree:tree[][E_BINTREE_TREE], value, &cont = 0, &old = 0);
+native Bintree_Add(Bintree:data[][E_BINTREE_TREE], input[E_BINTREE_INPUT], offset, maxsize = sizeof (data));
+native Bintree_Delete(Bintree:source[][E_BINTREE_TREE], index, count);
+native Bintree_UpdatePointers(Bintree:data[][E_BINTREE_TREE], offset, size, mod = -1);
+	native
+*/
+#if defined _YSI_CORE_BINTREE
+	#include "YSI/Core/YSI_bintree.own"
+#endif
+
+/*
+native _CORE_INI_FUNCTIONS_();
+	native
+native bool:INI_Load(filename[]);
+native bool:INI_ParseFile(filename[], remoteFormat[], bool:bFileFirst = false);
+native INI_GetEntryText(source[], dest[], i);
+native INI_BroadcastData(function[], identifier[], text[]);
+native bool:INI_GetEntryName(source[], dest[], &i);
+native INI_INI();
+native INI:INI_Open(filename[]);
+native INI_Close(INI:file);
+native INI_SetTag(INI:file, tag[]);
+native INI_WriteString(INI:file, name[], data[]);
+native INI_WriteInt(INI:file, name[], data);
+native INI_WriteFloat(INI:file, name[], Float:data, accuracy = 6);
+native INI_WriteBuffer(INI:file);
+native INI_String(name[], function);
+native INI_Bin(name[], function);
+native INI_Hex(name[], function);
+native INI_Float(name[], function);
+native INI_Int(name[], function);
+	native
+*/
+#if defined _YSI_CORE_INI
+	#include "YSI/Core/YSI_INI.own"
+#endif
+
+/*
+native _CORE_TEXT_FUNCTIONS_();
+	native
+naitve Text_Send(playerid, identifier[]);
+native Text_SendToAll(identifier[]);
+native Text_SendToGroup(group, identifier[]);
+native Text_SendToPlayers(Bit:players[], identifier[]);
+naitve Text_SendFormat(playerid, identifier[], {Float,_}:...);
+native Text_SendToAllFormat(identifier[], {Float,_}:...);
+native Text_SendToGroupFormat(group, identifier[], {Float,_}:...);
+native Text_SendToPlayersFormat(Bit:players[], identifier[], {Float,_}:...);
+native Text_Text();
+native Text_AddToBuffer(identifier[], text[]);
+native Text_ResetAll();
+native Text_NewLanguage(Language:languageID);
+native Text_Parse();
+native Text_GetText(identifier[], Language:languageID);
+native Text_RegisterTag(tag[]);
+native Text_GetTextStyle(index);
+native Text_GetTextColour(index);
+native Text_GetTextTime(index);
+native Text_GetTextFromIndex(index, Language:languageID, identifier[]);
+native Text_GetErrorMessage(Language:languageID);
+	native
+*/
+#if defined _YSI_CORE_TEXT
+	#include "YSI/Core/YSI_text.own"
+#endif
+
+/*
+native _CORE_FORMAT_FUNCTIONS_();
+	native
+native Format_SendFormattedText(playerid, type, colorTime, identifier[], {Float,_}:...);
+	native
+*/
+#if defined _YSI_CORE_FORMAT
+	#include "YSI/Core/YSI_format.own"
+#endif
+
+/*
+native _CORE_COMMAND_FUNCTIONS_();
+	native
+native Command_IsCleared(playerid, command);
+native Command_SetDisconnectReturn(set);
+native Command_SetIllegalReturn(set);
+native Command_UseShortCuts(set);
+native Command_SetDeniedReturn(set);
+native Command_UseDeniedMessage(set);
+native Command_UseAltNames(set);
+native Command_UsePrefix(set);
+native Command_UseSpace(set);
+native Command_Add(funcname[]);
+native Command_Parse();
+native Command_SetAltName(funcname[], altname[]);.
+native Comamnd_SetPlayerUse(command[], playerid, set);
+native Comamnd_SetPlayerUseByID(command, playerid, set);
+native Command_SetPrefix(prefix[]);
+native Command_Process(playerid, cmdtext[], help = 0);
+native Command_Name(funcname[]);
+	native
+native ycmd(command[]);
+	native
+*/
+#if defined _YSI_CORE_COMMANDS
+	#include "YSI/Core/YSI_commands.own"
+#endif
+
+/*
+native _CORE_LANGUAGE_FUNCTIONS_();
+	native
+native Langs_Langs();
+native Langs_IsActive(Language:languageID);
+native Langs_GetLanguageIdentifier(Language:languageID);
+native Langs_GetLanguageID(identifier[]);
+native Langs_ResetAll();
+native Langs_SaveEnteredData();
+native bool:Langs_LoadLanguage(LanguagelanguageID);
+native Langs_LoadAll();
+native Langs_AddLanguage(identifer[], name[]);
+native Langs_AddFile(filename[], path[] = "");
+native Langs_GetLanguageName(Language:languageID);
+native Langs_IsValid(Language:languageID);
+	native
+*/
+#if defined _YSI_CORE_LANGUAGES
+	#include "YSI/Core/YSI_languages.own"
+#endif
+
+/*
+native _CORE_PLAYER_FUNCTIONS_();
+	native
+native Language:Player_GetPlayerLanguage(playerid);
+native Player_OnPlayerConnect(playerid);
+native Player_Player();
+native Player_OnPlayerDisconnect(playerid, reason);
+native Player_SetPlayerLanguage(playerid, Language:languageID);
+native Player_FindShortCut(playerid, shortcut, cmdname[]);
+native Player_SetTag(tag[]);
+native Player_WriteString(name[], data[]);
+native Player_WriteInt(name[], data);
+native Player_WriteFloat(name[], Float:data, accuracy = 6);
+	native
+*/
+#if defined _YSI_CORE_PLAYER
+	#include "YSI/Core/YSI_player.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					======================
+					/YSI/Server/ Libraries
+					======================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _SERVER_MODULE_FUNCTIONS_();
+	native
+native Modules_Modules();
+native Modules_IsActive(Module:moduleID);
+native Modules_IsPrivate(Module:moduleID);
+native bool:Modules_LoadAll();
+native Modules_CloseAll();
+native Modules_Close(name[]);
+native Modules_CloseID(Module:id);
+native Module:Modules_Register(name[], tag[], hidden);
+native Modules_GetModuleCount();
+native Modules_GetVisibleCount();
+native Modules_GetHiddenCount();
+	native
+*/
+#if defined _YSI_SERVER_MODULES
+	#include "YSI/Server/YSI_modules.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					======================
+					/YSI/Visual/ Libraries
+					======================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _VISUAL_OBJECT_FUNCTIONS_();
+	native
+native Object_Object();
+native Object_AddToPlayer(objectid, playerid);
+native Object_AddToWorld(objectid, virtualworld);
+native Object_AddToAllPlayers(objectid);
+native Object_AddToAllWorlds(objectid);
+native Object_RemoveFromPlayer(objectid, playerid);
+native Object_RemoveFromWorld(objectid, virtualworld);
+native Object_RemoveFromAllPlayers(objectid);
+native Object_RemoveFromAllWorlds(objectid);
+native Object_OnPlayerDisconnect(playerid, reason);
+native Object_IsGlobal(objectid);
+	native
+native MoveDynamicObject(objectid, Float:X, Float:Y, Float:Z, Float:S);
+native StopDynamicObject(objectid);
+native IsValidDynamicObject(objectid);
+native CreateDynamicObject(model, Float:X, Float:Y, Float:Z, Float:RX = 0.0, Float:RY = 0.0, Float:RZ = 0.0);
+native CreatePlayerDynamicObject(playerid, model, Float:X, Float:Y, Float:Z, Float:RX = 0.0, Float:RY = 0.0, Float:RZ = 0.0);
+native CreateVWDynamicObject(virtualworld, model, Float:X, Float:Y, Float:Z, Float:RX = 0.0, Float:RY = 0.0, Float:RZ = 0.0);
+native CreatePlayerVWDynamicObject(playerid, virtualworld, model, Float:X, Float:Y, Float:Z, Float:RX = 0.0, Float:RY = 0.0, Float:RZ = 0.0);
+native DestroyDynamicObject(objectid);
+native GetDynamicObjectPos(objectid, &Float:X, &Float:Y, &Float:Z);
+native GetDynamicObjectRot(objectid, &Float:RX, &Float:RY, &Float:RZ);
+native SetDynamicObjectPos(objectid, Float:X, Float:Y, Float:Z);
+native SetDynamicObjectRot(objectid, Float:RX, Float:RY, Float:RZ);
+native AttachDynamicObjectToPlayer(objectid, playerid, Float:offX, Float:offY, Float:offZ, Float:rX, Float:rY, Float:rZ);
+native DetachDynamicObjectFromPlayer(objectid);
+native IsValidModel(modelid);
+	native
+*/
+#if defined _YSI_VISUAL_OBJECTS
+	#include "YSI/Visual/YSI_objects.own"
+#endif
+
+/*
+native _VISUAL_CHECKPOINT_FUNCTIONS_();
+	native
+native Checkpoint_Checkpoint();
+native Checkpoint_SetVisible(cpid, set);
+native Checkpoint_SetAllWorlds(cpid, set);
+native Checkpoint_SetAllPlayers(cpid, set);
+native Checkpoint_AddPlayer(cpid, playerid);
+native Checkpoint_RemovePlayer(cpid, playerid);
+native Checkpoint_AddVW(cpid, vwid);
+native Checkpoint_RemoveVW(cpid, vwid);
+native Checkpoint_HasPlayer(cpid, playerid);
+native Checkpoint_HasPlayerNoWorld(cpid, playerid);
+native Checkpoint_Get(playerid);
+native Checkpoint_OnPlayerEnterCheckpoint(playerid);
+native Checkpoint_OnPlayerLeaveCheckpoint(playerid);
+native Checkpoint_OnPlayerConnect(playerid);
+native Checkpoint_IsGlobal(checkpoint);
+	native
+native CreateCheckpoint(Float:x, Float:y, Float:z, Float:size, players = 0, vws = 0);
+native IsValidCheckpoint(cpid);
+native DestroyCheckpoint(cpid);
+	native
+*/
+#if defined _YSI_VISUAL_CHECKPOINTS
+	#include "YSI/Visual/YSI_checkpoints.own"
+#endif
+
+/*
+native _VISUAL_RACE_FUNCTIONS_();
+	native
+native Race_Race();
+native Race_OnPlayerEnterRaceCP(playerid);
+native Race_OnPlayerStateChange(playerid, newstate, oldstate);
+native Race_OnPlayerDisconnect(playerid, reason);
+native Race_Create(laps = 0, entry = 0, countdown = 3, bool:arial = 0, bool:fixedPrize = 1, exitTime = 0, interior = 0, world = 0, bool:restart = 0);
+native Race_AddCheckpoint(raceid, Float:x, Float:y, Float:z);
+native Race_AddStart(raceid, Float:x, Float:y, Float:z, Float:a);
+native Race_SetFixedWin(raceid, set);
+native Race_SetArial(raceid, set);
+native Race_PlayerLeave(playerid, refund = 0);
+native Race_SetCountdown(raceid, countdown);
+native Race_SetInterior(raceid, interior);
+native Race_SetWorld(raceid, world);
+native Race_SetPrize(raceid, position, amount);
+native Race_SetExitTime(raceid, time);
+native Race_IsActive(raceid);
+native Race_SetLaps(raceid, laps);
+native Race_SetEntry(raceid, cost);
+native Race_GetPlayerExitedTime(playerid);
+native Race_PlayerJoin(playerid, race);
+native Race_Start(race);
+native Race_GetPlayerRaceTime(playerid);
+native Race_GetPlayerPosition(playerid);
+	native
+*/
+#if defined _YSI_VISUAL_RACE
+	#include "YSI/Visual/YSI_race.own"
+#endif
+
+/*
+native _VISUAL_AREA_FUNCTIONS_();
+	native
+native Area_Area();
+native Area_OnPlayerConnect(playerid);
+native Area_Delete(area);
+native Area_AddCube(Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz);
+native Area_AddBox(Float:minx, Float:miny, Float:maxx, Float:maxy);
+native Area_AddCircle(Float:x, Float:y, Float:r, Float:h = 10000.0);
+native Area_AddSphere(Float:x, Float:y, Float:z, Float:r);
+native Area_AddPoly(Float:x1, Float:y1, Float:x2, Float:y2, Float:x3, Float:y3, Float:...);
+native Area_GetPlayerArea(playerid);
+native Area_SetPlayer(area, playerid, set);
+native Area_SetAllPlayers(area, set);
+native Area_SetAllWorlds(area, set);
+native Area_SetWorld(area, world, set);
+native Area_IsValid(area);
+	native
+*/
+#if defined _YSI_VISUAL_AREAS
+	#include "YSI/Visual/YSI_areas.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					========================
+					/YSI/Gamemode/ Libraries
+					========================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _GAMEMODE_PROPERTY_FUNCTIONS_();
+	native
+native Property_OnPlayerSelectedMenuRow(playerid, row);
+native Property_OnPlayerExitedMenu(playerid);
+native Property_OnPlayerEnterCheckpointEx(playerid, cpid);
+native Property_OnPlayerLeaveCheckpointEx(playerid, cpid);
+native Property_OnPlayerSpawn(playerid);
+native Property_OnPlayerConnect(playerid);
+native Property_OnPlayerLeaveArea(playerid, area);
+native Property_OnPlayerEnterArea(playerid, area);
+native Property_GetPlayerPropCount(playerid);
+native Property_GetLink(property);
+native Property_GetType(property);
+native Property_IsValid(property);
+native Property_Bank(playerid, amount);
+native Property_SavePlayerWeapon(playerid, weaponslot, ammo);
+native Property_SaveWeapons(playerid);
+native Property_LoadWeapons(playerid, identifier[], text[]);
+native Property_SaveBank(playerid);
+native Property_LoadBank(playerid, identifier[], text[]);
+	native
+native CreateProperty(name[], Float:x, Float:y, Float:z, price, reward, interval = 60000, sell = 0, multi = 0, reduce = 0, increase = 0);
+native CreateBank(Float:x, Float:y, Float:z, name[] = "");
+native CreateAmmunation(Float:x, Float:y, Float:z, spawn, instant, weapon, ammo, price, ...);
+native CreateMoneyArea(area, money = 100, interval = 10000);
+native CreateMoneyPoint(Float:x, Float:y, Float:z, Float:s, money = 100, interval = 10000);
+native CreateTeleport(Float:sx, Float:sy, Float:sz, Float:tx, Float:ty, Float:tz, cost = 0, name[] = "");
+native CreateForbiddenArea(area, kick = 0, health = 1000, invert = 0, name[] = "");
+native DestroyProperty(property);
+	native
+*/
+#if defined _YSI_GAMEMODE_PROPERTIES
+	#include "YSI/Gamemode/YSI_properties.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					======================
+					/YSI/System/ Libraries
+					======================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _SYSTEM_DEFAULT_FUNCTIONS_();
+	native
+native Default_Setup();
+native Default_OnGameModeInit();
+native Default_OnGameModeExit();
+native Default_OnFilterScriptInit();
+native Default_OnFilterScriptExit();
+native Default_OnPlayerConnect(playerid);
+native Default_OnPlayerDisconnect(playerid, reason);
+native Default_OnPlayerSpawn(playerid);
+native Default_OnPlayerDeath(playerid, killerid, reason);
+native Default_OnVehicleSpawn(vehicleid);
+native Default_OnVehicleDeath(vehicleid, killerid);
+native Default_OnPlayerText(playerid, text[]);
+native Default_OnPlayerCommandText(playerid, cmdtext[]);
+native Default_OnPlayerInfoChange(playerid);
+native Default_OnPlayerRequestClass(playerid, classid);
+native Default_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
+native Default_OnPlayerExitVehicle(playerid, vehicleid);
+native Default_OnPlayerStateChange(playerid, newstate, oldstate);
+native Default_OnPlayerEnterCheckpoint(playerid);
+native Default_OnPlayerLeaveCheckpoint(playerid);
+native Default_OnPlayerEnterRaceCheckpoint(playerid);
+native Default_OnPlayerLeaveRaceCheckpoint(playerid);
+native Default_OnRconCommand(cmd[]);
+native Default_OnPlayerPrivmsg(playerid, recieverid, text[]);
+native Default_OnPlayerRequestSpawn(playerid);
+native Default_OnObjectMoved(objectid);
+native Default_OnPlayerObjectMoved(playerid, objectid);
+native Default_OnPlayerPickUpPickup(playerid, pickupid);
+native Default_OnVehicleMod(vehicleid, componentid);
+native Default_OnVehiclePaintjob(vehicleid, paintjobid);
+native Default_OnVehicleRespray(vehicleid, color1, color2);
+native Default_OnPlayerSelectedMenuRow(playerid, row);
+native Default_OnPlayerExitedMenu(playerid);
+	native
+native LoadScript();
+	native
+*/
+#if defined _YSI_SYSTEM_DEFAULT
+	#include "YSI/System/YSI_default.own"
+#endif
+
+/*
+native _SYSTEM_GROUP_FUNCTIONS_();
+	native
+native Group_NameGroup(group, name[]);
+native Group_SetCommand(group, command[], set);
+native Group_SetCommandByID(group, command, set);
+native Group_UpdatePlayerCommand(command, playerid);
+native Group_SetCheckpoint(group, checkpoint, set);
+native Group_UpdatePlayerCheckpoint(checkpoint, playerid);
+native Group_SetObject(group, object, set);
+native Group_UpdatePlayerObject(object, playerid);
+native Group_SetArea(group, area, set);
+native Group_UpdatePlayerArea(area, playerid);
+native Group_SetProperty(group, property, set);
+native Group_UpdatePlayerProperty(property, playerid);
+native Group_AddPlayer(group, playerid);
+native Group_RemovePlayer(group, playerid);
+native Group_RemovePlayerFromAllGroups(playerid);
+native Bit:Group_GetGroupMembers(group);
+native Group_GetGroups(playerid);
+	native
+*/
+#if defined _YSI_SYSTEM_GROUPS
+	#include "YSI/System/YSI_groups.own"
+#endif
+
+/*
+native _SYSTEM_SCRIPT_FUNCTIONS_();
+	native
+native Script_OnGameModeInit();
+native Script_OnGameModeExit();
+native Script_OnFilterScriptInit();
+native Script_OnFilterScriptExit();
+native Script_OnPlayerConnect(playerid);
+native Script_OnPlayerDisconnect(playerid, reason);
+native Script_OnPlayerSpawn(playerid);
+native Script_OnPlayerDeath(playerid, killerid, reason);
+native Script_OnVehicleSpawn(vehicleid);
+native Script_OnVehicleDeath(vehicleid, killerid);
+native Script_OnPlayerText(playerid, text[]);
+native Script_OnPlayerCommandText(playerid, cmdtext[]);
+native Script_OnPlayerInfoChange(playerid);
+native Script_OnPlayerRequestClass(playerid, classid);
+native Script_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
+native Script_OnPlayerExitVehicle(playerid, vehicleid);
+native Script_OnPlayerStateChange(playerid, newstate, oldstate);
+native Script_OnPlayerEnterCheckpoint(playerid);
+native Script_OnPlayerLeaveCheckpoint(playerid);
+native Script_OnPlayerEnterRaceCheckpoint(playerid);
+native Script_OnPlayerLeaveRaceCheckpoint(playerid);
+native Script_OnRconCommand(cmd[]);
+native Script_OnPlayerPrivmsg(playerid, recieverid, text[]);
+native Script_OnPlayerRequestSpawn(playerid);
+native Script_OnObjectMoved(objectid);
+native Script_OnPlayerObjectMoved(playerid, objectid);
+native Script_OnPlayerPickUpPickup(playerid, pickupid);
+native Script_OnVehicleMod(vehicleid, componentid);
+native Script_OnVehiclePaintjob(vehicleid, paintjobid);
+native Script_OnVehicleRespray(vehicleid, color1, color2);
+native Script_OnPlayerSelectedMenuRow(playerid, row);
+native Script_OnPlayerExitedMenu(playerid);
+native Script_OnPlayerLogin(playerid, data[]);
+native Script_OnPlayerLogout(playerid);
+native Script_OnPlayerEnterCheckpointEx(playerid, cpid);
+native Script_OnPlayerLeaveCheckpointEx(playerid, cpid);
+native Script_OnPlayerEnterArea(playerid, area);
+native Script_OnPlayerLeaveArea(playerid, area);
+	native
+*/
+#if defined _YSI_SYSTEM_SCRIPT
+	#include "YSI/System/YSI_script.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					===================
+					/YSI/ Libraries (2)
+					===================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _POST_FUNCTIONS_();
+	native
+*/
+#include "YSI/YSI_post.own"

+ 23 - 63
pawno/include/YSI/internal/y_automasters.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					===============================
 					Y Sever Includes - Master Auto
 					===============================
@@ -18,17 +18,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI master include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -43,10 +43,9 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	0.1
 Changelog:
@@ -90,7 +89,7 @@ Operators:
 	-
 Natives:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 // =============================================================================
 // =============================================================================
@@ -103,7 +102,7 @@ Natives:
 
 #undef _inc_y_automasters
 
-//#define _YSIM_USED_AUTO
+#define _YSIM_USED_AUTO
 
 // Commands are set as master number 25
 #if defined _inc_y_commands
@@ -128,75 +127,36 @@ Natives:
 #if defined _inc_y_classes
 	#if !defined _YCM_w@ // w is letter 22
 		#define MASTER                  22
-		//#if defined _inc_y_classes_do
-		//	// Make sure only the implementation file calls y_master.
-		//	#define YSIM_DISABLE_RECALL
-		//#endif
-		#endinput
-	#endif
-#endif
-
-// Languages are set as master number 21.  This is the first library I've done
-// since largely finishing the y_master system (I hope anyway) and it is now, I
-// have to say, VERY smooth adding in a new YSI mastered library!  Actually, I
-// need to remember to add the "revert" code, but it's only hard with groups.
-#if defined _inc_y_languages
-	#if !defined _YCM_v@ // v is letter 21
-		#define MASTER                  21
 		#endinput
 	#endif
 #endif
 
-// Players are set as master number 20
-#if defined _inc_y_users
-	#if !defined _YCM_u@ // u is letter 20
-		#define MASTER                  20
-		#endinput
-	#endif
-#endif
-
-// Dialogs are set as master number 19
-#if defined _inc_y_dialog
-	#if !defined _YCM_t@ // t is letter 19
-		#define MASTER                  19
+// Dialogs are set as master number 23
+/*#if defined _inc_y_dialog
+	#if !defined _YCM_x@ // x is letter 23
+		#define MASTER                  23
 		#endinput
 	#endif
-#endif
-
-// Areas are set as master number 18
-#if defined _inc_y_areas
-	#if !defined _YCM_s@ // s is letter 18
-		#define MASTER                  18
-		#endinput
-	#endif
-#endif
-
-// PHP is set as master number 17
-#if defined _inc_y_php
-	#if !defined _YCM_r@ // r is letter 17
-		#define MASTER                  17
-		#endinput
-	#endif
-#endif
+#endif*/
 
-// Incognito's streamer is set as master number 16
-#if defined _inc_streamer
-	#if !defined _YCM_q@ // q is letter 16
-		#define MASTER                  16
+// Languages are set as master number 27
+/*#if defined _inc_y_languages
+	#if !defined _YCM_w@ // B is letter 27
+		#define MASTER                  22
 		#endinput
 	#endif
 #endif
 
-// Incognito's streamer is set as master number 16
-#if defined _inc_y_phone
-	#if !defined _YCM_p@ // q is letter 16
-		#define MASTER                  15
+// Players are set as master number 28
+#if defined _inc_y_player
+	#if !defined _YCM_v@ // C is letter 28
+		#define MASTER                  21
 		#endinput
 	#endif
 #endif
 
 // The help system is set as master number 29
-/*#if defined _inc_y_help
+#if defined _inc_y_help
 	#if !defined _YCM_u@ // D is letter 29
 		#define MASTER                  20
 		#endinput
@@ -218,7 +178,7 @@ Natives:
 	#endif
 #endif
 
-//#undef _YSIM_USED_AUTO
+#undef _YSIM_USED_AUTO
 
 // We can't have an auto-incrementing master number as there's no way to
 // guarantee that two scripts using the same library will have the same master

+ 10 - 23
pawno/include/YSI/internal/y_classgroups.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					=======================================
 					 y_classes - Advanced class selection! 
 					=======================================
@@ -18,17 +18,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI classgroups include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -43,20 +43,19 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
 	29/11/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock Class_ResolveGroups(class, Group:forgroup, bool:cp) <YSI_has_groups:y>
 {
-	P:2("Class_ResolveGroups<y>: call Resolve %d %d %d", class, _:forgroup, cp);
+	P:3("Class_AddClass<y>: call Resolve %d %d %d", class, forgroup, cp);
 	if (cp)
 	{
 		// Here "class" means "playerid".
@@ -64,20 +63,8 @@ stock Class_ResolveGroups(class, Group:forgroup, bool:cp) <YSI_has_groups:y>
 	}
 	else
 	{
-		P:7("Class_ResolveGroups<y>: Enable this class: %d For: %d", class, _:forgroup);
 		// Only enable this class for one group.
-		//Group_UpdateAllClass(class, false);
-		//Group_SetClass(forgroup, class, true);
-		/*#if !(YSIM_HAS_MASTER && (_YSIM_IS_CLIENT || _YSIM_IS_STUB))
-			_yGIClass(-1, 2, _:forgroup);
-			Class_InitialiseFromGroups(el);
-			_yGIClass(-1, 3, _:forgroup);
-		#endif
-		GROUP_ADD<forgroup>
-		{
-			// el.
-		}*/
-		if (forgroup == Group:-1) Group_ExclusiveClass(GROUP_GLOBAL, class);
-		else Group_ExclusiveClass(forgroup, class);
+		Group_UpdateAllClass(class, false);
+		Group_SetClass(forgroup, class, true);
 	}
 }

+ 7 - 18
pawno/include/YSI/internal/y_funcinc.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					===============================
 					 y_funcinc - Fix SYSREQ.C bugs
 					===============================
@@ -20,17 +20,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI funcinc include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -45,16 +45,15 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
 	06/08/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 forward _@_y_funcinc_@_();
 public _@_y_funcinc_@_()
@@ -64,14 +63,4 @@ public _@_y_funcinc_@_()
 	printf("");
 	new _funcinc_a[1 char];
 	strunpack(_funcinc_a, "");
-	memcpy("", "", 0, 0, 0);
-	format("", 0, "");
-	strfind("", "", false, 0);
-	strcat(_funcinc_a, "", 0);
-	strlen("");
-	CallRemoteFunction("", "");
-	CallLocalFunction("", "");
-	SetTimerEx("", 0, 0, "");
 }
-
-//#include "..\y_utils"

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 134 - 983
pawno/include/YSI/internal/y_grouponce.inc


+ 10 - 17
pawno/include/YSI/internal/y_grouprevert.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					=======================================
 					 y_groups - Player group abstractions! 
 					=======================================
@@ -18,17 +18,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI group include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -43,30 +43,23 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
 	29/11/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #undef _inc_y_grouprevert
 
-#if defined _YSIM_LAST_MANUAL
-	#define _YSIM_RESET_USER
-#else
-	#define MASTER 23
-	//GAAA
-	// GAAA?  Clearly something was annoying me...
-#endif
-
-#include "..\y_master"
+#define _YSIM_RESET_USER
+#include <YSI\y_master>
 
 #if defined GROUP_LIBRARY_NAME && defined GROUP_LIBRARY_SIZE
+//	#include <YSI\internal\y_groupsingle>
 	#undef _GROUP_MAKE_NAME
 	#undef _GROUP_MAKE_LIMIT
 	#define _GROUP_MAKE_NAME        GROUP_LIBRARY_NAME

+ 309 - 618
pawno/include/YSI/internal/y_groupsecond.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					=======================================
 					 y_groups - Player group abstractions! 
 					=======================================
@@ -18,17 +18,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI group include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -43,28 +43,44 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
-	2.0
+	1.0
 Changelog:
-	21/10/12:
-		Added Group_Get... functions.
-	20/10/12:
-		Pretty much a ground-up API-compatible rewrite.  Shorter and reliabler.
 	29/11/10:
 		First version
-\*----------------------------------------------------------------------------*/
-
-#undef _inc_y_groupsecond
+-*----------------------------------------------------------------------------*/
+	
+	#undef _inc_y_groupsecond
+	
+	// This is actually the second half of a function!
+	//_GROUP_INIT(group);
+	//_GROUP_MAKE_NAME<Group_...Init>(group);
+	#if YSIM_HAS_MASTER
+		#if YSIM_IS_CLIENT
+		#else
+			#if YSIM_IS_SERVER
+				_GROUP_OPC_IS_CALLED(playerid);
+			#else
+				#if YSIM_IS_STUB
+					#error y_groupsecond called with YSIM_IS_STUB.
+				#else
+					_GROUP_OPC_IS_CALLED(playerid);
+				#endif
+			#endif
+		#endif
+	#else
+		_GROUP_OPC_IS_CALLED(playerid);
+	#endif
+	// This is also NOT a master controlled function as the group master may be
+	// different to a system using the group system's master.
+	#pragma tabsize 4
+	_GROUP_OPC_OTHER_CALLED(playerid);
+}
 
-// This code, having been updated to use the later version of y_hooks,
-// unfortunately no longer has one function spread between two files, which was
-// a very unique (required) code feature.  However this version should be better
-// overall (at least slightly).
-//#include "..\y_hooks"
+forward _GROUP_OPC_PUBLIC(playerid);
 
 // This file contains generic code for setting all the stats to do with a single
 // element type.  Groups can be defined for any element (classes, objects etc)
@@ -78,701 +94,376 @@ Changelog:
 	#error Please define _GROUP_MAKE_LIMIT before including y_groups.
 #endif
 
-#if !defined _GROUP_MAKE_TAG
-	#define _GROUP_MAKE_TAG _
-#endif
-
 // Start of the multi-use file.
 static stock
-	BitArray:_GROUP_GROUP_NAME[_GROUP_MAKE_LIMIT]<_:_MAX_GROUPS_G>,
-	BitArray:_GROUP_DEFAULTS<_:_MAX_GROUPS_G>,
-	BitArray:YSI_g_sEmpty<_:_MAX_GROUPS_G>,
-	_yGI,
-	_yGU,
-	_yGA;
+	BitArray:_GROUP_GLOBAL_NAME<_GROUP_MAKE_LIMIT>,
+	BitArray:_GROUP_GROUP_NAME[MAX_GROUPS]<_GROUP_MAKE_LIMIT>,
+	BitArray:_GROUP_DEFAULTS<_:MAX_GROUPS + 1>,
+	YSI_g_sNextUpdateFunc[32],
+	YSI_g_sNextInitFunc[32],
+	bool:YSI_g_sHasOPC = false;
+
+// Initialise permissions for a new player based on the default settings.  This
+// is one of the few places where direct master system intervention is required
+// due to the horrible combination of function naming macros.
+// TODO: Uncomment when the better y_hooks library is integrated.
+
+_GROUP_OPC_OTHER_CALLED(playerid)
+{
+	if (YSI_g_sHasOPC) CallLocalFunction(#_GROUP_OPC_PUBLIC, "i", playerid);
+}
+
+#if YSIM_CLOUD
+	_GROUP_OPC_IS_CALLED(playerid)<>
+	{
+		#pragma unused playerid
+	}
+	
+	_GROUP_OPC_IS_CALLED(playerid)<_YCM:y>
+#else
+	stock _GROUP_OPC_IS_CALLED(playerid)
+#endif
+{
+	P:3(#_GROUP_OPC_IS_CALLED " called in %d", _@);
+	for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
+	{
+		// Set and unset all the global items.
+		_GROUP_SET_PLAYER(j, playerid, Bit_Get(_GROUP_GLOBAL_NAME, j));
+		P:5(#_GROUP_SET_PLAYER ": Set %d %d %d", j, playerid, Bit_Get(_GROUP_GLOBAL_NAME, j));
+	}
+}
 
-// Define the callback chaining for the current 
 #if YSIM_HAS_MASTER
-	#if _YSIM_IS_CLIENT
-		#define _gchain%0(%2) stock _GROUP_MAKE_NAME<%0...>(%2)
-		
-		// Should never be needed.
-		#define _GROUP_SET_PLAYER _GROUP_MAKE_NAME<_Error_..._Client_Set>
+	#if YSIM_IS_CLIENT
+		#define __GF<%0...%1>[%2](%3)<%4> stock _GROUP_MAKE_NAME<%0...%1>(%3)U@(8,YSIM_CALLER,_@),W@(#@#_GROUP_MAKE_NAME<%0...%1>,#%2#x,%4),U@(8,YSIM_CALLER,-1);stock _GROUP_MAKE_NAME<_%0...%1>(%3)
 	#else
-		#if _YSIM_IS_SERVER
-			#define _gchain%0(%2) _GROUP_MAKE_NAME<%0...>(%2);public _GROUP_MAKE_NAME<%0...>(%2);for(J@=1;J@;GROUP_CHAIN?<%0>(%2))
-			#define _GROUP_SET_PLAYER _GROUP_MAKE_NAME<..._SetPlayer>
+		#if YSIM_IS_SERVER
+			#define __GF<%0...%1>[%2](%3)<%4> forward _GROUP_MAKE_NAME<@%0...%1>(%3);_GROUP_MAKE_NAME<@%0...%1>(%3)_GROUP_MAKE_NAME<%0...%1>(%4);_GROUP_MAKE_NAME<%0...%1>(%3)
 		#else
-			#if _YSIM_IS_STUB
-				#define _gchain%0(%2) stock _GROUP_MAKE_NAME<%0...>(%2)
-				
-				// Because of the interaction between the various things that
-				// the groups and master systems this will NEVER be called in a
-				// stub script - and if it is we now get a nice compile-time
-				// error telling us so!  It may, however, prove difficult to
-				// trace!
-				#define _GROUP_SET_PLAYER _GROUP_MAKE_NAME<_Error_..._Stub_Set>
+			#if YSIM_IS_STUB
+				#error y_groupsecond called with YSIM_IS_STUB.
 			#else
-				#define _gchain%0(%2) _GROUP_MAKE_NAME<%0...>(%2);public _GROUP_MAKE_NAME<%0...>(%2)<>GROUP_CHAIN?<%0>(%2);public _GROUP_MAKE_NAME<%0...>(%2)<_YCM:y>for(J@=1;J@;GROUP_CHAIN?<%0>(%2))
-				
-				#define _GROUP_SET_PLAYER _GROUP_MAKE_NAME<..._SetPlayer>
+				#define __GF<%0...%1>[%2](%3)<%4> forward _GROUP_MAKE_NAME<@%0...%1>(%3);_GROUP_MAKE_NAME<@%0...%1>(%3)<>{}_GROUP_MAKE_NAME<@%0...%1>(%3)<_YCM:y>_GROUP_MAKE_NAME<%0...%1>(%4);_GROUP_MAKE_NAME<%0...%1>(%3)<>Y@(),W@(#@#_GROUP_MAKE_NAME<%0...%1>,#%2#x,%4),T@();_GROUP_MAKE_NAME<%0...%1>(%3)<_YCM:y>
 			#endif
 		#endif
 	#endif
 #else
-	#define _gchain%0(%2) _GROUP_MAKE_NAME<%0...>(%2);public _GROUP_MAKE_NAME<%0...>(%2);for(J@=1;J@;GROUP_CHAIN?<%0>(%2))
-	
-	#define _GROUP_SET_PLAYER _GROUP_MAKE_NAME<..._SetPlayer>
+	#define __GF<%0...%1>[%2](%3)<%4> stock _GROUP_MAKE_NAME<%0...%1>(%3)
 #endif
 
-/*----------------------------------------------------------------------------*\
-Function:
-	Group_FU
-Params:
-	playerid - Player to check.
-	el - Element to show or hide.
-	previous - The old state of affairs.
-	current - The new state of affairs.
-	reference - What to compare changes to.
-Return:
-	-
-Notes:
-	I did have a good reason for calling this "FU", but I forgot it!  Anyway,
-	the state of some groups has changed - either a player's groups or an
-	elements groups have changed.  If the player could previously see the
-	element but now can't, hide it.  If the player previously couldn't see it
-	but now can, show it.  If there is no change do nothing.  The old version of
-	this library would just re-show the element even if they could already see
-	it, but this was a bad design as it could incur large overheads in other
-	libraries when they had to do IO to enable or disable something for a
-	player.
-	
-	The change can be in either the player's groups or the element's groups,
-	either way this code will work regardless.
-	
-	Oh yeah, "FU" means "Full Update".
-\*----------------------------------------------------------------------------*/
+_GROUP_CREATE(group,idx);
 
-static stock Group_FU(playerid, el, Bit:previous[], Bit:current[], Bit:reference[])
-{
-	// "_GROUPS_CHECK" is a macro that expands to a massive unrolled "if"
-	// statement checking up to 512 groups at once.  Any more than that and this
-	// code resorts to a loop instead.  I say "at once"; it does 32 AT ONCE
-	// (as in truly in parallel), starting with the most likely match (the
-	// default group that every player and every element is usually in), and
-	// loops over all the groups in 32 group chunks.  When I say "loop", this
-	// could be in the form of a huge "if" statement with every iteration put in
-	// explicitly.
-	// nr = NOT REFERENCE
-	// ar = ALOW REFERENCE
-	// cur = NEW SETTINGS
-	// pre = PREVIOUS SETTINGS
-	/*if (Bit_Get(gNotDat, el))
-	{
-		if (Bit_Get(gAndDat, el))
-		{
-			_GROUPS_CHECK_IN(ar, cur)
-			{
-				_GROUPS_CHECK_NONE(nr, cur)
-				{
-					_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, true);
-					return;
-				}
-			}
-			// SHOULD IT BE REMOVED?
-			{
-				_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, false);
-				return;
-			}
-		}
-		else
-		{
-			_GROUPS_CHECK_ANY(ar, cur)
-			{
-				_GROUPS_CHECK_NONE(nr, cur)
+#if YSIM_HAS_MASTER
+	#if YSIM_IS_CLIENT
+		// Note: not the same.
+		_GROUP_MAKE_NAME<_yG@Init...>(group,idx)
+	#else
+		#if YSIM_IS_SERVER
+			_GROUP_CREATE(group,idx)
+		#else
+			#if !YSIM_IS_STUB
+				_GROUP_CREATE(group,idx)<>
 				{
-					_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, true);
-					return;
+					P:3(#_GROUP_MAKE_NAME<@yG_Init...> " called in %d", _@);
+					if (group == -1)
+					{
+						YSI_g_sHasOPC = funcidx(#_GROUP_OPC_PUBLIC) != -1;
+						P:3(#_GROUP_OPC_PUBLIC " does%s exist", YSI_g_sHasOPC ? ("") : ("not"));
+						new
+							a = Scripting_GetPublic(idx >>> 16, YSI_g_sNextUpdateFunc, "@yG_Upd"),
+							b = Scripting_GetPublic(idx & 0xFFFF, YSI_g_sNextInitFunc, "@yG_Init");
+						if (b)
+						{
+							CallLocalFunction(YSI_g_sNextInitFunc, "ii", -1, (a << 16) | b);
+						}
+					}
 				}
-			}
-			// SHOULD IT BE REMOVED?
-			{
-				_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, false);
-				return;
-			}
-		}
-	}
-	else
-	{
-		if (Bit_Get(gAndDat, el))
-		{
-			_GROUPS_CHECK_IN(ar, cur)
-			{
-				_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, true);
-				return;
-			}
-			// SHOULD IT BE REMOVED?
-			{
-				_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, false);
-				return;
-			}
-		}
-		else
-		{
-			_GROUPS_CHECK_ANY(ar, cur)
-			{
-				_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, true);
-				return;
-			}
-			// SHOULD IT BE REMOVED?
-			{
-				_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, false);
-				return;
-			}
-		}
-	}*/
-	/*_GROUPS_CHECK_ALL(nr, ar)
-	{
-		_GROUPS_CHECK_IN(ar, cur)
-		{
-			_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, true);
-			return;
-		}
-		_GROUPS_CHECK_IN(ar, pre)
-		{
-			_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, false);
-			return;
-		}
-		return;
-	}
-	_GROUPS_CHECK_ANY(ar, cur)
+				
+				_GROUP_CREATE(group,idx)<_YCM:y>
+			#endif
+		#endif
+	#endif
+#else
+	_GROUP_CREATE(group,idx)
+#endif
+{
+	P:3(#_GROUP_MAKE_NAME<@yG_Init...> " called in %d", _@);
+	if (group == -1)
 	{
-		_GROUPS_CHECK_NONE(nr, cur)
+		Bit_SetAll(_GROUP_GLOBAL_NAME, true, bits<_GROUP_MAKE_LIMIT>);
+		Bit_Let(_GROUP_DEFAULTS, _:MAX_GROUPS);
+		// Initialise the next item
+		YSI_g_sHasOPC = funcidx(#_GROUP_OPC_PUBLIC) != -1;
+		P:3(#_GROUP_OPC_PUBLIC " does%s exist", YSI_g_sHasOPC ? ("") : (" not"));
+		new
+			a = Scripting_GetPublic(idx >>> 16, YSI_g_sNextUpdateFunc, "@yG_Upd"),
+			b = Scripting_GetPublic(idx & 0xFFFF, YSI_g_sNextInitFunc, "@yG_Init");
+		if (b)
 		{
-			_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, true);
-			return;
+			CallLocalFunction(YSI_g_sNextInitFunc, "ii", -1, (a << 16) | b);
 		}
 	}
-	_GROUPS_CHECK_IN(ar, pre)
-	{
-		_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, false);
-		return;
-	}*/
-	_GROUPS_CHECK_ANY(previous, reference)
+	else if (group < _:MAX_GROUPS)
 	{
-		// Could previously see this thing.  The thing about this design is that
-		// it can (best case) take just 2 comparisons to end - and that should
-		// be the common case!
-		_GROUPS_CHECK_ANY(current, reference)
+		// This is called when a new group is created, it sets the default default
+		// values - i.e. sets everything to true.
+		Bit_SetAll(_GROUP_GROUP_NAME[Group:group], false, bits<_GROUP_MAKE_LIMIT>);
+		Bit_Vet(_GROUP_DEFAULTS, group);
+		if (YSI_g_sNextInitFunc[0])
 		{
-			// Still can.
-			return;
+			CallLocalFunction(YSI_g_sNextInitFunc, "ii", group, -1);
 		}
-		// Now can't.
-		_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, false);
-		return;
 	}
-	// Couldn't see it before.
-	_GROUPS_CHECK_ANY(current, reference)
+}
+
+#if !defined _YSI_GROUPS_FIRST_HALF
+	forward bool:_GROUP_INITIALISE(x = _GROUP_MAKE_LIMIT);
+#endif
+
+stock bool:_GROUP_INITIALISE(x = _GROUP_MAKE_LIMIT) <YSI_has_groups:y>
+{
+	// A new item has been added to the system - update all players according to
+	// the default settings for a group.
+	//_GROUP_UPDATE_ALL(_GROUP_LOCAL_NAME);
+	if (x != _GROUP_MAKE_LIMIT)
 	{
-		// They have whatever this thing is.  Note that this may be called
-		// MULTIPLE times for an element, without anything actually changing.
-		// I.e. this could be set to "true" repeatedly while never being set
-		// to "false".
-		_GROUP_SET_PLAYER(_GROUP_MAKE_TAG:el, playerid, true);
-		// We use "return" here because "_GROUPS_CHECK_ANY" MAY be a loop.
-		return;
+		P:3(#_GROUP_INITIALISE "<YSI_has_groups:y> called in %d", _@);
+		_GROUP_MAKE_NAME<Group_UpdateAll...>(x, true);
 	}
+	return true;
 }
 
-/*----------------------------------------------------------------------------*\
-Function:
-	_yGI
-Params:
-	&ni - Next init function variable as returned by y_amx.
-	&na - Next add function variable as returned by y_amx.
-	&nu - Next update function variable as returned by y_amx.
-Return:
-	-
-Notes:
-	This function is called when the group system first starts up to initialise
-	the global group and all the various function pointers.  The way the
-	"_gchain" macro works means that the fact that "ni" etc are references is
-	irrelevant; however, it does make the code LOOK much nicer and like
-	assigning to the variables does have some wider meaning.
-	
-	If this is called with "ni = -1", it is special code to temporarilly set or
-	restore the defaults for use with the "GROUP_ADD" macro.
-\*----------------------------------------------------------------------------*/
-
-_gchain _yGI(&ni, &na, &nu)
+// Called to set all players to a new element.  Can ignore defaults for
+// specialised setups such as classes.
+__GF<Group_UpdateAll...>[i](_GROUP_LOCAL_NAME,bool:d)<_GROUP_LOCAL_NAME,d>
 {
-	if (ni == -1)
+	// Set the permissions from the defaults for each groups.
+	new
+		s = Bit_Slot(_GROUP_LOCAL_NAME),
+		Bit:m = Bit_Mask(_GROUP_LOCAL_NAME),
+		Bit:v = ~m;
+	if (d)
 	{
-		static
-			BitArray:sStack<_MAX_GROUPS_G>;
-		if (na)
+		for (new Group:i; i != MAX_GROUPS; ++i)
 		{
-			//printf("PUSH %d", nu);
-			// Called to "push" the default settings.
-			sStack = _GROUP_DEFAULTS;
-			//printf("ONE %d", nu);
-			_GROUP_DEFAULTS = YSI_g_cEmptyGroups;
-			//printf("TWO %d", nu);
-			Bit_Let(_GROUP_DEFAULTS, nu);
-			//printf("THREE %d", nu);
-			for (new i = 0; i != bits<_MAX_GROUPS_G>; ++i)
-			{
-				YSI_g_sEmpty[i] = ~_GROUP_DEFAULTS[i];
-			}
-			//printf("DONE %d", nu);
-		}
-		else
-		{
-			//printf("POP");
-			// Called to "pop" the default settings.
-			_GROUP_DEFAULTS = sStack;
-			YSI_g_sEmpty = YSI_g_cEmptyGroups;
+			if (Bit_Get(_GROUP_DEFAULTS, i)) _GROUP_GROUP_NAME[i][s] |= m;
+			else _GROUP_GROUP_NAME[i][s] &= v;
 		}
+		// Set the default settings.
+		if (Bit_Get(_GROUP_DEFAULTS, MAX_GROUPS)) _GROUP_GLOBAL_NAME[s] |= m;
+		else _GROUP_GLOBAL_NAME[s] &= v;
+		// Now update all the existing players.
+		foreach (Player, i) _GROUP_MAKE_NAME<Group_UpdatePlayer...>(_GROUP_LOCAL_NAME, i);
 	}
 	else
 	{
-		P:4(#_GROUP_MAKE_NAME<_yGI...> " called: %i, %i, %i", ni, na, nu);
-		// Enable the default group.  If I'm right, this way is actually better than
-		// using variables as in most cases because "_MAX_GROUPS" is a constant so
-		// all the other maths will be constant.
-		Bit_Let(_GROUP_DEFAULTS, _MAX_GROUPS);
-		// Don't need this loop anymore, it is done for every element individually.
-		//for (new i = 0; i != _GROUP_MAKE_LIMIT; ++i)
-		//{
-		//	// Basically, enable everything in the default group.
-		//	Bit_Let(_GROUP_GROUP_NAME[i], _MAX_GROUPS);
-		//}
-		// Set up the function chaining.
-		ni = AMX_GetPublicPointerPrefix(ni, _yGI, _A<_yGI>);
-		na = AMX_GetPublicPointerPrefix(na, _yGA, _A<_yGA>);
-		nu = AMX_GetPublicPointerPrefix(nu, _yGU, _A<_yGU>);
+		P:3(#_GROUP_MAKE_NAME<Group_UpdateAll...> " called as 0");
+		for (new Group:i; i != MAX_GROUPS; ++i) _GROUP_GROUP_NAME[i][s] &= v;
+		_GROUP_GLOBAL_NAME[s] &= v;
 	}
 }
 
-/*----------------------------------------------------------------------------*\
-Function:
-	Group_Exclusive...
-Params:
-	Group:g - Group to add this to.
-	_GROUP_MAKE_TAG:el - Element to add.
-Return:
-	-
-Notes:
-	Add this element to ONLY this group and remove it from any others it might
-	already be in.  This is basically a simplified version of "GROUP_ADD".
-\*----------------------------------------------------------------------------*/
-
-gforeign Group_Exclusive...(Group:g,_GROUP_MAKE_TAG:el);
-
-gglobal Group_Exclusive...(Group:g,_GROUP_MAKE_TAG:el)
+static stock _GROUP_MAKE_NAME<Group_UpdatePlayer...>(_GROUP_LOCAL_NAME,playerid)
 {
-	if (GROUP_MASK <= g <= GROUP_GLOBAL)
+	if (Bit_Get(_GROUP_GLOBAL_NAME, _GROUP_LOCAL_NAME))
 	{
-		GROUP_FIX(g);
-		YSI_gTempGroups = _GROUP_DEFAULTS;
-		_GROUP_DEFAULTS = YSI_g_cEmptyGroups;
-		Bit_Let(_GROUP_DEFAULTS, _:g);
-		for (new i = 0; i != bits<_MAX_GROUPS_G>; ++i)
-		{
-			YSI_g_sEmpty[i] = ~_GROUP_DEFAULTS[i];
-		}
-		_GROUP_INITIALISE(el);
-		_GROUP_DEFAULTS = YSI_gTempGroups;
-		YSI_g_sEmpty = YSI_g_cEmptyGroups;
-		return 1;
+		_GROUP_SET_PLAYER(_GROUP_LOCAL_NAME, playerid, true);
+		return;
 	}
-	return 0;
-}
-
-/*----------------------------------------------------------------------------*\
-Function:
-	_yGA
-Params:
-	&group - The group that was just created.
-Return:
-	-
-Notes:
-	The given group was just created, loop over all elements and make sure they
-	are NOT in this group - only the global group has a "default default" of
-	true.  We don't need to update any players with this as no-one will ever be
-	in a brand new group.
-\*----------------------------------------------------------------------------*/
-
-_gchain _yGA(&group)
-{
-	P:4(#_GROUP_MAKE_NAME<_yGA...> " called: %i", _:group);
-	// Adding a new group is now a lot harder than it was before, but on the
-	// other hand, adding and using elements is vastly simpler so that's OK.
 	new
-		s = Bit_Slot(group),
-		Bit:m = ~Bit_Mask(group);
-	// Set the default "contains" for this group to false.
-	_GROUP_DEFAULTS[s] &= m;
-	// Disable every element in this group.
-	for (new i = 0; i != _GROUP_MAKE_LIMIT; ++i)
+		ps = Bit_Slot(playerid),
+		Bit:pm = Bit_Mask(playerid),
+		es = Bit_Slot(_GROUP_LOCAL_NAME),
+		Bit:em = Bit_Mask(_GROUP_LOCAL_NAME);
+	for (new Group:i; i != MAX_GROUPS; ++i)
 	{
-		_GROUP_GROUP_NAME[i][s] &= m;
+		if (_Group_IsActive(i) && YSI_gGroupPlayers[i][ps] & pm && _GROUP_GROUP_NAME[i][es] & em)
+		//if (Group_IsActive(i) && Group_HasPlayer(i, playerid) && Bit_Get(_GROUP_GROUP_NAME[i], _GROUP_LOCAL_NAME))
+		{
+			_GROUP_SET_PLAYER(_GROUP_LOCAL_NAME, playerid, true);
+			return;
+		}
 	}
+	_GROUP_SET_PLAYER(_GROUP_LOCAL_NAME, playerid, false);
 }
 
-/*----------------------------------------------------------------------------*\
-Function:
-	_yGU
-Params:
-	&pid - The player who joined or left groups.
-	Bit:p[] - Their previous groups.
-	Bit:c[] - Their new groups.
-Return:
-	-
-Notes:
-	The player "pid" just joined or left a group (or groups - can do multiple).
-	Update their visibility accordingly.  This function is ONLY called if there
-	is a CHANGE - earlier functions confirm that they weren't already in (or
-	not) this group(s) before the call.
-\*----------------------------------------------------------------------------*/
+_GROUP_UPDATE_PLAYER(playerid, group, set);
 
-_gchain _yGU(&pid, Bit:p[], Bit:c[])
+#if YSIM_HAS_MASTER
+	#if YSIM_IS_CLIENT
+		// Note: not the same.
+		_GROUP_MAKE_NAME<_yG@Upd...>(playerid, group, set)
+	#else
+		#if YSIM_IS_SERVER
+			_GROUP_UPDATE_PLAYER(playerid, group, set)
+		#else
+			#if !YSIM_IS_STUB
+				_GROUP_UPDATE_PLAYER(playerid, group, set)<>
+				{
+					if (YSI_g_sNextUpdateFunc[0])
+					{
+						CallLocalFunction(YSI_g_sNextUpdateFunc, "iii", playerid, group, set);
+					}
+				}
+				
+				_GROUP_UPDATE_PLAYER(playerid, group, set)<_YCM:y>
+			#endif
+		#endif
+	#endif
+#else
+	_GROUP_UPDATE_PLAYER(playerid, group, set)
+#endif
 {
-	P:4(#_GROUP_MAKE_NAME<_yGU...> " called: %i, %s, %s", pid, Bit_Display(p, bits<_MAX_GROUPS_G>), Bit_Display(c, bits<_MAX_GROUPS_G>));
-	// This code loops over every "thing" controlled by this script.  For every
-	// one it checks to see if the player can or can't see something that they
-	// previously could or couldn't see.  If their ability to see it has
-	// changed then the "_GROUP_SET_PLAYER" function in the controlling library
-	// is called to do the actual internal function of updating their state.
-	for (new el = 0; el != _GROUP_MAKE_LIMIT; ++el)
+	if (set)
 	{
-		Group_FU(pid, el, p, c, _GROUP_GROUP_NAME[el]);
+		// Joined a group - add everything they will need.
+		for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
+		{
+			if (Bit_Get(_GROUP_GROUP_NAME[group], j))
+			{
+				_GROUP_SET_PLAYER(j, playerid, true);
+			}
+		}
 	}
-}
-
-/*----------------------------------------------------------------------------*\
-Function:
-	_GROUP_INITIALISE
-Params:
-	x - The element that was added (maybe).
-	s - Was the element added or removed?
-Return:
-	-
-Notes:
-	The name is a macro, so this function isn't actually called this.  This is
-	called when a new element is created, and as such it is NOT chained to other
-	parts of the groups system because each part handles one type of element.
-	Loop through all players and set up the element for them if they are in a
-	group that this is also in by default.
-	
-	If x is "_GROUP_MAKE_LIMIT" then this is the test used in OnPlayerConnect in
-	various libraries to see if the groups system exists, and if not locally
-	initialise the player instead of leaving it up to this system.
-\*----------------------------------------------------------------------------*/
-
-#if !defined _YSI_GROUPS_FIRST_HALF
-	forward bool:_GROUP_INITIALISE(_GROUP_MAKE_TAG:x = _GROUP_MAKE_TAG:_GROUP_MAKE_LIMIT);
-#endif
-
-stock bool:_GROUP_INITIALISE(_GROUP_MAKE_TAG:x = _GROUP_MAKE_TAG:_GROUP_MAKE_LIMIT) <YSI_has_groups:y>
-{
-	P:4(#_GROUP_INITIALISE " called: %i", x);
-	// A new item has been added to the system - update all players according to
-	// the default settings for a group.
-	if (x != _GROUP_MAKE_TAG:_GROUP_MAKE_LIMIT)
+	else
 	{
-		//static
-		//	BitArray:sEmpty<_MAX_GROUPS_G>;
-		//printf("%d %s %s", _:x, Bit_Display(_GROUP_DEFAULTS), Bit_Display(YSI_g_sEmpty));
-		_GROUP_GROUP_NAME[_:x] = _GROUP_DEFAULTS;
-		foreach (new playerid : Player)
+		// Left a group - full update.
+		for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
 		{
-			// Uses "YSI_g_sEmpty" instead of a truly blank variable so that we
-			// can ensure that NO other groups have this element when we use the
-			// "GROUP_ADD" macro.
-			Group_FU(playerid, _:x, YSI_g_sEmpty, _GROUP_DEFAULTS, YSI_gGroupPlayers[playerid]);
+			_GROUP_MAKE_NAME<Group_UpdatePlayer...>(j, playerid);
 		}
 	}
-	return true;
 }
 
-/*----------------------------------------------------------------------------*\
-Function:
-	Group_Set...Default
-Params:
-	Group:g - Group to set for.
-	bool:s - Set or unset?
-Return:
-	-
-Notes:
-	If "s" is true, then all elements are added to this group (i.e. the default
-	is set to true and all previous settings are wiped out).  If it is false
-	then all elements are removed and a full update is done.
-\*----------------------------------------------------------------------------*/
-
-gforeign Group_Set...Default(Group:g,bool:s);
-
-gglobal Group_Set...Default(Group:g,bool:s)
+__GF<Group_Set...Default>[ii](Group:g,bool:s)<g,s>
 {
-	P:2(#_GROUP_MAKE_NAME<Group_Set...Default> " called: %i, %i", _:g, s);
-	if (GROUP_MASK <= g <= GROUP_GLOBAL)
+	GROUP_FIX(g);
+	if (g == GROUP_GLOBAL & ~GROUP_MASK)
 	{
-		// There is now NO validity check for reasons of distruibution.
-		GROUP_FIX(g);
-		new
-			slot = Bit_Slot(g),
-			Bit:mask = Bit_Mask(g),
-			Iterator:GP<MAX_PLAYERS>;
-		foreach (new playerid : Player)
-		{
-			// Do this check here so it is only done once per player.  This is a
-			// good argument for moving iterators to be duplicated in every
-			// script; however, the default "Group()" iterator implementation is
-			// a function, not a standard iterator - actually it now isn't...
-			if (YSI_gGroupPlayers[playerid][slot] & mask)
-			{
-				// Make a fast local iterator of all the players.
-				Iter_Add(GP, playerid);
-			}
-		}
-		static
-			BitArray:sNext<_MAX_GROUPS_G>;
+		_GROUP_MAKE_NAME<Group_SetGlobal...Default>(s);
+	}
+	else if (_Group_IsValid(g))
+	{
+		Bit_SetAll(_GROUP_GROUP_NAME[g], s, bits<_GROUP_MAKE_LIMIT>);
 		if (s)
 		{
 			Bit_Let(_GROUP_DEFAULTS, _:g);
-			for (new el = 0; el != _GROUP_MAKE_LIMIT; ++el)
+			foreach (Player, i)
 			{
-				sNext = _GROUP_GROUP_NAME[el];
-				if (sNext[slot] & mask)
+				if (_Group_HasPlayer(g, i))
 				{
-					continue;
+					for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
+					{
+						_GROUP_SET_PLAYER(j, i, true);
+					}
 				}
-				// Is this element NOT in the current group?
-				Bit_Let(sNext, _:g);
-				foreach (new playerid : GP)
-				{
-					Group_FU(playerid, el, _GROUP_GROUP_NAME[el], sNext, YSI_gGroupPlayers[playerid]);
-				}
-				_GROUP_GROUP_NAME[el] = sNext;
 			}
 		}
 		else
 		{
 			Bit_Vet(_GROUP_DEFAULTS, _:g);
-			for (new el = 0; el != _GROUP_MAKE_LIMIT; ++el)
+			foreach (Player, i)
 			{
-				sNext = _GROUP_GROUP_NAME[el];
-				if (!(sNext[slot] & mask))
-				{
-					continue;
-				}
-				// Is this element in the current group?
-				Bit_Vet(sNext, _:g);
-				foreach (new playerid : GP)
+				if (_Group_HasPlayer(g, i))
 				{
-					Group_FU(playerid, el, _GROUP_GROUP_NAME[el], sNext, YSI_gGroupPlayers[playerid]);
+					for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
+					{
+						_GROUP_MAKE_NAME<Group_UpdatePlayer...>(j, i);
+					}
 				}
-				_GROUP_GROUP_NAME[el] = sNext;
 			}
 		}
-		return 1;
 	}
-	return 0;
-}
-
-/*----------------------------------------------------------------------------*\
-Function:
-	Group_SetGlobal...Default
-Params:
-	bool:s - Set or unset?
-Return:
-	-
-Notes:
-	If "s" is true, then all elements are added to the global group (i.e. the
-	default is set to true and all previous settings are wiped out).  If it is
-	false then all elements are removed and a full update is done.
-\*----------------------------------------------------------------------------*/
-
-gforeign Group_SetGlobal...Default(bool:s);
-
-gglobal Group_SetGlobal...Default(bool:s)
-{
-	P:2(#_GROUP_MAKE_NAME<Group_SetGlobal...Default> " called: %i", s);
-	return _GROUP_MAKE_NAME<Group_Set...Default>(GROUP_GLOBAL, s);
 }
 
-/*----------------------------------------------------------------------------*\
-Function:
-	Group_Set...New
-Params:
-	Group:g - Group to set for.
-	bool:s - Set or unset?
-Return:
-	-
-Notes:
-	Similar to "Group_Set...Default", but doesn't reset all existing elements,
-	just sets the permissions for any future items.
-\*----------------------------------------------------------------------------*/
-
-gforeign Group_Set...New(Group:g,bool:s);
-
-gglobal Group_Set...New(Group:g,bool:s)
+__GF<Group_SetGlobal...Default>[i](bool:s)<s>
 {
-	P:2(#_GROUP_MAKE_NAME<Group_Set...New> " called: %i, %i", _:g, s);
-	if (GROUP_MASK <= g <= GROUP_GLOBAL)
+	Bit_SetAll(_GROUP_GLOBAL_NAME, s, bits<_GROUP_MAKE_LIMIT>);
+	if (s)
 	{
-		// There is now NO validity check for reasons of distruibution.
-		Bit_Set(_GROUP_DEFAULTS, _:GROUP_TEMP_FIX(g), s);
-		return 1;
+		Bit_Let(_GROUP_DEFAULTS, _:MAX_GROUPS);
+		foreach (Player, i)
+		{
+			for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
+			{
+				_GROUP_SET_PLAYER(j, i, true);
+			}
+		}
+	}
+	else
+	{
+		Bit_Vet(_GROUP_DEFAULTS, _:MAX_GROUPS);
+		foreach (Player, i)
+		{
+			for (new j = 0; j != _GROUP_MAKE_LIMIT; ++j)
+			{
+				_GROUP_MAKE_NAME<Group_UpdatePlayer...>(j, i);
+			}
+		}
 	}
-	return 0;
 }
 
-/*----------------------------------------------------------------------------*\
-Function:
-	Group_SetGlobal...New
-Params:
-	bool:s - Set or unset?
-Return:
-	-
-Notes:
-	All elements created FROM THIS POINT ON will have this default setting.
-\*----------------------------------------------------------------------------*/
-
-gforeign Group_SetGlobal...New(bool:s);
-
-gglobal Group_SetGlobal...New(bool:s)
+__GF<Group_SetGlobal...>[ii](_GROUP_LOCAL_NAME,bool:s)<_GROUP_LOCAL_NAME,s>
 {
-	P:2(#_GROUP_MAKE_NAME<Group_SetGlobal...New> " called: %i", s);
-	return _GROUP_MAKE_NAME<Group_Set...New>(GROUP_GLOBAL, s);
+	// Set wether the global group can use this item.
+	//Bit_Set(_GROUP_GLOBAL_NAME, _GROUP_LOCAL_NAME, set, bits<_GROUP_MAKE_LIMIT>);
+	if (s)
+	{
+		Bit_Let(_GROUP_GLOBAL_NAME, _GROUP_LOCAL_NAME);
+		foreach (Player, i)
+		{
+			_GROUP_SET_PLAYER(_GROUP_LOCAL_NAME, i, true);
+		}
+	}
+	else
+	{
+		Bit_Vet(_GROUP_GLOBAL_NAME, _GROUP_LOCAL_NAME);
+		foreach (Player, i)
+		{
+			_GROUP_MAKE_NAME<Group_UpdatePlayer...>(_GROUP_LOCAL_NAME, i);
+		}
+	}
 }
 
-/*----------------------------------------------------------------------------*\
-Function:
-	Group_Set...
-Params:
-	Group:g - Group to set for.
-	el - Element to set.
-	bool:s - Set or unset?
-Return:
-	-
-Notes:
-	If "s" is true, then one element is added to the current group.  False it is
-	removed.
-\*----------------------------------------------------------------------------*/
-
-gforeign Group_Set...(Group:g,_GROUP_MAKE_TAG:el,bool:s);
-
-gglobal Group_Set...(Group:g,_GROUP_MAKE_TAG:el,bool:s)
+__GF<Group_Set...>[iii](Group:g,_GROUP_LOCAL_NAME,bool:s)<g,_GROUP_LOCAL_NAME,s>
 {
-	P:2(#_GROUP_MAKE_NAME<Group_Set...> " called: %i, %i, %i", _:g, _:el, s);
 	// Set wether a group can use this item.
-	if (0 <= _:el < _GROUP_MAKE_LIMIT && GROUP_MASK <= g <= GROUP_GLOBAL)
+	if (0 <= _GROUP_LOCAL_NAME < _GROUP_MAKE_LIMIT)
 	{
-		// There is now NO validity check for reasons of distruibution.
 		GROUP_FIX(g);
-		new
-			slot = Bit_Slot(g),
-			Bit:mask = Bit_Mask(g);
-		//static
-		//	BitArray:sNext<_MAX_GROUPS_G>;
-		if (s)
+		if (g == GROUP_GLOBAL & ~GROUP_MASK)
 		{
-			YSI_gTempGroups = _GROUP_GROUP_NAME[_:el];
-			if (YSI_gTempGroups[slot] & mask)
-			{
-				// No point adding an element to a group that it is already in.
-				return 1;
-			}
-			// Is this element NOT in the current group?
-			Bit_Let(YSI_gTempGroups, _:g);
+			//_GROUP_GLOBAL_FUNC(_GROUP_LOCAL_NAME, set);
+			_GROUP_MAKE_NAME<Group_SetGlobal...>(_GROUP_LOCAL_NAME, s);
 		}
-		else
+		else if (_Group_IsValid(g))
 		{
-			YSI_gTempGroups = _GROUP_GROUP_NAME[_:el];
-			if (!(YSI_gTempGroups[slot] & mask))
+			//Bit_Set(_GROUP_GROUP_NAME[group], _GROUP_LOCAL_NAME, set, bits<_GROUP_MAKE_LIMIT>);
+			if (s)
 			{
-				return 1;
+				Bit_Let(_GROUP_GROUP_NAME[g], _GROUP_LOCAL_NAME);
+				foreach (Player, i)
+				{
+					if (_Group_HasPlayer(g, i))
+					{
+						_GROUP_SET_PLAYER(_GROUP_LOCAL_NAME, i, true);
+					}
+				}
 			}
-			// Is this element in the current group?
-			Bit_Vet(YSI_gTempGroups, _:g);
-		}
-		foreach (new playerid : Player)
-		{
-			if (YSI_gGroupPlayers[playerid][slot] & mask)
+			else
 			{
-				// The player is in the group in question, so they need a full
-				// update.
-				Group_FU(playerid, _:el, _GROUP_GROUP_NAME[_:el], YSI_gTempGroups, YSI_gGroupPlayers[playerid]);
+				Bit_Vet(_GROUP_GROUP_NAME[g], _GROUP_LOCAL_NAME);
+				foreach (Player, i)
+				{
+					if (_Group_HasPlayer(g, i))
+					{
+						//_GROUP_UPDATE(_GROUP_LOCAL_NAME, i);
+						_GROUP_MAKE_NAME<Group_UpdatePlayer...>(_GROUP_LOCAL_NAME, i);
+					}
+				}
 			}
 		}
-		_GROUP_GROUP_NAME[_:el] = YSI_gTempGroups;
-		return 1;
 	}
-	return 0;
-}
-
-/*----------------------------------------------------------------------------*\
-Function:
-	Group_SetGlobal...
-Params:
-	el - Element to set.
-	bool:s - Set or unset?
-Return:
-	-
-Notes:
-	If "s" is true, then one element is added to the global group.  False it is
-	removed.
-\*----------------------------------------------------------------------------*/
-
-gforeign Group_SetGlobal...(_GROUP_MAKE_TAG:el,bool:s);
-
-gglobal Group_SetGlobal...(_GROUP_MAKE_TAG:el,bool:s)
-{
-	P:2(#_GROUP_MAKE_NAME<Group_SetGlobal...> " called: %i, %i", _:el, s);
-	return _GROUP_MAKE_NAME<Group_Set...>(GROUP_GLOBAL, el, s);
-}
-
-/*----------------------------------------------------------------------------*\
-Function:
-	Group_Get...
-Params:
-	Group:g - Group to get from.
-	el - Element to get.
-Return:
-	bool: Does the group have the element?
-Notes:
-	-
-\*----------------------------------------------------------------------------*/
-
-gforeign bool:Group_Get...(Group:g,_GROUP_MAKE_TAG:el);
-
-gglobal bool:Group_Get...(Group:g,_GROUP_MAKE_TAG:el)
-{
-	P:2(#_GROUP_MAKE_NAME<Group_Get...> " called: %i, %i", _:g, _:el);
-	return (0 <= _:el < _GROUP_MAKE_LIMIT && GROUP_MASK <= g <= GROUP_GLOBAL && Bit_Get(_GROUP_GROUP_NAME[_:el], _:GROUP_TEMP_FIX(g)));
-}
-
-/*----------------------------------------------------------------------------*\
-Function:
-	Group_GetGlobal...
-Params:
-	el - Element to get.
-Return:
-	bool: Does the global group have the element?
-Notes:
-	-
-\*----------------------------------------------------------------------------*/
-
-gforeign Group_GetGlobal...(_GROUP_MAKE_TAG:el);
-
-gglobal Group_GetGlobal...(_GROUP_MAKE_TAG:el)
-{
-	P:2(#_GROUP_MAKE_NAME<Group_GetGlobal...> " called: %i", _:el);
-	return _GROUP_MAKE_NAME<Group_Get...>(GROUP_GLOBAL, el);
 }
 
-#undef _GROUP_MAKE_TAG
-#undef _gchain
-#undef _GROUP_SET_PLAYER
+#undef __GF

+ 50 - 16
pawno/include/YSI/internal/y_groupsingle.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					=======================================
 					 y_groups - Player group abstractions! 
 					=======================================
@@ -18,17 +18,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI group include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -43,37 +43,71 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
 	29/11/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #undef _inc_y_groupsingle
 
-#if !defined _GROUP_MAKE_TAG
-	#define _GROUP_MAKE_TAG _
-#endif
+//#undef GROUP_LOCAL
+//#undef Group
+
+/*#if YSIM_HAS_MASTER
+	#if YSIM_IS_CLIENT
+		//#define Group:%0_InitialiseFromGroups(%1)
+		stock _GROUP_INITIALISE(x) <YSI_has_groups:n>
+		{
+			#pragma unused x
+		}
+		
+		stock _GROUP_INITIALISE(x) <>
+		{
+			#pragma unused x
+		}
+	#else
+		#if YSIM_IS_SERVER
+			//#define Group:%0_InitialiseFromGroups(%1) forward _GROUP_INITIALISE(x);_GROUP_INITIALISE(%1)<YSI_has_groups:n>__GROUP_INITIALISE(%1);_GROUP_INITIALISE(%1)<>__GROUP_INITIALISE(%1);static stock __GROUP_INITIALISE(%1)
+			stock bool:_GROUP_INITIALISE(x) <YSI_has_groups:n>
+			{
+				#pragma unused x
+				return false;
+			}
+			
+			stock bool:_GROUP_INITIALISE(x) <>
+			{
+				#pragma unused x
+				return false;
+			}
+		#else
+			#if YSIM_IS_STUB
+				#error y_groupsingle called with YSIM_IS_STUB.
+			#else
+				//#define Group:%0_InitialiseFromGroups(%1) forward _GROUP_INITIALISE(x);_GROUP_INITIALISE(%1)<YSI_has_groups:n>__GROUP_INITIALISE(%1);_GROUP_INITIALISE(%1)<>__GROUP_INITIALISE(%1);static stock __GROUP_INITIALISE(%1)
+			#endif
+		#endif
+	#endif
+#else
+	//#define Group:%0_InitialiseFromGroups(%1) forward _GROUP_INITIALISE(x);_GROUP_INITIALISE(%1)<YSI_has_groups:n>__GROUP_INITIALISE(%1);_GROUP_INITIALISE(%1)<>__GROUP_INITIALISE(%1);static stock __GROUP_INITIALISE(%1)
+#endif*/
 
 #if !defined _YSI_HAS_GROUP_SYSTEM
-	forward bool:_GROUP_INITIALISE(_GROUP_MAKE_TAG:x = _GROUP_MAKE_TAG:_GROUP_MAKE_LIMIT);
+	forward bool:_GROUP_INITIALISE(x = _GROUP_MAKE_LIMIT);
 #endif
 
-stock bool:_GROUP_INITIALISE(_GROUP_MAKE_TAG:x = _GROUP_MAKE_TAG:_GROUP_MAKE_LIMIT) <YSI_has_groups:n>
+stock bool:_GROUP_INITIALISE(x = _GROUP_MAKE_LIMIT) <YSI_has_groups:n>
 {
 	#pragma unused x
 	return false;
 }
 
-stock bool:_GROUP_INITIALISE(_GROUP_MAKE_TAG:x = _GROUP_MAKE_TAG:_GROUP_MAKE_LIMIT) <>
+stock bool:_GROUP_INITIALISE(x = _GROUP_MAKE_LIMIT) <>
 {
 	#pragma unused x
 	return false;
 }
-
-#undef _GROUP_MAKE_TAG

+ 17 - 12
pawno/include/YSI/internal/y_nogroups.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					=======================================
 					 y_groups - Player group abstractions! 
 					=======================================
@@ -18,17 +18,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI groups include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -43,16 +43,15 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
 	29/11/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 // This file defines functions which are called if the group system is not used.
 
@@ -64,6 +63,11 @@ static stock _Groups_DefineStates_() <YSI_has_groups:y>
 {
 }
 
+/*stock _@Group_Sink(e)
+{
+	#pragma unused e
+}*/
+
 // Now you can use the default fallback to define functions:
 //  
 //  stock Class_InitialiseFromGroups() <YSI_has_groups:n>
@@ -77,17 +81,18 @@ static stock _Groups_DefineStates_() <YSI_has_groups:y>
 //  }
 //  
 
-#define _GROUP_LOCAL_NAME               _GROUP_MAKE_TAG:e
+#define _GROUP_LOCAL_NAME               e
 #define _GROUP_INITIALISE               _GROUP_MAKE_NAME<..._InitialiseFromGroups>
+//#define __GROUP_INITIALISE              _GROUP_MAKE_NAME<_..._InitialiseFromGroups>
+
+#define Group:
 
 // Dummy values.
 #define _GROUP_MAKE_NAME<%0...%1>       %0_%1
 #define _GROUP_MAKE_LIMIT               0
 
-#define INVALID_GROUP (Group:-1)
+#define GROUP_GLOBAL                    (Group:-1)
 #define GROUP_MASK                      (Group:0x80000000)
-#define GROUP_GLOBAL                    (Group:_MAX_GROUPS | GROUP_MASK) //-1)
 #define GROUP_FIX(%0)                   ((%0)&=~GROUP_MASK)
-#define GROUP_TEMP_FIX(%0)              ((%0)&~GROUP_MASK)
 
 #define NO_GROUPS(%0) if(!_GROUP_INITIALISE(%0))

+ 7 - 8
pawno/include/YSI/internal/y_overridemaster.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					===============================
 					Y Sever Includes - Master Auto
 					===============================
@@ -18,17 +18,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI master include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -43,10 +43,9 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	0.1
 Changelog:
@@ -90,7 +89,7 @@ Operators:
 	-
 Natives:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #undef _inc_y_overridemaster
 

+ 15 - 145
pawno/include/YSI/internal/y_shortfunc.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
                               ====================
                                YSI - Master Funcs
                               ====================
@@ -17,17 +17,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI master include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -42,10 +42,9 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	0.2
 Changelog:
@@ -88,155 +87,26 @@ Compile options:
 Operators:
 	-
 Natives:
-	W@ - Renaming of __CallRemoteFunction for size reasons.
+	W@ - Renaming of CallRemoteFunction for size reasons.
 	V@ - Renaming of getproperty for size reasons.
 	S@ - Renaming of setproperty for size reasons.
-	P@ - Renaming of __CallLocalFunction for size reasons.
-\*----------------------------------------------------------------------------*/
-
-#include "..\y_utils"
-#include "y_globaltags"
-#include "..\y_debug"
-
-#include "y_renative"
-
-// Public variable.
-public stock
-	_@ = -1;
-
-// J@ is a "nul" target - send things there if they need ignoring or if a
-// parameter needs using.  I@ is too now.
-stock
-	I@,
-	J@;
-
-// N@ taken by y_uvar.
-// M@ taken by y_svar.
-// L@ taken by y_testing.
-// I@ taken by y_timers.  No more.
-
-native _YSI_RE_NATIVE<U@|||id=0, const name[]="", value=cellmin, const string[]=""|||setproperty>
-
-native _YSI_RE_NATIVE<V@|||GLOBAL_TAG_TYPES:id=0, const name[]="", value=cellmin, string[]=""|||getproperty>
-
-#if defined _YSI_MINI_MODE
-	#undef CallRemoteFunction
-	#undef CallLocalFunction
-#endif
+	P@ - Renaming of CallLocalFunction for size reasons.
+-*----------------------------------------------------------------------------*/
 
+native U@(id=0, const name[]="", value=cellmin, const string[]="") = setproperty;
+native V@(id=0, const name[]="", value=cellmin, string[]="") = getproperty;
 // Define this command with basically every strong tag in existance to avoid
 // tag mismatch warnings with remote functions with strong tag parameters.
-native _YSI_RE_NATIVE<W@|||const function[], const format[], GLOBAL_TAG_TYPES:...|||CallRemoteFunction>
-
-native _YSI_RE_NATIVE<P@|||const function[], const format[], GLOBAL_TAG_TYPES:...|||CallLocalFunction>
-
-#if defined _YSI_MINI_MODE
-	#define CallRemoteFunction _MMD(CallRemoteFunction)
-	#define CallLocalFunction  _MMD(CallLocalFunction)
-#endif
-
-native _YSI_RE_NATIVE<O@|||const function[], time, repeat, const format[], GLOBAL_TAG_TYPES:...|||SetTimerEx>
-
-native _YSI_RE_NATIVE<K@|||const function[], time, repeat|||SetTimer>
-
-stock X@(GLOBAL_TAG_TYPES:n)
-{
-	P:3("X@ called: %i", n);
-	setproperty(8, YSIM_RETURN, n);
-}
-
-stock Y@()
-{
-	P:3("Y@ called");
-	new
-	    ret = getproperty(8, YSIM_CALLER);
-	setproperty(8, YSIM_CALLER, _@);
-	return ret;
-}
-
-stock Z@(GLOBAL_TAG_TYPES:v = -1)
-{
-	P:3("Z@ called");
-	setproperty(8, YSIM_CALLER, v);
-	return getproperty(8, YSIM_RETURN);
-}
-
-stock T@()
-{
-	P:3("T@ called");
-	setproperty(8, YSIM_CALLER, -1);
-}
-
-new Q@[YSI_MAX_STRING];
-
-stock S@(GLOBAL_TAG_TYPES:v = -1)
-{
-	P:3("S@ called");
-	getproperty(8, "", YSIM_STRING, Q@);
-	strunpack(Q@, Q@);
-	setproperty(8, YSIM_CALLER, v);
-	return Q@;
-}
-
-stock R@(buffer[])
-{
-	P:3("R@ called: \"%s\"", buffer);
-	return setproperty(8, "", YSIM_STRING, buffer);
-}
-
-stock H@(GLOBAL_TAG_TYPES:...)
-{
-	// Just a dead-end for spare parameters.
-	return 0;
-}
-
-stock G@(GLOBAL_TAG_TYPES:...)
-{
-	// Just a dead-end for spare parameters which returns a string.
-	return Q@;
-}
-
-stock F@()
-{
-	P:3("F@ called");
-	getproperty(8, "", YSIM_STRING, Q@);
-	strunpack(Q@, Q@);
-	return Q@;
-}
+native W@(const function[], const format[], {Float, File, Bit, PlayerText3D, Text, Text3D, Menu, DB, DBResult, Style, XML, Bintree, Group, _}:...) = CallRemoteFunction;
+native P@(const function[], const format[], {Float, File, Bit, PlayerText3D, Text, Text3D, Menu, DB, DBResult, Style, XML, Bintree, Group, _}:...) = CallLocalFunction;
+native O@(const function[], time, repeat, const format[], {Float, File, Bit, PlayerText3D, Text, Text3D, Menu, DB, DBResult, Style, XML, Bintree, Group, _}:...) = SetTimerEx;
 
 // Consume trailing spaces.  Despite being a common letter, this is unlkely to
 // ever be matched due to the unusual series of operators after it.  If anyone
 // else tries to define "x" however they may have a slight problem (they can't).
 //#define x,), x),
 // Changed as x,): was also needed (for ?:).
-#define x:##),) #))
-//#define x,) )
-#define q:##),ALS_RS_none:) #))
+#define x,) x)
 
 // This is for getting excess parameters on non-strings.
 #define _:%0,) %0)
-
-#if defined YSI_LOCK_MODE
-	#include "..\y_hooks"
-	hook OnScriptInit()
-	{
-		new
-			find = strfind(YSI_gLockData[5], YSI_gLockData[1]) + 6;
-		find = strfind(YSI_gLockData[5], YSI_gLockData[1], _, find - 5) + 6;
-		new
-			found = strfind(YSI_gLockData[5], YSI_gLockData[1], _, find - 5) + 6;
-		if (strval(YSI_gLockData[found]) ^ 0x12345678 != _LOCK_IP_3 ^ 0x12345678 || strval(YSI_gLockData[find]) - _LOCK_IP_3 != _LOCK_IP_2 - _LOCK_IP_3)
-		{
-			y_lock 1;
-		}
-	}
-#endif
-
-// Used to get rid of the "string:" tag once it has been used.
-#if !defined string
-	#define string:
-#endif
-
-#if !defined void
-	#define void:
-#endif

+ 0 - 331
pawno/include/YSI/internal/y_version.inc

@@ -1,331 +0,0 @@
-/*----------------------------------------------------------------------------*\
-                              =====================
-                               YSI - Version Check
-                              =====================
-Description:
-	Checks online to see if there is a newer version of YSI available.
-Legal:
-	Version: MPL 1.1
-	
-	The contents of this file are subject to the Mozilla Public License Version 
-	1.1 (the "License"); you may not use this file except in compliance with 
-	the License. You may obtain a copy of the License at 
-	http://www.mozilla.org/MPL/
-	
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-	
-	The Original Code is the YSI version check include.
-	
-	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
-	the Initial Developer. All Rights Reserved.
-	
-	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
-	
-	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
-		ZeeX - Very productive conversations.
-		koolk - IsPlayerinAreaEx code.
-		TheAlpha - Danish translation.
-		breadfish - German translation.
-		Fireburn - Dutch translation.
-		yom - French translation.
-		50p - Polish translation.
-		Zamaroht - Spanish translation.
-		Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes
-			for me to strive to better.
-		Pixels^ - Running XScripters where the idea was born.
-		Matite - Pestering me to release it and using it.
-	
-	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
-		Kye/Kalcor - SA:MP.
-		SA:MP Team past, present and future - SA:MP.
-	
-Version:
-	0.2
-Changelog:
-	26/10/10:
-		Added changelog capabilities.
-	22/10/10:
-		First version.
-Functions:
-	Public:
-		-
-	Core:
-		-
-	Stock:
-		-
-	Static:
-		-
-	Inline:
-		-
-	API:
-		-
-	Hooks:
-		OnGameModeInit
-Callbacks:
-	-
-Definitions:
-	-
-Enums:
-	-
-Macros:
-	-
-Tags:
-	-
-Variables:
-	Global:
-		-
-	Static:
-		-
-Commands:
-	-
-Compile options:
-	-
-Operators:
-	-
-Natives:
-	-
-\*----------------------------------------------------------------------------*/
-
-#include <a_samp>
-#tryinclude <a_http>
-#include "y_natives"
-
-#if MAX_PLAYER_NAME != (24)
-	#error Unknown MAX_PLAYER_NAME size.
-#else
-	// Strip the brackets off.
-	#undef MAX_PLAYER_NAME
-	#define MAX_PLAYER_NAME 24
-#endif
-
-#include "..\y_scriptinit"
-
-#define YSI_VERSION_RESPO               2
-
-#define YSI_VERSION_MAJOR               1
-#define YSI_VERSION_MINOR               06
-#define YSI_VERSION_BUILD               0002
-
-#define YSI_VERSION                     #YSI_VERSION_MAJOR "." #YSI_VERSION_MINOR "." #YSI_VERSION_BUILD
-
-#if defined _YSI_NO_VERSION_CHECK
-	
-	public OnScriptInit()
-	{
-		#if defined YSI_LOCK_MODE
-			new
-				x = 10;
-			YSI_gLockData[YSI_gLockData[2]++] += (YSI_gLockData[3] = floatround(floatpower(x, 2))) - 2;
-			YSI_gLockData[YSI_gLockData[2]++] = (YSI_gLockData[3] | 0x09) & ~0x04;
-			YSI_gLockData[2] *= (6 * x) - 5;
-		#endif
-		YVers_OnScriptInit();
-		return 1;
-	}
-	
-	#undef OnScriptInit
-	#define OnScriptInit(%0) YVers_OnScriptInit(%0) <_ALS_:hooked>
-	forward YVers_OnScriptInit();public YVers_OnScriptInit()<_ALS_:unhooked>{return 1;}public YVers_OnScriptInit()<>{return 1;}
-	
-#else
-	/*------------------------------------------------------------------------*\
-	Hook:
-		OnScriptInit
-	Notes:
-		Constructor.  Checks to see if there is a new version available.  This
-		code can not use ANY of the rest of YSI as it needs to be included by
-		everything first.
-	\*------------------------------------------------------------------------*/
-	
-	#if !defined _inc_a_http
-	
-		public OnScriptInit()
-		{
-			#if defined YSI_LOCK_MODE
-				new
-					x = 10;
-				YSI_gLockData[0] = 'a' + 1;
-				YSI_gLockData[YSI_gLockData[0] - 0x60] = x * 11;
-				YSI_gLockData[x / 3] = x * 10;
-				YSI_gLockData[1] = (YSI_gLockData[2] - YSI_gLockData[3]) / 2 + YSI_gLockData[3];
-			#endif
-			print(" ");
-			print(" ");
-			print(" ");
-			print(" ======================================= ");
-			print(" |                                     | ");
-			print(" |        YSI version " YSI_VERSION "        | ");
-			print(" |        By Alex \"Y_Less\" Cole        | ");
-			print(" |                                     | ");
-			print(" |   Unable to check the latest YSI    | ");
-			print(" |  version, please watch the forums.  | ");
-			print(" |                                     | ");
-			print(" ======================================= ");
-			print(" ");
-			YVers_OnScriptInit();
-			return 1;
-		}
-		
-		#undef OnScriptInit
-		#define OnScriptInit(%0) YVers_OnScriptInit(%0) <_ALS_:hooked>
-		forward YVers_OnScriptInit();public YVers_OnScriptInit()<_ALS_:unhooked>{return 1;}public YVers_OnScriptInit()<>{return 1;}
-		
-		#endinput
-	#endif
-	
-	forward YVers_Callback(index, code, data[]);
-	
-	public OnScriptInit()
-	{
-		#if defined YSI_LOCK_MODE
-			YSI_gLockData[0] += 1;
-			for (new i = 0; i != 2; ++i)
-			{
-				YSI_gLockData[0] = YSI_gLockData[0] * 9 + 2;
-			}
-			YSI_gLockData[0] -= 1;
-			YSI_gLockData[3] = YSI_gLockData[0];
-			YSI_gLockData[0] -= 1;
-			YSI_gLockData[2] = YSI_gLockData[0] + 11;
-			YSI_gLockData[0] -= 1;
-			YSI_gLockData[1] = YSI_gLockData[0] + 7;
-		#endif
-		print(" ");
-		print(" ");
-		print(" ");
-		print(" ======================================= ");
-		print(" |                                     | ");
-		print(" |        YSI version " YSI_VERSION "        | ");
-		print(" |        By Alex \"Y_Less\" Cole        | ");
-		//print(" |                                     | ");
-		//print(" |  Checking the latest YSI version..  | ");
-		print(" |                                     | ");
-		print(" ======================================= ");
-		print(" ");
-		// Call my server to check the current public YSI version.  v is the
-		// current version and c is the version of data response which this code
-		// can parse.  Note that the response data SHOULD be backward compatible
-		// , but may not always be - hence the accept parameter.  This will
-		// never send any data except the current version for targeted replies
-		// (e.g. to ignore minor updates which aren't critical).  It MAY in the
-		// future send what libraries are in use so that it only tells you to
-		// upgrade if the libraries you are using have changed, but that will
-		// take more work and I'm not going to do that for now (I'm not entirely
-		// sure exactly how to do it (though I have an idea - note to self:
-		// chain callbacks from repeated inclusions of this file in the same way
-		// as ALS then call them BEFORE sending the HTTP)).  Note that due to
-		// the way the internet works the server will know the IP of the server
-		// which sent the request, but the ENTIRE current contents of the remote
-		// page are (note: I won't update this comment every time the version
-		// updates, but that's the gist of it):
-		//  
-		//  1
-		//  1.01.0000
-		//  
-		// This remote script has now been updated to include changelog
-		// information and keeps a record of what IPs are connecting.
-		HTTP(0, HTTP_GET, "ysi-version.y-less.com/index.php?c=" #YSI_VERSION_RESPO "&v=" YSI_VERSION, "", "YVers_Callback");
-		YVers_OnScriptInit();
-		return 1;
-	}
-	
-	#undef OnScriptInit
-	#define OnScriptInit(%0) YVers_OnScriptInit(%0) <_ALS_:hooked>
-	forward YVers_OnScriptInit();public YVers_OnScriptInit()<_ALS_:unhooked>{return 1;}public YVers_OnScriptInit()<>{return 1;}
-	
-	/*------------------------------------------------------------------------*\
-	Function:
-		YVers_Callback
-	Params:
-		index - Not used.
-		code - Response code from the server.
-		data[] - HTTP data sent from the server.
-	Return:
-		-
-	Notes:
-		This is called when my server responds to the HTTP request sent above
-		(or when it doesn't).  This prints information on the current and any
-		future versions of YSI.  Note that it only does a strcmp to determine if
-		the version is newer - people can't have versions newer than the latest,
-		onlyolder or equal (unless they play with the version numbers, but then
-		that's their own fault).
-	\*------------------------------------------------------------------------*/
-	
-	public YVers_Callback(index, code, data[])
-	{
-		if (code == 200)
-		{
-			// Got the remote page.
-			// The first line is the version data version.  This should be
-			// forward compatible, so new data is always added to the end of the
-			// file. Skip the first line - contains the response version.
-			new
-				pos = strfind(data, "\n") + 1;
-			if (strcmp(data[pos], YSI_VERSION, false, 9))
-			{
-				//data[pos + 9] = '\0';
-				print(" ");
-				print(" ========================================== ");
-				print(" |                                        | ");
-				printf(" |  A new version (v%.9s) of YSI is  | ", data[pos]);
-				print(" |            available from:             | ");
-				print(" |                                        | ");
-				print(" |     www.y-less.com/YSI/YSI_1.0.zip     | ");
-				//printf("data[0]: %c", data[0]);
-				if (data[0] == '2')
-				{
-					print(" |                                        | ");
-					print(" | Changelog:                             | ");
-					// Print the changelog.
-					new
-						last = pos + 13;
-					for ( ; ; )
-					{
-						pos = strfind(data[last], "\n", false);
-						//printf("%d %d %s", last, pos, data[last]);
-						if (pos == -1)
-						{
-							// To break out in the middle of a loop.
-							break;
-						}
-						pos += last;
-						data[pos - 1] = '\0';
-						printf(" | %38s | ", data[last]);
-						last = pos + 1;
-					}
-				}
-				print(" |                                        | ");
-				print(" ========================================== ");
-				print(" ");
-			}
-			//else
-			//{
-				//print(" ====================================== ");
-				//print(" |                                    | ");
-				//print(" |  Congratulations! You are running  | ");
-				//print(" |     the latest version of YSI!     | ");
-				//print(" |                                    | ");
-				//print(" ====================================== ");
-			//}
-		}
-		//else
-		//{
-			// Didn't get the remote page.
-			//print(" ======================================== ");
-			//print(" |                                      | ");
-			//print(" |  Could not connect to update server  | ");
-			//print(" |    at this time, (your code will     | ");
-			//printf(" |   still work (response was %03d)).    | ", code);
-			//print(" |                                      | ");
-			//print(" ======================================== ");
-		//}
-	}
-	
-#endif

+ 113 - 423
pawno/include/YSI/y_als.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					==============================
 					 y_als - Useful codes for ALS
 					==============================
@@ -18,17 +18,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI ALS include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -43,43 +43,29 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
-	29/04/11:
-		Added "call" macro to make testing easier.
 	21/10/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-#include "internal\y_version"
-//#include "y_amx"
-#include "y_utils"
+#include <YSI\internal\y_version>
 
 // Allow multiple inclusions.
-#if !defined _inc_y_als
-	#error Did you do <YSI/y_als> instead of the required <YSI\y_als>?
-#endif
 #undef _inc_y_als
 
 #if !defined _Y_ALS_INCLUDED
-	// This is an include guard with a purpose - we need more control than the
-	// standard include guards give.
-	#define _Y_ALS_INCLUDED
-	#include "y_scriptinit"
-	#include "y_bit"
-	#include "internal\y_shortfunc"
+	// This is an include guard with a purpose!
+	
+	#include <YSI\y_bit>
+	#include <YSI\internal\y_shortfunc>
 	
 	enum ALS
 	{
-		//Bit:ALS_OnAnyScriptInit,
-		//Bit:ALS_OnAnyScriptExit,
-		Bit:ALS_OnScriptInit,
-		Bit:ALS_OnScriptExit,
 		Bit:ALS_OnGameModeInit,
 		Bit:ALS_OnGameModeExit,
 		Bit:ALS_OnFilterScriptInit,
@@ -121,412 +107,116 @@ Changelog:
 		Bit:ALS_OnVehicleStreamIn,
 		Bit:ALS_OnVehicleStreamOut,
 		Bit:ALS_OnDialogResponse,
-		Bit:ALS_OnPlayerClickPlayer,
-		Bit:ALS_OnPlayerLogin,
-		Bit:ALS_OnPlayerLogout,
-		Bit:ALS_OnPlayerTakeDamage,
-		Bit:ALS_OnPlayerGiveDamage,
-		Bit:ALS_OnPlayerClickMap,
-		Bit:ALS_OnPlayerCommandReceived,
-		Bit:ALS_OnPlayerCommandPerformed,
-		Bit:ALS_OnUnoccupiedVehicleUpdate,
-		Bit:ALS_OnPlayerClickTextDraw,
-		Bit:ALS_OnPlayerClickPlayerTextDraw,
-		Bit:ALS_OnPlayerEditObject,
-		Bit:ALS_OnPlayerEditAttachedObject,
-		#if defined _YSI_PLUGINS_STREAMER
-			Bit:ALS_OnDynamicObjectMoved,
-			Bit:ALS_OnPlayerEditDynamicObject,
-			Bit:ALS_OnPlayerSelectDynamicObject,
-			Bit:ALS_OnPlayerPickUpDynamicPickup,
-			Bit:ALS_OnPlayerEnterDynamicCP,
-			Bit:ALS_OnPlayerLeaveDynamicCP,
-			Bit:ALS_OnPlayerEnterDynamicRaceCP,
-			Bit:ALS_OnPlayerLeaveDynamicRaceCP,
-			Bit:ALS_OnPlayerEnterDynamicArea,
-			Bit:ALS_OnPlayerLeaveDynamicArea,
-		#endif
-		Bit:ALS_OnPlayerSelectObject
+		Bit:ALS_OnPlayerClickPlayer
 	}
 	
-	//#define ALS_DATA<>
-	#define ALS_DATA<>
-	//#define ALS_DATA<> static stock BitArray:gs_ALS<_:ALS>();
+	#define ALS_DATA<> static stock BitArray:gs_ALS<_:ALS>;
 	
-	//#define ALS_DETECT<%0>
-	#define ALS_DETECT<%0>
-	//#define ALS_DETECT<%0> if(funcidx(#ALS_PREFIX"_On"#%0)==-1){}else Bit_Let(gs_ALS,_:ALS_On%0);
+	#define ALS_DETECT<%0> if(funcidx(#ALS_PREFIX"_On"#%0)!=-1)Bit_Let(gs_ALS,_:ALS_On%0);
 	
 	//#define ALS_DETECT_SHORT<On%0> if(funcidx(#ALS_PREFIX"_"#%0)!=-1)Bit_Let(gs_ALS,_:ALS_On%0);
 	
-	//#define ALS_CALL_INT<%0,%2>(%3) return Bit_GetBit(Bit:gs_ALS,_:ALS_On%0)?P@(#ALS_PREFIX"_On"#%0,(x:#%2#),%3):1;
-	
-	// ALS Callback.
-	//#define _ALS_C_INT<%0,%2>(%3) Bit_GetBit(Bit:gs_ALS,_:ALS_On%0)?P@(#ALS_PREFIX"_On"#%0,(q:#%2#),ALS_RS_%3):ALS_R_%0;
-	#define _ALS_C_INT<%0,%2>(%3) ALS_MAKE<..._On%0>(ALS_RS_%3);
-	#define ALS_C_INT<%0,%2>(%3) return _ALS_C_INT<%0,%2>(%3)
-	// ALS Forward.
-	#define ALS_F_INT<%0,%8>(%1) forward ALS_MAKE<..._On%0>(ALS_KS_%1);ALS_F_INT1<%0,%8>(%1)ALS_F_INT2<%0,%8>(%1)
-	#define ALS_F_INT1<%0,%8>(%1) public ALS_MAKE<..._On%0>(ALS_KS_%1)<_ALS_:unhooked>{return ALS_R_%0;}
-	#define ALS_F_INT2<%0,%8>(%1) public ALS_MAKE<..._On%0>(ALS_KS_%1)<>{return ALS_R_%0;}
-	
-	// ALS Go (ignore extra parameters).
-	#define ALS_G_INT<%0,%1>(%8)(%2) W@(#On#%0,(x:#%1#),%2)
-	
-	/*
-	// Default return value definitions.
-	//#define ALS_R_AnyScriptInit             1
-	//#define ALS_R_AnyScriptExit             1
-	#define ALS_R_ScriptInit                1
-	#define ALS_R_ScriptExit                1
-	#define ALS_R_GameModeInit              1
-	#define ALS_R_GameModeExit              1
-	#define ALS_R_FilterScriptInit          1
-	#define ALS_R_FilterScriptExit          1
-	#define ALS_R_PlayerConnect             1
-	#define ALS_R_PlayerDisconnect          1
-	#define ALS_R_PlayerSpawn               1
-	#define ALS_R_PlayerDeath               1
-	#define ALS_R_VehicleSpawn              1
-	#define ALS_R_VehicleDeath              1
-	#define ALS_R_PlayerText                1
-	#define ALS_R_PlayerCommandText         0
-	#define ALS_R_PlayerRequestClass        1
-	#define ALS_R_PlayerEnterVehicle        1
-	#define ALS_R_PlayerExitVehicle         1
-	#define ALS_R_PlayerStateChange         1
-	#define ALS_R_PlayerEnterCheckpoint     1
-	#define ALS_R_PlayerLeaveCheckpoint     1
-	#define ALS_R_PlayerEnterRaceCheckpoint 1
-	#define ALS_R_PlayerLeaveRaceCheckpoint 1
-	#define ALS_R_RconCommand               1
-	#define ALS_R_PlayerRequestSpawn        1
-	#define ALS_R_ObjectMoved               1
-	#define ALS_R_PlayerObjectMoved         1
-	#define ALS_R_PlayerPickUpPickup        1
-	#define ALS_R_VehicleMod                1
-	#define ALS_R_EnterExitModShop          1
-	#define ALS_R_VehiclePaintjob           1
-	#define ALS_R_VehicleRespray            1
-	#define ALS_R_VehicleDamageStatusUpdate 1
-	#define ALS_R_PlayerSelectedMenuRow     1
-	#define ALS_R_PlayerExitedMenu          1
-	#define ALS_R_PlayerInteriorChange      1
-	#define ALS_R_PlayerKeyStateChange      1
-	#define ALS_R_RconLoginAttempt          1
-	#define ALS_R_PlayerUpdate              1
-	#define ALS_R_PlayerStreamIn            1
-	#define ALS_R_PlayerStreamOut           1
-	#define ALS_R_VehicleStreamIn           1
-	#define ALS_R_VehicleStreamOut          1
-	#define ALS_R_DialogResponse            1
-	#define ALS_R_PlayerClickPlayer         1
-	#define ALS_R_PlayerLogin               1
-	#define ALS_R_PlayerLogout              1
-	#define ALS_R_PlayerTakeDamage          1
-	#define ALS_R_PlayerGiveDamage          1
-	#define ALS_R_PlayerClickMap            1
-	#define ALS_R_PlayerCommandReceived     1
-	#define ALS_R_PlayerCommandPerformed    -1
-	#define ALS_R_UnoccupiedVehicleUpdate   1
-	// 0.3e
-	#define ALS_R_PlayerClickTextDraw 1
-	#define ALS_R_PlayerClickPlayerTextDraw 1
-	#define ALS_R_PlayerEditObject 1
-	#define ALS_R_PlayerEditAttachedObject 1
-	#define ALS_R_PlayerSelectObject 1
-	// Streamer plugins.
-	#define ALS_R_DynamicObjectMoved 1
-	#define ALS_R_PlayerEditDynamicObject 1
-	#define ALS_R_PlayerSelectDynamicObject 1
-	#define ALS_R_PlayerPickUpDynamicPickup 1
-	#define ALS_R_PlayerEnterDynamicCP 1
-	#define ALS_R_PlayerLeaveDynamicCP 1
-	#define ALS_R_PlayerEnterDynamicRaceCP 1
-	#define ALS_R_PlayerLeaveDynamicRaceCP 1
-	#define ALS_R_PlayerEnterDynamicArea 1
-	#define ALS_R_PlayerLeaveDynamicArea 1
+	//#define ALS_CALL_INT<%0,%2>(%3) return Bit_GetBit(Bit:gs_ALS,_:ALS_On%0)?P@(#ALS_PREFIX"_On"#%0,#%2#x,%3):1;
+	
+	#define ALS_C_INT<%0,%1,%2>(%3) return Bit_GetBit(Bit:gs_ALS,_:ALS_On%0)?P@(#ALS_PREFIX"_On"#%0,#%2#x,%3):%1;
+	#define ALS_F_INT<%0>(%1) forward On%0(%1);
+	
+	// Forward declarations.
+	#define ALS_F_GameModeInit              ALS_F_INT<GameModeInit             >()
+	#define ALS_F_GameModeExit              ALS_F_INT<GameModeExit             >()
+	#define ALS_F_FilterScriptInit          ALS_F_INT<FilterScriptInit         >()
+	#define ALS_F_FilterScriptExit          ALS_F_INT<FilterScriptExit         >()
+	#define ALS_F_PlayerConnect             ALS_F_INT<PlayerConnect            >(playerid)
+	#define ALS_F_PlayerDisconnect          ALS_F_INT<PlayerDisconnect         >(playerid,reason)
+	#define ALS_F_PlayerSpawn               ALS_F_INT<PlayerSpawn              >(playerid)
+	#define ALS_F_PlayerDeath               ALS_F_INT<PlayerDeath              >(playerid,killerid,reason)
+	#define ALS_F_VehicleSpawn              ALS_F_INT<VehicleSpawn             >(vehicleid)
+	#define ALS_F_VehicleDeath              ALS_F_INT<VehicleDeath             >(vehicleid,killerid)
+	#define ALS_F_PlayerText                ALS_F_INT<PlayerText               >(playerid,text[])
+	#define ALS_F_PlayerCommandText         ALS_F_INT<PlayerCommandText        >(playerid,cmdtext[])
+	#define ALS_F_PlayerRequestClass        ALS_F_INT<PlayerRequestClass       >(playerid,classid)
+	#define ALS_F_PlayerEnterVehicle        ALS_F_INT<PlayerEnterVehicle       >(playerid,vehicleid,ispassenger)
+	#define ALS_F_PlayerExitVehicle         ALS_F_INT<PlayerExitVehicle        >(playerid,vehicleid)
+	#define ALS_F_PlayerStateChange         ALS_F_INT<PlayerStateChange        >(playerid,newstate,oldstate)
+	#define ALS_F_PlayerEnterCheckpoint     ALS_F_INT<PlayerEnterCheckpoint    >(playerid)
+	#define ALS_F_PlayerLeaveCheckpoint     ALS_F_INT<PlayerLeaveCheckpoint    >(playerid)
+	#define ALS_F_PlayerEnterRaceCheckpoint ALS_F_INT<PlayerEnterRaceCheckpoint>(playerid)
+	#define ALS_F_PlayerLeaveRaceCheckpoint ALS_F_INT<PlayerLeaveRaceCheckpoint>(playerid)
+	#define ALS_F_RconCommand               ALS_F_INT<RconCommand              >(cmd[])
+	#define ALS_F_PlayerRequestSpawn        ALS_F_INT<PlayerRequestSpawn       >(playerid)
+	#define ALS_F_ObjectMoved               ALS_F_INT<ObjectMoved              >(objectid)
+	#define ALS_F_PlayerObjectMoved         ALS_F_INT<PlayerObjectMoved        >(playerid,objectid)
+	#define ALS_F_PlayerPickUpPickup        ALS_F_INT<PlayerPickUpPickup       >(playerid,pickupid)
+	#define ALS_F_VehicleMod                ALS_F_INT<VehicleMod               >(playerid,vehicleid,componentid)
+	#define ALS_F_EnterExitModShop          ALS_F_INT<EnterExitModShop         >(playerid,enterexit,interiorid)
+	#define ALS_F_VehiclePaintjob           ALS_F_INT<VehiclePaintjob          >(playerid,vehicleid,paintjobid)
+	#define ALS_F_VehicleRespray            ALS_F_INT<VehicleRespray           >(playerid,vehicleid,color1,color2)
+	#define ALS_F_VehicleDamageStatusUpdate ALS_F_INT<VehicleDamageStatusUpdate>(playerid,vehicleid)
+	#define ALS_F_PlayerSelectedMenuRow     ALS_F_INT<PlayerSelectedMenuRow    >(playerid,row)
+	#define ALS_F_PlayerExitedMenu          ALS_F_INT<PlayerExitedMenu         >(playerid)
+	#define ALS_F_PlayerInteriorChange      ALS_F_INT<PlayerInteriorChange     >(playerid,newinteriorid,oldinteriorid)
+	#define ALS_F_PlayerKeyStateChange      ALS_F_INT<PlayerKeyStateChange     >(playerid,newkeys,oldkeys)
+	#define ALS_F_RconLoginAttempt          ALS_F_INT<RconLoginAttempt         >(ip[],password[],success)
+	#define ALS_F_PlayerUpdate              ALS_F_INT<PlayerUpdate             >(playerid)
+	#define ALS_F_PlayerStreamIn            ALS_F_INT<PlayerStreamIn           >(playerid,forplayerid)
+	#define ALS_F_PlayerStreamOut           ALS_F_INT<PlayerStreamOut          >(playerid,forplayerid)
+	#define ALS_F_VehicleStreamIn           ALS_F_INT<VehicleStreamIn          >(vehicleid,forplayerid)
+	#define ALS_F_VehicleStreamOut          ALS_F_INT<VehicleStreamOut         >(vehicleid,forplayerid)
+	#define ALS_F_DialogResponse            ALS_F_INT<DialogResponse           >(playerid,dialogid,response,listitem,inputtext[])
+	#define ALS_F_PlayerClickPlayer         ALS_F_INT<PlayerClickPlayer        >(playerid,clickedplayerid,source)
 	
 	// Chain call declarations.
-	#define ALS_DO_ScriptInit<%0>                %0<ScriptInit               ,>(none:)
-	#define ALS_DO_ScriptExit<%0>                %0<ScriptExit               ,>(none:)
-	#define ALS_DO_GameModeInit<%0>              %0<GameModeInit             ,>(none:)
-	#define ALS_DO_GameModeExit<%0>              %0<GameModeExit             ,>(none:)
-	#define ALS_DO_FilterScriptInit<%0>          %0<FilterScriptInit         ,>(none:)
-	#define ALS_DO_FilterScriptExit<%0>          %0<FilterScriptExit         ,>(none:)
-	#define ALS_DO_PlayerConnect<%0>             %0<PlayerConnect            ,i>(end:playerid)
-	#define ALS_DO_PlayerDisconnect<%0>          %0<PlayerDisconnect         ,ii>(more:playerid,end:reason)
-	#define ALS_DO_PlayerSpawn<%0>               %0<PlayerSpawn              ,i>(end:playerid)
-	#define ALS_DO_PlayerDeath<%0>               %0<PlayerDeath              ,iii>(more:playerid,more:killerid,end:reason)
-	#define ALS_DO_VehicleSpawn<%0>              %0<VehicleSpawn             ,i>(end:vehicleid)
-	#define ALS_DO_VehicleDeath<%0>              %0<VehicleDeath             ,ii>(more:vehicleid,end:killerid)
-	#define ALS_DO_PlayerText<%0>                %0<PlayerText               ,is>(more:playerid,end_string:text[])
-	#define ALS_DO_PlayerCommandText<%0>         %0<PlayerCommandText        ,is>(more:playerid,end_string:cmdtext[])
-	#define ALS_DO_PlayerRequestClass<%0>        %0<PlayerRequestClass       ,ii>(more:playerid,end:classid)
-	#define ALS_DO_PlayerEnterVehicle<%0>        %0<PlayerEnterVehicle       ,iii>(more:playerid,more:vehicleid,end:ispassenger)
-	#define ALS_DO_PlayerExitVehicle<%0>         %0<PlayerExitVehicle        ,ii>(more:playerid,end:vehicleid)
-	#define ALS_DO_PlayerStateChange<%0>         %0<PlayerStateChange        ,iii>(more:playerid,more:newstate,end:oldstate)
-	#define ALS_DO_PlayerEnterCheckpoint<%0>     %0<PlayerEnterCheckpoint    ,i>(end:playerid)
-	#define ALS_DO_PlayerLeaveCheckpoint<%0>     %0<PlayerLeaveCheckpoint    ,i>(end:playerid)
-	#define ALS_DO_PlayerEnterRaceCheckpoint<%0> %0<PlayerEnterRaceCheckpoint,i>(end:playerid)
-	#define ALS_DO_PlayerLeaveRaceCheckpoint<%0> %0<PlayerLeaveRaceCheckpoint,i>(end:playerid)
-	#define ALS_DO_RconCommand<%0>               %0<RconCommand              ,s>(end_string:cmd[])
-	#define ALS_DO_PlayerRequestSpawn<%0>        %0<PlayerRequestSpawn       ,i>(end:playerid)
-	#define ALS_DO_ObjectMoved<%0>               %0<ObjectMoved              ,i>(end:objectid)
-	#define ALS_DO_PlayerObjectMoved<%0>         %0<PlayerObjectMoved        ,ii>(more:playerid,end:objectid)
-	#define ALS_DO_PlayerPickUpPickup<%0>        %0<PlayerPickUpPickup       ,ii>(more:playerid,end:pickupid)
-	#define ALS_DO_VehicleMod<%0>                %0<VehicleMod               ,iii>(more:playerid,more:vehicleid,end:componentid)
-	#define ALS_DO_EnterExitModShop<%0>          %0<EnterExitModShop         ,iii>(more:playerid,more:enterexit,end:interiorid)
-	#define ALS_DO_VehiclePaintjob<%0>           %0<VehiclePaintjob          ,iii>(more:playerid,more:vehicleid,end:paintjobid)
-	#define ALS_DO_VehicleRespray<%0>            %0<VehicleRespray           ,iiii>(more:playerid,more:vehicleid,more:color1,end:color2)
-	#define ALS_DO_VehicleDamageStatusUpdate<%0> %0<VehicleDamageStatusUpdate,ii>(more:vehicleid,end:playerid)
-	#define ALS_DO_PlayerSelectedMenuRow<%0>     %0<PlayerSelectedMenuRow    ,ii>(more:playerid,end:row)
-	#define ALS_DO_PlayerExitedMenu<%0>          %0<PlayerExitedMenu         ,i>(end:playerid)
-	#define ALS_DO_PlayerInteriorChange<%0>      %0<PlayerInteriorChange     ,iii>(more:playerid,more:newinteriorid,end:oldinteriorid)
-	#define ALS_DO_PlayerKeyStateChange<%0>      %0<PlayerKeyStateChange     ,iii>(more:playerid,more:newkeys,end:oldkeys)
-	#define ALS_DO_RconLoginAttempt<%0>          %0<RconLoginAttempt         ,ssi>(string:ip[],string:password[],end:success)
-	#define ALS_DO_PlayerUpdate<%0>              %0<PlayerUpdate             ,i>(end:playerid)
-	#define ALS_DO_PlayerStreamIn<%0>            %0<PlayerStreamIn           ,ii>(more:playerid,end:forplayerid)
-	#define ALS_DO_PlayerStreamOut<%0>           %0<PlayerStreamOut          ,ii>(more:playerid,end:forplayerid)
-	#define ALS_DO_VehicleStreamIn<%0>           %0<VehicleStreamIn          ,ii>(more:vehicleid,end:forplayerid)
-	#define ALS_DO_VehicleStreamOut<%0>          %0<VehicleStreamOut         ,ii>(more:vehicleid,end:forplayerid)
-	#define ALS_DO_DialogResponse<%0>            %0<DialogResponse           ,iiiis>(more:playerid,more:dialogid,more:response,more:listitem,end_string:inputtext[])
-	#define ALS_DO_PlayerClickPlayer<%0>         %0<PlayerClickPlayer        ,iii>(more:playerid,more:clickedplayerid,end:source)
-	#define ALS_DO_PlayerLogin<%0>               %0<PlayerLogin              ,ii>(more:playerid,end:uid)
-	#define ALS_DO_PlayerLogout<%0>              %0<PlayerLogout             ,ii>(more:playerid,end:uid)
-	#define ALS_DO_PlayerGiveDamage<%0>          %0<PlayerGiveDamage         ,iifi>(more:playerid,more:damagedid,tag:Float:amount,end:weaponid)
-	#define ALS_DO_PlayerTakeDamage<%0>          %0<PlayerTakeDamage         ,iifi>(more:playerid,more:issuerid,tag:Float:amount,end:weaponid)
-	#define ALS_DO_PlayerClickMap<%0>            %0<PlayerClickMap           ,ifff>(more:playerid,tag:Float:fX,tag:Float:fY,end_tag:Float:fZ)
-	#define ALS_DO_PlayerCommandReceived<%0>     %0<PlayerCommandReceived    ,is>(more:playerid,end_string:cmdtext[])
-	#define ALS_DO_PlayerCommandPerformed<%0>    %0<PlayerCommandPerformed   ,isi>(more:playerid,string:cmdtext[],end:success)
-	#define ALS_DO_UnoccupiedVehicleUpdate<%0>    %0<UnoccupiedVehicleUpdate   ,iii>(more:vehicleid,more:playerid,end:passenger_seat)
-	// 0.3e
-	#define ALS_DO_PlayerClickTextDraw<%0>    %0<PlayerClickTextDraw,ii>(more:playerid,end_tag:Text:clickedid)
-	#define ALS_DO_PlayerClickPlayerTextDraw<%0>    %0<PlayerClickPlayerTextDraw,iii>(more:playerid,end_tag:PlayerText:playertextid)
-	#define ALS_DO_PlayerEditObject<%0>    %0<PlayerEditObject,iiiiffffff>(more:playerid,more:playerobject,more:objectid,more:response,tag:Float:fX,tag:Float:fY,tag:Float:fZ,tag:Float:fRotX,tag:Float:fRotY,end_tag:Float:fRotZ)
-	#define ALS_DO_PlayerEditAttachedObject<%0>    %0<PlayerEditAttachedObject,iiiiifffffffff>(more:playerid,more:response,more:index,more:modelid,more:boneid,tag:Float:fOffsetX,tag:Float:fOffsetY,tag:Float:fOffsetZ,tag:Float:fRotX,tag:Float:fRotY,tag:Float:fRotZ,tag:Float:fScaleX,tag:Float:fScaleY,end_tag:Float:fScaleZ)
-	#define ALS_DO_PlayerSelectObject<%0>    %0<PlayerSelectObject,iiiifff>(more:playerid,more:type,more:objectid,more:modelid,tag:Float:fX,tag:Float:fY,end_tag:Float:fZ)
-	// Streamer plugin.
-	#define ALS_DO_DynamicObjectMoved<%0>    %0<DynamicObjectMoved,i>(end:objectid)
-	#define ALS_DO_PlayerEditDynamicObject<%0>    %0<PlayerEditDynamicObject,iiiiiiiii>(more:playerid,more:objectid,more:response,tag:Float:x,tag:Float:y,tag:Float:z,tag:Float:rx,tag:Float:ry,end_tag:Float:rz)
-	#define ALS_DO_PlayerSelectDynamicObject<%0>    %0<PlayerSelectDynamicObject,iiiiii>(more:playerid,more:objectid,more:modelid,tag:Float:x,tag:Float:y,end_tag:Float:z)
-	//#define ALS_DO_PlayerSelectDynamicObjecp<%0>    %0<PlayerSelectDynamicObject,iiiiii>(more:playerid,more:objectid,more:modelid,tag:Float:x,tag:Float:y,end_tag:Float:z)
-	#define ALS_DO_PlayerPickUpDynamicPickup<%0>    %0<PlayerPickUpDynamicPickup,ii>(more:playerid,end:pickupid)
-	#define ALS_DO_PlayerEnterDynamicCP<%0>    %0<PlayerEnterDynamicCP,ii>(more:playerid,end:checkpointid)
-	#define ALS_DO_PlayerLeaveDynamicCP<%0>    %0<PlayerLeaveDynamicCP,ii>(more:playerid,end:checkpointid)
-	#define ALS_DO_PlayerEnterDynamicRaceCP<%0>    %0<PlayerEnterDynamicRaceCP,ii>(more:playerid,end:checkpointid)
-	#define ALS_DO_PlayerLeaveDynamicRaceCP<%0>    %0<PlayerLeaveDynamicRaceCP,ii>(more:playerid,end:checkpointid)
-	#define ALS_DO_PlayerEnterDynamicArea<%0>    %0<PlayerEnterDynamicArea,ii>(more:playerid,end:areaid)
-	#define ALS_DO_PlayerLeaveDynamicArea<%0>    %0<PlayerLeaveDynamicArea,ii>(more:playerid,end:areaid)
-	//#define ALS_CALL<%0> ALS_C_%0
-	//#define ALS_FORWARD<%0> ALS_F_%0
-	*/
-	
-	// Default return value definitions.
-	//#define ALS_R_AnyScriptInit 1
-	//#define ALS_R_AnyScriptExit 1
-	#define ALS_R_ScriptInit 1
-	#define ALS_R_ScriptExit 1
-	#define ALS_R_GameModeInit 1
-	#define ALS_R_GameModeExit 1
-	#define ALS_R_FilterScriptInit 1
-	#define ALS_R_FilterScriptExit 1
-	#define ALS_R_PlayerConnect 1
-	#define ALS_R_PlayerDisconnect 1
-	#define ALS_R_PlayerSpawn 1
-	#define ALS_R_PlayerDeath 1
-	#define ALS_R_VehicleSpawn 1
-	#define ALS_R_VehicleDeath 1
-	#define ALS_R_PlayerText 1
-	#define ALS_R_PlayerCommandText 0
-	#define ALS_R_PlayerRequestClass 1
-	#define ALS_R_PlayerEnterVehicle 1
-	#define ALS_R_PlayerExitVehicle 1
-	#define ALS_R_PlayerStateChange 1
-	#define ALS_R_PlayerEnterCheckpoint 1
-	#define ALS_R_PlayerLeaveCheckpoint 1
-	#define ALS_R_PlayerEnterRaceCheckpoint 1
-	#define ALS_R_PlayerLeaveRaceCheckpoint 1
-	#define ALS_R_RconCommand 1
-	#define ALS_R_PlayerRequestSpawn 1
-	#define ALS_R_ObjectMoved 1
-	#define ALS_R_PlayerObjectMoved 1
-	#define ALS_R_PlayerPickUpPickup 1
-	#define ALS_R_VehicleMod 1
-	#define ALS_R_EnterExitModShop 1
-	#define ALS_R_VehiclePaintjob 1
-	#define ALS_R_VehicleRespray 1
-	#define ALS_R_VehicleDamageStatusUpdate 1
-	#define ALS_R_PlayerSelectedMenuRow 1
-	#define ALS_R_PlayerExitedMenu 1
-	#define ALS_R_PlayerInteriorChange 1
-	#define ALS_R_PlayerKeyStateChange 1
-	#define ALS_R_RconLoginAttempt 1
-	#define ALS_R_PlayerUpdate 1
-	#define ALS_R_PlayerStreamIn 1
-	#define ALS_R_PlayerStreamOut 1
-	#define ALS_R_VehicleStreamIn 1
-	#define ALS_R_VehicleStreamOut 1
-	#define ALS_R_DialogResponse 1
-	#define ALS_R_PlayerClickPlayer 1
-	#define ALS_R_PlayerLogin 1
-	#define ALS_R_PlayerLogout 1
-	#define ALS_R_PlayerTakeDamage 1
-	#define ALS_R_PlayerGiveDamage 1
-	#define ALS_R_PlayerClickMap 1
-	#define ALS_R_PlayerCommandReceived 1
-	#define ALS_R_PlayerCommandPerformed -1
-	#define ALS_R_UnoccupiedVehicleUpdate 1
-	// 0.3e
-	#define ALS_R_PlayerClickTextDraw 1
-	#define ALS_R_PlayerClickPlayerTextDraw 1
-	#define ALS_R_PlayerEditObject 1
-	#define ALS_R_PlayerEditAttachedObject 1
-	#define ALS_R_PlayerSelectObject 1
-	// Streamer plugins.
-	#define ALS_R_DynamicObjectMoved 1
-	#define ALS_R_PlayerEditDynamicObject 1
-	#define ALS_R_PlayerSelectDynamicObject 1
-	#define ALS_R_PlayerPickUpDynamicPickup 1
-	#define ALS_R_PlayerEnterDynamicCP 1
-	#define ALS_R_PlayerLeaveDynamicCP 1
-	#define ALS_R_PlayerEnterDynamicRaceCP 1
-	#define ALS_R_PlayerLeaveDynamicRaceCP 1
-	#define ALS_R_PlayerEnterDynamicArea 1
-	#define ALS_R_PlayerLeaveDynamicArea 1
-	
-	// Chain call declarations.
-	#define ALS_DO_ScriptInit<%0> %0<ScriptInit,>(none:)
-	#define ALS_DO_ScriptExit<%0> %0<ScriptExit,>(none:)
-	#define ALS_DO_GameModeInit<%0> %0<GameModeInit,>(none:)
-	#define ALS_DO_GameModeExit<%0> %0<GameModeExit,>(none:)
-	#define ALS_DO_FilterScriptInit<%0> %0<FilterScriptInit,>(none:)
-	#define ALS_DO_FilterScriptExit<%0> %0<FilterScriptExit,>(none:)
-	#define ALS_DO_PlayerConnect<%0> %0<PlayerConnect,i>(end:playerid)
-	#define ALS_DO_PlayerDisconnect<%0> %0<PlayerDisconnect,ii>(more:playerid,end:reason)
-	#define ALS_DO_PlayerSpawn<%0> %0<PlayerSpawn,i>(end:playerid)
-	#define ALS_DO_PlayerDeath<%0> %0<PlayerDeath,iii>(more:playerid,more:killerid,end:reason)
-	#define ALS_DO_VehicleSpawn<%0> %0<VehicleSpawn,i>(end:vehicleid)
-	#define ALS_DO_VehicleDeath<%0> %0<VehicleDeath,ii>(more:vehicleid,end:killerid)
-	#define ALS_DO_PlayerText<%0> %0<PlayerText,is>(more:playerid,end_string:text[])
-	#define ALS_DO_PlayerCommandText<%0> %0<PlayerCommandText,is>(more:playerid,end_string:cmdtext[])
-	#define ALS_DO_PlayerRequestClass<%0> %0<PlayerRequestClass,ii>(more:playerid,end:classid)
-	#define ALS_DO_PlayerEnterVehicle<%0> %0<PlayerEnterVehicle,iii>(more:playerid,more:vehicleid,end:ispassenger)
-	#define ALS_DO_PlayerExitVehicle<%0> %0<PlayerExitVehicle,ii>(more:playerid,end:vehicleid)
-	#define ALS_DO_PlayerStateChange<%0> %0<PlayerStateChange,iii>(more:playerid,more:newstate,end:oldstate)
-	#define ALS_DO_PlayerEnterCheckpoint<%0> %0<PlayerEnterCheckpoint,i>(end:playerid)
-	#define ALS_DO_PlayerLeaveCheckpoint<%0> %0<PlayerLeaveCheckpoint,i>(end:playerid)
-	#define ALS_DO_PlayerEnterRaceCheckpoint<%0> %0<PlayerEnterRaceCheckpoint,i>(end:playerid)
-	#define ALS_DO_PlayerLeaveRaceCheckpoint<%0> %0<PlayerLeaveRaceCheckpoint,i>(end:playerid)
-	#define ALS_DO_RconCommand<%0> %0<RconCommand,s>(end_string:cmd[])
-	#define ALS_DO_PlayerRequestSpawn<%0> %0<PlayerRequestSpawn,i>(end:playerid)
-	#define ALS_DO_ObjectMoved<%0> %0<ObjectMoved,i>(end:objectid)
-	#define ALS_DO_PlayerObjectMoved<%0> %0<PlayerObjectMoved,ii>(more:playerid,end:objectid)
-	#define ALS_DO_PlayerPickUpPickup<%0> %0<PlayerPickUpPickup,ii>(more:playerid,end:pickupid)
-	#define ALS_DO_VehicleMod<%0> %0<VehicleMod,iii>(more:playerid,more:vehicleid,end:componentid)
-	#define ALS_DO_EnterExitModShop<%0> %0<EnterExitModShop,iii>(more:playerid,more:enterexit,end:interiorid)
-	#define ALS_DO_VehiclePaintjob<%0> %0<VehiclePaintjob,iii>(more:playerid,more:vehicleid,end:paintjobid)
-	#define ALS_DO_VehicleRespray<%0> %0<VehicleRespray,iiii>(more:playerid,more:vehicleid,more:color1,end:color2)
-	#define ALS_DO_VehicleDamageStatusUpdate<%0> %0<VehicleDamageStatusUpdate,ii>(more:vehicleid,end:playerid)
-	#define ALS_DO_PlayerSelectedMenuRow<%0> %0<PlayerSelectedMenuRow,ii>(more:playerid,end:row)
-	#define ALS_DO_PlayerExitedMenu<%0> %0<PlayerExitedMenu,i>(end:playerid)
-	#define ALS_DO_PlayerInteriorChange<%0> %0<PlayerInteriorChange,iii>(more:playerid,more:newinteriorid,end:oldinteriorid)
-	#define ALS_DO_PlayerKeyStateChange<%0> %0<PlayerKeyStateChange,iii>(more:playerid,more:newkeys,end:oldkeys)
-	#define ALS_DO_RconLoginAttempt<%0> %0<RconLoginAttempt,ssi>(string:ip[],string:password[],end:success)
-	#define ALS_DO_PlayerUpdate<%0> %0<PlayerUpdate,i>(end:playerid)
-	#define ALS_DO_PlayerStreamIn<%0> %0<PlayerStreamIn,ii>(more:playerid,end:forplayerid)
-	#define ALS_DO_PlayerStreamOut<%0> %0<PlayerStreamOut,ii>(more:playerid,end:forplayerid)
-	#define ALS_DO_VehicleStreamIn<%0> %0<VehicleStreamIn,ii>(more:vehicleid,end:forplayerid)
-	#define ALS_DO_VehicleStreamOut<%0> %0<VehicleStreamOut,ii>(more:vehicleid,end:forplayerid)
-	#define ALS_DO_DialogResponse<%0> %0<DialogResponse,iiiis>(more:playerid,more:dialogid,more:response,more:listitem,end_string:inputtext[])
-	#define ALS_DO_PlayerClickPlayer<%0> %0<PlayerClickPlayer,iii>(more:playerid,more:clickedplayerid,end:source)
-	#define ALS_DO_PlayerLogin<%0> %0<PlayerLogin,ii>(more:playerid,end:uid)
-	#define ALS_DO_PlayerLogout<%0> %0<PlayerLogout,ii>(more:playerid,end:uid)
-	#define ALS_DO_PlayerGiveDamage<%0> %0<PlayerGiveDamage,iifi>(more:playerid,more:damagedid,tag:Float:amount,end:weaponid)
-	#define ALS_DO_PlayerTakeDamage<%0> %0<PlayerTakeDamage,iifi>(more:playerid,more:issuerid,tag:Float:amount,end:weaponid)
-	#define ALS_DO_PlayerClickMap<%0> %0<PlayerClickMap,ifff>(more:playerid,tag:Float:fX,tag:Float:fY,end_tag:Float:fZ)
-	#define ALS_DO_PlayerCommandReceived<%0> %0<PlayerCommandReceived,is>(more:playerid,end_string:cmdtext[])
-	#define ALS_DO_PlayerCommandPerformed<%0> %0<PlayerCommandPerformed,isi>(more:playerid,string:cmdtext[],end:success)
-	#define ALS_DO_UnoccupiedVehicleUpdate<%0> %0<UnoccupiedVehicleUpdate,iii>(more:vehicleid,more:playerid,end:passenger_seat)
-	// 0.3e
-	#define ALS_DO_PlayerClickTextDraw<%0> %0<PlayerClickTextDraw,ii>(more:playerid,end_tag:Text:clickedid)
-	#define ALS_DO_PlayerClickPlayerTextDraw<%0> %0<PlayerClickPlayerTextDraw,iii>(more:playerid,end_tag:PlayerText:playertextid)
-	#define ALS_DO_PlayerEditObject<%0> %0<PlayerEditObject,iiiiffffff>(more:playerid,more:playerobject,more:objectid,more:response,tag:Float:fX,tag:Float:fY,tag:Float:fZ,tag:Float:fRotX,tag:Float:fRotY,end_tag:Float:fRotZ)
-	#define ALS_DO_PlayerEditAttachedObject<%0> %0<PlayerEditAttachedObject,iiiiifffffffff>(more:playerid,more:response,more:index,more:modelid,more:boneid,tag:Float:fOffsetX,tag:Float:fOffsetY,tag:Float:fOffsetZ,tag:Float:fRotX,tag:Float:fRotY,tag:Float:fRotZ,tag:Float:fScaleX,tag:Float:fScaleY,end_tag:Float:fScaleZ)
-	#define ALS_DO_PlayerSelectObject<%0> %0<PlayerSelectObject,iiiifff>(more:playerid,more:type,more:objectid,more:modelid,tag:Float:fX,tag:Float:fY,end_tag:Float:fZ)
-	// Streamer plugin.
-	#define ALS_DO_DynamicObjectMoved<%0> %0<DynamicObjectMoved,i>(end:objectid)
-	#define ALS_DO_PlayerEditDynamicObject<%0> %0<PlayerEditDynamicObject,iiiiiiiii>(more:playerid,more:objectid,more:response,tag:Float:x,tag:Float:y,tag:Float:z,tag:Float:rx,tag:Float:ry,end_tag:Float:rz)
-	#define ALS_DO_PlayerSelectDynamicObject<%0> %0<PlayerSelectDynamicObject,iiiiii>(more:playerid,more:objectid,more:modelid,tag:Float:x,tag:Float:y,end_tag:Float:z)
-	//#define ALS_DO_PlayerSelectDynamicObjecp<%0> %0<PlayerSelectDynamicObject,iiiiii>(more:playerid,more:objectid,more:modelid,tag:Float:x,tag:Float:y,end_tag:Float:z)
-	#define ALS_DO_PlayerPickUpDynamicPickup<%0> %0<PlayerPickUpDynamicPickup,ii>(more:playerid,end:pickupid)
-	#define ALS_DO_PlayerEnterDynamicCP<%0> %0<PlayerEnterDynamicCP,ii>(more:playerid,end:checkpointid)
-	#define ALS_DO_PlayerLeaveDynamicCP<%0> %0<PlayerLeaveDynamicCP,ii>(more:playerid,end:checkpointid)
-	#define ALS_DO_PlayerEnterDynamicRaceCP<%0> %0<PlayerEnterDynamicRaceCP,ii>(more:playerid,end:checkpointid)
-	#define ALS_DO_PlayerLeaveDynamicRaceCP<%0> %0<PlayerLeaveDynamicRaceCP,ii>(more:playerid,end:checkpointid)
-	#define ALS_DO_PlayerEnterDynamicArea<%0> %0<PlayerEnterDynamicArea,ii>(more:playerid,end:areaid)
-	#define ALS_DO_PlayerLeaveDynamicArea<%0> %0<PlayerLeaveDynamicArea,ii>(more:playerid,end:areaid)
-	//#define ALS_CALL<%0> ALS_C_%0
-	//#define ALS_FORWARD<%0> ALS_F_%0
-	
-	//#define call%0On%1(%2) ALS_G_%1(%2)
-	
-	#define ALS_KS_more:%0,         %0,ALS_KS_
-	#define ALS_KS_string:%0[],     %0[],ALS_KS_
-	#define ALS_KS_tag:%3:%0,       %3:%0,ALS_KS_
-	#define ALS_KS_end:%0)          %0)
-	#define ALS_KS_none:)           )
-	#define ALS_KS_end_string:%0[]) %0[])
-	#define ALS_KS_end_tag:%3:%0)   %3:%0)
-	
-	#define ALS_TS_more:%0,         %0,ALS_TS_
-	#define ALS_TS_string:%0[],     (%0),ALS_TS_
-	#define ALS_TS_tag:%3:%0,       %3:%0,ALS_TS_
-	#define ALS_TS_end:%0)          %0)
-	#define ALS_TS_none:)           )
-	#define ALS_TS_end_string:%0[]) (%0))
-	#define ALS_TS_end_tag:%3:%0)   %3:%0)
-	
-	#define ALS_RS_more:%0,         %0,ALS_RS_
-	#define ALS_RS_string:%0[],     ((%0[0])?(%0):NULL),ALS_RS_
-	#define ALS_RS_tag:%3:%0,       (_:%0),ALS_RS_
-	#define ALS_RS_end:%0)          %0)
-	#define ALS_RS_none:)           )
-	#define ALS_RS_end_string:%0[]) ((%0[0])?(%0):NULL))
-	#define ALS_RS_end_tag:%3:%0)   (_:%0))
-	
-	#define ALS_DO:%9<%0> ALS_DO_%0<%9>
-	
-	#define ALS_CALL<%0> ALS_DO:ALS_C_INT<%0>
-	#define ALS_GET<%0> ALS_DO:_ALS_C_INT<%0>
-	#define ALS_FORWARD<%0> ALS_DO:ALS_F_INT<%0>
-	
-	#define call%0On%1(%2) ALS_DO:ALS_G_INT<%1>(%2)
-	
-	/*ALS_DoDetect(const str[]);
-	public ALS_DoDetect(const str[])
-	{
-		new
-			addr;
-		addr = funcidx(str);
-		if (addr != -1)
-		{
-			// Get the actual function address, not just the structure offset.
-			addr *= 8;
-			addr += AMX_HEADER_PUBLICS;
-			#emit LREF.S.pri addr
-			#emit STOR.S.pri addr
-		}
-		return addr;
-	}*/
+	#define ALS_C_GameModeInit              ALS_C_INT<GameModeInit             ,1,>()
+	#define ALS_C_GameModeExit              ALS_C_INT<GameModeExit             ,1,>()
+	#define ALS_C_FilterScriptInit          ALS_C_INT<FilterScriptInit         ,1,>()
+	#define ALS_C_FilterScriptExit          ALS_C_INT<FilterScriptExit         ,1,>()
+	#define ALS_C_PlayerConnect             ALS_C_INT<PlayerConnect            ,1,i>(playerid)
+	#define ALS_C_PlayerDisconnect          ALS_C_INT<PlayerDisconnect         ,1,ii>(playerid,reason)
+	#define ALS_C_PlayerSpawn               ALS_C_INT<PlayerSpawn              ,1,i>(playerid)
+	#define ALS_C_PlayerDeath               ALS_C_INT<PlayerDeath              ,1,iii>(playerid,killerid,reason)
+	#define ALS_C_VehicleSpawn              ALS_C_INT<VehicleSpawn             ,1,i>(vehicleid)
+	#define ALS_C_VehicleDeath              ALS_C_INT<VehicleDeath             ,1,ii>(vehicleid,killerid)
+	#define ALS_C_PlayerText                ALS_C_INT<PlayerText               ,1,is>(playerid,text)
+	#define ALS_C_PlayerCommandText         ALS_C_INT<PlayerCommandText        ,0,is>(playerid,cmdtext)
+	#define ALS_C_PlayerRequestClass        ALS_C_INT<PlayerRequestClass       ,1,ii>(playerid,classid)
+	#define ALS_C_PlayerEnterVehicle        ALS_C_INT<PlayerEnterVehicle       ,1,iii>(playerid,vehicleid,ispassenger)
+	#define ALS_C_PlayerExitVehicle         ALS_C_INT<PlayerExitVehicle        ,1,ii>(playerid,vehicleid)
+	#define ALS_C_PlayerStateChange         ALS_C_INT<PlayerStateChange        ,1,iii>(playerid,newstate,oldstate)
+	#define ALS_C_PlayerEnterCheckpoint     ALS_C_INT<PlayerEnterCheckpoint    ,1,i>(playerid)
+	#define ALS_C_PlayerLeaveCheckpoint     ALS_C_INT<PlayerLeaveCheckpoint    ,1,i>(playerid)
+	#define ALS_C_PlayerEnterRaceCheckpoint ALS_C_INT<PlayerEnterRaceCheckpoint,1,i>(playerid)
+	#define ALS_C_PlayerLeaveRaceCheckpoint ALS_C_INT<PlayerLeaveRaceCheckpoint,1,i>(playerid)
+	#define ALS_C_RconCommand               ALS_C_INT<RconCommand              ,1,s>(cmd)
+	#define ALS_C_PlayerRequestSpawn        ALS_C_INT<PlayerRequestSpawn       ,1,i>(playerid)
+	#define ALS_C_ObjectMoved               ALS_C_INT<ObjectMoved              ,1,i>(objectid)
+	#define ALS_C_PlayerObjectMoved         ALS_C_INT<PlayerObjectMoved        ,1,ii>(playerid,objectid)
+	#define ALS_C_PlayerPickUpPickup        ALS_C_INT<PlayerPickUpPickup       ,1,ii>(playerid,pickupid)
+	#define ALS_C_VehicleMod                ALS_C_INT<VehicleMod               ,1,iii>(playerid,vehicleid,componentid)
+	#define ALS_C_EnterExitModShop          ALS_C_INT<EnterExitModShop         ,1,iii>(playerid,enterexit,interiorid)
+	#define ALS_C_VehiclePaintjob           ALS_C_INT<VehiclePaintjob          ,1,iii>(playerid,vehicleid,paintjobid)
+	#define ALS_C_VehicleRespray            ALS_C_INT<VehicleRespray           ,1,iiii>(playerid,vehicleid,color1,color2)
+	#define ALS_C_VehicleDamageStatusUpdate ALS_C_INT<VehicleDamageStatusUpdate,1,ii>(playerid,playerid)
+	#define ALS_C_PlayerSelectedMenuRow     ALS_C_INT<PlayerSelectedMenuRow    ,1,ii>(playerid,row)
+	#define ALS_C_PlayerExitedMenu          ALS_C_INT<PlayerExitedMenu         ,1,i>(playerid)
+	#define ALS_C_PlayerInteriorChange      ALS_C_INT<PlayerInteriorChange     ,1,iii>(playerid,newinteriorid,oldinteriorid)
+	#define ALS_C_PlayerKeyStateChange      ALS_C_INT<PlayerKeyStateChange     ,1,iii>(playerid,newkeys,oldkeys)
+	#define ALS_C_RconLoginAttempt          ALS_C_INT<RconLoginAttempt         ,1,ssi>(ip,password,success)
+	#define ALS_C_PlayerUpdate              ALS_C_INT<PlayerUpdate             ,1,i>(playerid)
+	#define ALS_C_PlayerStreamIn            ALS_C_INT<PlayerStreamIn           ,1,ii>(playerid,forplayerid)
+	#define ALS_C_PlayerStreamOut           ALS_C_INT<PlayerStreamOut          ,1,ii>(playerid,forplayerid)
+	#define ALS_C_VehicleStreamIn           ALS_C_INT<VehicleStreamIn          ,1,ii>(vehicleid,forplayerid)
+	#define ALS_C_VehicleStreamOut          ALS_C_INT<VehicleStreamOut         ,1,ii>(vehicleid,forplayerid)
+	//#define ALS_C_DialogResponse            ALS_C_INT<DialogResponse           ,1,ii>(playerid,dialogid,response,listitem,inputtext)
+	#define ALS_C_PlayerClickPlayer         ALS_C_INT<PlayerClickPlayer        ,1,iii>(playerid,clickedplayerid,source)
+	#define ALS_C_DialogResponse if(inputtext[0]){ALS_C_INT<DialogResponse,1,iiiis>(playerid,dialogid,response,listitem,inputtext)}else{ALS_C_INT<DialogResponse,1,iiiis>(playerid,dialogid,response,listitem,NULL)}
+	
+	#define ALS_CALL<%0> ALS_C_%0
+	#define ALS_FORWARD<%0> ALS_F_%0
 	
+	#define _Y_ALS_INCLUDED
 #endif
 
-#if !defined ALS_MAKE
-	#if defined ALS_PREFIX
-		#error Use ALS_MAKE not ALS_PREFIX
-	#endif
-	//&&&
-	#define ALS_MAKE<%0...%1> %0Mode_%1
+#if !defined ALS_PREFIX
+	//#error You must define a callback prefix before including y_als.
+	#define ALS_PREFIX Mode
 #endif
-

+ 38 - 62
pawno/include/YSI/y_bintree.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					===================================
 					Y Sever Includes - Binary Tree Core
 					===================================
@@ -19,17 +19,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI binary tree include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -44,10 +44,9 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	0.1.3
 Changelog:
@@ -107,17 +106,13 @@ Compile options:
 	-
 Operators:
 	-
-\*----------------------------------------------------------------------------*/
-
-#include "internal\y_version"
+-*----------------------------------------------------------------------------*/
 
-#include "y_debug"
-#include "y_utils"
+#include <YSI\internal\y_version>
 
 #define BINTREE_NO_BRANCH -1
 #define BINTREE_NOT_FOUND -1
 
-// If this ever changes, update the size reference in y_users.
 enum E_BINTREE_TREE
 {
 	E_BINTREE_TREE_VALUE,
@@ -137,11 +132,7 @@ enum E_BINTREE_INPUT
 //#define Bintree:%1[%2] Bintree:%1[%2][E_BINTREE_TREE]
 #define BinaryTree:%1<%2> Bintree:%1[%2][E_BINTREE_TREE]
 
-// Update at a later date...
-#define Bintree_DisplayOutput(%0) "<bintree output>"
-#define Bintree_DisplayInput(%0) "<bintree input>"
-
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_Sort
 Params:
@@ -151,12 +142,12 @@ Return:
 	-
 Notes:
 	Entry point for Bintree_QSort.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define Bintree_Sort(%1,%2) \
 	Bintree_QSort((%1), 0, (%2) - 1)
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_Fill
 Params:
@@ -167,12 +158,12 @@ Return:
 	Bintree_SortHalf.
 Notes:
 	Entry point for Bintree_SortHalf.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define Bintree_Fill(%1,%2,%3) \
 	Bintree_SortHalf((%1), (%2), 0, (%3), 0, BINTREE_NO_BRANCH)
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_Generate
 Params:
@@ -183,11 +174,10 @@ Return:
 	-
 Notes:
 	Just calls the sort and fill routines.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock Bintree_Generate(BinaryTree:output<>, input[][E_BINTREE_INPUT], size)
 {
-	P:3("Bintree_Generate called: %s, %s, %i", Bintree_DisplayOutput(output), Bintree_DisplayInput(input), size);
 	if (!size)
 	{
 		output[0][E_BINTREE_TREE_PARENT] = BINTREE_NO_BRANCH;
@@ -200,7 +190,7 @@ stock Bintree_Generate(BinaryTree:output<>, input[][E_BINTREE_INPUT], size)
 	return 1;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_Reset
 Params:
@@ -210,11 +200,10 @@ Return:
 	-
 Notes:
 	Initialises the array for use.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock Bintree_Reset(BinaryTree:tree<>, pointer = 0)
 {
-	P:3("Bintree_Reset called: %s, %i", Bintree_DisplayOutput(tree), pointer);
 	tree[pointer][E_BINTREE_TREE_VALUE] = 0;
 	tree[pointer][E_BINTREE_TREE_LEFT] = BINTREE_NO_BRANCH;
 	tree[pointer][E_BINTREE_TREE_RIGHT] = BINTREE_NO_BRANCH;
@@ -222,7 +211,7 @@ stock Bintree_Reset(BinaryTree:tree<>, pointer = 0)
 	tree[pointer][E_BINTREE_TREE_POINTER] = BINTREE_NOT_FOUND;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_FindValue
 Params:
@@ -240,16 +229,14 @@ Notes:
 	If cont is not -1 the search will start from the data pointed to by the
 	data pointed to by conts' right path, this is to allow collisions to be
 	passed over if you want a subsequent one.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock Bintree_FindValue(BinaryTree:tree<>, value, &cont = 0, &old = 0)
 {
-	P:3("Bintree_FindValue called: %s, %i, %i, %i", Bintree_DisplayOutput(tree), value, cont, old);
 	new
 		treeValue;
 	while (cont != BINTREE_NO_BRANCH)
 	{
-		P:7("Bintree_FindValue: search %d %d %d %d", cont, old, tree[cont][E_BINTREE_TREE_VALUE], value);
 		old = cont;
 		treeValue = tree[old][E_BINTREE_TREE_VALUE];
 		if (value < treeValue) cont = tree[old][E_BINTREE_TREE_LEFT];
@@ -265,7 +252,7 @@ stock Bintree_FindValue(BinaryTree:tree<>, value, &cont = 0, &old = 0)
 	return BINTREE_NOT_FOUND;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_QSort
 Params:
@@ -277,11 +264,10 @@ Return:
 Notes:
 	Custom version of QSort (see YSI_misc) allows for E_BINTREE_INPUT data
 	types, preserving the relative pointers for the sorted data.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-stock Bintree_QSort(numbers[][E_BINTREE_INPUT], left, right)
+Bintree_QSort(numbers[][E_BINTREE_INPUT], left, right)
 {
-	P:3("Bintree_QSort called: %s, %i, %i", Bintree_DisplayInput(numbers), left, right);
 	new
 		pivot = numbers[left][E_BINTREE_INPUT_VALUE],
 		pointer = numbers[left][E_BINTREE_INPUT_POINTER],
@@ -313,7 +299,7 @@ stock Bintree_QSort(numbers[][E_BINTREE_INPUT], left, right)
 	if (right > pivot) Bintree_QSort(numbers, pivot + 1, right);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_SortHalf
 Params:
@@ -337,11 +323,10 @@ Notes:
 	after bisecting values haven't been tested).
 	
 	Based on code written for PHP by me.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-stock Bintree_SortHalf(BinaryTree:output<>, data[][E_BINTREE_INPUT], index, upper, offset, parent)
+Bintree_SortHalf(BinaryTree:output<>, data[][E_BINTREE_INPUT], index, upper, offset, parent)
 {
-	P:3("Bintree_SortHalf called: %s, %s, %i, %i, %i, %i", Bintree_DisplayOutput(output), Bintree_DisplayInput(data), index, upper, offset, parent);
 	new
 		num = upper - index;
 	if (!num) return offset;
@@ -355,15 +340,12 @@ stock Bintree_SortHalf(BinaryTree:output<>, data[][E_BINTREE_INPUT], index, uppe
 	}
 	else if (num == 2)
 	{
-		P:3("Bintree_SortHalf: adding %i %i %i", index, data[index][E_BINTREE_INPUT_VALUE], data[index + 1][E_BINTREE_INPUT_VALUE]);
 		output[offset][E_BINTREE_TREE_VALUE] = data[index][E_BINTREE_INPUT_VALUE];
 		output[offset][E_BINTREE_TREE_POINTER] = data[index][E_BINTREE_INPUT_POINTER];
 		output[offset][E_BINTREE_TREE_PARENT] = parent;
 		output[offset][E_BINTREE_TREE_LEFT] = BINTREE_NO_BRANCH;
-		output[offset][E_BINTREE_TREE_RIGHT] = offset + 1;
-		++offset;
-		++index;
-		output[offset][E_BINTREE_TREE_VALUE] = data[index][E_BINTREE_INPUT_VALUE];
+		output[offset][E_BINTREE_TREE_RIGHT] = ++offset;
+		output[offset][E_BINTREE_TREE_VALUE] = data[++index][E_BINTREE_INPUT_VALUE];
 		output[offset][E_BINTREE_TREE_POINTER] = data[index][E_BINTREE_INPUT_POINTER];
 		output[offset][E_BINTREE_TREE_PARENT] = offset - 1;
 		output[offset][E_BINTREE_TREE_LEFT] = BINTREE_NO_BRANCH;
@@ -387,7 +369,7 @@ stock Bintree_SortHalf(BinaryTree:output<>, data[][E_BINTREE_INPUT], index, uppe
 	return offset + 1;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_Add
 Params:
@@ -403,11 +385,10 @@ Notes:
 
 native Bintree_Add(BinaryTree:tree<>, pointer, value, offset, maxsize = sizeof (data));
 
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock Bintree_Add(BinaryTree:data<>, pointer, value, offset, maxsize = sizeof (data))
 {
-	P:3("Bintree_Add called: %s, %i, %i, %i, %i", Bintree_DisplayOutput(data), pointer, value, offset, maxsize);
 	if (offset >= maxsize) return BINTREE_NOT_FOUND;
 	if (offset)
 	{
@@ -436,7 +417,7 @@ stock Bintree_Add(BinaryTree:data<>, pointer, value, offset, maxsize = sizeof (d
 	}
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_Delete
 Params:
@@ -452,11 +433,10 @@ Notes:
 	chunk (unless there's only 2 items) goes left.
 	
 	Called itteratively to ensure branches are maintained.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock Bintree_Delete(BinaryTree:source<>, index, count)
 {
-	P:3("Bintree_Delete called: %s, %i, %i", Bintree_DisplayOutput(source), index, count);
 	new
 		branch,
 		old = index;
@@ -485,7 +465,7 @@ stock Bintree_Delete(BinaryTree:source<>, index, count)
 	return BINTREE_NO_BRANCH;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_Compress
 Params:
@@ -496,11 +476,10 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 static stock Bintree_Compress(BinaryTree:data<>, index, count)
 {
-	P:4("Bintree_Compress called: %s, %i, %i", Bintree_DisplayOutput(data), index, count);
 	new
 		index2 = index + 1;
 	while (index < count)
@@ -524,7 +503,7 @@ static stock Bintree_Compress(BinaryTree:data<>, index, count)
 	return count - 1;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_FindMin
 Params:
@@ -534,18 +513,17 @@ Return:
 	-
 Notes:
 	Finds the smallest value on a branch
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 static stock Bintree_FindMin(BinaryTree:data<>, offset)
 {
-	P:4("Bintree_FindMin called: %s, %i", Bintree_DisplayOutput(data), offset);
 	new
 		branch;
 	while ((branch = data[offset][E_BINTREE_TREE_LEFT]) != BINTREE_NO_BRANCH) offset = branch;
 	return offset;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_FindMax
 Params:
@@ -555,18 +533,17 @@ Return:
 	-
 Notes:
 	Finds the largest value on a branch
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 static stock Bintree_FindMax(BinaryTree:data<>, offset)
 {
-	P:4("Bintree_FindMax called: %s, %i", Bintree_DisplayOutput(data), offset);
 	new
 		branch;
 	while ((branch = data[offset][E_BINTREE_TREE_RIGHT]) != BINTREE_NO_BRANCH) offset = branch;
 	return offset;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bintree_UpdatePointers
 Params:
@@ -578,11 +555,10 @@ Return:
 Notes:
 	Used for updating pointers when the target data has been modifed (i.e. a
 	value has been removed from the array and the array shifted).
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock Bintree_UpdatePointers(BinaryTree:data<>, offset, size, mod = -1)
 {
-	P:3("Bintree_UpdatePointers called: %s, %i, %i, %i", Bintree_DisplayOutput(data), offset, size, mod);
 	for (new i = 0; i < size; i++)
 	{
 		if (data[i][E_BINTREE_TREE_POINTER] > offset) data[i][E_BINTREE_TREE_POINTER] += mod;

+ 32 - 127
pawno/include/YSI/y_bit.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					===========================
 					Y Sever Includes - Bit Core
 					===========================
@@ -23,17 +23,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI bit include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -48,17 +48,12 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	0.2
 Changelog:
-	21/10/12:
-		Changed "Bit_Display" to print in the correct order.
-	22/02/12:
-		Added the "BITS" iterator.
 	01/12/08:
 		Rewrote most of the code to use shifts and ands not divs and mods.
 	24/06/07:
@@ -107,12 +102,9 @@ Commands:
 	-
 Compile options:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-#include "internal\y_version"
-#include "y_debug"
-#include "y_utils"
-#include "y_cell"
+#include <YSI\internal\y_version>
 
 // This is redefined below, don't worry.  It's like this so the function
 // prototypes can use a familiar syntax.
@@ -132,7 +124,7 @@ Compile options:
 	#endif
 #endif
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bit_Bits
 Params:
@@ -141,12 +133,11 @@ Return:
 	Number of cells required for the bit array.
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-// If this ever changes, update the size reference in y_users.
 #define Bit_Bits(%1) (((%1)+cellbits-1)/cellbits)
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bit_Slot
 Params:
@@ -155,11 +146,11 @@ Return:
 	The true array slot for this value.
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define Bit_Slot(%1) ((_:%1)>>>CELLSHIFT)
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bit_Mask
 Params:
@@ -168,11 +159,11 @@ Return:
 	The bit in the array slot to use.
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define Bit_Mask(%1) (Bit:(1<<((_:%1)&cellbits-1)))
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bit_GetBit
 Params:
@@ -182,11 +173,11 @@ Return:
 	State of the provided slot, 0 on fail.
 Notes:
 	Unsafe but faster for when you're sure you're within range.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define Bit_GetBit(%1,%2) (%1[(%2)>>>CELLSHIFT]&Bit:(1<<((%2)&cellbits-1)))
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bit_Get
 Params:
@@ -200,11 +191,11 @@ Notes:
 
 native Bit_Get(BitArray:array<>, slot);
 
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define Bit_Get(%1,%2) bool:Bit_GetBit(Bit:%1,_:%2)
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bit_Let
 Params:
@@ -214,11 +205,11 @@ Return:
 	-
 Notes:
 	Sets the slot to 1.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define Bit_Let(%1,%2) %1[(%2)>>>CELLSHIFT]|=Bit:(1<<((%2)&cellbits-1))
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bit_Vet
 Params:
@@ -228,11 +219,11 @@ Return:
 	-
 Notes:
 	Sets the slot to 0.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define Bit_Vet(%1,%2) %1[(%2)>>>CELLSHIFT]&=Bit:~(1<<((%2)&cellbits-1))
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bit_Set
 Params:
@@ -247,18 +238,16 @@ Notes:
 
 native Bit_Set(BitArray:array<>, slot, bool:set, size = sizeof (array));
 
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-stock Bit_Set(BitArray:array<>, slot, bool:set)//, size = sizeof (array))
+stock Bit_Set(BitArray:array<>, slot, bool:set, size = sizeof (array))
 {
-	//if (slot >>> CELLSHIFT >= size) return;
+	if (slot >>> CELLSHIFT >= size) return;
 	if (set) Bit_Let(array, slot);
 	else Bit_Vet(array, slot);
 }
 
-//#define Bit_Set(%0,%1,%2) ((%2)?Bit_Let(%0,(%1)):Bit_Vet(%0,(%1)))
-
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bit_SetAll
 Params:
@@ -272,7 +261,7 @@ Notes:
 
 native Bit_SetAll(BitArray:array<>, bool:set, size = sizeof (array));
 
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock Bit_SetAll(BitArray:array<>, bool:set, size = sizeof (array))
 {
@@ -281,7 +270,7 @@ stock Bit_SetAll(BitArray:array<>, bool:set, size = sizeof (array))
 	for (new i = 0; i != size; ++i) array[i] = val;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Bit_GetCount
 Params:
@@ -295,9 +284,8 @@ Notes:
 
 native Bit_Count(BitArray:array<>, size = sizeof (array));
 
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-#define Bit_Count Bit_GetCount
 stock Bit_GetCount(BitArray:array<>, size = sizeof (array))
 {
 	new
@@ -313,93 +301,10 @@ stock Bit_GetCount(BitArray:array<>, size = sizeof (array))
 	return count;
 }
 
-stock Bit_Display(BitArray:array<>, size = sizeof (array))
-{
-	new
-		ret[YSI_MAX_STRING],
-		val;
-	while (size--)
-	{
-		val = Cell_ReverseBits(array[size]);
-		format(ret, sizeof (ret), "%016b%016b%s", val >>> 16, val & 0xFFFF, ret);
-	}
-	P:7("Bit_Display called: %s, %i", ret, size);
-	return ret;
-}
+#define bits<%1> \
+	Bit_Bits(%1)
 
 #define bitsof(%0) (sizeof(%0)*cellbits)
 
-stock Bits@YSII_Ag(BitArray:data<>, start, size = sizeof (data))
-{
-	P:3("YSI_gABITSFunc called: %s, %i", Bit_Display(data, size), start);
-	static const
-		scDeBruijn[] =
-			{
-				0,  1,  28, 2,  29, 14, 24, 3,  30, 22, 20, 15, 25, 17, 4,  8,
-				31, 27, 13, 23, 21, 19, 16, 7,  26, 12, 18, 6,  11, 5,  10, 9
-			};
-	++start;
-	new
-		cur,
-		i = Bit_Slot(start);
-	if (i == size)
-	{
-		return -1;
-	}
-	// Blank out the lowest bits to get the lowest bit not yet used.
-	if ((cur = (_:data[i] & ~((1 << (start & (cellbits - 1))) - 1))))
-	{
-		//printf("%d %d %d %d", cur, data[i], start, ~((1 << (start & (cellbits - 1))) - 1));
-		// Bits left in the current cell.
-		return (i * cellbits) + scDeBruijn[((cur & -cur) * 0x077CB531) >>> 27];
-	}
-	++i;
-	while (i != size)
-	{
-		if ((cur = _:data[i]))
-		{
-			return (i * cellbits) + scDeBruijn[((cur & -cur) * 0x077CB531) >>> 27];
-		}
-		++i;
-	}
-	return -1;
-}
-
-stock Blanks@YSII_Ag(BitArray:data<>, start, size = sizeof (data))
-{
-	P:3("YSI_gABlanksFunc called: %s, %i", Bit_Display(data), start);
-	static const
-		scDeBruijn[] =
-			{
-				0,  1,  28, 2,  29, 14, 24, 3,  30, 22, 20, 15, 25, 17, 4,  8,
-				31, 27, 13, 23, 21, 19, 16, 7,  26, 12, 18, 6,  11, 5,  10, 9
-			};
-	//++start;
-	new
-		cur,
-		i = Bit_Slot(start);
-	if (i == size)
-	{
-		return -1;
-	}
-	if ((cur = ~(_:(data[i] & ~((1 << (start & (cellbits - 1))) - 1)))))
-	{
-		// Bits left in the current cell.
-		return (i * cellbits) + scDeBruijn[((cur & -cur) * 0x077CB531) >>> 27];
-	}
-	++i;
-	while (i != size)
-	{
-		if ((cur = ~_:data[i]))
-		{
-			return (i * cellbits) + scDeBruijn[((cur & -cur) * 0x077CB531) >>> 27];
-		}
-		++i;
-	}
-	return -1;
-}
-
-#define bits<%1> Bit_Bits(%1) 
-
 #undef BitArray
 #define BitArray:%1<%2> Bit:%1[bits<%2>]

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 437 - 438
pawno/include/YSI/y_classes.inc


+ 8 - 9
pawno/include/YSI/y_colors.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					==========================
 					 y_colours - X11 colours!
 					==========================
@@ -21,17 +21,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI colours include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -46,15 +46,14 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
 	06/08/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-#include "y_colours"
+#include <YSI\y_colours>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1286 - 172
pawno/include/YSI/y_colours.inc


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 182 - 328
pawno/include/YSI/y_commands.inc


+ 24 - 128
pawno/include/YSI/y_debug.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					==============================
 					Y Sever Includes - Debug Setup
 					==============================
@@ -8,13 +8,11 @@ Description:
 	General debug levels:
 	
 	0 - No debug information.
-	1 - Callbacks and timers.
-	2 - Remote functions.
-	3 - Stock functions.
-	4 - Static functions.
-	5 - Code.
-	6 - Loops.
-	7 - Extra loop code.
+	1 - Callbacks start and finish.
+	2 - Major functions called.
+	3 - Major control flow.
+	4 - Minor control flow/functions.
+	5 - Code steps.
 	
 	If you use P:0 you get an optional debug print controlled by the global
 	state ysi_debug - which is either on or off.
@@ -31,17 +29,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI debug include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -56,10 +54,9 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
@@ -85,10 +82,8 @@ Functions:
 Callbacks:
 	-
 Definitions:
-	P:<0-6> - Print a message.
-	P:C - Run debug code.
-	P:E - Print an error message.
-	P:W - Print a warning message.
+	DBGP - Simple Debug_Print wrapper.
+	DBGC - Simple Debug_Code wrapper.
 Enums:
 	-
 Macros:
@@ -106,15 +101,11 @@ Compile options:
 	_DEBUG - Debugging level to use.
 Operators:
 	-
-\*----------------------------------------------------------------------------*/
-
-#include "internal\y_version"
-
-#include "internal\y_funcinc"
+-*----------------------------------------------------------------------------*/
 
-#include "y_scriptinit"
+#include <YSI\internal\y_version>
 
-#include "internal\y_natives"
+#include <YSI\internal\y_funcinc>
 
 #if !defined _DEBUG
 	#define _DEBUG 0
@@ -123,7 +114,7 @@ Operators:
 #define P:%1(%2); Debug_Print%1(%2);
 #define C:%1(%2); Debug_Code%1(%2);
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Debug_Code
 Params:
@@ -138,7 +129,7 @@ Notes:
 	
 	The code must all be on one line to avoid errors.
 	This isn't really a function as the first parameter is part of the name.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define DBGC1 Debug_Code1
 #define DBGC2 Debug_Code2
@@ -181,14 +172,7 @@ Notes:
 	#define Debug_Code5(%1);
 #endif
 
-#if _DEBUG >= 6
-	#define Debug_Code6(%1); \
-		%1
-#else
-	#define Debug_Code6(%1);
-#endif
-
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Debug_Print
 Params:
@@ -201,7 +185,7 @@ Notes:
 	This isn't really a function as the first parameter is part of the name:
 	
 	Debug_Print4("variables: %d, %d", i, j);
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define DBGP1 Debug_Print1
 #define DBGP2 Debug_Print2
@@ -244,36 +228,7 @@ Notes:
 	#define Debug_Print5(%1);
 #endif
 
-#if _DEBUG >= 6
-	#define Debug_Print6(%1); \
-		printf(%1);
-#else
-	#define Debug_Print6(%1);
-#endif
-
-#if _DEBUG >= 7
-	#define Debug_Print7(%1); \
-		printf(%1);
-#else
-	#define Debug_Print7(%1);
-#endif
-
-#define Debug_PrintE(%1); \
-	Debug_Print0("\7\7\7*** YSI Error: " #%1);
-
-#define Debug_PrintW(%1); \
-	Debug_Print0("\7*** YSI Warning: " #%1);
-
-#define Debug_PrintI(%1); \
-	Debug_Print0("*** YSI Info: " #%1);
-
-#define Debug_PrintF(%1); \
-	Debug_Print0("\7\7\7\7\7*** YSI Fatal Error: " #%1);
-
-#define Debug_PrintC(%1); \
-	Debug_Code1(%1);
-
-stock Debug_Print0(str[], {Float,_}:...) <ysi_debug : on>
+stock Debug_Print0(str[], {Float,_}:...) <ysi_debug:on>
 {
 	// This uses the variable parameter passing method based on code by Zeex.
 	// See page 15 of the code optimisations topic.
@@ -285,8 +240,6 @@ stock Debug_Print0(str[], {Float,_}:...) <ysi_debug : on>
 			arg_start,
 			arg_end;
 		
-		//#emit BREAK
-		
 		// Load the real address of the last static parameter.  Do this by
 		// loading the address of the parameter and then adding the value of
 		// [FRM] (frame pointer).
@@ -335,7 +288,7 @@ stock Debug_Print0(str[], {Float,_}:...) <ysi_debug : on>
 	}
 }
 
-stock Debug_Print0(str[], {Float,_}:...) <ysi_debug : off>
+stock Debug_Print0(str[], {Float,_}:...) <ysi_debug:off>
 {
 	#pragma unused str
 }
@@ -345,64 +298,7 @@ stock Debug_Print0(str[], {Float,_}:...) <>
 	#pragma unused str
 }
 
-stock Debug_PrintArray(arr[], size)
-{
-	new
-		str[96];
-	switch (size)
-	{
-		case 0:
-			str = "<>";
-		case 1:
-			format(str, sizeof (str), "<%d>", arr[0]);
-		case 2:
-			format(str, sizeof (str), "<%d, %d>", arr[0], arr[1]);
-		case 3:
-			format(str, sizeof (str), "<%d, %d, %d>", arr[0], arr[1], arr[2]);
-		case 4:
-			format(str, sizeof (str), "<%d, %d, %d, %d>", arr[0], arr[1], arr[2], arr[3]);
-		case 5:
-			format(str, sizeof (str), "<%d, %d, %d, %d, %d>", arr[0], arr[1], arr[2], arr[3], arr[4]);
-		default:
-			format(str, sizeof (str), "<%d, %d, %d, %d, %d, ... (+ %d)>", arr[0], arr[1], arr[2], arr[3], arr[4], size - 5);
-	}
-	return str;
-}
-
-/*#if _DEBUG > 0
+#if _DEBUG > 0
 	#define Debug_Print0(%1); \
 		printf(%1);
-#endif*/
-
-public OnScriptInit()
-{
-	Debug_SetState();
-	new
-		s;
-	// Test the ADDRESS of the variable, not the value.
-	#emit CONST.pri YSI_FILTERSCRIPT
-	#emit STOR.S.pri s
-	if (s)
-	{
-		//goto Debug_OnScriptInit_no_fault();
-		return Debug_OnScriptInit();
-	}
-	P:F("YSI_FILTERSCRIPT == 0");
-	while (s != 10000000) ++s;
-	#emit CONST.pri 0
-	#emit SCTRL     6
-	return 1;
-}
-
-static stock Debug_SetState() <ysi_debug : off>
-{
-}
-
-static stock Debug_SetState() <>
-{
-	state ysi_debug : on;
-}
-
-#undef OnScriptInit
-#define OnScriptInit(%0) Debug_OnScriptInit(%0) <_ALS_:hooked>
-forward Debug_OnScriptInit();public Debug_OnScriptInit()<_ALS_:unhooked>{return 1;}public Debug_OnScriptInit()<>{return 1;}
+#endif

+ 11 - 26
pawno/include/YSI/y_files.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 							========================
 							 y_files - Include File 
 							========================
@@ -17,35 +17,20 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI files include.
+	The Original Code is the YSI 2.0 SA:MP plugin.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
-	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+	Contributor(s):
 	
-	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
-		ZeeX - Very productive conversations.
-		koolk - IsPlayerinAreaEx code.
-		TheAlpha - Danish translation.
-		breadfish - German translation.
-		Fireburn - Dutch translation.
-		yom - French translation.
-		50p - Polish translation.
-		Zamaroht - Spanish translation.
-		Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes
-			for me to strive to better.
-		Pixels^ - Running XScripters where the idea was born.
-		Matite - Pestering me to release it and using it.
+	Peter Beverloo
+	Marcus Bauer
 	
-	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
-		Kye/Kalcor - SA:MP.
-		SA:MP Team past, present and future - SA:MP.
+	Special Thanks to:
 	
+	SA:MP Team past, present and future
 Version:
 	0.1
 Changelog:
@@ -85,13 +70,13 @@ Compile options:
 	-
 Operators:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					=================
 					 y_ini Libraries
 					=================
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 // File functions
 native ffind(const pattern[], filename[], len, &idx);

+ 80 - 51
pawno/include/YSI/y_flooding.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					===================================
 					Y Sever Includes - Connections Core
 					===================================
@@ -17,17 +17,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI flooding include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -42,10 +42,9 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Changelog:
 	15/11/10:
 		Updated to YSI 1.0.
@@ -87,29 +86,26 @@ Compile options:
 	-
 Operators:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-#include "internal\y_version"
-#include "y_iterate"
-#include "y_debug"
-#include "y_hooks"
+#include <YSI\internal\y_version>
 
 enum e_FLOOD_ACTION (+= 0x00010000)
 {
-	e_FLOOD_ACTION_COUNT = 0x0000FFFF,
+	e_FLOOD_ACTION_COUNT = 0x0000FFFF
 	e_FLOOD_ACTION_ACTION = 0x000F0000,
 	e_FLOOD_ACTION_NOTHING = 0,
 	e_FLOOD_ACTION_BLOCK,
 	e_FLOOD_ACTION_KICK,
 	e_FLOOD_ACTION_BAN,
-	e_FLOOD_ACTION_FBAN
+	e_FLOOD_ACTION_OPC = 0x80000000,
 }
 
 static
 	YSI_g_sPlayerIPs[MAX_PLAYERS],
 	e_FLOOD_ACTION:YSI_g_sMaxConnections = e_FLOOD_ACTION_COUNT | e_FLOOD_ACTION_BLOCK;
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	SetMaxConnections
 Params:
@@ -119,22 +115,57 @@ Return:
 	-
 Notes:
 	Sets the maximum connections allowed from a single IP.
-	
-	Options:
-	
-	e_FLOOD_ACTION_BLOCK - Kick the latest player on this IP.
-	e_FLOOD_ACTION_KICK - Kick all players on this IP.
-	e_FLOOD_ACTION_BAN - Ban the IP and have players time out.
-	e_FLOOD_ACTION_FBAN - Ban the IP and kick all the players instantly.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock SetMaxConnections(max = -1, e_FLOOD_ACTION:action = e_FLOOD_ACTION_BLOCK)
 {
-	P:3("SetMaxConnections called: %i, %i", max, _:action);
-	YSI_g_sMaxConnections = (e_FLOOD_ACTION:max & e_FLOOD_ACTION_COUNT) | action;
+	YSI_g_sMaxConnections = (e_FLOOD_ACTION:max & e_FLOOD_ACTION_COUNT) | action | (YSI_g_sMaxConnections & e_FLOOD_ACTION_OPC);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
+Function:
+	OnScriptInit
+Params:
+	-
+Return:
+	-
+Notes:
+	Constructor.
+-*----------------------------------------------------------------------------*/
+
+#if defined FILTERSCRIPT
+	public OnFilterScriptInit()
+#else
+	public OnGameModeInit()
+#endif
+{
+	if (funcidx("YFLD_OnPlayerConnect") != -1)
+	{
+		YSI_g_sMaxConnections |= e_FLOOD_ACTION_OPC;
+	}
+	CallLocalFunction("YFLD_OnScriptInit", "");
+	return 1;
+}
+
+#if defined FILTERSCRIPT
+	#if defined _ALS_OnFilterScriptInit
+		#undef OnFilterScriptInit
+	#else
+		#define _ALS_OnFilterScriptInit
+	#endif
+	#define OnFilterScriptInit YFLD_OnScriptInit
+#else
+	#if defined _ALS_OnGameModeInit
+		#undef OnGameModeInit
+	#else
+		#define _ALS_OnGameModeInit
+	#endif
+	#define OnGameModeInit YFLD_OnScriptInit
+#endif
+
+forward YFLD_OnScriptInit();
+
+/*----------------------------------------------------------------------------*-
 Function:
 	Conn_OnPlayerConnect
 Params:
@@ -147,17 +178,21 @@ Notes:
 	
 	Could be edited to only loop through players once but I'm not sure the
 	extra code required would be faster anyway, definately not easier.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-hook OnPlayerConnect(playerid)
+public OnPlayerConnect(playerid)
 {
+	if (YSI_g_sMaxConnections & e_FLOOD_ACTION_OPC)
+	{
+		CallLocalFunction("YFLD_OnPlayerConnect", "i", playerid);
+	}
 	if ((YSI_g_sMaxConnections & e_FLOOD_ACTION_COUNT) != e_FLOOD_ACTION_COUNT)
 	{
 		new
 			count = 0,
 			IP = GetIP(playerid);
 		YSI_g_sPlayerIPs[playerid] = IP;
-		foreach (new i : Player)
+		foreach (Player, i)
 		{
 			if (YSI_g_sPlayerIPs[i] == IP)
 			{
@@ -178,34 +213,12 @@ hook OnPlayerConnect(playerid)
 				case e_FLOOD_ACTION_KICK:
 				{
 					// Kick all the players.
-					foreach (new i : Player)
-					{
-						if(YSI_g_sPlayerIPs[i] == IP)
-						{
-							Kick(i);
-						}
-					}
-					return 0;
 				}
 				case e_FLOOD_ACTION_BAN:
 				{
 					// Ban the IP.
 					BanEx(playerid, "YSI max connections auto-ban");
 				}
-				case e_FLOOD_ACTION_FBAN:
-				{
-					// Ban the IP.
-					BanEx(playerid, "YSI max connections auto-ban");
-					// Kick all the players.
-					foreach (new i : Player)
-					{
-						if(YSI_g_sPlayerIPs[i] == IP)
-						{
-							Kick(i);
-						}
-					}
-					return 0;
-				}
 				default:
 				{
 					// Do nothing.
@@ -213,7 +226,23 @@ hook OnPlayerConnect(playerid)
 				}
 			}
 		}
+		foreach (Player, i)
+		{
+			if (YSI_g_sPlayerIPs[i] == IP)
+			{
+				Kick(i);
+			}
+		}
 		return 0;
 	}
 	return 1;
 }
+
+#if defined _ALS_OnPlayerConnect
+	#undef OnPlayerConnect
+#else
+	#define _ALS_OnPlayerConnect
+#endif
+#define OnPlayerConnect YFLD_OnPlayerConnect
+
+forward YFLD_OnPlayerConnect(playerid);

+ 51 - 138
pawno/include/YSI/y_groups.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					=======================================
 					 y_groups - Player group abstractions! 
 					=======================================
@@ -18,17 +18,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI groups include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -43,28 +43,23 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
 	29/11/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-#include "internal\y_version"
+#include <YSI\internal\y_version>
 
-#if !defined _inc_y_groups
-	#error Did you do <YSI/y_groups> instead of the required <YSI\y_groups>?
-#endif
 #undef _inc_y_groups
 
-#include "internal\y_nogroups"
-#include "internal\y_plugins"
+#include <YSI\internal\y_nogroups>
 
-/*#if defined YSI_GROUPS_LAST
+#if defined YSI_GROUPS_LAST
 	#if YSI_GROUPS_LAST == 25
 		#undef _GROUP_MAKE_NAME
 		#undef _GROUP_MAKE_LIMIT
@@ -87,7 +82,7 @@ Changelog:
 		#define _GROUP_MAKE_LIMIT       _GROUP_MAKE_LIMIT_INTTEST2
 	#endif
 	#undef YSI_GROUPS_LAST
-#endif*/
+#endif
 
 #if defined _YSI_GROUPS_FIRST_HALF
 	#undef _YSI_GROUPS_FIRST_HALF
@@ -101,18 +96,18 @@ Changelog:
 		// Mark this library as existing.
 		#define _YSI_GROUP_CLASSES_INCLUDED
 		// These all need doing twice - once here and once below.
-		//#if defined _YSI_HAS_GROUP_SYSTEM
-		//	#include "internal\y_groupfirst"
-		//#endif
+		#if defined _YSI_HAS_GROUP_SYSTEM
+			#include <YSI\internal\y_groupfirst>
+		#endif
 		#undef _GROUP_MAKE_NAME
 		#undef _GROUP_MAKE_LIMIT
 		#define _GROUP_MAKE_NAME        _GROUP_MAKE_NAME_CLASSES
 		#define _GROUP_MAKE_LIMIT       _GROUP_MAKE_LIMIT_CLASSES
 		#if defined _YSI_HAS_GROUP_SYSTEM
-			#include "internal\y_groupsecond"
-			#include "internal\y_classgroups"
+			#include <YSI\internal\y_groupsecond>
+			#include <YSI\internal\y_classgroups>
 		#endif
-		#include "internal\y_groupsingle"
+		#include <YSI\internal\y_groupsingle>
 		// End.
 		#endinput
 	#endif
@@ -124,39 +119,17 @@ Changelog:
 		// Mark this library as existing.
 		#define _YSI_GROUP_COMMANDS_INCLUDED
 		// These all need doing twice - once here and once below.
-		//#if defined _YSI_HAS_GROUP_SYSTEM
-		//	#include "internal\y_groupfirst"
-		//#endif
-		#undef _GROUP_MAKE_NAME
-		#undef _GROUP_MAKE_LIMIT
-		#define _GROUP_MAKE_NAME        _GROUP_MAKE_NAME_CMD
-		#define _GROUP_MAKE_LIMIT       _GROUP_MAKE_LIMIT_CMD
 		#if defined _YSI_HAS_GROUP_SYSTEM
-			#include "internal\y_groupsecond"
+			#include <YSI\internal\y_groupfirst>
 		#endif
-		#include "internal\y_groupsingle"
-		// End.
-		#endinput
-	#endif
-#endif
-#if defined _inc_y_areas
-	#if !defined _YSI_GROUP_AREAS_INCLUDED
-		// Although this is included before _GROUP_MAKE_NAME is set, it will
-		// still be the correct value eventually.
-		// Mark this library as existing.
-		#define _YSI_GROUP_AREAS_INCLUDED
-		// These all need doing twice - once here and once below.
-		//#if defined _YSI_HAS_GROUP_SYSTEM
-		//	#include "internal\y_groupfirst"
-		//#endif
 		#undef _GROUP_MAKE_NAME
 		#undef _GROUP_MAKE_LIMIT
-		#define _GROUP_MAKE_NAME        _GROUP_MAKE_NAME_AREAS
-		#define _GROUP_MAKE_LIMIT       _GROUP_MAKE_LIMIT_AREAS
+		#define _GROUP_MAKE_NAME        _GROUP_MAKE_NAME_CMD
+		#define _GROUP_MAKE_LIMIT       _GROUP_MAKE_LIMIT_CMD
 		#if defined _YSI_HAS_GROUP_SYSTEM
-			#include "internal\y_groupsecond"
+			#include <YSI\internal\y_groupsecond>
 		#endif
-		#include "internal\y_groupsingle"
+		#include <YSI\internal\y_groupsingle>
 		// End.
 		#endinput
 	#endif
@@ -167,17 +140,17 @@ Changelog:
 			// Mark this library as existing.
 			#define _YSI_GROUP_INTTEST_INCLUDED
 			// These all need doing twice - once here and once below.
-			//#if defined _YSI_HAS_GROUP_SYSTEM
-			//	#include "internal\y_groupfirst"
-			//#endif
+			#if defined _YSI_HAS_GROUP_SYSTEM
+				#include <YSI\internal\y_groupfirst>
+			#endif
 			#undef _GROUP_MAKE_NAME
 			#undef _GROUP_MAKE_LIMIT
 			#define _GROUP_MAKE_NAME    _GROUP_MAKE_NAME_INTTEST
 			#define _GROUP_MAKE_LIMIT   _GROUP_MAKE_LIMIT_INTTEST
 			#if defined _YSI_HAS_GROUP_SYSTEM
-				#include "internal\y_groupsecond"
+				#include <YSI\internal\y_groupsecond>
 			#endif
-			#include "internal\y_groupsingle"
+			#include <YSI\internal\y_groupsingle>
 			// End.
 			#endinput
 		#endif
@@ -187,17 +160,17 @@ Changelog:
 			// Mark this library as existing.
 			#define _YSI_GROUP_INTTEST2_INCLUDED
 			// These all need doing twice - once here and once below.
-			//#if defined _YSI_HAS_GROUP_SYSTEM
-			//	#include "internal\y_groupfirst"
-			//#endif
+			#if defined _YSI_HAS_GROUP_SYSTEM
+				#include <YSI\internal\y_groupfirst>
+			#endif
 			#undef _GROUP_MAKE_NAME
 			#undef _GROUP_MAKE_LIMIT
 			#define _GROUP_MAKE_NAME    _GROUP_MAKE_NAME_INTTEST2
 			#define _GROUP_MAKE_LIMIT   _GROUP_MAKE_LIMIT_INTTEST2
 			#if defined _YSI_HAS_GROUP_SYSTEM
-				#include "internal\y_groupsecond"
+				#include <YSI\internal\y_groupsecond>
 			#endif
-			#include "internal\y_groupsingle"
+			//#include <YSI\internal\y_groupsingle>
 			// End.
 			#endinput
 		#endif
@@ -217,109 +190,59 @@ Changelog:
 	#define _YSI_HAS_GROUP_SYSTEM
 	// Include the main code.
 	#include <a_samp>
-	#include "internal\y_grouponce"
+	#include <YSI\internal\y_grouponce>
 	
 	// Include code for previous libraries.
 	#if defined _YSI_GROUP_CLASSES_INCLUDED
 		// This only needs to be done if the library was previously included.
 		#define _YSIM_OVERRIDE          22
-		#include "y_master"
+		#include <YSI\y_master>
 		// Include the first half of the file for the call chain.
-		//#include "internal\y_groupfirst"
+		#include <YSI\internal\y_groupfirst>
 		#undef _GROUP_MAKE_NAME
 		#undef _GROUP_MAKE_LIMIT
 		#define _GROUP_MAKE_NAME        _GROUP_MAKE_NAME_CLASSES
 		#define _GROUP_MAKE_LIMIT       _GROUP_MAKE_LIMIT_CLASSES
 		// Include the second half of the file for the methods.
-		#include "internal\y_groupsecond"
-		#include "internal\y_classgroups"
+		#include <YSI\internal\y_groupsecond>
+		#include <YSI\internal\y_classgroups>
 	#endif
 	#if defined _YSI_GROUP_COMMANDS_INCLUDED
 		// This only needs to be done if the library was previously included.
 		#define _YSIM_OVERRIDE          25
-		#include "y_master"
+		#include <YSI\y_master>
 		// Include the first half of the file for the call chain.
-		//#include "internal\y_groupfirst"
+		#include <YSI\internal\y_groupfirst>
 		#undef _GROUP_MAKE_NAME
 		#undef _GROUP_MAKE_LIMIT
 		#define _GROUP_MAKE_NAME        _GROUP_MAKE_NAME_CMD
 		#define _GROUP_MAKE_LIMIT       _GROUP_MAKE_LIMIT_CMD
 		// Include the second half of the file for the methods.
-		#include "internal\y_groupsecond"
-	#endif
-	#if defined _YSI_GROUP_AREAS_INCLUDED
-		// This only needs to be done if the library was previously included.
-		#define _YSIM_OVERRIDE          18
-		#include "y_master"
-		// Include the first half of the file for the call chain.
-		//#include "internal\y_groupfirst"
-		#undef _GROUP_MAKE_NAME
-		#undef _GROUP_MAKE_LIMIT
-		#define _GROUP_MAKE_NAME        _GROUP_MAKE_NAME_AREAS
-		#define _GROUP_MAKE_LIMIT       _GROUP_MAKE_LIMIT_AREAS
-		// Include the second half of the file for the methods.
-		#include "internal\y_groupsecond"
-	#endif
-	#if defined _YSI_PLUGINS_STREAMER
-		#if defined _YCM_q@
-			#define _YSIM_OVERRIDE          16
-		#endif
-		#include "y_master"
-		// Include the first half of the file for the call chain.
-		//#include "internal\y_groupfirst"
-		//#undef _GROUP_MAKE_NAME
-		//#undef _GROUP_MAKE_LIMIT
-		//#define _GROUP_MAKE_NAME<%0...%1> %0SObject%1
-		//#define _GROUP_MAKE_LIMIT<%0...%1> 
-		// Include the second half of the file for the methods.
-		//#include "internal\y_groupsecond"
-		#include "internal\y_incognitostreamer"
+		#include <YSI\internal\y_groupsecond>
 	#endif
 	// Internal test library.
 	#if defined _YSI_ALLOW_INTERNAL_TEST
 		#if defined _YSI_GROUP_INTTEST_INCLUDED
 			#define _YSIM_OVERRIDE      9
-			#include "y_master"
-			//#include "internal\y_groupfirst"
+			#include <YSI\y_master>
+			#include <YSI\internal\y_groupfirst>
 			#undef _GROUP_MAKE_NAME
 			#undef _GROUP_MAKE_LIMIT
 			#define _GROUP_MAKE_NAME    _GROUP_MAKE_NAME_INTTEST
 			#define _GROUP_MAKE_LIMIT   _GROUP_MAKE_LIMIT_INTTEST
-			#include "internal\y_groupsecond"
+			#include <YSI\internal\y_groupsecond>
 		#endif
 		#if defined _YSI_GROUP_INTTEST2_INCLUDED
 			#define _YSIM_OVERRIDE      8
-			#include "y_master"
-			//#include "internal\y_groupfirst"
+			#include <YSI\y_master>
+			#include <YSI\internal\y_groupfirst>
 			#undef _GROUP_MAKE_NAME
 			#undef _GROUP_MAKE_LIMIT
 			#define _GROUP_MAKE_NAME    _GROUP_MAKE_NAME_INTTEST2
 			#define _GROUP_MAKE_LIMIT   _GROUP_MAKE_LIMIT_INTTEST2
-			#include "internal\y_groupsecond"
+			#include <YSI\internal\y_groupsecond>
 		#endif
 	#endif
-	// Recursive group functions to make groups of groups.  Make this code pure
-	// client code so that 90% of it is not included ever.
-	/*#define _YSIM_OVERRIDE      24
-	//#define YSIM_C_ENABLE
-	#include "y_master"
-	#undef _GROUP_MAKE_NAME
-	#undef _GROUP_MAKE_LIMIT*/
-	/*#define _GROUP_MAKE_NAME        _GROUP_MAKE_NAME_GROUP
-	#define _GROUP_MAKE_LIMIT       _GROUP_MAKE_LIMIT_GROUP
-	#define _GROUP_MAKE_TAG         Group
-	//#include "internal\y_groupsecond"
-	#undef _YSI_GROUPS_FIRST_HALF
-	// Disable the OnPlayerConnect code.
-	#undef ghook
-	#define ghook%0On%1(%2) stock _GROUP_MAKE_NAME<On%2...>(%3)
-	#include "internal\y_groupsecond"
-	#undef ghook
-	#define ghook group_hook
-	#define _YSI_GROUPS_FIRST_HALF
-	#define _GROUP_MAKE_TAG         Group
-	#include "internal\y_groupsingle"*/
-	// These need VERY different defaults.
 #endif
 
 // Now include any user defined libraries.
@@ -329,21 +252,18 @@ Changelog:
 		#if defined _YSIM_MANUAL_SET
 			#define _YSIM_RESET_USER
 		#endif
-		#include "y_master"
-		//#include "internal\y_groupsingle"
-		//#include "internal\y_groupfirst"
+		#include <YSI\y_master>
+		//#include <YSI\internal\y_groupsingle>
+		#include <YSI\internal\y_groupfirst>
 		#undef _GROUP_MAKE_NAME
 		#undef _GROUP_MAKE_LIMIT
 		#define _GROUP_MAKE_NAME        GROUP_LIBRARY_NAME
 		#define _GROUP_MAKE_LIMIT       GROUP_LIBRARY_SIZE
-		//#if defined GROUP_LIBRARY_TAG
-		//	#define _GROUP_MAKE_TAG       GROUP_LIBRARY_TAG
-		//#endif
 		#undef _YSI_GROUPS_FIRST_HALF
 		// Include the second half of the file for the methods.
-		#include "internal\y_groupsecond"
+		#include <YSI\internal\y_groupsecond>
 		#define _YSI_GROUPS_FIRST_HALF
-		#include "internal\y_groupsingle"
+		#include <YSI\internal\y_groupsingle>
 		// Remove the definitions.
 		//#undef GROUP_LIBRARY_SIZE
 		//#undef GROUP_LIBRARY_NAME
@@ -355,10 +275,3 @@ Changelog:
 		#error You must define both GROUP_LIBRARY_SIZE and GROUP_LIBRARY_NAME.
 	#endif
 #endif
-
-// Revert to the user's included definition if y_groups was included after all
-// group using libraries and after explicit y_master inclusion.
-//#include "internal\y_grouprevert"
-
-//#define YSI_SET_LAST_GROUP 24
-#include "internal\y_grouprevert"

+ 956 - 24
pawno/include/YSI/y_hooks.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					==============================
 					 y_hooks - Hook any callback!
 					==============================
@@ -17,19 +17,18 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the SA:MP callback hooks include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
 	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
 		Peter, Cam - Support.
-		ZeeX, g_aSlice/Slice, Popz, others - Very productive conversations.
+		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
 		breadfish - German translation.
@@ -43,34 +42,967 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
-	2.0
+	1.0
 Changelog:
-	25/02/12:
-		Extracted most of the code to a separate file.
-	17/03/11:
-		Second complete re-write using another new technique.  Now VERY fast!
-		Updated OnPlayerUpdate code using Google63's SCTRL jump code.
 	06/08/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
+
+#include <YSI\internal\y_version>
+#include <a_samp>
+
+#include <YSI\y_scripting>
+#include <YSI\y_utils>
+
+#define ALS_PREFIX S@@
+
+#include <YSI\y_als>
+#include <YSI\y_stringhash>
+#include <YSI\internal\y_shortfunc>
+
+#include <YSI\y_debug>
+
+//#define Hook:%1_On%2(%3) forward %1_@%2(%3); public %1_@%2(%3)
+#define Hook:%1_On%2(%3) @yH_%2_%1(%3);@yH_%2_%1(%3)
+
+#define HOOK_FUNC_SEARCH                 (Scripting_FastString('@', 'y', 'H', '_'))
+
+#define HOOKS_INSERT<%0> tmp=_:gs_aHookFunctionPointers[ALS_On%0],gs_aHookFunctionPointers[ALS_On%0]=Bit:((tmp!=_:-1?tmp&0xFFFF:idx-1)|idx<<16);
+
+//#define HOOKS_CALL<%0,%1>(%2) new t=_:gs_aHookFunctionPointers[ALS_On%0];if(t!=-1){new e=t>>>16;t&=0xFFFF;do t=Scripting_GetPublic(t,gs_szFunctionBuffer,"@yH_"#%0),P@(gs_szFunctionBuffer,#%1#x,%2);while(t!=e);}
+#define HOOKS_C_INT<%0,%1>(%2) new t=_:gs_aHookFunctionPointers[ALS_On%0];if(t!=-1){new e=t>>>16;t&=0xFFFF;do t=Scripting_GetPublic(t,gs_szFunctionBuffer,"@yH_"#%0),P@(gs_szFunctionBuffer,#%1#x,%2);while(t!=e);}
+
+#define HUK_C_GameModeInit              HOOKS_C_INT<GameModeInit             ,>()
+#define HUK_C_GameModeExit              HOOKS_C_INT<GameModeExit             ,>()
+#define HUK_C_FilterScriptInit          HOOKS_C_INT<FilterScriptInit         ,>()
+#define HUK_C_FilterScriptExit          HOOKS_C_INT<FilterScriptExit         ,>()
+#define HUK_C_PlayerConnect             HOOKS_C_INT<PlayerConnect            ,i>(playerid)
+#define HUK_C_PlayerDisconnect          HOOKS_C_INT<PlayerDisconnect         ,ii>(playerid,reason)
+#define HUK_C_PlayerSpawn               HOOKS_C_INT<PlayerSpawn              ,i>(playerid)
+#define HUK_C_PlayerDeath               HOOKS_C_INT<PlayerDeath              ,iii>(playerid,killerid,reason)
+#define HUK_C_VehicleSpawn              HOOKS_C_INT<VehicleSpawn             ,i>(vehicleid)
+#define HUK_C_VehicleDeath              HOOKS_C_INT<VehicleDeath             ,ii>(vehicleid,killerid)
+#define HUK_C_PlayerText                HOOKS_C_INT<PlayerText               ,is>(playerid,text)
+#define HUK_C_PlayerCommandText         HOOKS_C_INT<PlayerCommandText        ,is>(playerid,cmdtext)
+#define HUK_C_PlayerRequestClass        HOOKS_C_INT<PlayerRequestClass       ,ii>(playerid,classid)
+#define HUK_C_PlayerEnterVehicle        HOOKS_C_INT<PlayerEnterVehicle       ,iii>(playerid,vehicleid,ispassenger)
+#define HUK_C_PlayerExitVehicle         HOOKS_C_INT<PlayerExitVehicle        ,ii>(playerid,vehicleid)
+#define HUK_C_PlayerStateChange         HOOKS_C_INT<PlayerStateChange        ,iii>(playerid,newstate,oldstate)
+#define HUK_C_PlayerEnterCheckpoint     HOOKS_C_INT<PlayerEnterCheckpoint    ,i>(playerid)
+#define HUK_C_PlayerLeaveCheckpoint     HOOKS_C_INT<PlayerLeaveCheckpoint    ,i>(playerid)
+#define HUK_C_PlayerEnterRaceCheckpoint HOOKS_C_INT<PlayerEnterRaceCheckpoint,i>(playerid)
+#define HUK_C_PlayerLeaveRaceCheckpoint HOOKS_C_INT<PlayerLeaveRaceCheckpoint,i>(playerid)
+#define HUK_C_RconCommand               HOOKS_C_INT<RconCommand              ,s>(cmd)
+#define HUK_C_PlayerRequestSpawn        HOOKS_C_INT<PlayerRequestSpawn       ,i>(playerid)
+#define HUK_C_ObjectMoved               HOOKS_C_INT<ObjectMoved              ,i>(objectid)
+#define HUK_C_PlayerObjectMoved         HOOKS_C_INT<PlayerObjectMoved        ,ii>(playerid,objectid)
+#define HUK_C_PlayerPickUpPickup        HOOKS_C_INT<PlayerPickUpPickup       ,ii>(playerid,pickupid)
+#define HUK_C_VehicleMod                HOOKS_C_INT<VehicleMod               ,iii>(playerid,vehicleid,componentid)
+#define HUK_C_EnterExitModShop          HOOKS_C_INT<EnterExitModShop         ,iii>(playerid,enterexit,interiorid)
+#define HUK_C_VehiclePaintjob           HOOKS_C_INT<VehiclePaintjob          ,iii>(playerid,vehicleid,paintjobid)
+#define HUK_C_VehicleRespray            HOOKS_C_INT<VehicleRespray           ,iiii>(playerid,vehicleid,color1,color2)
+#define HUK_C_VehicleDamageStatusUpdate HOOKS_C_INT<VehicleDamageStatusUpdate,ii>(playerid,playerid)
+#define HUK_C_PlayerSelectedMenuRow     HOOKS_C_INT<PlayerSelectedMenuRow    ,ii>(playerid,row)
+#define HUK_C_PlayerExitedMenu          HOOKS_C_INT<PlayerExitedMenu         ,i>(playerid)
+#define HUK_C_PlayerInteriorChange      HOOKS_C_INT<PlayerInteriorChange     ,iii>(playerid,newinteriorid,oldinteriorid)
+#define HUK_C_PlayerKeyStateChange      HOOKS_C_INT<PlayerKeyStateChange     ,iii>(playerid,newkeys,oldkeys)
+#define HUK_C_RconLoginAttempt          HOOKS_C_INT<RconLoginAttempt         ,ssi>(ip,password,success)
+#define HUK_C_PlayerUpdate              HOOKS_C_INT<PlayerUpdate             ,i>(playerid)
+#define HUK_C_PlayerStreamIn            HOOKS_C_INT<PlayerStreamIn           ,ii>(playerid,forplayerid)
+#define HUK_C_PlayerStreamOut           HOOKS_C_INT<PlayerStreamOut          ,ii>(playerid,forplayerid)
+#define HUK_C_VehicleStreamIn           HOOKS_C_INT<VehicleStreamIn          ,ii>(vehicleid,forplayerid)
+#define HUK_C_VehicleStreamOut          HOOKS_C_INT<VehicleStreamOut         ,ii>(vehicleid,forplayerid)
+//#define HUK_C_DialogResponse            HOOKS_C_INT<DialogResponse           ,ii>(playerid,dialogid,response,listitem,inputtext)
+#define HUK_C_PlayerClickPlayer         HOOKS_C_INT<PlayerClickPlayer        ,iii>(playerid,clickedplayerid,source)
+//#define HUK_C_DialogResponse if(inputtext[0]){HOOKS_C_INT<DialogResponse,iiiis>(playerid,dialogid,response,listitem,inputtext)}else{HOOKS_C_INT<DialogResponse,iiiis>(playerid,dialogid,response,listitem,NULL)}
+
+//#define CALL_WRAPPER<%0> HUK_C_%0 ALS_CALL_%0
+#define HOOKS_CALL<%0> HUK_C_%0 ALS_C_%0
+
+#define HOOKS_MAX_UPDATES               (4)
+
+static
+	gs_aHookFunctionPointers[ALS] = {Bit:-1, ...},
+	gs_szFunctionBuffer[32],
+	gs_aOnPlayerUpdateHooks[HOOKS_MAX_UPDATES] = {-1, ...}/*,
+	gs_pCodeStart*/;
+
+ALS_DATA<>
+
+/*static Hooks_GetNext(&idx)
+{
+	idx = Scripting_GetPublicFast(idx, gs_szFunctionBuffer, HOOK_FUNC_SEARCH);
+	if (idx == 0)
+	{
+		return -1;
+	}
+	return YHash(gs_szFunctionBuffer[4], true, hash_bernstein, strfind(gs_szFunctionBuffer[4], "_"));
+}*/
+
+/*----------------------------------------------------------------------------*-
+Function:
+	Hooks_GenFuncList
+Params:
+	-
+Return:
+	-
+Notes:
+	Generates a set of data describing every callback for speed later.
+-*----------------------------------------------------------------------------*/
+
+static Hooks_GenFuncList()
+{
+	// Check for old style hooks using the new ALS library.
+	ALS_DETECT<GameModeInit>
+	#if 1
+	ALS_DETECT<GameModeExit>
+	ALS_DETECT<FilterScriptInit>
+	ALS_DETECT<FilterScriptExit>
+	ALS_DETECT<PlayerConnect>
+	ALS_DETECT<PlayerDisconnect>
+	ALS_DETECT<PlayerSpawn>
+	ALS_DETECT<PlayerDeath>
+	ALS_DETECT<VehicleSpawn>
+	ALS_DETECT<VehicleDeath>
+	ALS_DETECT<PlayerText>
+	ALS_DETECT<PlayerCommandText>
+	ALS_DETECT<PlayerRequestClass>
+	ALS_DETECT<PlayerEnterVehicle>
+	ALS_DETECT<PlayerExitVehicle>
+	ALS_DETECT<PlayerStateChange>
+	ALS_DETECT<PlayerEnterCheckpoint>
+	ALS_DETECT<PlayerLeaveCheckpoint>
+	ALS_DETECT<PlayerEnterRaceCheckpoint>
+	ALS_DETECT<PlayerLeaveRaceCheckpoint>
+	ALS_DETECT<RconCommand>
+	ALS_DETECT<PlayerRequestSpawn>
+	ALS_DETECT<ObjectMoved>
+	ALS_DETECT<PlayerObjectMoved>
+	ALS_DETECT<PlayerPickUpPickup>
+	ALS_DETECT<VehicleMod>
+	ALS_DETECT<EnterExitModShop>
+	ALS_DETECT<VehiclePaintjob>
+	ALS_DETECT<VehicleRespray>
+	ALS_DETECT<VehicleDamageStatusUpdate>
+	ALS_DETECT<PlayerSelectedMenuRow>
+	ALS_DETECT<PlayerExitedMenu>
+	ALS_DETECT<PlayerInteriorChange>
+	ALS_DETECT<PlayerKeyStateChange>
+	ALS_DETECT<RconLoginAttempt>
+	ALS_DETECT<PlayerUpdate>
+	ALS_DETECT<PlayerStreamIn>
+	ALS_DETECT<PlayerStreamOut>
+	ALS_DETECT<VehicleStreamIn>
+	ALS_DETECT<VehicleStreamOut>
+	ALS_DETECT<DialogResponse>
+	ALS_DETECT<PlayerClickPlayer>
+	#endif
+	// Check for new style hooks.  This gets the bounds of functions, to make
+	// later calls very slightly faster!
+	new
+		idx = 0,
+		tmp;
+	// For some reason compile time initialisation didn't work...
+	for (new ALS:i; i != ALS; ++i)
+	{
+		gs_aHookFunctionPointers[i] = -1;
+	}
+	for ( ; ; )
+	{
+		idx = Scripting_GetPublicFast(idx, gs_szFunctionBuffer, HOOK_FUNC_SEARCH);
+		if (idx == 0)
+		{
+			break;
+		}
+		//return YHash(gs_szFunctionBuffer[4], true, bernstein, strfind(gs_szFunctionBuffer[4], "_"));
+		//switch (Hooks_GetNext(idx))
+		switch (YHash(gs_szFunctionBuffer[4], true, hash_bernstein, strfind(gs_szFunctionBuffer[4], "_")))
+		{
+			case _H(G,a,m,e,M,o,d,e,I,n,i,t):
+				HOOKS_INSERT<GameModeInit>
+			case _H(G,a,m,e,M,o,d,e,E,x,i,t):
+				HOOKS_INSERT<GameModeExit>
+			case _H(F,i,l,t,e,r,S,c,r,i,p,t,I,n,i,t):
+				HOOKS_INSERT<FilterScriptInit>
+			case _H(F,i,l,t,e,r,S,c,r,i,p,t,E,x,i,t):
+				HOOKS_INSERT<FilterScriptExit>
+			case _H(P,l,a,y,e,r,C,o,n,n,e,c,t):
+				HOOKS_INSERT<PlayerConnect>
+			case _H(P,l,a,y,e,r,D,i,s,c,o,n,n,e,c,t):
+				HOOKS_INSERT<PlayerDisconnect>
+			case _H(P,l,a,y,e,r,S,p,a,w,n):
+				HOOKS_INSERT<PlayerSpawn>
+			case _H(P,l,a,y,e,r,D,e,a,t,h):
+				HOOKS_INSERT<PlayerDeath>
+			case _H(V,e,h,i,c,l,e,S,p,a,w,n):
+				HOOKS_INSERT<VehicleSpawn>
+			case _H(V,e,h,i,c,l,e,D,e,a,t,h):
+				HOOKS_INSERT<VehicleDeath>
+			case _H(P,l,a,y,e,r,T,e,x,t):
+				HOOKS_INSERT<PlayerText>
+			case _H(P,l,a,y,e,r,C,o,m,m,a,n,d,T,e,x,t):
+				HOOKS_INSERT<PlayerCommandText>
+			case _H(P,l,a,y,e,r,R,e,q,u,e,s,t,C,l,a,s,s):
+				HOOKS_INSERT<PlayerRequestClass>
+			case _H(P,l,a,y,e,r,E,n,t,e,r,V,e,h,i,c,l,e,):
+				HOOKS_INSERT<PlayerEnterVehicle>
+			case _H(P,l,a,y,e,r,E,x,i,t,V,e,h,i,c,l,e,):
+				HOOKS_INSERT<PlayerExitVehicle>
+			case _H(P,l,a,y,e,r,S,t,a,t,e,C,h,a,n,g,e):
+				HOOKS_INSERT<PlayerStateChange>
+			case _H(P,l,a,y,e,r,E,n,t,e,r,C,h,e,c,k,p,o,i,n,t), _H(P,l,a,y,e,r,E,n,t,e,r,C,P):
+				HOOKS_INSERT<PlayerEnterCheckpoint>
+			case _H(P,l,a,y,e,r,L,e,a,v,e,C,h,e,c,k,p,o,i,n,t), _H(P,l,a,y,e,r,L,e,a,v,e,C,P):
+				HOOKS_INSERT<PlayerLeaveCheckpoint>
+			case _H(P,l,a,y,e,r,E,n,t,e,r,R,a,c,e,C,h,e,c,k,p,o,i,n,t), _H(P,l,a,y,e,r,E,n,t,e,r,R,C,P):
+				HOOKS_INSERT<PlayerEnterRaceCheckpoint>
+			case _H(P,l,a,y,e,r,L,e,a,v,e,R,a,c,e,C,h,e,c,k,p,o,i,n,t), _H(P,l,a,y,e,r,L,e,a,v,e,R,C,P):
+				HOOKS_INSERT<PlayerLeaveRaceCheckpoint>
+			case _H(R,c,o,n,C,o,m,m,a,n,d):
+				HOOKS_INSERT<RconCommand>
+			case _H(P,l,a,y,e,r,R,e,q,u,e,s,t,S,p,a,w,n):
+				HOOKS_INSERT<PlayerRequestSpawn>
+			case _H(O,b,j,e,c,t,M,o,v,e,d):
+				HOOKS_INSERT<ObjectMoved>
+			case _H(P,l,a,y,e,r,O,b,j,e,c,t,M,o,v,e,d):
+				HOOKS_INSERT<PlayerObjectMoved>
+			case _H(P,l,a,y,e,r,P,i,c,k,U,p,P,i,c,k,u,p):
+				HOOKS_INSERT<PlayerPickUpPickup>
+			case _H(V,e,h,i,c,l,e,M,o,d):
+				HOOKS_INSERT<VehicleMod>
+			case _H(E,n,t,e,r,E,x,i,t,M,o,d,S,h,o,p):
+				HOOKS_INSERT<EnterExitModShop>
+			case _H(V,e,h,i,c,l,e,P,a,i,n,t,j,o,b):
+				HOOKS_INSERT<VehiclePaintjob>
+			case _H(V,e,h,i,c,l,e,R,e,s,p,r,a,y):
+				HOOKS_INSERT<VehicleRespray>
+			case _H(V,e,h,i,c,l,e,D,a,m,a,g,e,S,t,a,t,u,s,U,p,d,a,t,e), _H(V,e,h,i,c,l,e,D,a,m,a,g,e,U,p,d,a,t,e):
+				HOOKS_INSERT<VehicleDamageStatusUpdate>
+			case _H(P,l,a,y,e,r,S,e,l,e,c,t,e,d,M,e,n,u,R,o,w), _H(P,l,a,y,e,r,S,e,l,e,c,t,e,d,M,e,n,u):
+				HOOKS_INSERT<PlayerSelectedMenuRow>
+			case _H(P,l,a,y,e,r,E,x,i,t,e,d,M,e,n,u):
+				HOOKS_INSERT<PlayerExitedMenu>
+			case _H(P,l,a,y,e,r,I,n,t,e,r,i,o,r,C,h,a,n,g,e):
+				HOOKS_INSERT<PlayerInteriorChange>
+			case _H(P,l,a,y,e,r,K,e,y,S,t,a,t,e,C,h,a,n,g,e):
+				HOOKS_INSERT<PlayerKeyStateChange>
+			case _H(R,c,o,n,L,o,g,i,n,A,t,t,e,m,p,t):
+				HOOKS_INSERT<RconLoginAttempt>
+			case _H(P,l,a,y,e,r,S,t,r,e,a,m,I,n):
+				HOOKS_INSERT<PlayerStreamIn>
+			case _H(P,l,a,y,e,r,S,t,r,e,a,m,O,u,t):
+				HOOKS_INSERT<PlayerStreamOut>
+			case _H(V,e,h,i,c,l,e,S,t,r,e,a,m,I,n):
+				HOOKS_INSERT<VehicleStreamIn>
+			case _H(V,e,h,i,c,l,e,S,t,r,e,a,m,O,u,t):
+				HOOKS_INSERT<VehicleStreamOut>
+			case _H(D,i,a,l,o,g,R,e,s,p,o,n,s,e):
+				HOOKS_INSERT<DialogResponse>
+			case _H(P,l,a,y,e,r,C,l,i,c,k,P,l,a,y,e,r):
+				HOOKS_INSERT<PlayerClickPlayer>
+			case -1:
+				// Do nothing - end condition.
+				break;
+			case _H(P,l,a,y,e,r,U,p,d,a,t,e):
+			{
+				//HOOKS_INSERT<PlayerUpdate>
+				// This uses different code to improve speed a little bit.
+				tmp = _:gs_aHookFunctionPointers[ALS_OnPlayerUpdate];
+				if (tmp == -1)
+				{
+					gs_aHookFunctionPointers[ALS_OnPlayerUpdate] = Bit:0;
+					// Save the index of the first OnPlayerUpdate function.
+					gs_aOnPlayerUpdateHooks[0] = idx - 1;
+					//gs_aOnPlayerUpdateHooks[0] = Scripting_GetPublicPointer(gs_szFunctionBuffer);
+				}
+				else
+				{
+					// f = First, the upper limit.
+					// s = Second, the lower limit.
+					// Note that this only supports 65535 public functions, but
+					// I suspect the compiler may get a little upset before you
+					// reach that number - and if it doesn't you're going to
+					// end up with a HUGE AMX!
+					// f should always be larger than s in a normal system, even
+					// if it's only 1 larger.
+					new
+						s = tmp & 0xFFFF;
+					if (tmp & 0xFFFF0000)
+					{
+						// Given up counting - too many for quick
+						// resolution.
+						gs_aHookFunctionPointers[ALS_OnPlayerUpdate] = Bit:(s | idx << 16);
+					}
+					else
+					{
+						// Counting.
+						if (++s == HOOKS_MAX_UPDATES)
+						{
+							// Reached the limit of the number of quick hooks
+							// for OnPlayerUpdate supported.
+							gs_aHookFunctionPointers[ALS_OnPlayerUpdate] = Bit:(idx - 1 | idx << 16);
+						}
+						else
+						{
+							gs_aOnPlayerUpdateHooks[s] = idx - 1;
+							//gs_aOnPlayerUpdateHooks[s] = Scripting_GetPublicPointer(gs_szFunctionBuffer);
+							gs_aHookFunctionPointers[ALS_OnPlayerUpdate] = Bit:s;
+						}
+					}
+				}
+				//gs_aHookFunctionPointers[ALS_OnPlayerUpdate] = Bit:((tmp!=_:-1?tmp&0xFFFF:idx-1)|idx<<16);
+			}
+		}
+	}
+	// Now, skip functions we don't need...  This is actually self modifying
+	// code, so if you don't use any of the Hook: features, they are never even
+	// called.  The functionality of this script depends entirely on the rest of
+	// the script.  This can't be made in to a macro because #OnWhatever needs
+	// to stringise the value in the current define if it exists, whereas doing
+	// #On%0 would just make a string of "OnWhatever".
+	if (gs_aHookFunctionPointers[ALS_OnGameModeInit] == Bit:-1) Scripting_RedirectPublic(#OnGameModeInit, Scripting_GetPublicPointer("S@@_OnGameModeInit"));
+	// Now the same again.
+	#if 1
+	if (gs_aHookFunctionPointers[ALS_OnGameModeExit] == Bit:-1) Scripting_RedirectPublic(#OnGameModeExit, Scripting_GetPublicPointer("S@@_OnGameModeExit"));
+	if (gs_aHookFunctionPointers[ALS_OnFilterScriptInit] == Bit:-1) Scripting_RedirectPublic(#OnFilterScriptInit, Scripting_GetPublicPointer("S@@_OnFilterScriptInit"));
+	if (gs_aHookFunctionPointers[ALS_OnFilterScriptExit] == Bit:-1) Scripting_RedirectPublic(#OnFilterScriptExit, Scripting_GetPublicPointer("S@@_OnFilterScriptExit"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerConnect] == Bit:-1) Scripting_RedirectPublic(#OnPlayerConnect, Scripting_GetPublicPointer("S@@_OnPlayerConnect"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerDisconnect] == Bit:-1) Scripting_RedirectPublic(#OnPlayerDisconnect, Scripting_GetPublicPointer("S@@_OnPlayerDisconnect"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerSpawn] == Bit:-1) Scripting_RedirectPublic(#OnPlayerSpawn, Scripting_GetPublicPointer("S@@_OnPlayerSpawn"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerDeath] == Bit:-1) Scripting_RedirectPublic(#OnPlayerDeath, Scripting_GetPublicPointer("S@@_OnPlayerDeath"));
+	if (gs_aHookFunctionPointers[ALS_OnVehicleSpawn] == Bit:-1) Scripting_RedirectPublic(#OnVehicleSpawn, Scripting_GetPublicPointer("S@@_OnVehicleSpawn"));
+	if (gs_aHookFunctionPointers[ALS_OnVehicleDeath] == Bit:-1) Scripting_RedirectPublic(#OnVehicleDeath, Scripting_GetPublicPointer("S@@_OnVehicleDeath"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerText] == Bit:-1) Scripting_RedirectPublic(#OnPlayerText, Scripting_GetPublicPointer("S@@_OnPlayerText"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerCommandText] == Bit:-1) Scripting_RedirectPublic(#OnPlayerCommandText, Scripting_GetPublicPointer("S@@_OnPlayerCommandText"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerRequestClass] == Bit:-1) Scripting_RedirectPublic(#OnPlayerRequestClass, Scripting_GetPublicPointer("S@@_OnPlayerRequestClass"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerEnterVehicle] == Bit:-1) Scripting_RedirectPublic(#OnPlayerEnterVehicle, Scripting_GetPublicPointer("S@@_OnPlayerEnterVehicle"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerExitVehicle] == Bit:-1) Scripting_RedirectPublic(#OnPlayerExitVehicle, Scripting_GetPublicPointer("S@@_OnPlayerExitVehicle"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerStateChange] == Bit:-1) Scripting_RedirectPublic(#OnPlayerStateChange, Scripting_GetPublicPointer("S@@_OnPlayerStateChange"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerEnterCheckpoint] == Bit:-1) Scripting_RedirectPublic(#OnPlayerEnterCheckpoint, Scripting_GetPublicPointer("S@@_OnPlayerEnterCheckpoint"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerLeaveCheckpoint] == Bit:-1) Scripting_RedirectPublic(#OnPlayerLeaveCheckpoint, Scripting_GetPublicPointer("S@@_OnPlayerLeaveCheckpoint"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerEnterRaceCheckpoint] == Bit:-1) Scripting_RedirectPublic(#OnPlayerEnterRaceCheckpoint, Scripting_GetPublicPointer("S@@_OnPlayerEnterRaceCheckpoint"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerLeaveRaceCheckpoint] == Bit:-1) Scripting_RedirectPublic(#OnPlayerLeaveRaceCheckpoint, Scripting_GetPublicPointer("S@@_OnPlayerLeaveRaceCheckpoint"));
+	if (gs_aHookFunctionPointers[ALS_OnRconCommand] == Bit:-1) Scripting_RedirectPublic(#OnRconCommand, Scripting_GetPublicPointer("S@@_OnRconCommand"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerRequestSpawn] == Bit:-1) Scripting_RedirectPublic(#OnPlayerRequestSpawn, Scripting_GetPublicPointer("S@@_OnPlayerRequestSpawn"));
+	if (gs_aHookFunctionPointers[ALS_OnObjectMoved] == Bit:-1) Scripting_RedirectPublic(#OnObjectMoved, Scripting_GetPublicPointer("S@@_OnObjectMoved"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerObjectMoved] == Bit:-1) Scripting_RedirectPublic(#OnPlayerObjectMoved, Scripting_GetPublicPointer("S@@_OnPlayerObjectMoved"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerPickUpPickup] == Bit:-1) Scripting_RedirectPublic(#OnPlayerPickUpPickup, Scripting_GetPublicPointer("S@@_OnPlayerPickUpPickup"));
+	if (gs_aHookFunctionPointers[ALS_OnVehicleMod] == Bit:-1) Scripting_RedirectPublic(#OnVehicleMod, Scripting_GetPublicPointer("S@@_OnVehicleMod"));
+	if (gs_aHookFunctionPointers[ALS_OnEnterExitModShop] == Bit:-1) Scripting_RedirectPublic(#OnEnterExitModShop, Scripting_GetPublicPointer("S@@_OnEnterExitModShop"));
+	if (gs_aHookFunctionPointers[ALS_OnVehiclePaintjob] == Bit:-1) Scripting_RedirectPublic(#OnVehiclePaintjob, Scripting_GetPublicPointer("S@@_OnVehiclePaintjob"));
+	if (gs_aHookFunctionPointers[ALS_OnVehicleRespray] == Bit:-1) Scripting_RedirectPublic(#OnVehicleRespray, Scripting_GetPublicPointer("S@@_OnVehicleRespray"));
+	if (gs_aHookFunctionPointers[ALS_OnVehicleDamageStatusUpdate] == Bit:-1) Scripting_RedirectPublic(#OnVehicleDamageStatusUpdate, Scripting_GetPublicPointer("S@@_OnVehicleDamageStatusUpdate"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerSelectedMenuRow] == Bit:-1) Scripting_RedirectPublic(#OnPlayerSelectedMenuRow, Scripting_GetPublicPointer("S@@_OnPlayerSelectedMenuRow"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerExitedMenu] == Bit:-1) Scripting_RedirectPublic(#OnPlayerExitedMenu, Scripting_GetPublicPointer("S@@_OnPlayerExitedMenu"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerInteriorChange] == Bit:-1) Scripting_RedirectPublic(#OnPlayerInteriorChange, Scripting_GetPublicPointer("S@@_OnPlayerInteriorChange"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerKeyStateChange] == Bit:-1) Scripting_RedirectPublic(#OnPlayerKeyStateChange, Scripting_GetPublicPointer("S@@_OnPlayerKeyStateChange"));
+	if (gs_aHookFunctionPointers[ALS_OnRconLoginAttempt] == Bit:-1) Scripting_RedirectPublic(#OnRconLoginAttempt, Scripting_GetPublicPointer("S@@_OnRconLoginAttempt"));
+	//if (gs_aHookFunctionPointers[ALS_OnPlayerUpdate] == Bit:-1) Scripting_RedirectPublic(#OnPlayerUpdate, Scripting_GetPublicPointer("S@@_OnPlayerUpdate"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerStreamIn] == Bit:-1) Scripting_RedirectPublic(#OnPlayerStreamIn, Scripting_GetPublicPointer("S@@_OnPlayerStreamIn"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerStreamOut] == Bit:-1) Scripting_RedirectPublic(#OnPlayerStreamOut, Scripting_GetPublicPointer("S@@_OnPlayerStreamOut"));
+	if (gs_aHookFunctionPointers[ALS_OnVehicleStreamIn] == Bit:-1) Scripting_RedirectPublic(#OnVehicleStreamIn, Scripting_GetPublicPointer("S@@_OnVehicleStreamIn"));
+	if (gs_aHookFunctionPointers[ALS_OnVehicleStreamOut] == Bit:-1) Scripting_RedirectPublic(#OnVehicleStreamOut, Scripting_GetPublicPointer("S@@_OnVehicleStreamOut"));
+	if (gs_aHookFunctionPointers[ALS_OnDialogResponse] == Bit:-1) Scripting_RedirectPublic(#OnDialogResponse, Scripting_GetPublicPointer("S@@_OnDialogResponse"));
+	if (gs_aHookFunctionPointers[ALS_OnPlayerClickPlayer] == Bit:-1) Scripting_RedirectPublic(#OnPlayerClickPlayer, Scripting_GetPublicPointer("S@@_OnPlayerClickPlayer"));
+	#endif
+	// The OnPlayerUpdate code is special.
+	tmp = _:gs_aHookFunctionPointers[ALS_OnPlayerUpdate];
+	if (tmp == -1)
+	{
+		Scripting_RedirectPublic(#OnPlayerUpdate, Scripting_GetPublicPointer("S@@_OnPlayerUpdate"));
+	}
+	else
+	{
+		if (!(tmp & 0xFFFF))
+		{
+			// Some fast find functions, but no normal ones.
+			gs_aHookFunctionPointers[ALS_OnPlayerUpdate] = Bit:-1;
+		}
+	}
+}
+
+#pragma tabsize 0
+
+// Hook OnGameModeInit using the old system to call the new system.
+public OnGameModeInit()
+{
+	#if !defined FILTERSCRIPT
+		// Generate the list of functions
+		Hooks_GenFuncList();
+	#endif
+	HOOKS_CALL<GameModeInit>
+	//HOOKS_CALL<GameModeInit,>()
+	//ALS_CALL<OnGameModeInit,>()
+}
+#if defined _ALS_OnGameModeInit
+	#undef OnGameModeInit
+#else
+	#define _ALS_OnGameModeInit
+#endif
+#define OnGameModeInit S@@_OnGameModeInit
+ALS_FORWARD<GameModeInit>
+
+public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
+{
+	if (inputtext[0])
+	{
+		HOOKS_C_INT<DialogResponse,iiiis>(playerid,dialogid,response,listitem,inputtext)
+		ALS_C_INT<DialogResponse,1,iiiis>(playerid,dialogid,response,listitem,inputtext)
+	}
+	else
+	{
+		HOOKS_C_INT<DialogResponse,iiiis>(playerid,dialogid,response,listitem,NULL)
+		ALS_C_INT<DialogResponse,1,iiiis>(playerid,dialogid,response,listitem,NULL)
+	}
+	//HOOKS_CALL<DialogResponse>
+}
+#if defined _ALS_OnDialogResponse
+	#undef OnDialogResponse
+#else
+	#define _ALS_OnDialogResponse
+#endif
+#define OnDialogResponse S@@_OnDialogResponse
+ALS_FORWARD<DialogResponse>
+
+public OnPlayerUpdate(playerid)
+{
+	P:1("Hooks_OnPlayerUpdate called");
+	// This is the special one.
+	for (new i = 0; i != HOOKS_MAX_UPDATES; ++i)
+	{
+		P:2("Hooks_OnPlayerUpdate: i = %d", i);
+		new
+			tmp = gs_aOnPlayerUpdateHooks[i];
+		if (tmp == -1)
+		{
+			ALS_CALL<PlayerUpdate>
+		}
+		// This function can return any public, it's not limited to getting
+		// OnPlayerUpdate functions, but the passed index means it will reach a
+		// matching function, which will be an update function, instantly.
+		Scripting_GetPublicFast(tmp, gs_szFunctionBuffer, HOOK_FUNC_SEARCH);
+		CallLocalFunction(gs_szFunctionBuffer,"i", playerid);
+	}
+	P:2("Hooks_OnPlayerUpdate ended");
+	// This uses the normal call wrapper.
+	HOOKS_CALL<PlayerUpdate>
+}
+#if defined _ALS_OnPlayerUpdate
+	#undef OnPlayerUpdate
+#else
+	#define _ALS_OnPlayerUpdate
+#endif
+#define OnPlayerUpdate S@@_OnPlayerUpdate
+ALS_FORWARD<PlayerUpdate>
+
+public OnFilterScriptInit()
+{
+	#if defined FILTERSCRIPT
+		// Generate the list of functions
+		Hooks_GenFuncList();
+	#endif
+	HOOKS_CALL<FilterScriptInit>
+}
+#if defined _ALS_OnFilterScriptInit
+	#undef OnFilterScriptInit
+#else
+	#define _ALS_OnFilterScriptInit
+#endif
+#define OnFilterScriptInit S@@_OnFilterScriptInit
+ALS_FORWARD<FilterScriptInit>
+
+// =============================================================================
+// =============================================================================
+// |||                                                                       |||
+// |||   NOTE:                                                               |||
+// |||                                                                       |||
+// |||     EVERYTHING BEYOND THIS POINT IS BORING AND CAN BE IGNORED -       |||
+// |||     IT'S JUST THE SAME CODE OVER AND OVER FOR EVERY CALLBACK:         |||
+// |||                                                                       |||
+// |||                                                                       |||
+// |||       public OnPlayerConnect(playerid)                                |||
+// |||       {                                                               |||
+// |||           HOOKS_CALL<PlayerConnect>                                   |||
+// |||       }                                                               |||
+// |||       #if defined _ALS_OnPlayerConnect                                |||
+// |||           #undef OnPlayerConnect                                      |||
+// |||       #else                                                           |||
+// |||           #define _ALS_OnPlayerConnect                                |||
+// |||       #endif                                                          |||
+// |||       #define OnPlayerConnect S@@_OnPlayerConnect                     |||
+// |||       ALS_FORWARD<PlayerConnect>                                      |||
+// |||                                                                       |||
+// |||                                                                       |||
+// |||     THE "#if 1" WILL ALLOW YOU TO HIDE ALL THE CODE IN AN             |||
+// |||     EDITOR WITH CODE FOLDING, FOR EXAMPLE NOTEPAD++                   |||
+// |||                                                                       |||
+// =============================================================================
+// =============================================================================
+
+#if 1
+
+public OnGameModeExit()
+{
+	HOOKS_CALL<GameModeExit>
+}
+#if defined _ALS_OnGameModeExit
+	#undef OnGameModeExit
+#else
+	#define _ALS_OnGameModeExit
+#endif
+#define OnGameModeExit S@@_OnGameModeExit
+ALS_FORWARD<GameModeExit>
+
+public OnFilterScriptExit()
+{
+	HOOKS_CALL<FilterScriptExit>
+}
+#if defined _ALS_OnFilterScriptExit
+	#undef OnFilterScriptExit
+#else
+	#define _ALS_OnFilterScriptExit
+#endif
+#define OnFilterScriptExit S@@_OnFilterScriptExit
+ALS_FORWARD<FilterScriptExit>
+
+public OnPlayerConnect(playerid)
+{
+	HOOKS_CALL<PlayerConnect>
+}
+#if defined _ALS_OnPlayerConnect
+	#undef OnPlayerConnect
+#else
+	#define _ALS_OnPlayerConnect
+#endif
+#define OnPlayerConnect S@@_OnPlayerConnect
+ALS_FORWARD<PlayerConnect>
+
+public OnPlayerDisconnect(playerid, reason)
+{
+	HOOKS_CALL<PlayerDisconnect>
+}
+#if defined _ALS_OnPlayerDisconnect
+	#undef OnPlayerDisconnect
+#else
+	#define _ALS_OnPlayerDisconnect
+#endif
+#define OnPlayerDisconnect S@@_OnPlayerDisconnect
+ALS_FORWARD<PlayerDisconnect>
+
+public OnPlayerSpawn(playerid)
+{
+	HOOKS_CALL<PlayerSpawn>
+}
+#if defined _ALS_OnPlayerSpawn
+	#undef OnPlayerSpawn
+#else
+	#define _ALS_OnPlayerSpawn
+#endif
+#define OnPlayerSpawn S@@_OnPlayerSpawn
+ALS_FORWARD<PlayerSpawn>
 
-#if !defined _inc_y_hooks
-	#error Did you do <YSI/y_hooks> instead of the required <YSI\y_hooks>?
+public OnPlayerDeath(playerid, killerid, reason)
+{
+	HOOKS_CALL<PlayerDeath>
+}
+#if defined _ALS_OnPlayerDeath
+	#undef OnPlayerDeath
+#else
+	#define _ALS_OnPlayerDeath
 #endif
-#undef _inc_y_hooks
+#define OnPlayerDeath S@@_OnPlayerDeath
+ALS_FORWARD<PlayerDeath>
 
-// Multiple includes!
-#include "internal\y_unique"
+public OnVehicleSpawn(vehicleid)
+{
+	HOOKS_CALL<VehicleSpawn>
+}
+#if defined _ALS_OnVehicleSpawn
+	#undef OnVehicleSpawn
+#else
+	#define _ALS_OnVehicleSpawn
+#endif
+#define OnVehicleSpawn S@@_OnVehicleSpawn
+ALS_FORWARD<VehicleSpawn>
+
+public OnVehicleDeath(vehicleid, killerid)
+{
+	HOOKS_CALL<VehicleDeath>
+}
+#if defined _ALS_OnVehicleDeath
+	#undef OnVehicleDeath
+#else
+	#define _ALS_OnVehicleDeath
+#endif
+#define OnVehicleDeath S@@_OnVehicleDeath
+ALS_FORWARD<VehicleDeath>
+
+public OnPlayerText(playerid, text[])
+{
+	HOOKS_CALL<PlayerText>
+}
+#if defined _ALS_OnPlayerText
+	#undef OnPlayerText
+#else
+	#define _ALS_OnPlayerText
+#endif
+#define OnPlayerText S@@_OnPlayerText
+ALS_FORWARD<PlayerText>
+
+public OnPlayerCommandText(playerid, cmdtext[])
+{
+	HOOKS_CALL<PlayerCommandText>
+}
+#if defined _ALS_OnPlayerCommandText
+	#undef OnPlayerCommandText
+#else
+	#define _ALS_OnPlayerCommandText
+#endif
+#define OnPlayerCommandText S@@_OnPlayerCommandText
+ALS_FORWARD<PlayerCommandText>
+
+public OnPlayerRequestClass(playerid, classid)
+{
+	HOOKS_CALL<PlayerRequestClass>
+}
+#if defined _ALS_OnPlayerRequestClass
+	#undef OnPlayerRequestClass
+#else
+	#define _ALS_OnPlayerRequestClass
+#endif
+#define OnPlayerRequestClass S@@_OnPlayerRequestClass
+ALS_FORWARD<PlayerRequestClass>
+
+public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
+{
+	HOOKS_CALL<PlayerEnterVehicle>
+}
+#if defined _ALS_OnPlayerEnterVehicle
+	#undef OnPlayerEnterVehicle
+#else
+	#define _ALS_OnPlayerEnterVehicle
+#endif
+#define OnPlayerEnterVehicle S@@_OnPlayerEnterVehicle
+ALS_FORWARD<PlayerEnterVehicle>
+
+public OnPlayerExitVehicle(playerid, vehicleid)
+{
+	HOOKS_CALL<PlayerExitVehicle>
+}
+#if defined _ALS_OnPlayerExitVehicle
+	#undef OnPlayerExitVehicle
+#else
+	#define _ALS_OnPlayerExitVehicle
+#endif
+#define OnPlayerExitVehicle S@@_OnPlayerExitVehicle
+ALS_FORWARD<PlayerExitVehicle>
 
-#if defined _INC_y_hooks
-	#endinput
+public OnPlayerStateChange(playerid, newstate, oldstate)
+{
+	HOOKS_CALL<PlayerStateChange>
+}
+#if defined _ALS_OnPlayerStateChange
+	#undef OnPlayerStateChange
+#else
+	#define _ALS_OnPlayerStateChange
 #endif
-// Everything except including "y_unique" is done once only.
-#define _INC_y_hooks
+#define OnPlayerStateChange S@@_OnPlayerStateChange
+ALS_FORWARD<PlayerStateChange>
+
+public OnPlayerEnterCheckpoint(playerid)
+{
+	HOOKS_CALL<PlayerEnterCheckpoint>
+}
+#if defined _ALS_OnPlayerEnterCheckpoint
+	#undef OnPlayerEnterCheckpoint
+#else
+	#define _ALS_OnPlayerEnterCheckpoint
+#endif
+#define OnPlayerEnterCheckpoint S@@_OnPlayerEnterCheckpoint
+ALS_FORWARD<PlayerEnterCheckpoint>
+
+public OnPlayerLeaveCheckpoint(playerid)
+{
+	HOOKS_CALL<PlayerLeaveCheckpoint>
+}
+#if defined _ALS_OnPlayerLeaveCheckpoint
+	#undef OnPlayerLeaveCheckpoint
+#else
+	#define _ALS_OnPlayerLeaveCheckpoint
+#endif
+#define OnPlayerLeaveCheckpoint S@@_OnPlayerLeaveCheckpoint
+ALS_FORWARD<PlayerLeaveCheckpoint>
+
+public OnPlayerEnterRaceCheckpoint(playerid)
+{
+	HOOKS_CALL<PlayerEnterRaceCheckpoint>
+}
+#if defined _ALS_OnPlayerEnterRaceCP
+	#undef OnPlayerEnterRaceCheckpoint
+#else
+	#define _ALS_OnPlayerEnterRaceCP
+#endif
+#define OnPlayerEnterRaceCheckpoint S@@_OnPlayerEnterRaceCheckpoint
+ALS_FORWARD<PlayerEnterRaceCheckpoint>
+
+public OnPlayerLeaveRaceCheckpoint(playerid)
+{
+	HOOKS_CALL<PlayerLeaveRaceCheckpoint>
+}
+#if defined _ALS_OnPlayerLeaveRaceCP
+	#undef OnPlayerLeaveRaceCheckpoint
+#else
+	#define _ALS_OnPlayerLeaveRaceCP
+#endif
+#define OnPlayerLeaveRaceCheckpoint S@@_OnPlayerLeaveRaceCheckpoint
+ALS_FORWARD<PlayerLeaveRaceCheckpoint>
+
+public OnRconCommand(cmd[])
+{
+	HOOKS_CALL<RconCommand>
+}
+#if defined _ALS_OnRconCommand
+	#undef OnRconCommand
+#else
+	#define _ALS_OnRconCommand
+#endif
+#define OnRconCommand S@@_OnRconCommand
+ALS_FORWARD<RconCommand>
+
+public OnPlayerRequestSpawn(playerid)
+{
+	HOOKS_CALL<PlayerRequestSpawn>
+}
+#if defined _ALS_OnPlayerRequestSpawn
+	#undef OnPlayerRequestSpawn
+#else
+	#define _ALS_OnPlayerRequestSpawn
+#endif
+#define OnPlayerRequestSpawn S@@_OnPlayerRequestSpawn
+ALS_FORWARD<PlayerRequestSpawn>
+
+public OnObjectMoved(objectid)
+{
+	HOOKS_CALL<ObjectMoved>
+}
+#if defined _ALS_OnObjectMoved
+	#undef OnObjectMoved
+#else
+	#define _ALS_OnObjectMoved
+#endif
+#define OnObjectMoved S@@_OnObjectMoved
+ALS_FORWARD<ObjectMoved>
+
+public OnPlayerObjectMoved(playerid, objectid)
+{
+	HOOKS_CALL<PlayerObjectMoved>
+}
+#if defined _ALS_OnPlayerObjectMoved
+	#undef OnPlayerObjectMoved
+#else
+	#define _ALS_OnPlayerObjectMoved
+#endif
+#define OnPlayerObjectMoved S@@_OnPlayerObjectMoved
+ALS_FORWARD<PlayerObjectMoved>
+
+public OnPlayerPickUpPickup(playerid, pickupid)
+{
+	HOOKS_CALL<PlayerPickUpPickup>
+}
+#if defined _ALS_OnPlayerPickUpPickup
+	#undef OnPlayerPickUpPickup
+#else
+	#define _ALS_OnPlayerPickUpPickup
+#endif
+#define OnPlayerPickUpPickup S@@_OnPlayerPickUpPickup
+ALS_FORWARD<PlayerPickUpPickup>
+
+public OnVehicleMod(playerid, vehicleid, componentid)
+{
+	HOOKS_CALL<VehicleMod>
+}
+#if defined _ALS_OnVehicleMod
+	#undef OnVehicleMod
+#else
+	#define _ALS_OnVehicleMod
+#endif
+#define OnVehicleMod S@@_OnVehicleMod
+ALS_FORWARD<VehicleMod>
+
+public OnEnterExitModShop(playerid, enterexit, interiorid)
+{
+	HOOKS_CALL<EnterExitModShop>
+}
+#if defined _ALS_OnEnterExitModShop
+	#undef OnEnterExitModShop
+#else
+	#define _ALS_OnEnterExitModShop
+#endif
+#define OnEnterExitModShop S@@_OnEnterExitModShop
+ALS_FORWARD<EnterExitModShop>
+
+public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
+{
+	HOOKS_CALL<VehiclePaintjob>
+}
+#if defined _ALS_OnVehiclePaintjob
+	#undef OnVehiclePaintjob
+#else
+	#define _ALS_OnVehiclePaintjob
+#endif
+#define OnVehiclePaintjob S@@_OnVehiclePaintjob
+ALS_FORWARD<VehiclePaintjob>
+
+public OnVehicleRespray(playerid, vehicleid, color1, color2)
+{
+	HOOKS_CALL<VehicleRespray>
+}
+#if defined _ALS_OnVehicleRespray
+	#undef OnVehicleRespray
+#else
+	#define _ALS_OnVehicleRespray
+#endif
+#define OnVehicleRespray S@@_OnVehicleRespray
+ALS_FORWARD<VehicleRespray>
+
+public OnVehicleDamageStatusUpdate(vehicleid, playerid)
+{
+	HOOKS_CALL<VehicleDamageStatusUpdate>
+}
+#if defined _ALS_OnVehicleDamageStatusUpd
+	#undef OnVehicleDamageStatusUpdate
+#else
+	#define _ALS_OnVehicleDamageStatusUpd
+#endif
+#define OnVehicleDamageStatusUpdate S@@_OnVehicleDamageStatusUpdate
+ALS_FORWARD<VehicleDamageStatusUpdate>
+
+public OnPlayerSelectedMenuRow(playerid, row)
+{
+	HOOKS_CALL<PlayerSelectedMenuRow>
+}
+#if defined _ALS_OnPlayerSelectedMenuRow
+	#undef OnPlayerSelectedMenuRow
+#else
+	#define _ALS_OnPlayerSelectedMenuRow
+#endif
+#define OnPlayerSelectedMenuRow S@@_OnPlayerSelectedMenuRow
+ALS_FORWARD<PlayerSelectedMenuRow>
+
+public OnPlayerExitedMenu(playerid)
+{
+	HOOKS_CALL<PlayerExitedMenu>
+}
+#if defined _ALS_OnPlayerExitedMenu
+	#undef OnPlayerExitedMenu
+#else
+	#define _ALS_OnPlayerExitedMenu
+#endif
+#define OnPlayerExitedMenu S@@_OnPlayerExitedMenu
+ALS_FORWARD<PlayerExitedMenu>
+
+public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
+{
+	HOOKS_CALL<PlayerInteriorChange>
+}
+#if defined _ALS_OnPlayerInteriorChange
+	#undef OnPlayerInteriorChange
+#else
+	#define _ALS_OnPlayerInteriorChange
+#endif
+#define OnPlayerInteriorChange S@@_OnPlayerInteriorChange
+ALS_FORWARD<PlayerInteriorChange>
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	HOOKS_CALL<PlayerKeyStateChange>
+}
+#if defined _ALS_OnPlayerKeyStateChange
+	#undef OnPlayerKeyStateChange
+#else
+	#define _ALS_OnPlayerKeyStateChange
+#endif
+#define OnPlayerKeyStateChange S@@_OnPlayerKeyStateChange
+ALS_FORWARD<PlayerKeyStateChange>
+
+public OnRconLoginAttempt(ip[], password[], success)
+{
+	HOOKS_CALL<RconLoginAttempt>
+}
+#if defined _ALS_OnRconLoginAttempt
+	#undef OnRconLoginAttempt
+#else
+	#define _ALS_OnRconLoginAttempt
+#endif
+#define OnRconLoginAttempt S@@_OnRconLoginAttempt
+ALS_FORWARD<RconLoginAttempt>
+
+public OnPlayerStreamIn(playerid, forplayerid)
+{
+	HOOKS_CALL<PlayerStreamIn>
+}
+#if defined _ALS_OnPlayerStreamIn
+	#undef OnPlayerStreamIn
+#else
+	#define _ALS_OnPlayerStreamIn
+#endif
+#define OnPlayerStreamIn S@@_OnPlayerStreamIn
+ALS_FORWARD<PlayerStreamIn>
+
+public OnPlayerStreamOut(playerid, forplayerid)
+{
+	HOOKS_CALL<PlayerStreamOut>
+}
+#if defined _ALS_OnPlayerStreamOut
+	#undef OnPlayerStreamOut
+#else
+	#define _ALS_OnPlayerStreamOut
+#endif
+#define OnPlayerStreamOut S@@_OnPlayerStreamOut
+ALS_FORWARD<PlayerStreamOut>
+
+public OnVehicleStreamIn(vehicleid, forplayerid)
+{
+	HOOKS_CALL<VehicleStreamIn>
+}
+#if defined _ALS_OnVehicleStreamIn
+	#undef OnVehicleStreamIn
+#else
+	#define _ALS_OnVehicleStreamIn
+#endif
+#define OnVehicleStreamIn S@@_OnVehicleStreamIn
+ALS_FORWARD<VehicleStreamIn>
+
+public OnVehicleStreamOut(vehicleid, forplayerid)
+{
+	HOOKS_CALL<VehicleStreamOut>
+}
+#if defined _ALS_OnVehicleStreamOut
+	#undef OnVehicleStreamOut
+#else
+	#define _ALS_OnVehicleStreamOut
+#endif
+#define OnVehicleStreamOut S@@_OnVehicleStreamOut
+ALS_FORWARD<VehicleStreamOut>
+
+public OnPlayerClickPlayer(playerid, clickedplayerid, source)
+{
+	HOOKS_CALL<PlayerClickPlayer>
+}
+#if defined _ALS_OnDPlayerClickPlayer
+	#undef OnPlayerClickPlayer
+#else
+	#define _ALS_OnPlayerClickPlayer
+#endif
+#define OnPlayerClickPlayer S@@_OnPlayerClickPlayer
+ALS_FORWARD<PlayerClickPlayer>
+
+#endif
+
+#pragma tabsize 4
 
-#include "internal\y_dohooks"
+#undef ALS_PREFIX

+ 81 - 392
pawno/include/YSI/y_ini.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					===========================
 					Y Sever Includes - INI Core
 					===========================
@@ -18,17 +18,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI ini include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -43,10 +43,9 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
@@ -77,7 +76,7 @@ Changelog:
 	21/06/07:
 		Added INI_NEW_LINE for future writing functions.
 	20/06/07:
-		Added support for an optional parameter in broadcastfunc data.
+		Added support for an optional parameter in broadcast data.
 	15/04/07:
 		Updated for more whitespaces.
 		Added INI comment code.
@@ -153,32 +152,21 @@ Compile options:
 	-
 Operators:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 // Ini file reading is not distributed.  User file reading may be, though I
 // doubt it.
 
-#include "internal\y_version"
+#include <YSI\internal\y_version>
 
 //#tryinclude <sscanf>
 
-#include "y_utils"
-#include "y_bit"
-#include "y_debug"
-#include "y_inline"
-
-#include "internal\y_natives"
-
-#define MAX_INI_LINE                    (MAX_INI_ENTRY_NAME + MAX_INI_ENTRY_TEXT + 32)
-
-#define INI_NO_FILE                     (INI:-1)
-
-#if !defined INI_NEW_LINE
-	#define INI_NEW_LINE                "\r\n"
-#endif
+#include <YSI\y_utils>
+#include <YSI\y_bit>
+#include <YSI\y_debug>
 
 #if !defined MAX_INI_TAG
-	#define MAX_INI_TAG                 (32)
+	#define MAX_INI_TAG                 (16)
 #endif
 
 #if !defined MAX_INI_ENTRY_NAME
@@ -186,7 +174,15 @@ Operators:
 #endif
 
 #if !defined MAX_INI_ENTRY_TEXT
-	#define MAX_INI_ENTRY_TEXT          YSI_MAX_STRING
+	#define MAX_INI_ENTRY_TEXT          128
+#endif
+
+#define MAX_INI_LINE                    (MAX_INI_ENTRY_NAME + MAX_INI_ENTRY_TEXT + 32)
+
+#define INI_NO_FILE                     (INI:-1)
+
+#if !defined INI_NEW_LINE
+	#define INI_NEW_LINE                "\r\n"
 #endif
 
 #if !defined INI_MAX_WRITES
@@ -212,11 +208,7 @@ Operators:
 	#endif*/
 #endif
 
-//#define MAX_INI_STRING                  (64)
-
-#define MAX_INI_STRING                  FUNCTION_LENGTH
-
-#define Y_INI_WRITE_ARRAY_SIZE ((MAX_INI_ENTRY_TEXT - 1) / 16 * 16)
+#define MAX_INI_STRING                  (64)
 
 enum E_INI_WRITE
 {
@@ -238,7 +230,7 @@ static stock
 	YSI_g_sINITagPos[INI_MAX_WRITES],
 	YSI_g_sINICurrentTag[INI_MAX_WRITES],
 	YSI_g_sINIWriteTag[INI_MAX_WRITES][MAX_INI_TAGS][E_INI_TAGS],
-	YSI_g_sINIWriteFile[INI_MAX_WRITES][YSI_MAX_STRING];
+	YSI_g_sINIWriteFile[INI_MAX_WRITES][128];
 
 #define INI_Parse(%1,%2) \
 	forward @INI_%1_%2(name[], value[]); \
@@ -349,7 +341,7 @@ static stock
 		if(!strcmp((%1),name,true))return strcpy(%2,value,%3)
 #endif
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_GetEntryName
 Params:
@@ -359,28 +351,23 @@ Return:
 	bool: Found the name correctly.
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock bool:INI_GetEntryName(source[], dest[], &i)
 {
-	P:3("bool:INI_GetEntryName called: \"%s\", %i, %i", source, dest, i);
 	new
 		j;
 	while (source[j] && source[j] <= ' ') j++;
-	P:7("bool:INI_GetEntryName: progress 0");
 	i = j;
 	while (source[i] > ' ' && source[i] != '=') i++;
-	P:7("bool:INI_GetEntryName: progress 1");
 	if (i == j) return false;
-	P:7("bool:INI_GetEntryName: progress 2");
 	i -= j;
 	memcpy(dest, source, j, i * 4, MAX_INI_ENTRY_NAME);
 	dest[i] = '\0';
-	P:7("bool:INI_GetEntryName: progress 3, %s, %i, %s", dest, i, source);
 	return true;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_GetEntryText
 Params:
@@ -389,35 +376,18 @@ Params:
 Return:
 	-
 Notes:
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI_GetEntryText(source[], dest[], i)
 {
-	P:3("INI_GetEntryText called: \"%s\", %i, %i", source, dest, i);
-	while ('\0' < source[i] <= ' ')
-	{
-		++i;
-	}
-	P:7("bool:INI_GetEntryText: progress 1");
-	if (source[i] == '=')
-	{
-		while ('\0' < source[++i] <= ' ')
-		{
-			// Do nothing.
-		}
-	}
-	P:7("bool:INI_GetEntryText: progress 2");
 	while (source[i] && (source[i] <= ' ' || source[i] == '=')) i++;
-	//while (source[i] && (source[i] <= ' ' || source[i] == '=')) i++;
-	P:7("bool:INI_GetEntryText: progress 3");
 	dest[0] = 1;
 	dest[1] = '\0';
 	if (!source[i]) return;
-	P:7("bool:INI_GetEntryText: progress 4, %s, %d, %s", dest, i, source);
 	strcpy(dest, source[i], MAX_INI_ENTRY_TEXT);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_ParseFile
 Params:
@@ -429,8 +399,6 @@ Params:
 	extra - Additional data to send.
 	bLocal - Call local functions instead of gloabal ones.
 	bPassTag - Pass the tag as an extra parameter not the function name.
-	bFilter - Apply the tag name filter to all tags or just prefixed ones?
-	filter - Text to use to search for which tags to load.
 Return:
 	-
 Notes:
@@ -440,36 +408,19 @@ Notes:
 	to exclude one or the other from the function name by setting the required
 	parameter to be entered first and then only haing one %s in the format
 	sting.  The default order is tag first for languages compatability.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-stock bool:INI_ParseFile(fname[], remoteFormat[], bool:bFileFirst = false, bool:bExtra = false, extra = 0, bool:bLocal = true, bool:bPassTag = false, bool:bFilter = true, filter[] = "")
+stock bool:INI_ParseFile(filename[], remoteFormat[], bool:bFileFirst = false, bool:bExtra = false, extra = 0, bool:bLocal = true, bool:bPassTag = false)
 {
-	P:3("bool:INI_ParseFile called: \"%s\", \"%s\", %i, %i, %i, %i, %i", fname, remoteFormat, bFileFirst, bExtra, extra, bLocal, bPassTag);
 	new
-		File:f,
-		filename[64],
-		callbackFormat;
-	if (bExtra)
-	{
-		if (bPassTag) callbackFormat = _F<isss>;
-		else callbackFormat = _F<iss>;
-	}
-	else
-	{
-		if (bPassTag) callbackFormat = _F<sss>;
-		else callbackFormat = _F<ss>;
-	}
-	strcpy(filename, fname, 64);
+		File:f;
 	if (!(f = fopen(filename, io_read))) return false;
-	P:5("INI_ParseFile: open");
 	new
 		line[MAX_INI_LINE],
-		tagName[MAX_INI_STRING] = "\1\0",
+		tagName[MAX_INI_STRING],
 		function[MAX_INI_STRING],
 		comment,
-		pos,
-		bool:bCallback,
-		callback[E_CALLBACK_DATA];
+		pos;
 	// Strip the extension from the filename.
 	comment = chrfind('.', filename);
 	if (comment != -1) filename[comment] = '\0';
@@ -490,7 +441,6 @@ stock bool:INI_ParseFile(fname[], remoteFormat[], bool:bFileFirst = false, bool:
 		}
 		--comment;
 	}
-	P:5("INI_ParseFile: filename only");
 	// Set the default tag value.
 	if (bFileFirst)
 	{
@@ -500,12 +450,7 @@ stock bool:INI_ParseFile(fname[], remoteFormat[], bool:bFileFirst = false, bool:
 	{
 		format(function, sizeof (function), remoteFormat, "", filename);
 	}
-	if (bLocal)
-	{
-		bCallback = bool:Callback_Get(callback_tag:function, callback, callbackFormat);
-	}
 	// Now read in the whole data.
-	P:5("INI_ParseFile: parse");
 	while (fread(f, line))
 	{
 		StripNL(line);
@@ -525,67 +470,22 @@ stock bool:INI_ParseFile(fname[], remoteFormat[], bool:bFileFirst = false, bool:
 		{
 			// Got a tag, update the function to call.
 			stringIdent[comment] = '\0';
-			P:5("INI_ParseFile: Is checkable %d %d %d", stringIdent[1] == '@', stringIdent[2] == '@', (comment = chrfind('-', stringIdent)) != -1);
-			if (stringIdent[1] == '@' && stringIdent[2] == '@' && (comment = chrfind('-', stringIdent)) != -1)
-			{
-				// We are keeping the ability to filter by tag names, but now
-				// we are just using the existing unique tag load code in y_ini.
-				stringIdent[comment] = '\0';
-				P:5("INI_ParseFile: SingleTag check");
-				if (strcmp(filter, stringIdent[3]))
-				{
-					P:5("INI_ParseFile: Not this time");
-					// Skip tags we don't care about.  This will not skip
-					// anything if the passed tag is "" (here I'm (ab)using the
-					// fact that "strcmp" returns 0 when an empty string is
-					// involved).
-					function[0] = '\0';
-					continue;
-				}
-				stringIdent[comment] = '-';
-				++comment;
-			}
-			else
-			{
-				P:5("INI_ParseFile: SingleTag check");
-				// Apply the filter to non-prefixed tags if desired.
-				if (bFilter && strcmp(filter, stringIdent[1]))
-				{
-					P:5("INI_ParseFile: Not this time");
-					// Skip tags we don't care about.  This will not skip
-					// anything if the passed tag is "" (here I'm (ab)using the
-					// fact that "strcmp" returns 0 when an empty string is
-					// involved).
-					function[0] = '\0';
-					continue;
-				}
-				comment = 1;
-			}
 			if (bFileFirst)
 			{
-				format(function, sizeof (function), remoteFormat, filename, stringIdent[comment]);
+				format(function, sizeof (function), remoteFormat, filename, stringIdent[1]);
 			}
 			else
 			{
-				format(function, sizeof (function), remoteFormat, stringIdent[comment], filename);
+				format(function, sizeof (function), remoteFormat, stringIdent[1], filename);
 			}
-			if (bLocal)
-			{
-				bCallback = bool:Callback_Get(callback_tag:function, callback, callbackFormat);
-			}
-			P:5("INI_ParseFile: Call it \"%s\", %d, %d", function, bLocal, funcidx(function) == -1);
 			// Skip complex checks where possible.
 			if (bLocal && funcidx(function) == -1)
 			{
-				// This needs updating for inline functions.
 				function[0] = '\0';
 			}
-			else
+			else if (bPassTag)
 			{
-				if (bPassTag)
-				{
-					strcpy(tagName, stringIdent[1], MAX_INI_STRING);
-				}
+				strcpy(tagName, stringIdent[1], MAX_INI_STRING);
 			}
 		}
 		else if (function[0])
@@ -594,40 +494,33 @@ stock bool:INI_ParseFile(fname[], remoteFormat[], bool:bFileFirst = false, bool:
 				stringText[MAX_INI_ENTRY_TEXT];
 			INI_GetEntryText(line, stringText, pos);
 			// Read in a value - distribute it as required.
-			if (bCallback)
+			if (bLocal)
 			{
 				if (bExtra)
 				{
 					if (bPassTag)
 					{
-						Callback_Call(callback, extra, tagName, stringIdent, stringText);
-						//CallLocalFunction(function, "isss", extra, tagName, stringIdent, stringText);
+						CallLocalFunction(function, "isss", extra, tagName, stringIdent, stringText);
 					}
 					else
 					{
-						Callback_Call(callback, extra, stringIdent, stringText);
-						//CallLocalFunction(function, "iss", extra, stringIdent, stringText);
+						CallLocalFunction(function, "iss", extra, stringIdent, stringText);
 					}
 				}
 				else
 				{
 					if (bPassTag)
 					{
-						Callback_Call(callback, tagName, stringIdent, stringText);
-						//CallLocalFunction(function, "sss", tagName, stringIdent, stringText);
+						CallLocalFunction(function, "sss", tagName, stringIdent, stringText);
 					}
 					else
 					{
-						Callback_Call(callback, stringIdent, stringText);
-						//CallLocalFunction(function, "ss", stringIdent, stringText);
+						CallLocalFunction(function, "ss", stringIdent, stringText);
 					}
 				}
 			}
-			else if (!bLocal)
+			else
 			{
-				// Can't use inilne functions remotely (it makes no sense at all
-				// - inline functions come from the call point, and the call
-				// point is in this local script.
 				if (bExtra)
 				{
 					if (bPassTag)
@@ -657,7 +550,7 @@ stock bool:INI_ParseFile(fname[], remoteFormat[], bool:bFileFirst = false, bool:
 	return true;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_Load
 Params:
@@ -670,15 +563,14 @@ Return:
 Notes:
 	Wrapper for INI_ParseFile to use standard API features so people can
 	worry even less.  Designed for use with INI_Parse.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock bool:INI_Load(filename[], bool:bExtra = false, extra = 0, bool:bLocal = true)
 {
-	P:3("bool:INI_Load called: \"%s\", %i, %i, %i", filename, _:bExtra, extra, _:bLocal);
 	return INI_ParseFile(filename, "@INI_%s_%s", true, bExtra, extra, bLocal, false);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_Open
 Params:
@@ -687,15 +579,10 @@ Return:
 	INI - handle to the file or INI_NO_FILE.
 Notes:
 	Doesn't actually open the file, just starts a new buffer if possible.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI:INI_Open(filename[])
 {
-	if (ftouch(filename) == -1)
-	{
-		P:E("INI_Open could not find or create file %s", filename);
-	}
-	P:3("INI:INI_Open called: \"%s\"", filename);
 	new
 		i;
 	for (i = 0; i < INI_MAX_WRITES; i++)
@@ -721,12 +608,12 @@ stock INI:INI_Open(filename[])
 		{
 			fclose(fHnd);
 		}
-		else P:E("Could not create target file");
+		C:1(else printf("*** Internal Error: Could not create target file"););
 	}*/
 	return INI:i;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_Close
 Params:
@@ -735,16 +622,15 @@ Return:
 	-
 Notes:
 	Writes any outstanding buffer data to the file and ends the stream.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI_Close(INI:file)
 {
-	P:3("INI_Close called: %i", _:file);
-	if (YSI_g_sINIWritePos[_:file] || YSI_g_sINITagPos[_:file]) INI_WriteBuffer(file);
+	if (YSI_g_sINIWritePos[_:file]) INI_WriteBuffer(file);
 	YSI_g_sINIWriteFile[_:file][0] = '\0';
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_SetTag
 Params:
@@ -756,11 +642,10 @@ Notes:
 	Sets a new [tag] section header.  Subsequent data is written under this
 	header.  Uses lists for constant tag switching and checks the tag doesn't
 	already exist.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI_SetTag(INI:file, tag[])
 {
-	P:3("INI_SetTag called: %i, \"%s\"", _:file, tag);
 	if (file < INI:0 || file >= INI:INI_MAX_WRITES) return;
 	new
 		pos = YSI_g_sINITagPos[_:file];
@@ -791,150 +676,7 @@ stock INI_SetTag(INI:file, tag[])
 	++YSI_g_sINITagPos[_:file];
 }
 
-/*----------------------------------------------------------------------------*\
-Function:
-	INI_DeleteTag
-Params:
-	INI:file - INI file handle to write to.
-	tag[] - Name of the whole section to delete.
-Return:
-	-
-Notes:
-	Removes a [tag] section from a file.
-\*----------------------------------------------------------------------------*/
-
-stock INI_DeleteTag(INI:file, tag[])
-{
-	P:3("INI_DeleteTag called: %i, \"%s\"", _:file, tag);
-	if (file < INI:0 || file >= INI:INI_MAX_WRITES) return;
-	new
-		pos = YSI_g_sINITagPos[_:file];
-	for (new i = 0; i < pos; i++)
-	{
-		P:6("INI_DeleteTag: %i, \"%s\", \"%s\"", i, tag, unpack(YSI_g_sINIWriteTag[_:file][i][E_INI_TAGS_NAME]));
-		if (YSI_g_sINIWriteTag[_:file][i][E_INI_TAGS_NAME][0] && !strcmp(tag, YSI_g_sINIWriteTag[_:file][i][E_INI_TAGS_NAME], true))
-		{
-			YSI_g_sINICurrentTag[_:file] = i;
-			YSI_g_sINIWriteTag[_:file][i][E_INI_TAGS_START] = cellmax;
-			return;
-		}
-	}
-	if (pos >= MAX_INI_TAGS)
-	{
-		if (!INI_WriteBuffer(file)) return;
-		// Loop.
-		pos = 0;
-	}
-	strpack(YSI_g_sINIWriteTag[_:file][pos][E_INI_TAGS_NAME], tag, MAX_INI_TAG);
-	YSI_g_sINIWriteTag[_:file][pos][E_INI_TAGS_START] = cellmax;
-	YSI_g_sINICurrentTag[_:file] = pos;
-	++YSI_g_sINITagPos[_:file];
-}
-
-stock INI_WriteArray(INI:file, const name[], data[], len)
-{
-	// Write 6 bits at a time, in 3 cell chunks.  It takes 16 bytes to record
-	// three cells with 6 bits per byte.
-	P:4("INI_WriteArray called");
-	new
-		dname[MAX_INI_ENTRY_NAME],
-		write[Y_INI_WRITE_ARRAY_SIZE + 1],
-		idx,
-		wi,
-		iter;
-	// Write the length first just so the data exists.
-	//INI_WriteInt(file, name, len);
-	valstr(write, len);
-	INI_AddToBuffer(file, name, write);
-	write[0] = '\0';
-	while (idx + 3 < len)
-	{
-		// Store all the data fast.
-		//write[wi++] = (((data[idx] & 0xFC000000) >>> 2) | ((data[idx] & 0x03F00000) >> 4) | ((data[idx] & 0x000FC000) >> 6) | ((data[idx] & 0x00003F00) >> 8))
-		write[wi++] = ((data[idx] & 0xFC000000) >>> 26) + '>';
-		write[wi++] = ((data[idx] & 0x03F00000) >>> 20) + '>';
-		write[wi++] = ((data[idx] & 0x000FC000) >>> 14) + '>';
-		write[wi++] = ((data[idx] & 0x00003F00) >>> 8) + '>';
-		//write[wi++] = (((data[idx - 1] & 0x000000FC) << 22) | ((data[idx - 1] & 0x00000003) << 20) | ((data[idx] & 0xF0000000) >>> 12) | ((data[idx] & 0x0FC00000) >> 14) | ((data[idx] & 0x003F0000) >> 16))
-		write[wi++] = ((data[idx] & 0x000000FC) >>> 2) + '>';
-		write[wi++] = (((data[idx] & 0x00000003) << 4) | ((data[idx + 1] & 0xF0000000) >>> 28)) + '>';
-		++idx;
-		write[wi++] = ((data[idx] & 0x0FC00000) >>> 22) + '>';
-		write[wi++] = ((data[idx] & 0x003F0000) >>> 16) + '>';
-		//write[wi++] = (((data[idx] & 0x0000FC00) << 14) | ((data[idx] & 0x000003F0) << 12) | ((data[idx] & 0x0000000F) << 10) | ((data[idx + 1] & 0xC0000000) >>> 22) | ((data[idx + 1] & 0x3F000000) >> 24))
-		write[wi++] = ((data[idx] & 0x0000FC00) >>> 10) + '>';
-		write[wi++] = ((data[idx] & 0x000003F0) >>> 4) + '>';
-		write[wi++] = (((data[idx] & 0x0000000F) << 2) | ((data[idx + 1] & 0xC0000000) >>> 30)) + '>';
-		++idx;
-		write[wi++] = ((data[idx] & 0x3F000000) >>> 24) + '>';
-		//write[wi++] = (((data[idx] & 0x00FC0000) << 6) | ((data[idx] & 0x0003F000) << 4) | ((data[idx] & 0x00000FC0) << 2) | ((data[idx] & 0x0000003F) << 0))
-		write[wi++] = ((data[idx] & 0x00FC0000) >>> 18) + '>';
-		write[wi++] = ((data[idx] & 0x0003F000) >>> 12) + '>';
-		write[wi++] = ((data[idx] & 0x00000FC0) >>> 6) + '>';
-		write[wi++] = ((data[idx] & 0x0000003F) >>> 0) + '>';
-		++idx;
-		if (wi == Y_INI_WRITE_ARRAY_SIZE)
-		{
-			format(dname, sizeof (dname), "@@%s-%d", name, iter++);
-			//printf("%s = %s", dname, write);
-			P:5("Uvar_WriteArray: write %s = %s", dname, write);
-			//Player_WriteString(dname, write);
-			write[wi] = '\0';
-			INI_AddToBuffer(file, dname, write);
-			write[0] = '\0';
-			wi = 0;
-		}
-	}
-	// Do the straggling bytes.
-	if (idx != len)
-	{
-		write[wi++] = ((data[idx] & 0xFC000000) >>> 26) + '>';
-		write[wi++] = ((data[idx] & 0x03F00000) >>> 20) + '>';
-		write[wi++] = ((data[idx] & 0x000FC000) >>> 14) + '>';
-		write[wi++] = ((data[idx] & 0x00003F00) >>> 8) + '>';
-		//write[wi++] = (((data[idx - 1] & 0x000000FC) << 22) | ((data[idx - 1] & 0x00000003) << 20) | ((data[idx] & 0xF0000000) >>> 12) | ((data[idx] & 0x0FC00000) >> 14) | ((data[idx] & 0x003F0000) >> 16))
-		write[wi++] = ((data[idx] & 0x000000FC) >>> 2) + '>';
-		if (++idx == len)
-		{
-			write[wi++] = ((data[idx - 1] & 0x00000003) << 4) + '>';
-		}
-		else
-		{
-			write[wi++] = (((data[idx - 1] & 0x00000003) << 4) | ((data[idx] & 0xF0000000) >>> 28)) + '>';
-			write[wi++] = ((data[idx] & 0x0FC00000) >>> 22) + '>';
-			write[wi++] = ((data[idx] & 0x003F0000) >>> 16) + '>';
-			//write[wi++] = (((data[idx] & 0x0000FC00) << 14) | ((data[idx] & 0x000003F0) << 12) | ((data[idx] & 0x0000000F) << 10) | ((data[idx + 1] & 0xC0000000) >>> 22) | ((data[idx + 1] & 0x3F000000) >> 24))
-			write[wi++] = ((data[idx] & 0x0000FC00) >>> 10) + '>';
-			write[wi++] = ((data[idx] & 0x000003F0) >>> 4) + '>';
-			if (++idx == len)
-			{
-				write[wi++] = ((data[idx - 1] & 0x0000000F) << 2) + '>';
-			}
-			else
-			{
-				write[wi++] = (((data[idx - 1] & 0x0000000F) << 2) | ((data[idx] & 0xC0000000) >>> 30)) + '>';
-				//++idx;
-				write[wi++] = ((data[idx] & 0x3F000000) >>> 24) + '>';
-				//write[wi++] = (((data[idx] & 0x00FC0000) << 6) | ((data[idx] & 0x0003F000) << 4) | ((data[idx] & 0x00000FC0) << 2) | ((data[idx] & 0x0000003F) << 0))
-				write[wi++] = ((data[idx] & 0x00FC0000) >>> 18) + '>';
-				write[wi++] = ((data[idx] & 0x0003F000) >>> 12) + '>';
-				write[wi++] = ((data[idx] & 0x00000FC0) >>> 6) + '>';
-				write[wi++] = ((data[idx] & 0x0000003F) >>> 0) + '>';
-			}
-		}
-		format(dname, sizeof (dname), "@@%s-%d", name, iter++);
-		//printf("%s = %s", dname, write);
-		P:5("Uvar_WriteArray: write %s = %s", dname, write);
-		//Player_WriteString(dname, write);
-		write[wi] = '\0';
-		INI_AddToBuffer(file, dname, write);
-		write[0] = '\0';
-		wi = 0;
-	}
-	return 1;
-}
-
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_AddToBuffer
 Params:
@@ -949,11 +691,10 @@ Notes:
 	in the buffer to write to and purges the buffer if not.  Finally saves the
 	data in the buffer for writing when required and adds the data to the
 	relevant list for tag inclusion.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-static stock INI_AddToBuffer(INI:file, const name[], data[])
+static stock INI_AddToBuffer(INI:file, name[], data[])
 {
-	P:4("INI_AddToBuffer called: %i, \"%s\", \"%s\"", _:file, name, data);
 	if (file < INI:0 || file >= INI:INI_MAX_WRITES)
 	{
 		return 0;
@@ -969,11 +710,6 @@ static stock INI_AddToBuffer(INI:file, const name[], data[])
 		pos = YSI_g_sINIWritePos[_:file],
 		tmptag = YSI_g_sINICurrentTag[_:file],
 		start = YSI_g_sINIWriteTag[_:file][tmptag][E_INI_TAGS_START];
-	if (start == cellmax)
-	{
-		// Don't write to a deleted tag.
-		return 0;
-	}
 	while (start != -1)
 	{
 		if (!strcmp(name, YSI_g_sINIWriteBuffer[_:file][start][E_INI_WRITE_NAME], true))
@@ -1012,7 +748,7 @@ static stock INI_AddToBuffer(INI:file, const name[], data[])
 	return 1;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_RemoveEntry
 Params:
@@ -1022,17 +758,16 @@ Return:
 	-
 Notes:
 	Wrapper for INI_AddToBuffer for removing data.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI_RemoveEntry(INI:file, name[])
 {
-	P:3("INI_RemoveEntry called: %i, \"%s\"", _:file, name);
 	static
 		sData[2] = {-1, 0};
 	INI_AddToBuffer(file, name, sData);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_WriteString
 Params:
@@ -1043,15 +778,14 @@ Return:
 	-
 Notes:
 	Wrapper for INI_AddToBuffer for strings.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI_WriteString(INI:file, name[], data[])
 {
-	P:3("INI_WriteString called: %i, \"%s\", \"%s\"", _:file, name, data);
 	INI_AddToBuffer(file, name, data);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_WriteInt
 Params:
@@ -1062,18 +796,17 @@ Return:
 	-
 Notes:
 	Wrapper for INI_AddToBuffer for integers.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI_WriteInt(INI:file, name[], data)
 {
-	P:3("INI_WriteInt called: %i, \"%s\", %i", _:file, name, data);
 	new
 		str[12];
 	valstr(str, data);
 	INI_AddToBuffer(file, name, str);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_WriteHex
 Params:
@@ -1084,11 +817,10 @@ Return:
 	-
 Notes:
 	Wrapper for INI_AddToBuffer for integers to be written as hex values.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI_WriteHex(INI:file, name[], data)
 {
-	P:3("INI_WriteHex called: %i, \"%s\", %i", _:file, name, data);
 	static const
 		sc_values[] = !"0123456789ABCDEF";
 	new
@@ -1105,7 +837,7 @@ stock INI_WriteHex(INI:file, name[], data)
 	INI_AddToBuffer(file, name, str[i]);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_WriteBin
 Params:
@@ -1116,15 +848,14 @@ Return:
 	-
 Notes:
 	Wrapper for INI_AddToBuffer for integers to be written as binary values.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI_WriteBin(INI:file, name[], data)
 {
-	P:3("INI_WriteBin called: %i, \"%s\", %i", _:file, name, data);
 	// Do four values at once for speed.  This uses a packed string and unpacks
 	// it so that we can quickly write four values at once.
 	static const
-		sc_values[] = !"0000" "0001" "0010" "0011" "0100" "0101" "0110" "0111" "1000" "1001" "1010" "1011" "1100" "1101" "1110" "1111";
+		sc_values[] = !"0000000100100011010001010110011110001001101010111100110111101111";
 	new
 		str[35],
 		i = 10;
@@ -1141,7 +872,7 @@ stock INI_WriteBin(INI:file, name[], data)
 	INI_AddToBuffer(file, name, str[i]);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_WriteBool
 Params:
@@ -1152,11 +883,10 @@ Return:
 	-
 Notes:
 	Wrapper for INI_AddToBuffer for booleans.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI_WriteBool(INI:file, name[], bool:data)
 {
-	P:3("INI_WriteBool called: %i, \"%s\", %i", _:file, name, _:data);
 	if (data)
 	{
 		INI_AddToBuffer(file, name, "true");
@@ -1167,7 +897,7 @@ stock INI_WriteBool(INI:file, name[], bool:data)
 	}
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_WriteFloat
 Params:
@@ -1180,18 +910,17 @@ Return:
 Notes:
 	Wrapper for INI_AddToBuffer for floats.  Uses custom code instead of
 	format() as it's actually faster for something simple like this.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock INI_WriteFloat(INI:file, name[], Float:data, accuracy = 6)
 {
-	P:3("INI_WriteFloat called: %i, \"%s\", %f, %i", _:file, name, data, accuracy);
 	new
 		str[32];
 	format(str, sizeof (str), "%.*f", accuracy, data);
 	INI_AddToBuffer(file, name, str);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	INI_WriteBuffer
 Params:
@@ -1213,11 +942,10 @@ Notes:
 	written to the temp file along with all their data.  The original file is
 	then destroyed and reopend and all the data copied out from the temp file
 	to the newly opened original file, closed and saved.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 static stock INI_WriteBuffer(INI:file)
 {
-	P:4("INI_WriteBuffer called: %i", _:file);
 	if (_:file < 0 || _:file >= INI_MAX_WRITES) return 0;
 	new
 		//File:buffer = fopen("_temp_ysi_user_file_.ysi", io_write),
@@ -1229,7 +957,6 @@ static stock INI_WriteBuffer(INI:file)
 			line[MAX_INI_LINE],
 			BitArray:read<INI_BUFFER_SIZE>, //:read[INI_BUFFER_BITS],
 			writing = 0,
-			skipTag = 0,
 			//Bit:tagswritten,
 			BitArray:tagswritten<MAX_INI_TAGS>,
 			tagpos = YSI_g_sINITagPos[_:file],
@@ -1244,15 +971,7 @@ static stock INI_WriteBuffer(INI:file)
 				// Will be -1 if there is no tagless data.
 				if (start != -1)
 				{
-					if (start == cellmax)
-					{
-						skipTag = 1;
-						start = -1;
-					}
-					else
-					{
-						writing = 1;
-					}
+					writing = 1;
 					Bit_Set(tagswritten, 0, true);
 				}
 			}
@@ -1280,7 +999,7 @@ static stock INI_WriteBuffer(INI:file)
 				}
 				if (line[0] == '[' && (pos = chrfind(']', line)) != -1 && endofline(line, pos + 1))
 				{
-					//pos--;
+					pos--;
 					writing = 0;
 					new
 						form[MAX_INI_LINE];
@@ -1298,42 +1017,21 @@ static stock INI_WriteBuffer(INI:file)
 						}
 						start = YSI_g_sINIWriteBuffer[_:file][start][E_INI_WRITE_NEXT];
 					}
-					if (!skipTag)
-					{
-						while (blank--) fwrite(buffer, INI_NEW_LINE);
-					}
+					while (blank--) fwrite(buffer, INI_NEW_LINE);
 					blank = 0;
-					skipTag = 0;
 					// Note the start of the new tag.
-					line[pos] = '\0';
 					for (new j = 0; j < tagpos; j++)
 					{
 						//if (!Bit_Get(tagswritten, j) && !YSI_g_sINIWriteTag[_:file][j][E_INI_TAGS_NAME][pos] && !strcmp(YSI_g_sINIWriteTag[_:file][j][E_INI_TAGS_NAME], line[1], true, pos))
-						//printf("compare %d, %s, %s", Bit_Get(tagswritten, j), unpack(YSI_g_sINIWriteTag[_:file][j][E_INI_TAGS_NAME]), line[1]);
-						if (!Bit_Get(tagswritten, j) && !strcmp(YSI_g_sINIWriteTag[_:file][j][E_INI_TAGS_NAME], line[1])) //, true, pos))
+						if (!Bit_Get(tagswritten, j) && !strcmp(YSI_g_sINIWriteTag[_:file][j][E_INI_TAGS_NAME], line[1], true, pos))
 						{
-							/*if (YSI_g_sINIWriteTag[_:file][j][E_INI_TAGS_NAME])
-							{
-								continue;
-							}*/
+							writing = 1;
 							start = YSI_g_sINIWriteTag[_:file][j][E_INI_TAGS_START];
-							P:7("INI_WriteBuffer: Next tag: %s, %d", line[1], start);
-							if (start == cellmax)
-							{
-								skipTag = 1;
-								start = -1;
-								writing = 0;
-							}
-							else
-							{
-								writing = 1;
-							}
 							//tagswritten |= Bit:(1 << j);
 							Bit_Set(tagswritten, j, true);
 							break;
 						}
 					}
-					line[pos--] = ']';
 				}
 				else if (writing)
 				{
@@ -1349,7 +1047,7 @@ static stock INI_WriteBuffer(INI:file)
 					{
 						if (!Bit_GetBit(read, start) && !strcmp(name, YSI_g_sINIWriteBuffer[_:file][start][E_INI_WRITE_NAME]))
 						{
-							Bit_Set(read, start, true);//, INI_BUFFER_SIZE);
+							Bit_Set(read, start, true, INI_BUFFER_SIZE);
 							// Delete the current entry from the file, as per
 							// our request.
 							if (YSI_g_sINIWriteBuffer[_:file][start][E_INI_WRITE_TEXT][0] == -1)
@@ -1386,10 +1084,7 @@ static stock INI_WriteBuffer(INI:file)
 					start = liststart;
 				}
 				INI_WriteBuffer_cont1:
-				if (!skipTag)
-				{
-					fwrite(buffer, line);
-				}
+				fwrite(buffer, line);
 				INI_WriteBuffer_cont2:
 			}
 			// Write any data from this tag group not in the original file.
@@ -1409,18 +1104,12 @@ static stock INI_WriteBuffer(INI:file)
 			fclose(source);
 		}
 		// Write any tag groups not found in the original file.
-		//printf("write some tag");
 		for (new j = 0; j < tagpos; j++)
 		{
 			//if (!(tagswritten & Bit:(1 << j)))
-			//printf("write this tag: %s", unpack(YSI_g_sINIWriteTag[_:file][j][E_INI_TAGS_NAME]));
 			if (!Bit_Get(tagswritten, j))
 			{
 				start = YSI_g_sINIWriteTag[_:file][j][E_INI_TAGS_START];
-				if (start == cellmax)
-				{
-					continue;
-				}
 				if (j || YSI_g_sINIWriteTag[_:file][0][E_INI_TAGS_NAME][0])
 				{
 					strunpack(line, YSI_g_sINIWriteTag[_:file][j][E_INI_TAGS_NAME]);

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 235 - 504
pawno/include/YSI/y_iterate.inc


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 241 - 290
pawno/include/YSI/y_master.inc


+ 51 - 127
pawno/include/YSI/y_playerarray.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					========================================
 					 y_playerarray - Bit arrays of players! 
 					========================================
@@ -19,10 +19,10 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI playerarray include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
@@ -50,39 +50,33 @@ Legal:
 Version:
 	1.0
 Changelog:
-	25/02/11:
-		Scrapped pointless "playing" code I was unhappy with.
 	29/11/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-#include "internal\y_version"
+#include <YSI\internal\y_version>
 
+#include <YSI\y_bit>
 #include <a_samp>
-#include "y_debug"
-#include "y_bit"
 
 #define PA_TYPE_NONE                    (-1)
 #define PA_TYPE_BOOL                    (-2)
 #define PA_TYPE_ID                      (-3)
 #define PA_TYPE_PA                      (-4)
 
-#if defined _YSI_SPECIAL_DEBUG
-	#define PS_IS_PLAYER_CONNECTED(%0) (%0 != INVALID_PLAYER_ID)
-#else
-	#define PS_IS_PLAYER_CONNECTED IsPlayerConnected
-#endif
+#define PlayerArray:%0<%1> Bit:%0[%1]//={Bit:-1}
 
-#define PlayerArray:%0<%1> Bit:%0[%1] //={Bit:PA_TYPE_PA,Bit:0,Bit:0,...}
+#define PA_DEC<%0> static stock PlayerArray:_YSI_g_sPlayerDataA[%0]<MAX_PLAYERS>;//const _YSI_g_sPlayerDataS=%0;
+#define PA_INT<%0,%2> PA_Init(_YSI_g_sPlayerDataA[(%0)],(%2));
+#define PA_ADD<%0,%1> PA+(_YSI_g_sPlayerDataA[(%0)],(%1));
+#define PA_REM<%0,%1> PA-(_YSI_g_sPlayerDataA[(%0)],(%1));
+#define PA_SET<%0,%1,%2> (%2)?(PA+(_YSI_g_sPlayerDataA[(%0)],(%1))):(PA-(_YSI_g_sPlayerDataA[(%0)],(%1)));
 
-//#define Bit:%0[%1,%2] Bit:%0[%1]={Bit:PA_TYPE_PA,Bit:(-1*_:%2),Bit:(-1*_:%2),...}
-
-#define PA_INIT:%1, Bit:PA_TYPE_PA,Bit:(-1*_:%1),Bit:(-1*_:%1),
+//#define PA_Init() {Bit:-1}
 
 stock PA_Init(Bit:a[], bool:init = false, s = bits<MAX_PLAYERS>)
 {
-	P:3("PA_Init called: %i, %i, %i", _:a, _:init, s);
-	//--s;
+	--s;
 	new
 		Bit:m = init ? (Bit:-1) : (Bit:0);
 	a[0] = Bit:PA_TYPE_PA;
@@ -92,126 +86,56 @@ stock PA_Init(Bit:a[], bool:init = false, s = bits<MAX_PLAYERS>)
 	}
 }
 
-#define PA_FastInit(%0) %0[0]=Bit:PA_TYPE_PA
-
-#define PA_GetBit(%1,%2) (%1[((%2)>>>CELLSHIFT)+1]&Bit:(1<<((%2)&cellbits-1)))
+//#define PA_Get(%1,%2) bool:(%1[Bit_Slot(%2)+1]&Bit_Mask(%2))
 
-#define PA_Get(%1,%2) bool:PA_GetBit(Bit:%1,_:%2)
-
-#define PA_Let(%1,%2) %1[((%2)>>>CELLSHIFT)+1]|=Bit:(1<<((%2)&cellbits-1))
+/*stock PA_Assign(PlayerArray:array<>, slot, value, count = bitsof (array))
+{
+	if (slot >= count) return;
+	if (set) array[Bit_Slot(slot) + 1] |= Bit_Mask(slot);
+	else array[Bit_Slot(slot) + 1] &= ~Bit_Mask(slot);
+}*/
 
-#define PA_Vet(%1,%2) %1[((%2)>>>CELLSHIFT)+1]&=Bit:~(1<<((%2)&cellbits-1))
+stock Bit:operator+(Bit:oper2, PlayerArray:oper1)
+{
+	return oper2 | Bit_Mask(_:oper1);
+}
 
-#define PA_GetCount(%1) Bit_GetCount(%1[1],bits<MAX_PLAYERS>)
+stock Bit:operator-(Bit:oper2, PlayerArray:oper1)
+{
+	return oper2 & ~Bit_Mask(_:oper1);
+}
 
-//#define PA_Set(%0,%1,%2) ((%2)?Bit_Let(%0,(%1)):Bit_Vet(%0,(%1)))
-stock PA_Set(PlayerArray:d<>, slot, bool:set)
+stock bool:operator==(Bit:oper2, PlayerArray:oper1)
 {
-	P:3("PA_Set called: %s, %i, %i", Bit_Display(Bit:d[1]), slot, _:set);
-	if (set)
-	{
-		PA_Let(d, slot);
-		return 1;
-	}
-	else
-	{
-		PA_Vet(d, slot);
-		return 0;
-	}
+	return bool:(oper2 & Bit_Mask(_:oper1));
 }
 
-/*stock YSI_gSPAFunc(PlayerArray:data<>)
+stock bool:operator!=(Bit:oper2, PlayerArray:oper1)
 {
-	P:3("YSI_gSPA called: %s", Bit_Display(Bit:data[1]));
-	static const
-		scDeBruijn[] =
-			{
-				0,  1,  28, 2,  29, 14, 24, 3,  30, 22, 20, 15, 25, 17, 4,  8,
-				31, 27, 13, 23, 21, 19, 16, 7,  26, 12, 18, 6,  11, 5,  10, 9
-			};
-	new
-		cur;
-	for (new i = 1; i != bits<MAX_PLAYERS> + 1; ++i)
-	{
-		if ((cur = _:data[i]))
-		{
-			// http://supertech.csail.mit.edu/papers/debruijn.pdf
-			new
-				ret = ((i - 1) * cellbits) + scDeBruijn[((cur & -cur) * 0x077CB531) >>> 27];
-			if (PS_IS_PLAYER_CONNECTED(ret))
-			{
-				return ret;
-			}
-			else
-			{
-				return YSI_gAPAFunc(data, ret);
-			}
-		}
-	}
-	return -1;
-}*/
+	return !(oper2 & Bit_Mask(_:oper1));
+}
 
-stock PA@YSII_Ag(PlayerArray:data<>, start)
+/*stock Bit:operator&(Bit:oper2, PlayerArray:oper1)
 {
-	P:3("YSI_gAPAFunc called: %s, %i", Bit_Display(Bit:data[1]), start);
-	static const
-		scDeBruijn[] =
-			{
-				0,  1,  28, 2,  29, 14, 24, 3,  30, 22, 20, 15, 25, 17, 4,  8,
-				31, 27, 13, 23, 21, 19, 16, 7,  26, 12, 18, 6,  11, 5,  10, 9
-			};
-	++start;
-	YSI_gAPAFunc_loop:
-	new
-		cur,
-		i = Bit_Slot(start) + 1;
-	if ((cur = (_:data[i] & (~((1 << start) - 1)))))
-	{
-		new
-			ret = ((i - 1) * cellbits) + scDeBruijn[((cur & -cur) * 0x077CB531) >>> 27];
-		// I'd like to replace this with code which doesn't call
-		// IsPlayerConnected and doesn't use "goto", but it avoids massive tail
-		// recursion (well, it is tail recursion which I've inlined).
-		if (PS_IS_PLAYER_CONNECTED(ret))
-		{
-			return ret;
-		}
-		else
-		{
-			//return YSI_gAPAFunc(data, ret);
-			start = ret + 1;
-			goto YSI_gAPAFunc_loop;
-		}
-	}
-	++i;
-	while (i != bits<MAX_PLAYERS> + 1)
-	{
-		if ((cur = _:data[i]))
-		{
-			new
-				ret = ((i - 1) * cellbits) + scDeBruijn[((cur & -cur) * 0x077CB531) >>> 27];
-			if (PS_IS_PLAYER_CONNECTED(ret))
-			{
-				return ret;
-			}
-			else
-			{
-				//return YSI_gAPAFunc(data, ret);
-				start = ret + 1;
-				goto YSI_gAPAFunc_loop;
-			}
-		}
-		++i;
-	}
-	return -1;
+	#pragma unused oper1
+	return oper2;
 }
 
-//#define YSI_gAPA(%0)[%1] YSI_gAPAFunc(%0,%1)
-//#define YSI_gSPS YSI_gSPA
-//#define YSI_gAPS YSI_gAPA
+stock Bit:operator|(Bit:oper2, PlayerArray:oper1)
+{
+	#pragma unused oper1
+	return oper2 & Bit_Mask(_:oper1);
+}*/
 
-//#define PA(%0)_YSII_Sg;_:%1!=-1;%2=_Y_ITER_ARRAY:%8PA(%3)_YSII_Ag[%4] YSI_gSPAFunc(%0);_:%1!=-1;%2=YSI_gAPAFunc(%3,%4)
+//#define PA%0(%1,%2) (Bit:(%1[Bit_Slot(%2)+1]%0=PlayerArray:(%2))&Bit_Mask(%2))
+#define PA%0(%1,%2) (%1[Bit_Slot(%2)+1]%0=PlayerArray:(%2))
 
-#undef PlayerArray
+/*stock PA_Set(PlayerArray:array<>, slot, bool:set, count = bitsof (array))
+{
+	if (slot >= count) return;
+	if (set) array[Bit_Slot(slot) + 1] |= Bit_Mask(slot);
+	else array[Bit_Slot(slot) + 1] &= ~Bit_Mask(slot);
+}*/
 
+#undef PlayerArray
 #define PlayerArray:%0<%1> Bit:%0[bits<%1>+1]//={Bit:-1}

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 16 - 1027
pawno/include/YSI/y_stringhash.inc


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 126 - 202
pawno/include/YSI/y_td.inc


+ 44 - 182
pawno/include/YSI/y_testing.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					====================================
 					 y_testing - Run unit tests easilly 
 					====================================
@@ -17,17 +17,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI testing include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -42,10 +42,9 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
@@ -53,144 +52,57 @@ Changelog:
 		Integrated in to YSI.
 	06/08/10:
 		First version
-\*----------------------------------------------------------------------------*/
-
-/*#if defined _inc_a_samp || defined _samp_included || defined _inc_y_version
-	#error y_testing must be the VERY FIRST include in your mode if being used.
-#endif
-
-// Now we redefined "native" to do something clever!
-// "IsPlayerAttachedObjectSlotUsed" is an issue for us...
-
-// "y_renative" allows native functions to be declared without constantly trying
-// to redefine it.
-#include "internal\y_renative"
-
-#define native%0(%1); _YSI_NO_TAG_NATIVE:_YSI_RE_NATIVE<%0@|||%1|||%0>_YSI_RE_STOCK<%0|||%1|||_:%0@>
-
-//stock%0(%1){printf(_:_YSI_NO_SQUARE:"native "#%0" called");return _:%0@(%1);}
-
-#define _YSI_RE_STOCK<%0|||%1|||%2> stock%0(%1){print(_:_YSI_NO_SQUARE:"native "#%0" called");return %2(%1);}
-
-#define _YSI_NO_SQUARE:%0);%1(%2[%3]%4);} _YSI_NO_SQUARE:%0);%1(%2%4);}
-
-//#define _YSI_NO_TAG_NATIVE:_YSI_RE_NATIVE<%0:%1|||%2|||%3:%4>%5{%6;%7:%8:%9} _YSI_RE_NATIVE<%1|||%2|||%4>%5{%6;return%8:%9}
-#define _YSI_NO_TAG_NATIVE:_YSI_RE_NATIVE<%0:%1|||%2|||%3:%4>_YSI_RE_STOCK<%5:%6|||%7|||_:%8:%9> _YSI_RE_NATIVE<%1|||%2|||%4>_YSI_RE_STOCK<%5:%6|||%7|||%8:%9>
+-*----------------------------------------------------------------------------*/
 
-#include <a_samp>*/
+#include <YSI\internal\y_version>
 
-#include "internal\y_version"
+#include <YSI\y_scripting>
+#include <YSI\y_debug>
 
-#include "y_amx"
-#include "internal\y_shortfunc"
-#include "y_debug"
-
-#include "y_va"
-
-#include "internal\y_natives"
-
-#if defined INCLUDE_TESTS
-	#define RUN_TESTS
-	#define Debug_PrintT va_printf
-#elseif defined RUN_TESTS
-	#define _AUTO_RUN_TESTS
-	#define Debug_PrintT va_printf
-#else
+#if !defined RUN_TESTS
 	#if _DEBUG > 0 || defined _YSI_SPECIAL_DEBUG
 		#define RUN_TESTS
-		#define _AUTO_RUN_TESTS
-		//#if defined _YSI_SPECIAL_DEBUG
-		//	#define TP printf
-		//	//#define TC(%0); %0
-		#define Debug_PrintT va_printf
-		//#else
-		//	//#define TP P:0
-		//	//#define TC C:0
-		//#endif
+		#if defined _YSI_SPECIAL_DEBUG
+			#define TP printf
+			#define TC(%0); %0
+		#else
+			#define TP P:1
+			#define TC C:1
+		#endif
 	#else
-		#define Debug_PrintT(%0);
-	//	#define Tests:%1() stock bool:Tests_@%1()
-	//	#define Test:%1() stock bool:Test_@%1()
-	//	#define TestInit:%1() stock Init_@%1()
-	//	#define TestClose:%1() stock Shut_@%1()
+		#define Tests:%1() stock bool:Tests_@%1()
+		#define Test:%1() stock bool:Test_@%1()
+		#define TestInit:%1() stock Init_@%1()
+		#define TestClose:%1() stock Shut_@%1()
 	#endif
 #endif
 
-#define TEST_TRUE(%0)  Testing_Test(!!%0)
-#define TEST_FALSE(%0) Testing_Test(!%0)
-#define TEST_NULL(%0)  Testing_Test(0 == %0)
-#define TEST_NOT_NULL(%0)  Testing_Test(0 != %0)
-#define TEST_N(%0,%1)  Testing_Test(%1 == %0)
+#define TEST_TRUE(%0)  Testing_Test(bool:(%0))
+#define TEST_FALSE(%0) Testing_Test(!(%0))
+#define TEST_NULL(%0)  Testing_Test((%0) == 0)
+#define TEST_N(%0,%1)  Testing_Test((%0) == (%1))
 
 #define TEST_TRUE_EX(%0,%2)  Testing_Test(bool:(%0), (%2))
 #define TEST_FALSE_EX(%0,%2) Testing_Test(!(%0), (%2))
 #define TEST_NULL_EX(%0,%2)  Testing_Test((%0) == 0, (%2))
 #define TEST_N_EX(%0,%1,%2)  Testing_Test((%0) == (%1), (%2))
 
-#define TEST_MSG "\2\2\2\2\2"
-#define TEST_FAILED "FAIL:"
-#define TEST_PASSED "PASS!"
-//#define TEST_FAILED "*** Test Failed:"
-//#define TEST_PASSED "*** Test Passed:"
-
-#define _Y_TESTEQ(%0) "\"%0\"")
-#define _Y_TESTDQ:_Y_TESTEQ(%0"%1"%2) _Y_TESTDQ:_Y_TESTEQ(%0\x22;%1\x22;%2)
-//#define _Y_TESTCB:_Y_TESTDQ:_Y_TESTEQ(%0)%1) _Y_TESTCB:_Y_TESTDQ:_Y_TESTEQ(%0\x29;%1)
-#define _Y_TESTCB:_Y_TESTDQ:_Y_TESTEQ(%0)%1) _Y_TESTCB:_Y_TESTDQ:_Y_TESTEQ(%0\x29;%1)
-#define _Y_TESTOB:_Y_TESTCB:_Y_TESTDQ:_Y_TESTEQ(%0(%1) _Y_TESTOB:_Y_TESTCB:_Y_TESTDQ:_Y_TESTEQ(%0\x28;%1)
-
-#define ASSERT(%0) Testing_Test(%0,TEST_MSG" %s", _Y_TESTOB:_Y_TESTCB:_Y_TESTDQ:_Y_TESTEQ(%0)
-#define ASSERT_TRUE(%0) ASSERT(!!%0) //Testing_Test(!!%0,__name)
-#define ASSERT_FALSE(%0) ASSERT(!%0) //Testing_Test(!%0,__name)
-#define ASSERT_NULL(%0) ASSERT(0 == %0) //Testing_Test(0==%0,__name)
-#define ASSERT_N:%1(%0) ASSERT(%1 == %0) //Testing_Test(%1==%0,__name)
-
 static stock
 	YSI_g_sTests,
 	YSI_g_sFails;
 
-stock Testing_Test(bool:x, str[] = "", va_args<>)
+stock Testing_Test(bool:x, const str[] = "")
 {
-	P:3("Testing_Test called: %i, \"%s\"", x, str);
 	++YSI_g_sTests;
 	if (!x)
 	{
 		++YSI_g_sFails;
-		if (numargs() == 2)
-		{
-			P:T(TEST_FAILED " %s", va_start<1>);
-			//printf("*** Test failed: %s", str);
-		}
-		else
-		{
-			if (str[0] == '\2')
-			{
-				strunpack(str, !TEST_FAILED, 6);
-				str[5] = ' ';
-			}
-			P:T(str, va_start<2>);
-		}
-	}
-	else /*if (numargs() == 2)
-	{
-		P:T(TEST_PASSED " %s", va_start<1>);
-	}
-	else
-	{
-		P:T(str, va_start<2>);
-		if (str[0] == '\2')
-		{
-			strunpack(str, !TEST_PASSED, 17);
-			str[16] = ' ';
-		}
-		printf(str);
-		P:T(str, va_start<2>);*/
-	{
-		P:T(TEST_PASSED, va_start<2>);
+		TP("*** Test failed: %s", str);
 	}
+	TC(else printf("*** Test passed: %s", str););
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	Testing_Run
 Params:
@@ -204,20 +116,18 @@ Notes:
 
 native Testing_Run(&tests, &fails, buffer[33] = "");
 
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock bool:Testing_Run(&tests, &fails, lastfail[33] = "", bool:p = false)
 {
-	P:3("bool:Testing_Run called: %i, %i, \"%s\", %i", tests, fails, lastfail, p);
 	#pragma unused p
 	#if defined RUN_TESTS
-		P:2("Testing_Run() called");
+		P:3("Testsing_Run() called");
 		new
 			idx,
 			buffer[32];
-		while ((idx = AMX_GetPublicName(idx, buffer, "Test_@")))
+		while ((idx = Scripting_GetPublic(idx, buffer, "Test_@")))
 		{
-			strunpack(buffer, buffer);
 			++YSI_g_sTests;
 			// Call the setup function if there is one.
 			buffer[0] = 'I';
@@ -230,7 +140,7 @@ stock bool:Testing_Run(&tests, &fails, lastfail[33] = "", bool:p = false)
 			buffer[1] = 'e';
 			buffer[2] = 's';
 			buffer[3] = 't';
-			P:5("Testing_Run(): Calling %s", buffer[6]);
+			TP("Testsing_Run(): Calling %s", buffer[6]);
 			if (!CallLocalFunction(buffer, ""))
 			{
 				if (YSI_g_sFails)
@@ -244,7 +154,7 @@ stock bool:Testing_Run(&tests, &fails, lastfail[33] = "", bool:p = false)
 					while ((lastfail[fails] = buffer[fails + 6])) ++fails;
 					YSI_g_sFails = 1;
 				}
-				//TC(if (p) printf("*** Test failed: %s", buffer[fails + 6]););
+				TC(if (p) printf("*** Test failed: %s", buffer[fails + 6]););
 			}
 			// Call the shutdown function if there is one.
 			buffer[0] = 'S';
@@ -253,9 +163,8 @@ stock bool:Testing_Run(&tests, &fails, lastfail[33] = "", bool:p = false)
 			buffer[3] = 't';
 			CallLocalFunction(buffer, "");
 		}
-		while ((idx = AMX_GetPublicName(idx, buffer, "Tezt_@")))
+		while ((idx = Scripting_GetPublic(idx, buffer, "Tezt_@")))
 		{
-			strunpack(buffer, buffer);
 			//++YSI_g_sTests;
 			// Call the setup function if there is one.
 			buffer[0] = 'I';
@@ -269,7 +178,7 @@ stock bool:Testing_Run(&tests, &fails, lastfail[33] = "", bool:p = false)
 			buffer[2] = 'z';
 			buffer[3] = 't';
 			fails = YSI_g_sFails;
-			P:5("Testing_Run(): Calling %s", buffer[6]);
+			TP("Testsing_Run(): Calling %s", buffer[6]);
 			CallLocalFunction(buffer, "");
 			/*if (YSI_g_sFails != fails)
 			{
@@ -303,71 +212,24 @@ stock bool:Testing_Run(&tests, &fails, lastfail[33] = "", bool:p = false)
 }
 
 #if defined RUN_TESTS
-	#define Test:%1() forward bool:Tezt_@%1(); public bool:Tezt_@%1() for(new string:__name[]=#%1,bool:__once=(printf("*** Test %s start", __name) || TRUE);__once;__once=(printf(" ") && FALSE))
-	#define Tests:%1() forward bool:Test_@%1(); public bool:Test_@%1() for(new string:__name[]=#%1,bool:__once=(printf("*** Test %s start", __name) || TRUE);__once;__once=(printf(" ") && FALSE))
-	#define TestInit:%1() forward Init_@%1(); public Init_@%1() for(new string:__name[]=#%1,bool:__once=TRUE;__once;__once=(printf(" ", __name) && FALSE))
-	#define TestClose:%1() forward Shut_@%1(); public Shut_@%1() for(new string:__name[]=#%1,bool:__once=TRUE;__once;__once=(printf(" ", __name) && FALSE))
-	
-	#if defined _AUTO_RUN_TESTS
+	#define Tests:%1() forward bool:Tezt_@%1(); public bool:Tezt_@%1()
+	#define Test:%1() forward bool:Test_@%1(); public bool:Test_@%1()
+	#define TestInit:%1() forward Init_@%1(); public Init_@%1()
+	#define TestClose:%1() forward Shut_@%1(); public Shut_@%1()
+	#if _DEBUG > 0 || defined _YSI_SPECIAL_DEBUG
 		#if !defined FILTERSCRIPT
 			// Hook main in gamemodes.
 			main()
 			{
-				// Disable error messages (as we're likely to generate them).
-				state ysi_debug : off;
-				CallLocalFunction("Testing_main", "");
 				new
 					tests,
 					fails;
-				printf(" ");
-				printf("  ||===================||  ");
-				printf("  || STARTING TESTS... ||  ");
-				printf("  ||===================||  ");
-				printf(" ");
 				Testing_Run(tests, fails, _, true);
 				printf("*** Tests: %d, Fails: %d", tests, fails);
-				if (!fails)
-				{
-					printf(" ");
-					printf("  ||===================||  ");
-					printf("  || ALL TESTS PASSED! ||  ");
-					printf("  ||===================||  ");
-					printf(" ");
-				}
-				state ysi_debug : on;
+				Testing_main();
 			}
 			
-			#define main forward Testing_main(); public Testing_main
+			#define main Testing_main
 		#endif
-	#else
-		Testing_RunAll()
-		{
-			// Disable error messages (as we're likely to generate them).
-			state ysi_debug : off;
-			new
-				tests,
-				fails;
-			printf(" ");
-			printf("  ||===================||  ");
-			printf("  || STARTING TESTS... ||  ");
-			printf("  ||===================||  ");
-			printf(" ");
-			Testing_Run(tests, fails, _, true);
-			printf("*** Tests: %d, Fails: %d", tests, fails);
-			if (!fails)
-			{
-				printf(" ");
-				printf("  ||===================||  ");
-				printf("  || ALL TESTS PASSED! ||  ");
-				printf("  ||===================||  ");
-				printf(" ");
-			}
-			state ysi_debug : on;
-		}
 	#endif
-#else
-	#define Tests:%1() stock bool:Tests_@%1()
-	#define Test:%1() stock bool:Test_@%1()
-	#define TestInit:%1() stock Init_@%1()
-	#define TestClose:%1() stock Shut_@%1()
 #endif

+ 170 - 417
pawno/include/YSI/y_timers.inc

@@ -1,12 +1,11 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					  ====================================
 					   y_timers - Run timers efficiently. 
 					  ====================================
 Description:
 	Sets up repeating timers without requiring any SetTimers and arranges them
 	so that they will be very unlikely to meet (at least for a long time) using
-	scheduling algorithms to get timers with the same period to be offset.  Also
-	fixes arrays and strings in timers so they can be passed properly.
+	scheduling algorithms to get timers with the same period to be offset.
 Legal:
 	Version: MPL 1.1
 	
@@ -20,17 +19,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI timers include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -45,17 +44,12 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
-	2.0
+	1.0
 Changelog:
-	29/04/11:
-		Added version 2 of the code with more advanced options.
-	21/03/11:
-		Added debug printing to timer functions.  Uses "P:C" in compiling.
 	26/10/10:
 		Officially added simple calling.
 		Added "delay" functions.
@@ -66,446 +60,205 @@ Changelog:
 		Added pickups.
 	03/08/07:
 		First version.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-// Disable this version!
-#if defined USE_Y_TIMERS_V1
-	
-	#include "internal\y_timersold"
-	#endinput
-	
-#endif
 
-#include "internal\y_version"
-#include "y_amx"
-#include "internal\y_shortfunc"
-#include "y_malloc"
-#include "y_iterate"
-// This will be called twice and means there are two separate OnScriptInit
-// functions in this file.
-#include "y_hooks"
-#include "y_debug"
+#include <YSI\internal\y_shortfunc>
 
-#define task%0[%1](%2) %0@yT_(g,p);public%0@yT_(g,p){static s=-1;return _Timer_I(#%0,%1,g,s);}%0();public%0()
+#include <YSI\y_scripting>
+#include <YSI\y_debug>
 
-#define ptask%0[%1](%2) stock %0_yT@=1;%0@yT_(g,p);public%0@yT_(g,p){static s[MAX_PLAYERS]={-1,...},a[2];return _Timer_D(#%0@_yT,%1,g,p,s,%0_yT@,a);}%0@_yT(p);public%0@_yT(p)if(%0_yT@)%0(p);%0(%2)
+//#define Timer:%0[%1](%2) forward @yT_%1_%0();@yT_%1_%0()
+#define Timer:%0[%1](%2) forward @yT_%1_%0();stock %0() @yT_%1_%0();@yT_%1_%0()
 
-#define pause%0; {J@=_:@Ym:%0@yT_(0,-1);}
-#define resume%0; {J@=_:@Ym:%0@yT_(1,-1);}
-#define @Ym:%0:%1@yT_(%2,-1) %0@yT_(%2,%1)
+#define Delay:%0[%1,%2](%3) stock %0(%3)return O@(#@#%0,%1,0,#%2#x,%3);stock v@%0(_:_o@,%3)return O@(#@#%0,_o@,0,#%2#x,%3);forward @%0(%3);@%0(%3)
 
-static stock
-	Alloc:YSI_g_sLastSlot = NO_ALLOC,
-	Alloc:YSI_g_sFirstSlot = NO_ALLOC,
-	YSI_g_sPlayerTimers = -1;
+#define FixDelay:%0[%1,%2](%3) stock %0(%3)return O@("@_"#%0,%1,0,#%2#x,%3);forward @_%0(%3);@_%0(%3)
+// There's a bug in passing strings to timer functions, so I've remove it.
+//#define Delay@p:%0[%1,%2](%3)<%4> stock %0(%3)return O@(#@#%0,%1,0,#%2,%4);stock v@%0(_o@,%3)return O@(#@#%0,_o@,0,#%2,%4);forward @%0(%3);@%0(%3)
 
-hook OnScriptInit()
-{
-	P:1("hook Timers_OnScriptInit called");
-	new
-		pointer,
-		time,
-		idx,
-		entry;
-	while ((idx = AMX_GetPublicEntrySuffix(idx, entry, _A<@yT_>)))
-	//while ((idx = AMX_GetPublicPointerSuffix(idx, pointer, _A<@yT_>)))
-	{
-		P:6("Timer_OnScriptInit: entry: %d", entry);
-		#emit LREF.S.pri entry
-		#emit STOR.S.pri pointer
-		//YSI_g_sCurFunc = pointer;
-		// Don't bother with the real name, call the function by address to get
-		// the time the function runs for.
-		P:7("Timer_OnScriptInit: pointer: %d", pointer);
-		// Push the address of the current function.
-		#emit PUSH.S     pointer
-		#emit PUSH.C     0xFFFFFFFF
-		#emit PUSH.C     8
-		#emit LCTRL      6
-		#emit ADD.C      28
-		#emit PUSH.pri
-		#emit LOAD.S.pri pointer
-		#emit SCTRL      6
-		#emit STOR.S.pri time
-		//YSI_g_sCurFunc = 0;
-		P:7("Timer_OnScriptInit: time: %d", time);
-		if (time != -1)
-		{
-			// Find all the functions with the same time.  This is less
-			// efficient than previous implementations (it is O(N^2)), but also
-			// more robust as it won't fail no matter how many different times
-			// there are - old ones relied on an array with a finite size.
-			new
-				pointer2,
-				time2,
-				idx2,
-				total,
-				pre;
-			while ((idx2 = AMX_GetPublicPointerSuffix(idx2, pointer2, _A<@yT_>)))
-			{
-				// Call the functions a second time to guarantee getting
-				#emit PUSH.C     0
-				#emit PUSH.C     0xFFFFFFFF
-				#emit PUSH.C     8
-				#emit LCTRL      6
-				#emit ADD.C      28
-				#emit PUSH.pri
-				#emit LOAD.S.pri pointer2
-				#emit SCTRL      6
-				#emit STOR.S.pri time2
-				if (time2 == time)
-				{
-					++total;
-					if (idx2 < idx)
-					{
-						++pre;
-					}
-				}
-			}
-			P:7("Timer_OnScriptInit: total: %d, time: %d, pre: %d", total, time, pre);
-			// Now we know what time this function has, how many others have
-			// that time and how many have already been started.
-			new
-				buffer[32];
-			entry += 4;
-			#emit LREF.S.pri entry
-			#emit STOR.S.pri pointer
-			AMX_ReadString(AMX_BASE_ADDRESS + pointer, buffer);
-			P:7("Timer_OnScriptInit: %s", unpack(buffer));
-			// Get the time offset for the current call.  This should mean that
-			// all the functions are nicely spread out.
-			SetTimerEx(buffer, time * pre / total, 0, "ii", 1, -1);
-		}
-	}
-	P:1("hook Timers_OnScriptInit ended");
-}
+#define skip:%0(%3) @%0(%3)
+#define delay:%0[%1](%3) v@%0(_:%1,%3)
 
-hook OnPlayerConnect(playerid)
-{
-	P:1("hook Timers_OnPlayerConnect called: %d", playerid);
-	// Loop through all the per-player timers.  Correctly finds them all from a
-	// linked list hidden in static variables (which are really global).
-	new
-		cur = YSI_g_sPlayerTimers,
-		data;
-	while (cur != -1)
-	{
-		#emit LREF.S.pri  cur
-		#emit STOR.S.pri  data
-		P:6("Timers_OnPlayerConnect: func: %x", data);
-		// Start this timer for this player.
-		#emit PUSH.S     playerid
-		#emit PUSH.C     1
-		// Push the parameter count (in bytes).  This is actually passed to
-		// native functions directly.
-		#emit PUSH.C     8
-		// Call the function currently in the list to trigger the repeating
-		// timer.  This involves getting the current "cip" address, modifying it
-		// to get the return address then modifying "cip" to call the function.
-		#emit LCTRL      6
-		#emit ADD.C      28
-		#emit PUSH.pri
-		#emit LOAD.S.pri data
-		#emit SCTRL      6
-		// Returned, get the next list element.
-		cur += 4;
-		#emit LREF.S.pri  cur
-		#emit STOR.S.pri  cur
-	}
-	P:1("hook Timers_OnPlayerConnect ended");
-}
+// This defines the number of different periods that timers can have.  This
+// number is a HUGE over-estimate, you would need to have over 256 timers, none
+// of them with the same period, for this number to be too small!
+#define MAX_TIMER_VARIATIONS            (256)
 
-hook OnPlayerDisconnect(playerid, reason)
-{
-	P:1("hook Timers_OnPlayerDisconnect called: %d, %d, playerid, reason");
-	// Loop through all the per-player timers.  Correctly finds them all from a
-	// linked list hidden in static variables (which are really global).
-	new
-		cur = YSI_g_sPlayerTimers,
-		data;
-	while (cur != -1)
-	{
-		#emit LREF.S.pri  cur
-		#emit STOR.S.pri  data
-		P:6("Timers_OnPlayerDisconnect: func: %x", data);
-		// End this timer for this player.
-		#emit PUSH.S     playerid
-		#emit PUSH.C     0
-		// Push the parameter count (in bytes).  This is actually passed to
-		// native functions directly.
-		#emit PUSH.C     8
-		// Call the function currently in the list to trigger the repeating
-		// timer.  This involves getting the current "cip" address, modifying it
-		// to get the return address then modifying "cip" to call the function.
-		#emit LCTRL      6
-		#emit ADD.C      28
-		#emit PUSH.pri
-		#emit LOAD.S.pri data
-		#emit SCTRL      6
-		// Returned, get the next list element.
-		cur += 4;
-		#emit LREF.S.pri  cur
-		#emit STOR.S.pri  cur
-	}
-	P:1("hook Timers_OnPlayerDisconnect ended");
-}
+forward Timer_Start(timer, delay);
+
+/*----------------------------------------------------------------------------*-
+Function:
+	OnScriptInit
+Params:
+	-
+Return:
+	-
+Notes:
+	-
+-*----------------------------------------------------------------------------*/
 
-stock _Timer_I(func[], interval, action, &result)
+#if defined FILTERSCRIPT
+	public OnFilterScriptInit()
+#else
+	public OnGameModeInit()
+#endif
 {
-	P:3("_Timer_I called");
-	switch (action)
+	new
+		buffer[32],
+		idx = 0,
+		timers[MAX_TIMER_VARIATIONS][2],//[3],
+		periods = 0;
+	// 0 = time, 1 = count, 2 = offset.
+	// First loop - get all the different periods.
+	// Get the list of timers from the list of publics.
+	while ((idx = Scripting_GetPublicFast(idx, buffer, (Scripting_FastString('@', 'y', 'T', '_')))))
 	{
-		case 0:
+		// Get the time associated with the timer.  We know this starts at index
+		// position 4, because we always set it to be there.
+		new
+			time = strval(buffer[4]);
+		if (time)
 		{
-			if (result != -1)
+			// Valid time, find this in the array.
+			for (new i = 0; ; ++i)
 			{
-				KillTimer(result),
-				result =- 1;
+				if (i == periods)
+				{
+					timers[i][0] = time;
+					timers[i][1] = 1;
+					++periods;
+					break;
+				}
+				else if (timers[i][0] == time)
+				{
+					++timers[i][1];
+					break;
+				}
 			}
-		}
-		case 1:
-		{
-			if (result == -1)
+			if (periods == MAX_TIMER_VARIATIONS)
 			{
-				result = SetTimer(func, interval, 1);
+				P:1("*** Internal Error: Timer array full");
+				break;
 			}
 		}
 	}
-	return interval;
-}
-
-// Attempt to stop or start a task, possibly for a single player.
-stock _Timer_D(func[], interval, const action, who, results[MAX_PLAYERS], &pp, a[2])
-{
-	P:3("_Timer_D called");
-	switch (action)
+	// Group timers with common periods together, for example timers with 1000
+	// and 500ms periods need to be interleaved so they don't run at the same
+	// time very often.  Obviously ANY combination of timers will eventually run
+	// at the same time at some point, but we can reduce this chance.
+	/*for (new i = 0; i != periods; ++i)
 	{
-		case -1:
-		{
-			if (who)
-			{
-				a[0] = who;
-				a[1] = YSI_g_sPlayerTimers;
-				// Store the address of the global array.
-				#emit LOAD.S.pri  a
-				#emit STOR.pri    YSI_g_sPlayerTimers
-			}
-		}
-		case 0:
+		new
+			time = timers[i][0];
+		if (timers[i][2])
 		{
-			// Stop the timer.
-			if (who == -1)
+			for (new j = 0; j != i; ++j)
 			{
-				pp = 0;
-			}
-			else if (results[who] != -1)
-			{
-				KillTimer(results[who]);
-				results[who] = -1;
+				new
+					ct = timers[j][0];
+				if ((time / ct) * ct == time || (ct / time) * time == ct)
+				{
+					// Set the count to the same as the master.
+					timers[i][1] = timers[j][1];
+					break;
+				}
 			}
 		}
-		case 1:
+		else
 		{
-			// Start the timer.
-			if (who == -1)
-			{
-				pp = 1;
-			}
-			else if (results[who] == -1)
+			new
+				offset = timers[i][1];
+			for (new j = i + 1; j != periods; ++j)
 			{
-				results[who] = SetTimerEx(func, interval, true, "i", who);
+				// Find similar periods.
+				new
+					ct = timers[j][0];
+				if ((time / ct) * ct == time)
+				{
+					// This time is larger.
+				}
+				else if ((ct / time) * time == ct)
+				{
+				}
+				if ((time / ct) * ct == time || (ct / time) * time == ct)
+				{
+					// That's integer division, so valid code.  Mark this
+					// element as controlled by another element.
+					timers[j][2] = offset;
+					offset += timers[j][1];
+				}
 			}
+			timers[i][1] = offset;
 		}
-	}
-	// No global interval for per-player timers.
-	return -1;
-}
-
-static stock Alloc:Timer_GetSingleSlot(len)
-{
-	// Allocates memory and secretly appends data to the start.
-	P:4("Timer_GetSingleSlot called: %d", len);
-	new
-		Alloc:slot = malloc(len + 1);
-	if (slot == NO_ALLOC)
-	{
-		return NO_ALLOC;
-	}
-	P:5("Timer_GetSingleSlot: %d, %d, %d", _:YSI_g_sFirstSlot, _:YSI_g_sLastSlot, _:slot);
-	// Standard linked list.
-	if (YSI_g_sFirstSlot == NO_ALLOC)
-	{
-		YSI_g_sFirstSlot = slot;
-	}
-	else
-	{
-		mset(YSI_g_sLastSlot, 0, _:slot);
-	}
-	YSI_g_sLastSlot = slot;
-	mset(YSI_g_sLastSlot, 0, -1);
-	return slot;// + Alloc:1;
-}
-
-// Allocate memory to store a string.
-stock _Timer_S(string:str[])
-{
-	P:3("_Timer_S called");
-	new
-		len = strlen(str);
-	if (len & 0x0F)
-	{
-		len = (len & ~0x0F) + 32;
-	}
-	new
-		Alloc:slot = Timer_GetSingleSlot(len + 1);
-	if (slot != NO_ALLOC)
-	{
-		msets(slot, 1, str);
-	}
-	P:5("str: %d", _:slot);
-	return _:slot + 1;
-}
-
-// Allocate memory to store an array.
-stock _Timer_A(str[], len)
-{
-	P:3("_Timer_A called");
-	new
-		Alloc:slot = Timer_GetSingleSlot(len);
-	if (slot != NO_ALLOC)
-	{
-		mseta(slot, 1, str, len);
-	}
-	P:5("str: %d", _:slot);
-	return _:slot + 1;
-}
-
-//stock
-//	I@ = -1;
-
-// Create the timer setup.
-stock _Timer_C(tt, g)
-{
-	P:3("_Timer_C called: %d, %d", tt, g);
-	//P:3("_Timer_C called: %d", tt);
-	// This is done here for convenience.
-	I@ = -1;
-	// Only repeating timers are freed like this.
-	// UPDATE: Now all timers with array parameters, regardless of repeat status
-	// are freed like this.  Only timers with no malloc aren't.
-	if (g)
+	}*/
+	C:1(for(new i;i!=periods;++i)printf("%d %d %d",timers[i][0],timers[i][1],0););//,timers[i][2]););
+	// Now we know how many of each period there are we can try arrange them so
+	// that they execute at very different times.
+	// [1] contains the total number of timers on similar periods.
+	for (new i = 0; i != periods; ++i)
 	{
+		// First calculate the gap between the timers.
 		new
-			Alloc:slot = Timer_GetSingleSlot(1);
-		P:5("_Timer_C: slot = %d", _:slot);
-		if (slot == NO_ALLOC)
-		{
-			// Not a graceful fail!
-			return 0;
-		}
-		mset(slot, 1, tt);
-		// Just so it isn't a real timer ID (or possibly isn't).
-		slot = ~YSI_g_sFirstSlot;// ^ Alloc:-1;
-		YSI_g_sFirstSlot = NO_ALLOC;
-		YSI_g_sLastSlot = NO_ALLOC;
-		return _:slot;
-	}
-	// Reset these variables on all timers, including self-cleaning ones.
-	YSI_g_sFirstSlot = NO_ALLOC;
-	YSI_g_sLastSlot = NO_ALLOC;
-	return tt;
-}
-
-// Free all timer resources.
-stock _Timer_F(slot)
-{
-	P:3("_Timer_F called");
-	// This is done here for convenience.
-	if (slot & 0x80000000)
-	{
+			time = timers[i][0],
+			offset = time / timers[i][1];
+		// Now start all the timers with this time at that offset.
+		idx = 0;
 		new
-			next;
-		slot = ~slot; //^= -1;
-		for ( ; ; )
+			last = 0,
+			curo = offset;
+		while ((idx = Scripting_GetPublicFast(idx, buffer, (Scripting_FastString('@', 'y', 'T', '_')))))
 		{
-			next = mget(Alloc:slot, 0);
-			P:6("_Timer_F: slot = %d, next = %d", slot, next);
-			// Out of stored strings and arrays.
-			if (next == -1)
+			if (strval(buffer[4]) == time)
 			{
-				KillTimer(mget(Alloc:slot, 1));
-				free(Alloc:slot);
-				break;
+				// That's the old start code, which uses 7ms offsets to try get
+				// as close as possible to different server frames (5ms).
+				SetTimerEx("Timer_Start", curo + (random(14) - 7), 0, "ii", last, time);
+				//SetTimerEx("Timer_Start", curo, 0, "ii", last, time);
+				curo += offset;
 			}
-			free(Alloc:slot);
-			slot = next;
+			// So that the first found timer in the next function is correct.
+			last = idx;
 		}
 	}
-	else
-	{
-		KillTimer(slot);
-	}
-	return 1;
+	CallLocalFunction("Timers_OnScriptInit", "");
 }
 
-stock _Timer_H(slot)
+#if defined FILTERSCRIPT
+	#if defined _ALS_OnFilterScriptInit
+		#undef OnFilterScriptInit
+	#else
+		#define _ALS_OnFilterScriptInit
+	#endif
+	#define OnFilterScriptInit Timers_OnScriptInit
+#else
+	#if defined _ALS_OnGameModeInit
+		#undef OnGameModeInit
+	#else
+		#define _ALS_OnGameModeInit
+	#endif
+	#define OnGameModeInit Timers_OnScriptInit
+#endif
+
+forward Timers_OnScriptInit();
+
+/*----------------------------------------------------------------------------*-
+Function:
+	Timer_Start
+Params:
+	timer - Approximate public function index.
+	delay - How often it's called.
+Return:
+	-
+Notes:
+	Only needed for more than one timer.  Offsets calls from each other for
+	better server load distribution.
+-*----------------------------------------------------------------------------*/
+
+public Timer_Start(timer, delay)
 {
-	_Timer_F(~(slot - 1));
+	new
+		buffer[32];
+	Scripting_GetPublicFast(timer, buffer, (Scripting_FastString('@', 'y', 'T', '_')));
+	SetTimer(buffer, delay, 1);
 }
-
-// These are the tag-type definitions for the various possible parameter types.
-// Array-like definitions.
-#define @Yf:@Yg:@Yh:#%0#%1|||%3[%4]|||%5,%6;%8>%9||| @Ye:@Yw:#%0#%1|||%3[%4]|||%5,%6;%9|||
-
-#define @Ye:@Yw:#%0#%1|||%2string:%3[%4]|||%5,%6;%9||| @Yf:@Yg:@Yh:#%0d#%1,_Timer_S(%3)|||%5|||%6;1>%9,@Yv&%3&|||
-
-// This one has an extra parameter because arrays must always be followed by
-// their length.
-#define @Yw:#%0#%1|||%3[%4]|||%5,%6,%7;%9||| @Yf:@Yg:@Yh:#%0d#%1,_Timer_A(%3,%5)|||%5|||%6,%7;1>%9,@Yv&%3&|||
-
-// Tag-like definitions.
-#define @Yg:@Yh:#%0#%1|||%2:%3|||%5,%6;%8>%9||| @Yf:@Yg:@Yh:#%0d#%1,%2:%3|||%5|||%6;%8>%9,%2:%3|||
-
-// Others.
-#define @Yh:#%0#%1|||%3|||%5,%6;%8>%9||| @Yf:@Yg:@Yh:#%0d#%1,%3|||%5|||%6;%8>%9,%3|||
-
-// Main entry point for defer type determination.
-#define _YT@CR:%0,%1)%8>%2||| @Yf:@Yg:@Yh:#i#,@Yx:J@|||%0|||%1;%8>%2|||
-
-// Define for "defer" with timer, parameters and main function.
-#define YSI_timer%0[%1]%3(%2) stock%0_yT@(%2)return _Timer_C(O@(#%0@_yT,(I@==-1)?(%1):I@,J@,_YT@CR:%2,,)0>%0|||%0|||(%2)
-
-// Expand additional parameters out to three functions after processing.
-//#define @Yx:%0||||||;%1,%2|||%4||| %0),1);@Yu:%1@_yT(%2);public @Yu:%1@_yT(%2){%4(%2);}%4
-#define @Yx:%0||||||;%8>%1,%2|||%4||| %0),%8);@Yj:%1@_yT(__r,%2);public @Yj:%1@_yT(__r,%2){%4(%2);}%4
-
-// Can't believe I never thought of this before!  If only there was a way to
-// make it less generic than "id".
-#define id#,@Yx:J@,||||||;%8>%1,%2|||%4||| ),0);%1@_yT();public%1@_yT(){%4();}%4
-
-// Remove excess "_Timer_G" and "_Timer_B".
-#define @Yj:%0(%5){%1(%8&%2&%3)%9} @Yj:%0(%5){%1(%8:YSI_gMallocMemory[%2]%3);@Yl(@Yk:%2)%9}
-//#define @Yu:%0{%1(%8&%2&%3)%9} @Yu:%0{%1(%8:YSI_gMallocMemory[%2]%3)%9}
-#define @Yv&%0& %0
-
-//#define @Yk:%0);@Yl(@Yk:%1); %0,@Yk:%1);
-// I'm not entirely sure why this works in reverse order, but I'm glad it does!
-#define @Yk:%0);@Yl(@Yk:%1); @Yk:%0);
-#define @Yl if(!__r)_Timer_F
-
-//#define string:
-
-#define defer%0(%1) (J@=0,I@=-1,Timer:%0_yT@(%1))
-
-#define repeat%0(%1) (J@=1,I@=-1,Timer:%0_yT@(%1))
-
-// Custom time.
-#define Timer:%0[%1]_yT@(%2) I@=%1,Timer:%0_yT@(%2)
-
-#define stop%0; {_Timer_F(_:%0);}
-
-#define timerfunc YSI_timer
-
-#if !defined YSI_NO_timer
-	#define timer YSI_timer
-#endif

+ 34 - 368
pawno/include/YSI/y_utils.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					=================================
 					Y Sever Includes - Misc Functions
 					=================================
@@ -17,17 +17,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI utils include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -42,19 +42,12 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	0.1.3
 Changelog:
-	06/10/12:
-		Upgraded "memset" to use "FILL".
-	22/12/11:
-		Changed "ceildiv" to only evaluate arguments once.
-	05/12/11:
-		Added NO_VALUE to test if macros have no value.
 	08/09/10:
 		Added strcpy and StripNL.
 	08/08/10:
@@ -72,31 +65,11 @@ Variables:
 		TRUE - True hack for infinate loops.
 		FALSE - False hack for one-time loops.
 		NULL - 1 long string for passing via Call(Remote|Local)Function.
-\*----------------------------------------------------------------------------*/
-
-#include "internal\y_version"
+-*----------------------------------------------------------------------------*/
 
-#include "y_debug"
-#include "y_amx"
+#include <YSI\internal\y_version>
 //#tryinclude <sscanf>
 
-/*// "File,Float," must remain last always.
-#if defined CUSTOM_TAG_TYPES
-	#define File,Float, Float,File,CUSTOM_TAG_TYPES
-#else
-	#define File,Float, Float,File
-#endif*/
-// Add new tags to the START of this list.
-#include "internal\y_globaltags"
-
-// VERY VERY VERY IMPORTANT!!! y_inline uses "130" instead of "YSI_MAX_STRING"
-// for two lines (one is "520" for "130 * 4").
-#define YSI_MAX_STRING                  (130)
-
-#define FUNCTION_LENGTH                 (32)
-
-#define NO_VALUE(%0) ((2*%0-1+1)==-1)
-
 #if !defined TRUE
 new stock
 	bool:TRUE = true;
@@ -110,61 +83,9 @@ new stock
 	NULL[2] = {1, 0};
 #endif
 
-// Define "volatile" as nothing.
-#if !defined volatile
-	#define volatile
-#endif
-
-#define YSIM_MASTER #M
-
-#define YSIM_RETURN #R
-
-#define YSIM_CALLER #C
-
-#define YSIM_TEXT_D #T
-#define YSIM_TEXT_L #L
-#define YSIM_TEXT_S #Y
-#define YSIM_TEXT_P #Z
-
-#define YSIM_ORDERS #O
-
-#define YSIM_HFIRST #H
-
-#define YSIM_OPDRET #D
-
-#define YSIM_TXTFND #X
-
-#define YSIM_TXTIND #I
-
-#define YSIM_TXTLEN #E
-
-#define YSIM_LOG_IN #U
-
-#if !defined YSIM_STRING
-	#define YSIM_STRING (42)
-#endif
-
-#define FLOAT_INFINITY                  (Float:0x7F800000)
-#define FLOAT_NEG_INFINITY              (Float:0xFF800000)
-#define FLOAT_NEGATIVE_INFINITY         (Float:0xFF800000)
-#define FLOAT_NAN                       (Float:0x7FFFFFFF)
-#define FLOAT_NOT_A_NUMBER              (Float:0x7FFFFFFF)
-#define FLOAT_QNAN                      (Float:0x7FFFFFFF)
-#define FLOAT_QUIET_NAN                 (Float:0x7FFFFFFF)
-#define FLOAT_QUIET_NOT_A_NUMBER        (Float:0x7FFFFFFF)
-#define FLOAT_SNAN                      (Float:0x7FBFFFFF)
-#define FLOAT_SIGNALING_NAN             (Float:0x7FBFFFFF)
-#define FLOAT_SIGNALING_NOT_A_NUMBER    (Float:0x7FBFFFFF)
-
 //#pragma unused TRUE, FALSE, NULL
 
-#define ceildiv(%0,%1) \
-	(((%0)-1)/(%1)+1)
-
-#define floordiv(%0,%1) \
-	((%0)/(%1))
-
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	isnull
 Params:
@@ -173,14 +94,14 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #if !defined isnull
 	#define isnull(%1) \
 		((%1[0] == 0) || (%1[0] == 1 && %1[1] == 0))
 #endif
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	isodd
 Params:
@@ -189,12 +110,12 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define isodd(%1) \
 	((%1) & 1)
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	iseven
 Params:
@@ -203,29 +124,29 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define iseven(%1) \
 	(!isodd(%1))
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	strcpy
 Params:
 	dest - Destination string.
 	src - Source string.
-	len - (Implicit) maximum length of the destination.
+	len - Maximum length of the destination.
 Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-#define strcpy(%0,%1) \
-	strcat((%0[0] = '\0', %0), %1)
+#define strcpy(%0,%1,%2) \
+	strcat((%0[0] = '\0', %0), %1, %2)
 //	memcpy(%0,%1,0,strlen(%1)*4+4,%2)
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	StripNL
 Params:
@@ -234,17 +155,16 @@ Return:
 	-
 Notes:
 	Updated from old versions, should be more efficient
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock StripNL(str[])
 {
-	P:3("StripNL called: \"%s\"", str);
 	new
 		i = strlen(str);
 	while (i-- && str[i] <= ' ') str[i] = '\0';
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	endofline
 Params:
@@ -254,17 +174,15 @@ Return:
 	-
 Notes:
 	Checks if the current point in a line is the end of non-whitespace data.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock endofline(line[], pos)
 {
-	P:3("endofline called: \"%s\", %i", line, pos);
-	if (pos < 0 || pos > strlen(line)) return 0;
 	while (line[pos]) if (line[pos++] > ' ') return 0;
 	return 1;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	chrfind
 Params:
@@ -275,34 +193,19 @@ Return:
 	Fail - -1, Success - pos
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock chrfind(needle, haystack[], start = 0)
 {
-	P:3("chrfind called: %c, \"%s\", %i", needle, haystack, start);
 	if (start < 0)
 	{
 		start = 0;
 	}
-	else if (start > strlen(haystack)) return -1;
 	while (haystack[start]) if (haystack[start++] == needle) return start - 1;
 	return -1;
 }
 
-//#define chrfind(%0'%1'%2,%3) str
-
-stock chrfindp(needle, haystack[], start = 0)
-{
-	P:3("chrfind called: %c, \"%s\", %i", needle, haystack, start);
-	if (start < 0)
-	{
-		start = 0;
-	}
-	while (haystack{start}) if (haystack{start++} == needle) return start - 1;
-	return -1;
-}
-
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	bernstein
 Params:
@@ -322,7 +225,7 @@ Notes:
 	
 	I modified it slightly from the original code pasted by aru, to code
 	closer to the code http://www.burtleburtle.net/bob/hash/doobs.html and
-	to work with PAWN (and shaved 0.2�s off the time for one call :D).
+	to work with PAWN (and shaved 0.2µs off the time for one call :D).
 	
 	Uber reduced version (just for fun):
 	b(s[]){new h=-1,i,j;while((j=s[i++]))h=h*33+j;return h;}
@@ -331,11 +234,10 @@ Notes:
 	strings for the updated text system involving file based styling and this
 	is not checked for collisions as it's unimportant.  But this doesn't affect
 	the function at all, I just mentioned it here for "interest".
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock bernstein(string[])
 {
-	P:3("bernstein called: \"%s\"", string);
 	new
 		hash = -1,
 		i,
@@ -343,12 +245,11 @@ stock bernstein(string[])
 	while ((j = string[i++]))
 	{
 		hash = hash * 33 + j;
-		//printf("Hash stage %d: %d", i - 1, hash);
 	}
 	return hash;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	ishex
 Params:
@@ -357,11 +258,10 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock ishex(str[])
 {
-	P:3("ishex called: \"%s\"", str);
 	new
 		i,
 		cur;
@@ -375,86 +275,7 @@ stock ishex(str[])
 	return 1;
 }
 
-/*----------------------------------------------------------------------------*\
-Function:
-	unpack
-Params:
-	str[] - String to unpack
-Return:
-	unpacked string
-Notes:
-	Mainly used for debugging.
-\*----------------------------------------------------------------------------*/
-
-stock unpack(const str[])
-{
-	P:3("unpack called: \"%s\"", str);
-	new
-		ret[YSI_MAX_STRING] = {0};
-	if (strlen(str) <= YSI_MAX_STRING)
-	{
-		strunpack(ret, str);
-	}
-	return ret;
-}
-
-/*----------------------------------------------------------------------------*\
-Function:
-	GetIP
-Params:
-	playerid - Player to get IP of.
-Return:
-	IP as a 32bit int.
-Notes:
-	-
-\*----------------------------------------------------------------------------*/
-
-stock GetIP(playerid)
-{
-	new
-		ip[16];
-	GetPlayerIp(playerid, ip, sizeof (ip));
-	new
-		ipv = strval(ip) << 24,
-		pos = 0;
-	while (pos < 15 && ip[pos++] != '.') {}
-	ipv += strval(ip[pos]) << 16;
-	while (pos < 15 && ip[pos++] != '.') {}
-	ipv += strval(ip[pos]) << 8;
-	while (pos < 15 && ip[pos++] != '.') {}
-	ipv += strval(ip[pos]);
-	return ipv;
-}
-
-/*----------------------------------------------------------------------------*\
-Function:
-	getstring
-Params:
-	addr - Address of the string on the heap.
-Return:
-	string
-Notes:
-	Is passed the result of getarg, which will be the address of a string (in
-	theory) and uses that for DMA to get the string.
-\*----------------------------------------------------------------------------*/
-
-stock getstring(addr)
-{
-	new
-		ret[YSI_MAX_STRING];
-	va_getstring(ret, addr);
-	return ret;
-}
-
-stock getstringarg(addr)
-{
-	new
-		ret[YSI_MAX_STRING];
-	va_getstring(ret, addr);
-	return ret;
-}
-
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	isnumeric
 Params:
@@ -463,11 +284,10 @@ Return:
 	-
 Notes:
 	Checks if a given string is numeric.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock isnumeric(str[])
 {
-	P:3("isnumeric called: \"%s\"", str);
 	new
 		ch,
 		i;
@@ -493,7 +313,7 @@ stock isnumeric(str[])
 			ret,
 			val,
 			i;
-		if (string[0] == '0' && string[1] | 0x20 == 'x') i = 2;
+		if (string[0] == '0' && (string[1] == 'x' || string[1] == 'X')) i = 2;
 		while (string[i])
 		{
 			ret <<= 4;
@@ -545,7 +365,7 @@ stock isnumeric(str[])
 		{
 			case '0':
 			{
-				if (string[1] | 0x20 == 'b')
+				if (string[1] == 'b' || string[1] == 'B')
 				{
 					pos = 2;
 				}
@@ -581,157 +401,3 @@ stock isnumeric(str[])
 		return value;
 	}
 #endif
-
-/*----------------------------------------------------------------------------*\
-Function:
-	memset
-	rawMemset
-Params:
-	arr[], iAddress - Array or address to set to a value.
-	iSize - Number of cells to fill.
-	iValue - What to set the cells to.
-Return:
-	-
-Notes:
-	Based on code by Slice:
-	
-	http://forum.sa-mp.com/showthread.php?p=1606781#post1606781
-	
-	Modified to use binary flags instead of a loop.
-	
-	"memset" takes an array, the size of the array, and a value to fill it with
-	and sets the whole array to that value.
-	
-	"rawmemset" is similar, but takes an AMX data segment address instead and
-	the size is in bytes, not cells.
-\*----------------------------------------------------------------------------*/
-
-stock memset(arr[], size = sizeof (arr), val = 0)
-{
-	new
-		addr;
-	#emit LOAD.S.pri arr
-	#emit STOR.S.pri addr
-	// Convert the size from cells to bytes.
-	rawMemset(addr, size * 4, val);
-	return 0;
-}
-
-stock rawMemset(iAddress, iSize, iValue)
-{
-	// Loop until there are only little bits left to fill.
-	while (iSize >= 4096)
-	{
-		// I have to do this because the FILL instruction doesn't accept a
-		// dynamic number.
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 4096
-		iSize    -= 4096;
-		iAddress += 4096;
-	}
-	if (iSize & 2048)
-	{
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 2048
-		iAddress += 2048;
-	}
-	if (iSize & 1024)
-	{
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 1024
-		iAddress += 1024;
-	}
-	if (iSize & 512)
-	{
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 512
-		iAddress += 512;
-	}
-	if (iSize & 256)
-	{
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 256
-		iAddress += 256;
-	}
-	if (iSize & 128)
-	{
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 128
-		iAddress += 128;
-	}
-	if (iSize & 64)
-	{
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 64
-		iAddress += 64;
-	}
-	if (iSize & 32)
-	{
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 32
-		iAddress += 32;
-	}
-	if (iSize & 16)
-	{
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 16
-		iAddress += 16;
-	}
-	if (iSize & 8)
-	{
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 8
-		iAddress += 8;
-	}
-	if (iSize & 4)
-	{
-		#emit LOAD.S.alt iAddress
-		#emit LOAD.S.pri iValue
-		#emit FILL 4
-		iAddress += 4;
-	}
-}
-
-#if !defined ReturnPlayerName
-	stock ReturnPlayerName(playerid)
-	{
-		new
-			str[MAX_PLAYER_NAME];
-		GetPlayerName(playerid, str, sizeof (str));
-		return str;
-	}
-#endif
-
-stock ftouch(const filename[])
-{
-	if (fexist(filename))
-	{
-		return 0;
-	}
-	else
-	{
-		new
-			File:f = fopen(filename, io_write);
-		if (f)
-		{
-			fclose(f);
-			return 1;
-		}
-		else
-		{
-			return -1;
-		}
-	}
-}
-
-#include "y_va"

+ 95 - 324
pawno/include/YSI/y_xml.inc

@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 					=============================
 					 y_xml - XML file functions!
 					=============================
@@ -25,17 +25,17 @@ Legal:
 	for the specific language governing rights and limitations under the
 	License.
 	
-	The Original Code is the YSI XML include.
+	The Original Code is the SA:MP script information include.
 	
 	The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-	Portions created by the Initial Developer are Copyright (C) 2011
+	Portions created by the Initial Developer are Copyright (C) 2008
 	the Initial Developer. All Rights Reserved.
 	
 	Contributors:
-		ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
+		ZeeX, koolk
 	
 	Thanks:
-		JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
+		Peter, Cam - Support.
 		ZeeX - Very productive conversations.
 		koolk - IsPlayerinAreaEx code.
 		TheAlpha - Danish translation.
@@ -50,25 +50,22 @@ Legal:
 		Matite - Pestering me to release it and using it.
 	
 	Very special thanks to:
-		Thiadmer - PAWN, whose limits continue to amaze me!
+		Thiadmer - PAWN.
 		Kye/Kalcor - SA:MP.
 		SA:MP Team past, present and future - SA:MP.
-	
 Version:
 	1.0
 Changelog:
 	06/08/10:
 		First version
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
-#include "internal\y_version"
+#include <YSI\internal\y_version>
 
 #include <a_samp>
 
-#include "y_debug"
-#include "y_utils"
-
-#include "internal\y_natives"
+#include <YSI\y_debug>
+#include <YSI\y_utils>
 
 #if !defined MAX_XML_FILES
 	#define MAX_XML_FILES               (5)
@@ -78,19 +75,19 @@ Changelog:
 
 #define NO_XML_FILE                     (XML:-1)
 
-#define MAX_XML_FUNCTION                FUNCTION_LENGTH
 #define MAX_XML_ENTRY_NAME              (32)
 #define MAX_XML_ENTRY_TEXT              (80)
+#define MAX_XML_FUNCTION                (32)
 
-#define XML_BUFFER_SIZE                 (512)
+#define XML_BUFFER_SIZE                 (64)
 
 #define MAX_XML_HANDLERS                (16)
 
-#if !defined XML_WRITE_BUFFER_SIZE
-	#define XML_WRITE_BUFFER_SIZE           (512)
-#endif
+#define XML_WRITE_BUFFER_SIZE           (170)
 
-#define XML_NO_WRITE (XMLEntry:cellmax)
+#if !defined MAX_STRING
+	#define MAX_STRING                  (512)
+#endif
 
 enum E_XML_PARA
 {
@@ -122,7 +119,7 @@ static stock
 	YSI_g_sCurBuffer = -1,
 	YSI_g_sEndTag = 0;
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_IsValid
 Params:
@@ -131,12 +128,12 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define XML_IsValid(%1) \
 	((%1) >= XML:0 && (%1) < XML_MAX_XML_FILES && YSI_g_sCurHandler[(%1)] != -1)
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_IsChar
 Params:
@@ -145,12 +142,12 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define XML_IsChar(%1) \
 	(((%1) >= 'a' && (%1) <= 'z') || ((%1) >= 'A' && (%1) <= 'Z') || ((%1) >= '0' && (%1) <= '9') || (%1 == '_'))
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_New
 Params:
@@ -159,20 +156,20 @@ Return:
 	XML
 Notes:
 	Creates a new set of rules for parsing XML files.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML:XML_New()
 {
-	P:3("XML:XML_New called");
 	new
 		XML:i;
 	while (i < XML_MAX_XML_FILES && YSI_g_sCurHandler[i] != -1) i++;
 	if (i == XML_MAX_XML_FILES) return NO_XML_FILE;
 	YSI_g_sCurHandler[i] = 0;
+	YSI_g_sCurBuffer = 0;
 	return i;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_Destroy
 Params:
@@ -181,18 +178,17 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_Destroy(XML:rule)
 {
-	P:3("XML_Destroy called: %i", _:rule);
 	if (!XML_IsValid(rule)) return 0;
 	YSI_g_sCurBuffer = -1;
 	YSI_g_sCurHandler[rule] = -1;
 	return 1;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_Parse
 Params:
@@ -201,25 +197,22 @@ Params:
 Return:
 	-
 Notes:
-	Now supports self-closing tags and XML comments.
-\*----------------------------------------------------------------------------*/
+	-
+-*----------------------------------------------------------------------------*/
 
 stock XML_Parse(XML:rule, filename[])
 {
-	P:3("XML_Parse called: %i, \"%s\"", _:rule, filename);
 	if (!XML_IsValid(rule)) return 0;
-	YSI_g_sCurBuffer = 0;
 	new
 		File:xFile = fopen(filename);
 	if (xFile)
 	{
 		new
-			line[YSI_MAX_STRING],
+			line[MAX_STRING],
 			tagCount,
 			gotLastValue,
 			inClose,
 			inOpen,
-			inComment,
 			value[MAX_XML_ENTRY_TEXT],
 			name[MAX_XML_ENTRY_NAME],
 			inPar;
@@ -229,28 +222,13 @@ stock XML_Parse(XML:rule, filename[])
 			new
 				pos,
 				ch;
-			if (inComment)
-			{
-				pos = strfind(line, "-->", false, 0);
-				if (pos == -1)
-				{
-					// Skip this whole line.
-					continue;
-				}
-				else
-				{
-					pos += 3;
-					inComment = 0;
-				}
-			}
 			while ((ch = line[pos]) && ch <= ' ') pos++;
 			while (ch)
 			{
 				if (ch <= ' ') pos++;
 				else if (ch == '<')
 				{
-					pos++;
-					if (line[pos] == '/')
+					if (line[++pos] == '/')
 					{
 						pos++;
 						tagCount--;
@@ -269,26 +247,11 @@ stock XML_Parse(XML:rule, filename[])
 						}
 						inClose = 1;
 					}
-					else if (line[pos] == '!' && line[pos + 1] == '-' && line[pos + 2] == '-')
-					{
-						// XML comments.
-						pos = strfind(line, "-->", false, pos + 3);
-						if (pos == -1)
-						{
-							inComment = 1;
-							break;
-						}
-						else
-						{
-							pos += 3;
-						}
-					}
 					else
 					{
 						inOpen = 1;
 						tagCount++;
 						while ((ch = line[pos]) && XML_IsChar(ch)) pos++;
-						//name = XML_GetName(line, pos);
 					}
 					gotLastValue = 0;
 					inPar = 0;
@@ -300,27 +263,6 @@ stock XML_Parse(XML:rule, filename[])
 					inClose = 0;
 					pos++;
 				}
-				else if (ch == '/')
-				{
-					// Self-closing tags (FINALLY)!
-					pos++;
-					if (inOpen)
-					{
-						tagCount--;
-						inOpen = strfind(line, "<") + 1;
-						if (inOpen)
-						{
-							name = XML_GetName(line, inOpen);
-							value = XML_ParseTag(rule, name, tagCount);
-							if (value[0] && tagCount > 1)
-							{
-								XML_Push(name, value, tagCount);
-							}
-							inOpen = 0;
-						}
-						inClose = 1; // Well, we sort of are...
-					}
-				}
 				else if (inPar)
 				{
 					value = XML_GetValue(line, pos);
@@ -332,10 +274,7 @@ stock XML_Parse(XML:rule, filename[])
 					value = XML_GetParameter(line, pos);
 					XML_Push(name, value, tagCount);
 				}
-				else
-				{
-					pos++;
-				}
+				else pos++;
 				ch = line[pos];
 			}
 		}
@@ -345,7 +284,7 @@ stock XML_Parse(XML:rule, filename[])
 	return 0;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_Push
 Params:
@@ -357,27 +296,20 @@ Return:
 Notes:
 	Pushes an identifier and it's value (either explicitaly stated or returned
 	from another function) to the stack with basic parent info.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_Push(name[], text[], depth)
 {
-	P:3("XML_Push called: \"%s\", \"%s\", %i, %i", name, text, depth, YSI_g_sCurBuffer);
 	if (YSI_g_sCurBuffer < XML_BUFFER_SIZE && YSI_g_sCurBuffer >= 0)
 	{
-		P:7("XML_Push: first");
 		strcpy(YSI_g_sParameters[YSI_g_sCurBuffer][E_XML_PARA_NAME], name, MAX_XML_ENTRY_NAME);
-		P:7("XML_Push: second");
 		strcpy(YSI_g_sParameters[YSI_g_sCurBuffer][E_XML_PARA_VALUE], text, MAX_XML_ENTRY_TEXT);
-		P:7("XML_Push: third");
 		YSI_g_sParameters[YSI_g_sCurBuffer][E_XML_PARA_LEVEL] = depth;
-		P:7("XML_Push: fourth");
-		++YSI_g_sCurBuffer;
-		P:7("XML_Push: fifth");
+		YSI_g_sCurBuffer++;
 	}
-	P:5("XML_Push: YSI_g_sCurBuffer = %d", YSI_g_sCurBuffer);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_GetParameter
 Params:
@@ -388,11 +320,10 @@ Return:
 Notes:
 	Gets the data from inside ""s in an identifier.  Now supports
 	\ for escape characters.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_GetParameter(line[], &pos)
 {
-	P:3("XML_GetParameter called: \"%s\", %i", line, pos);
 	new
 		ch,
 		ret[MAX_XML_ENTRY_TEXT],
@@ -455,7 +386,7 @@ stock XML_GetParameter(line[], &pos)
 	return ret;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_GetValue
 Params:
@@ -465,11 +396,10 @@ Return:
 	-
 Notes:
 	Gets the text between tags.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_GetValue(line[], &pos)
 {
-	P:3("XML_GetValue called: \"%s\", %i", line, pos);
 	new
 		ch,
 		ret[MAX_XML_ENTRY_TEXT],
@@ -484,7 +414,7 @@ stock XML_GetValue(line[], &pos)
 	return ret;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_GetName
 Params:
@@ -494,11 +424,10 @@ Return:
 	-
 Notes:
 	Gets the identifier of a piece of data.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_GetName(line[], &pos)
 {
-	P:3("XML_GetName called: \"%s\", %i", line, pos);
 	new
 		ch,
 		ret[MAX_XML_ENTRY_NAME],
@@ -513,7 +442,7 @@ stock XML_GetName(line[], &pos)
 	return ret;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_ParseTag
 Params:
@@ -524,11 +453,10 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_ParseTag(XML:rule, name[], tagCount)
 {
-	P:3("XML_ParseTag called: %i, \"%s\", %i", _:rule, name, tagCount);
 	new
 		i,
 		j = YSI_g_sCurHandler[rule],
@@ -542,30 +470,19 @@ stock XML_ParseTag(XML:rule, name[], tagCount)
 		}
 		i++;
 	}
-	P:5("XML_ParseTag: Check %d != %d", i, j);
 	if (i != j)
 	{
 		//format(ret, sizeof (ret), "%d", CallLocalFunction(YSI_g_sHandlers[rule][i][E_XML_HANDLER_FUNCTION], ""));
 		valstr(ret, CallLocalFunction(YSI_g_sHandlers[rule][i][E_XML_HANDLER_FUNCTION], ""));
 	}
-	while (YSI_g_sCurBuffer-- && YSI_g_sParameters[YSI_g_sCurBuffer][E_XML_PARA_LEVEL] > tagCount)
+	while (YSI_g_sCurBuffer)
 	{
-		P:3("XML_ParseTag item: %d %s %d", YSI_g_sCurBuffer, YSI_g_sParameters[YSI_g_sCurBuffer][E_XML_PARA_NAME], YSI_g_sParameters[YSI_g_sCurBuffer][E_XML_PARA_LEVEL]);
-		//--YSI_g_sCurBuffer;
+		if (YSI_g_sParameters[--YSI_g_sCurBuffer][E_XML_PARA_LEVEL] <= tagCount) break;
 	}
-	++YSI_g_sCurBuffer;
-	/*while (YSI_g_sCurBuffer)
-	{
-		if (YSI_g_sParameters[--YSI_g_sCurBuffer][E_XML_PARA_LEVEL] <= tagCount)
-		{
-			++YSI_g_sCurBuffer;
-			break;
-		}
-	}*/
 	return ret;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_GetKeyValue
 Params:
@@ -575,79 +492,26 @@ Return:
 	Data found.
 Notes:
 	Pops items off the stack for use in custom functions.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_GetKeyValue(key[], value[])
 {
-	P:3("XML_GetKeyValue called: \"%s\", \"%s\"", key, value);
 	key[0] = 1;
 	key[1] = 0;
 	value[0] = 1;
 	value[1] = 0;
-	P:5("XML_GetKeyValue: YSI_g_sCurBuffer: %d", YSI_g_sCurBuffer);
 	if (YSI_g_sCurBuffer)
 	{
-		--YSI_g_sCurBuffer;
-		if (YSI_g_sParameters[YSI_g_sCurBuffer][E_XML_PARA_LEVEL] <= YSI_g_sEndTag)
-		{
-			++YSI_g_sCurBuffer;
-			return 0;
-		}
-		P:5("XML_GetKeyValue: first");
+		YSI_g_sCurBuffer--;
+		if (YSI_g_sParameters[YSI_g_sCurBuffer][E_XML_PARA_LEVEL] <= YSI_g_sEndTag) return 0;
 		strcpy(key, YSI_g_sParameters[YSI_g_sCurBuffer][E_XML_PARA_NAME], MAX_XML_ENTRY_NAME);
-		P:5("XML_GetKeyValue: second");
 		strcpy(value, YSI_g_sParameters[YSI_g_sCurBuffer][E_XML_PARA_VALUE], MAX_XML_ENTRY_TEXT);
-		P:3("XML_GetKeyValue ending: \"%s\", \"%s\"", key, value);
 		return 1;
 	}
 	return 0;
 }
 
-/*----------------------------------------------------------------------------*\
-Function:
-	XML_GetParentValue
-Params:
-	key[] - Name of the parameter to get.
-	value[] - Variable to return value in.
-Return:
-	Data found.
-Notes:
-	Does no poping, just searches for a value with the right name at the right
-	depth so children can use the data if they HAVE to.
-\*----------------------------------------------------------------------------*/
-
-stock XML_GetParentValue(const key[], value[])
-{
-	P:3("XML_GetParentValue called: \"%s\"", key);
-	value[0] = 1;
-	value[1] = 0;
-	P:7("XML_GetParentValue: first");
-	//P:C(for (new i = 0; i != YSI_g_sCurBuffer; ++i) P:0("XML_GetParentValue: buffer[%d] = %s", i, YSI_g_sParameters[i][E_XML_PARA_NAME]););
-	for (new i = 0; i != YSI_g_sCurBuffer; ++i)
-	{
-		P:7("XML_GetParentValue: second %d %d %d", i, YSI_g_sParameters[i][E_XML_PARA_LEVEL], YSI_g_sEndTag);
-		if (YSI_g_sParameters[i][E_XML_PARA_LEVEL] == YSI_g_sEndTag)
-		{
-			P:7("XML_GetParentValue: 2b: %s %s", key, YSI_g_sParameters[i][E_XML_PARA_NAME]);
-			if (!strcmp(key, YSI_g_sParameters[i][E_XML_PARA_NAME]))
-			{
-				P:7("XML_GetParentValue: third");
-				strcpy(value, YSI_g_sParameters[i][E_XML_PARA_VALUE], MAX_XML_ENTRY_TEXT);
-				return 1;
-			}
-		}
-		else if (YSI_g_sParameters[i][E_XML_PARA_LEVEL] > YSI_g_sEndTag)
-		{
-			P:7("XML_GetParentValue: fourth");
-			// In to child data.
-			return 0;
-		}
-	}
-	P:7("XML_GetParentValue: fifth");
-	return 0;
-}
-
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_AddHandler
 Params:
@@ -658,11 +522,10 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_AddHandler(XML:rule, trigger[], function[])
 {
-	P:3("XML_AddHandler called: %i, \"%s\", \"%s\"", _:rule, trigger, function);
 	new
 		handle;
 	if (!XML_IsValid(rule) || (handle = YSI_g_sCurHandler[rule]) >= MAX_XML_HANDLERS && handle >= 0) return 0;
@@ -672,7 +535,7 @@ stock XML_AddHandler(XML:rule, trigger[], function[])
 	return 1;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_RemoveHandler
 Params:
@@ -682,11 +545,10 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_RemoveHandler(XML:rule, trigger[])
 {
-	P:3("XML_RemoveHandler called: %i, \"%s\"", _:rule, trigger);
 	if (XML_IsValid(rule))
 	{
 		for (new i = 0, j = YSI_g_sCurHandler[rule]; i < j; i++)
@@ -707,7 +569,7 @@ stock XML_RemoveHandler(XML:rule, trigger[])
 	return 0;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_AddParameter
 Params:
@@ -718,12 +580,11 @@ Return:
 	-
 Notes:
 	-
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 //#define XML_AddSubEntry XML_AddParameter
 stock XMLEntry:XML_AddParameter(XMLEntry:parent, tag[], value[] = "")
 {
-	P:3("XMLEntry:XML_AddParameter called: %i, \"%s\", \"%s\"", _:parent, tag, value);
 	if (_:parent < YSI_g_sXMLWritePointer < XML_WRITE_BUFFER_SIZE)
 	{
 		strcpy(YSI_g_sXMLWriteBuffer[YSI_g_sXMLWritePointer][E_XML_WRITE_TAG], tag, MAX_XML_ENTRY_NAME);
@@ -736,7 +597,7 @@ stock XMLEntry:XML_AddParameter(XMLEntry:parent, tag[], value[] = "")
 	return XMLEntry:cellmax;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_AddItem
 Params:
@@ -748,13 +609,12 @@ Notes:
 	Starts the creation of a new tag to be written to a file, the structure
 	has to be manually created then written.  There is no buffering of multiple
 	tags before writing as a single tag can have quite a bit of data.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define XML_CreateEntry XML_AddItem
 #define XML_AddSubEntry XML_AddItem
 stock XMLEntry:XML_AddItem(tag[], name[] = "", XMLEntry:parent = XMLEntry:cellmax)
 {
-	P:3("XMLEntry:XML_AddItem called: \"%s\", \"%s\", %i", tag, name, _:parent);
 	if (_:parent != cellmax)
 	{
 		return XML_AddParameter(parent, tag, name);
@@ -770,24 +630,21 @@ stock XMLEntry:XML_AddItem(tag[], name[] = "", XMLEntry:parent = XMLEntry:cellma
 	return XMLEntry:cellmax;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_WriteItem
 Params:
 	filename[] - File to write to.
 	item - Handle to the tag to write.
-	bool:bIncludeXML - Write the default <XML> tags or not?
-	bool:bFavourShort - Write the shortest tags possible.
 Return:
 	-
 Notes:
 	Writea the data for a tag to a file.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 #define XML_WriteEntry XML_WriteItem
-stock XML_WriteItem(filename[], XMLEntry:item, bool:bIncludeXML = true, bool:bFavourShort = false)
+stock XML_WriteItem(filename[], XMLEntry:item)
 {
-	P:3("XML_WriteItem called: \"%s\", %i", filename, _:item);
 	if (_:item < YSI_g_sXMLWritePointer)
 	{
 		new
@@ -796,14 +653,14 @@ stock XML_WriteItem(filename[], XMLEntry:item, bool:bIncludeXML = true, bool:bFa
 		{
 			new
 				File:fHnd = fopen(filename, io_read),
-				File:__ftemp = ftemp();//fopen("_temp_ysi_user_file_.ysi", io_write);
-			if (fHnd && __ftemp)
+				File:fTemp = ftemp();//fopen("_temp_ysi_user_file_.ysi", io_write);
+			if (fHnd && fTemp)
 			{
 				new
-					str[YSI_MAX_STRING];
+					str[MAX_STRING];
 				while (fread(fHnd, str))
 				{
-					fwrite(__ftemp, str);
+					fwrite(fTemp, str);
 					if (!data)
 					{
 						new
@@ -812,25 +669,24 @@ stock XML_WriteItem(filename[], XMLEntry:item, bool:bIncludeXML = true, bool:bFa
 						while ((ch = str[i++]) && ch <= ' ') {}
 						if (ch == '<')
 						{
-							if (bFavourShort) XML_WriteItemDataShort(_:item, __ftemp, 2);
-							else XML_WriteItemData(_:item, __ftemp, 2);
+							XML_WriteItemData(_:item, fTemp, 2);
 							data = 1;
 						}
 					}
 				}
 				fclose(fHnd);
-				//fclose(__ftemp);
+				//fclose(fTemp);
 				fremove(filename);
 				if (data)
 				{
 					fHnd = fopen(filename, io_write);
-					fseek(__ftemp);
-					//__ftemp = fopen("_temp_ysi_user_file_.ysi", io_read);
-					if (fHnd)// && __ftemp)
+					fseek(fTemp);
+					//fTemp = fopen("_temp_ysi_user_file_.ysi", io_read);
+					if (fHnd)// && fTemp)
 					{
-						while (fread(__ftemp, str)) fwrite(fHnd, str);
+						while (fread(fTemp, str)) fwrite(fHnd, str);
 						fclose(fHnd);
-						fclose(__ftemp);
+						fclose(fTemp);
 						//fremove("_temp_ysi_user_file_.ysi");
 						YSI_g_sXMLWritePointer = _:item;
 						return 1;
@@ -841,9 +697,9 @@ stock XML_WriteItem(filename[], XMLEntry:item, bool:bIncludeXML = true, bool:bFa
 			{
 				fclose(fHnd);
 			}
-			if (__ftemp)
+			if (fTemp)
 			{
-				fclose(__ftemp);
+				fclose(fTemp);
 				//fremove("_temp_ysi_user_file_.ysi");
 			}
 		}
@@ -853,10 +709,9 @@ stock XML_WriteItem(filename[], XMLEntry:item, bool:bIncludeXML = true, bool:bFa
 				File:fHnd = fopen(filename, io_write);
 			if (fHnd)
 			{
-				if (bIncludeXML) fwrite(fHnd, "<XML>\r\n");
-				if (bFavourShort) XML_WriteItemDataShort(_:item, fHnd, _:bIncludeXML * 2);
-				else XML_WriteItemData(_:item, fHnd, _:bIncludeXML * 2);
-				if (bIncludeXML) fwrite(fHnd, "</XML>");
+				fwrite(fHnd, "<XML>\r\n");
+				XML_WriteItemData(_:item, fHnd, 2);
+				fwrite(fHnd, "</XML>");
 				fclose(fHnd);
 				YSI_g_sXMLWritePointer = _:item;
 				return 1;
@@ -866,7 +721,7 @@ stock XML_WriteItem(filename[], XMLEntry:item, bool:bIncludeXML = true, bool:bFa
 	return 0;
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_WriteItemData
 Params:
@@ -877,25 +732,22 @@ Return:
 	-
 Notes:
 	Recursive function to write a tag and it's children to a file.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 static stock XML_WriteItemData(item, File:fHnd, depth)
 {
-	P:4("XML_WriteItemData called: %i, %i, %i", item, _:fHnd, depth);
 	new
-		str[YSI_MAX_STRING],
+		str[MAX_STRING],
 		i = YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_CHILDREN];
 	if (i == -1)
 	{
 		format(str, sizeof (str), "%*s<%s>%s</%s>\n", depth, "", YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_TAG], YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_VALUE], YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_TAG]);
 		fwrite(fHnd, str);
-		P:7("XML_WriteItemData: writing %s", str);
 	}
 	else
 	{
 		if (YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_VALUE][0]) format(str, sizeof (str), "%*s<%s name=\"%s\">\n", depth, "", YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_TAG], YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_VALUE]);
 		else format(str, sizeof (str), "%*s<%s>\n", depth, "", YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_TAG]);
-		P:7("XML_WriteItemData: writing %s", str);
 		fwrite(fHnd, str);
 		depth += 2;
 		while (i != -1)
@@ -905,90 +757,11 @@ static stock XML_WriteItemData(item, File:fHnd, depth)
 		}
 		depth -= 2;
 		format(str, sizeof (str), "%*s</%s>\n", depth, "", YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_TAG]);
-		P:7("XML_WriteItemData: writing %s", str);
-		fwrite(fHnd, str);
-	}
-}
-
-/*----------------------------------------------------------------------------*\
-Function:
-	XML_WriteItemDataShort
-Params:
-	item - Item to write data for.
-	File:fHnd - File to write to.
-	depth - Current indentation.
-Return:
-	-
-Notes:
-	Recursive function to write a tag and it's children to a file.  Writes tags
-	in the shortest manner possible.  This does make it slower however (not much
-	though given the use of linked lists).
-\*----------------------------------------------------------------------------*/
-
-static stock XML_WriteItemDataShort(item, File:fHnd, depth)
-{
-	P:4("XML_WriteItemDataShort called: %i, %i, %i", item, _:fHnd, depth);
-	new
-		str[YSI_MAX_STRING],
-		i = YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_CHILDREN];
-	if (i == -1)
-	{
-		format(str, sizeof (str), "%*s<%s>%s</%s>\n", depth, "", YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_TAG], YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_VALUE], YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_TAG]);
 		fwrite(fHnd, str);
-		P:7("XML_WriteItemDataShort: writing 0 %s", str);
-	}
-	else
-	{
-		// Loop through all children to find those with no children.
-		format(str, sizeof (str), "%*s<%s", depth, "", YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_TAG]);
-		P:7("XML_WriteItemDataShort: writing 1 %s", str);
-		fwrite(fHnd, str);
-		new
-			notDone = 0;
-		do
-		{
-			if (YSI_g_sXMLWriteBuffer[i][E_XML_WRITE_CHILDREN] == -1)
-			{
-				format(str, sizeof (str), " %s=\"%s\"", YSI_g_sXMLWriteBuffer[i][E_XML_WRITE_TAG], YSI_g_sXMLWriteBuffer[i][E_XML_WRITE_VALUE]);
-				P:7("XML_WriteItemDataShort: writing 2 %s", str);
-				fwrite(fHnd, str);
-			}
-			else
-			{
-				++notDone;
-			}
-			i = YSI_g_sXMLWriteBuffer[i][E_XML_WRITE_SIBLINGS];
-		}
-		while (i != -1);
-		if (notDone)
-		{
-			P:7("XML_WriteItemDataShort: writing 3 >\n");
-			fwrite(fHnd, ">\n");
-			depth += 2;
-			i = YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_CHILDREN];
-			do
-			{
-				if (YSI_g_sXMLWriteBuffer[i][E_XML_WRITE_CHILDREN] != -1)
-				{
-					XML_WriteItemDataShort(i, fHnd, depth);
-				}
-				i = YSI_g_sXMLWriteBuffer[i][E_XML_WRITE_SIBLINGS];
-			}
-			while (i != -1);
-			depth -= 2;
-			format(str, sizeof (str), "%*s</%s>\n", depth, "", YSI_g_sXMLWriteBuffer[item][E_XML_WRITE_TAG]);
-			fwrite(fHnd, str);
-			P:7("XML_WriteItemDataShort: writing 4 %s", str);
-		}
-		else
-		{
-			P:7("XML_WriteItemData: writing 5 />\n");
-			fwrite(fHnd, " />\n");
-		}
 	}
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_RemoveItem
 Params:
@@ -999,15 +772,14 @@ Return:
 	-
 Notes:
 	Does a replace on data in a file with no new data.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_RemoveItem(file[], tag[], name[])
 {
-	P:3("XML_RemoveItem called: \"%s\", \"%s\", \"%s\", ", file, tag, name);
 	return XML_ReplaceItem(file, tag, name, -1);
 }
 
-/*----------------------------------------------------------------------------*\
+/*----------------------------------------------------------------------------*-
 Function:
 	XML_ReplaceItem
 Params:
@@ -1019,21 +791,20 @@ Return:
 	-
 Notes:
 	Replaces a tag's data with new data, basically changes a tag's value.
-\*----------------------------------------------------------------------------*/
+-*----------------------------------------------------------------------------*/
 
 stock XML_ReplaceItem(file[], tag[], name[], replacement)
 {
-	P:3("XML_ReplaceItem called: \"%s\", \"%s\", \"%s\", %i", file, tag, name, replacement);
 	if (fexist(file))
 	{
 		new
 			File:fHnd = fopen(file, io_read),
-			File:__ftemp = ftemp();//fopen("_temp_ysi_user_file_.ysi", io_write);
-		if (fHnd && __ftemp)
+			File:fTemp = ftemp();//fopen("_temp_ysi_user_file_.ysi", io_write);
+		if (fHnd && fTemp)
 		{
 			new
 				tagCount,
-				line[YSI_MAX_STRING],
+				line[MAX_STRING],
 				inTag,
 				atStart;
 			while (fread(fHnd, line))
@@ -1079,7 +850,7 @@ stock XML_ReplaceItem(file[], tag[], name[], replacement)
 								if (replacement != -1)
 								{
 									if (replacement >= YSI_g_sXMLWritePointer) replacement = -1;
-									else XML_WriteItemData(replacement, __ftemp, (tagCount - 1) * 2);
+									else XML_WriteItemData(replacement, fTemp, (tagCount - 1) * 2);
 								}
 							}
 						}
@@ -1088,20 +859,20 @@ stock XML_ReplaceItem(file[], tag[], name[], replacement)
 					else pos++;
 					ch = line[pos];
 				}
-				if (!inTag) fwrite(__ftemp, line);
+				if (!inTag) fwrite(fTemp, line);
 				if (inTag == 3) inTag = 0;
 			}
 			fclose(fHnd);
-			//fclose(__ftemp);
+			//fclose(fTemp);
 			fremove(file);
 			fHnd = fopen(file, io_write);
-			//__ftemp = fopen("_temp_ysi_user_file_.ysi", io_read);
-			fseek(__ftemp);
-			if (fHnd && __ftemp)
+			//fTemp = fopen("_temp_ysi_user_file_.ysi", io_read);
+			fseek(fTemp);
+			if (fHnd && fTemp)
 			{
-				while (fread(__ftemp, line)) fwrite(fHnd, line);
+				while (fread(fTemp, line)) fwrite(fHnd, line);
 				fclose(fHnd);
-				fclose(__ftemp);
+				fclose(fTemp);
 				//fremove("_temp_ysi_user_file_.ysi");
 				if (replacement != -1) YSI_g_sXMLWritePointer = replacement;
 				return 1;
@@ -1111,9 +882,9 @@ stock XML_ReplaceItem(file[], tag[], name[], replacement)
 		{
 			fclose(fHnd);
 		}
-		if (__ftemp)
+		if (fTemp)
 		{
-			fclose(__ftemp);
+			fclose(fTemp);
 			//fremove("_temp_ysi_user_file_.ysi");
 		}
 		return 0;

+ 46 - 231
pawno/include/a_mysql.inc

@@ -1,245 +1,60 @@
-/**
- * MySQL plugin R39-5
- */
-
+/*
+	SA-MP MySQL plugin R5
+	Copyright (c) 2008-2010, G-sTyLeZzZ 
+*/
 
 #if defined mysql_included
 	#endinput
 #endif
 #define mysql_included
 
+//Common error codes (http://dev.mysql.com/doc/refman/5.0/en/error-messages-(client|server).html)
 
-/**
- * Common error codes
- *
- * Client: http://dev.mysql.com/doc/refman/5.1/en/error-messages-client.html
- * Server: http://dev.mysql.com/doc/refman/5.1/en/error-messages-server.html
- */
-
-#define ER_DBACCESS_DENIED_ERROR 		1044
-#define ER_ACCESS_DENIED_ERROR 			1045
-#define ER_UNKNOWN_TABLE 				1109
-#define ER_SYNTAX_ERROR 				1149
-#define CR_SERVER_GONE_ERROR 			2006
-#define CR_SERVER_LOST 					2013
-#define CR_COMMAND_OUT_OF_SYNC 			2014
-#define CR_SERVER_LOST_EXTENDED 		2055
-
-
-enum E_LOGLEVEL
-{
-	LOG_NONE = 0,
-	LOG_ERROR = 1,
-	LOG_WARNING = 2,
-	LOG_DEBUG = 4,
-	
-	LOG_ALL = LOG_ERROR | LOG_WARNING | LOG_DEBUG
-};
-
-enum E_LOGTYPE
-{
-	LOG_TYPE_TEXT = 1,
-	LOG_TYPE_HTML = 2
-};
-
-enum ORM_Error
-{
-	ERROR_OK,
-	ERROR_NO_DATA
-};
-
-enum E_VAR_DATATYPE 
-{
-	DATATYPE_INT,
-	DATATYPE_FLOAT,
-	DATATYPE_STRING
-};
-
-enum E_MYSQL_OPTION
-{
-	DUPLICATE_CONNECTIONS,
-	LOG_TRUNCATE_DATA
-};
-
-enum E_EXECTIME_UNIT
-{
-	UNIT_MILLISECONDS,
-	UNIT_MICROSECONDS
-};
-
-
-#define mysql_real_escape_string 					mysql_escape_string
-#define cache_num_fields 							cache_get_field_count
-#define cache_num_rows 								cache_get_row_count
-#define mysql_function_query(%0,%1,%2,%3,"%4"%5) 	mysql_tquery(%0,%1,%3,#%4%5)
-#define mysql_reload(%0) 							mysql_tquery(%0,"FLUSH PRIVILEGES")
-#define mysql_debug(%0)								(%0?mysql_log(LOG_ALL):mysql_log())
-#define ismysqlnull(%0) 							(strcmp(%0,"NULL",false)==0)
-
-
-// ORM functions
-native ORM:orm_create(const table[], connectionHandle = 1);
-native orm_destroy(ORM:id);
-
-native ORM_Error:orm_errno(ORM:id);
-
-native orm_apply_cache(ORM:id, row);
-native orm_select(ORM:id, callback[] = "", format[] = "", {Float, _}:...);
-/*
-native orm_select_inline(ORM:id, callback:Callback, format[], {Float,_}:...); //y_inline
-*/
-native orm_update(ORM:id);
-native orm_insert(ORM:id, callback[] = "", format[] = "", {Float, _}:...);
-/*
-native orm_insert_inline(ORM:id, callback:Callback, format[], {Float,_}:...); //y_inline
-*/
-native orm_delete(ORM:id, bool:clearvars=true);
-
-native orm_load(ORM:id, callback[] = "", format[] = "", {Float, _}:...) = orm_select;
-native orm_save(ORM:id, callback[] = "", format[] = "", {Float, _}:...);
-
-native orm_addvar_int(ORM:id, &var, varname[]);
-native orm_addvar_float(ORM:id, &Float:var, varname[]);
-native orm_addvar_string(ORM:id, var[], var_maxlen, varname[]);
+#define ER_DBACCESS_DENIED_ERROR 1044
+#define ER_ACCESS_DENIED_ERROR 1045
+#define ER_UNKNOWN_TABLE 1109
+#define ER_SYNTAX_ERROR 1149
+#define CR_SERVER_GONE_ERROR 2006
+#define CR_SERVER_LOST 2013
+#define CR_COMMAND_OUT_OF_SYNC 2014
+#define CR_SERVER_LOST_EXTENDED 2055
 
-native orm_delvar(ORM:id, varname[]);
-native orm_setkey(ORM:id, varname[]);
+//Native functions
 
+#define mysql_fetch_row(%1) mysql_fetch_row_format(%1,"|")
+#define mysql_next_row() mysql_retrieve_row()
+#define mysql_get_field(%1,%2) mysql_fetch_field_row(%2,%1)
 
-// MySQL functions
-native mysql_log(E_LOGLEVEL:loglevel = LOG_ERROR | LOG_WARNING, E_LOGTYPE:logtype = LOG_TYPE_TEXT);
-native mysql_connect(const host[], const user[], const database[], const password[], port = 3306, bool:autoreconnect = true, pool_size = 2);
+native mysql_affected_rows(connectionHandle = 1);
 native mysql_close(connectionHandle = 1);
-native mysql_reconnect(connectionHandle = 1);
-
-native mysql_unprocessed_queries(connectionHandle = 1);
-native mysql_current_handle();
-native mysql_option(E_MYSQL_OPTION:type, value);
-
+native mysql_connect(const host[],const user[],const database[],const password[]);
+native mysql_debug(enable = 1);
 native mysql_errno(connectionHandle = 1);
-native mysql_escape_string(const source[], destination[], connectionHandle = 1, max_len = sizeof(destination));
-native mysql_format(connectionHandle, output[], len, format[], {Float,_}:...);
-native mysql_pquery(connectionHandle, query[], callback[] = "", format[] = "", {Float,_}:...);
-/*
-native mysql_pquery_inline(connHandle, query[], callback:Callback, format[], {Float,_}:...); //y_inline
-*/
-native mysql_tquery(connectionHandle, query[], callback[] = "", format[] = "", {Float,_}:...);
-/*
-native mysql_tquery_inline(connHandle, query[], callback:Callback, format[], {Float,_}:...); //y_inline
-*/
-native Cache:mysql_query(conhandle, query[], bool:use_cache = true);
-
-native mysql_stat(destination[], connectionHandle = 1, max_len = sizeof(destination));
-native mysql_get_charset(destination[], connectionHandle = 1, max_len = sizeof(destination));
-native mysql_set_charset(charset[], connectionHandle = 1);
-
-
-// Cache functions
-native cache_get_data(&num_rows, &num_fields, connectionHandle = 1);
-native cache_get_row_count(connectionHandle = 1);
-native cache_get_field_count(connectionHandle = 1);
-native cache_get_field_name(field_index, destination[], connectionHandle = 1, max_len = sizeof(destination));
-
-native cache_get_row(row, field_idx, destination[], connectionHandle = 1, max_len = sizeof(destination));
-native cache_get_row_int(row, field_idx, connectionHandle = 1);
-native Float:cache_get_row_float(row, field_idx, connectionHandle = 1);
-
-native cache_get_field_content(row, const field_name[], destination[], connectionHandle = 1, max_len = sizeof(destination));
-native cache_get_field_content_int(row, const field_name[], connectionHandle = 1);
-native Float:cache_get_field_content_float(row, const field_name[], connectionHandle = 1);
-
-native Cache:cache_save(connectionHandle = 1);
-native cache_delete(Cache:cache_id, connectionHandle = 1);
-native cache_set_active(Cache:cache_id, connectionHandle = 1);
-native cache_is_valid(Cache:cache_id, connectionHandle = 1);
-
-native cache_affected_rows(connectionHandle = 1);
-native cache_insert_id(connectionHandle = 1);
-native cache_warning_count(connectionHandle = 1);
-
-native cache_get_query_exec_time(E_EXECTIME_UNIT:unit = UNIT_MICROSECONDS);
-native cache_get_query_string(destination[], max_len = sizeof(destination));
-
-
-// Forward declarations
-forward OnQueryError(errorid, error[], callback[], query[], connectionHandle);
-
-
-#if defined MYSQL_USE_YINLINE || defined E_CALLBACK_DATA
-	#if !defined E_CALLBACK_DATA
-		#include <YSI\y_inline>
-	#endif
-	
-	static g_MySQL_InlineData[1000][E_CALLBACK_DATA];
-	static g_MySQL_VarArray[32][YSI_MAX_STRING];
-	static g_MySQL_AddressArray[32];
-
-	stock MySQL_Internal_SaveInline(callback:CB) 
-	{
-		static bool:g_MySQL_LazyInit = true;
-		if(g_MySQL_LazyInit == true) 
-		{
-			//set g_MySQL_InlineData empty
-			for(new i=0; i < sizeof(g_MySQL_InlineData); ++i)
-				for(new E_CALLBACK_DATA:e = E_CALLBACK_DATA:0; e < E_CALLBACK_DATA; ++e)
-					g_MySQL_InlineData[i][e] = 0;
-			g_MySQL_LazyInit = false;
-		}
-		
-		for(new i=0; i < sizeof(g_MySQL_InlineData); ++i)
-			if(_:g_MySQL_InlineData[i][E_CALLBACK_DATA_POINTER] == 0)
-				if (Callback_Get(CB, g_MySQL_InlineData[i]))
-					return i;
-					
-		return -1;
-	}
-	
-	#define mysql_pquery_inline(%0,%1,%2,"%3"%4) \
-		mysql_pquery(%0,%1,"FJ37DH3JG_MYSQL_INTERNAL","d"#%3,MySQL_Internal_SaveInline(%2)%4)
-		
-	#define mysql_tquery_inline(%0,%1,%2,"%3"%4) \
-		mysql_tquery(%0,%1,"FJ37DH3JG_MYSQL_INTERNAL","d"#%3,MySQL_Internal_SaveInline(%2)%4)
-	
-	#define orm_select_inline(%0,%1,"%2"%3) \
-		orm_select(%0,"FJ37DH3JG_MYSQL_INTERNAL","d"#%2,MySQL_Internal_SaveInline(%1)%3)
-	
-	#define orm_insert_inline(%0,%1,"%2"%3) \
-		orm_insert(%0,"FJ37DH3JG_MYSQL_INTERNAL","d"#%2,MySQL_Internal_SaveInline(%1)%3)
+native mysql_fetch_int(connectionHandle = 1);
+native mysql_fetch_field(number,dest[],connectionHandle = 1);
+native mysql_fetch_field_row(string[],const fieldname[],connectionHandle = 1);
+native mysql_fetch_float(&Float:result,connectionHandle = 1);
+native mysql_fetch_row_format(string[],const delimiter[] = "|",connectionHandle = 1);
+native mysql_format(connectionHandle, output[], format[], {Float,_}:...);
+native mysql_field_count(connectionHandle = 1);
+native mysql_free_result(connectionHandle = 1);
+native mysql_get_charset(destination[],connectionHandle = 1);
+native mysql_insert_id(connectionHandle = 1);
+native mysql_num_rows(connectionHandle = 1);
+native mysql_num_fields(connectionHandle = 1);
+native mysql_ping(connectionHandle = 1);
+native mysql_query(query[],resultid = (-1),extraid = (-1),connectionHandle = 1);
+native mysql_query_callback(index,query[],callback[],extraid = (-1),connectionHandle = 1);
+native mysql_real_escape_string(const source[],destination[],connectionHandle = 1);
+native mysql_reconnect(connectionHandle = 1);
+native mysql_reload(connectionHandle = 1);
+native mysql_retrieve_row(connectionHandle = 1);
+native mysql_set_charset(charset[],connectionHandle = 1);
+native mysql_stat(const destination[],connectionHandle = 1);
+native mysql_store_result(connectionHandle = 1);
+native mysql_warning_count(connectionHandle = 1);
 
+//forward declarations
 
-	forward FJ37DH3JG_MYSQL_INTERNAL(...);
-	public FJ37DH3JG_MYSQL_INTERNAL(...) 
-	{
-		new InlineDataIndex = getarg(0);
-		if(InlineDataIndex < 0)
-			return 0;
-		
-		for(new i=0; i < numargs()-1; ++i) 
-		{
-			for(new l=0; l < YSI_MAX_STRING; ++l) 
-			{
-				new TmpVal = getarg(i+1, l);
-				if(l == 0 || g_MySQL_VarArray[i][l-1] < 256)
-					g_MySQL_VarArray[i][l] = TmpVal;
-				else 
-					break;
-			}
-			
-			g_MySQL_AddressArray[i] = AMX_GetRelativeAddress(g_MySQL_VarArray[i][0]);
-		}
-		
-		Callback_Array(g_MySQL_InlineData[InlineDataIndex], g_MySQL_AddressArray);
-		
-		Callback_Release(g_MySQL_InlineData[InlineDataIndex]);
-		for(new E_CALLBACK_DATA:e = E_CALLBACK_DATA:0; e < E_CALLBACK_DATA; ++e)
-			g_MySQL_InlineData[InlineDataIndex][e] = 0;
-		
-		for(new i=0; i < numargs()-1; ++i) 
-		{
-			g_MySQL_AddressArray[i] = 0;
-			for(new l=0, lmax=strlen(g_MySQL_VarArray[i]); l < lmax; ++l)
-				g_MySQL_VarArray[i][l] = 0;
-		}
-		return 1;
-	}
-#endif
+forward OnQueryFinish(query[], resultid, extraid, connectionHandle);
+forward OnQueryError(errorid, error[], resultid, extraid, callback[], query[], connectionHandle);

+ 31 - 20
pawno/include/a_zones.inc

@@ -1,5 +1,5 @@
 /*  SA:MP Functions
- *
+ *  
  *  ZONES Functions By ~Cueball~
  *  ZONES Functions Aided By Betamaster (locations), Mabako (locations), Simon (finetuning)
  *
@@ -231,12 +231,12 @@ static const gSAZones[][SAZONE_MAIN] = {  // Majority of names and area coordina
 	{"Little Mexico",               {1758.90,-1722.20,-89.00,1812.60,-1577.50,110.90}},
 	{"Los Flores",                  {2581.70,-1454.30,-89.00,2632.80,-1393.40,110.90}},
 	{"Los Flores",                  {2581.70,-1393.40,-89.00,2747.70,-1135.00,110.90}},
-	{"Los Santos Airport",    	{1249.60,-2394.30,-89.00,1852.00,-2179.20,110.90}},
-	{"Los Santos Airport",   	{1852.00,-2394.30,-89.00,2089.00,-2179.20,110.90}},
-	{"Los Santos Airport",    	{1382.70,-2730.80,-89.00,2201.80,-2394.30,110.90}},
-	{"Los Santos Airport",    	{1974.60,-2394.30,-39.00,2089.00,-2256.50,60.90}},
-	{"Los Santos Airport",  	{1400.90,-2669.20,-39.00,2189.80,-2597.20,60.90}},
-	{"Los Santos Airport",   	{2051.60,-2597.20,-39.00,2152.40,-2394.30,60.90}},
+	{"Los Santos International",    {1249.60,-2394.30,-89.00,1852.00,-2179.20,110.90}},
+	{"Los Santos International",    {1852.00,-2394.30,-89.00,2089.00,-2179.20,110.90}},
+	{"Los Santos International",    {1382.70,-2730.80,-89.00,2201.80,-2394.30,110.90}},
+	{"Los Santos International",    {1974.60,-2394.30,-39.00,2089.00,-2256.50,60.90}},
+	{"Los Santos International",    {1400.90,-2669.20,-39.00,2189.80,-2597.20,60.90}},
+	{"Los Santos International",    {2051.60,-2597.20,-39.00,2152.40,-2394.30,60.90}},
 	{"Marina",                      {647.70,-1804.20,-89.00,851.40,-1577.50,110.90}},
 	{"Marina",                      {647.70,-1577.50,-89.00,807.90,-1416.20,110.90}},
 	{"Marina",                      {807.90,-1577.50,-89.00,926.90,-1416.20,110.90}},
@@ -451,6 +451,30 @@ stock GetPlayer3DZone(playerid, zone[], len) //Credits to Cueball, Betamaster, M
 	return 0;
 }
 
+stock Get3DZone(Float:x, Float:y, Float:z, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
+{
+ 	for(new i = 0; i != sizeof(gSAZones); i++ )
+ 	{
+		if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4] && z >= gSAZones[i][SAZONE_AREA][2] && z <= gSAZones[i][SAZONE_AREA][5])
+		{
+		    return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
+		}
+	}
+	return 0;
+}
+
+stock Get2DPosZone(Float:x, Float:y, zone[], len)
+{
+ 	for(new i = 0; i != sizeof(gSAZones); i++ )
+ 	{
+		if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
+		{
+		    return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
+		}
+	}
+	return 0;
+}
+
 //---------------------------------------------------------------------------------------------------
 
 /* IsPlayerInZone(playerid, zone[])
@@ -469,18 +493,5 @@ stock IsPlayerInZone(playerid, zone[]) //Credits to Cueball, Betamaster, Mabako,
 		if(strfind(TmpZone, zone, true) != -1)
 			return 1;
 	}
-	return 0;
-}
-
-stock GetZone(Float: x, Float: y, zone[]) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
-{
- 	for(new i = 0; i != sizeof(gSAZones); i++ )
- 	{
-		if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
-		{
-		    return format(zone, MAX_ZONE_NAME, gSAZones[i][SAZONE_NAME], 0);
-		}
-	}
-	
 	return 0;
 }

+ 59 - 79
pawno/include/audio.inc

@@ -1,86 +1,75 @@
 /*
- * Copyright (C) 2012 Incognito
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <a_samp>
-
-// Natives (Main)
+    SA-MP Audio Plugin v0.4
+    Copyright © 2010 Incognito
 
-native Audio_CreateTCPServer(port);
-native Audio_DestroyTCPServer();
-native Audio_SetPack(const name[], bool:transferable = true, bool:automated = true);
-native Audio_IsClientConnected(playerid);
-native Audio_SendMessage(playerid, const message[]);
-native Audio_TransferPack(playerid);
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#if defined _audio_included
+	#endinput
+#endif
+#define _audio_included
+#pragma library audio
 
-// Natives (Sequences)
+// Natives
 
+native Audio_CreateTCPServer(port);
+native Audio_DestroyTCPServer();
+native Audio_SetPack(const audiopack[], bool:transferable = true);
 native Audio_CreateSequence();
 native Audio_DestroySequence(sequenceid);
 native Audio_AddToSequence(sequenceid, audioid);
 native Audio_RemoveFromSequence(sequenceid, audioid);
-
-// Natives (Audio)
-
 native Audio_Play(playerid, audioid, bool:pause = false, bool:loop = false, bool:downmix = false);
-native Audio_PlayStreamed(playerid, const url[], bool:pause = false, bool:loop = false, bool:downmix = false);
 native Audio_PlaySequence(playerid, sequenceid, bool:pause = false, bool:loop = false, bool:downmix = false);
+native Audio_PlayStreamed(playerid, const url[], bool:pause = false, bool:loop = false, bool:downmix = false);
 native Audio_Pause(playerid, handleid);
 native Audio_Resume(playerid, handleid);
 native Audio_Stop(playerid, handleid);
 native Audio_Restart(playerid, handleid);
-native Audio_GetPosition(playerid, handleid, const callback[] = "Audio_OnGetPosition");
-native Audio_SetPosition(playerid, handleid, seconds);
+native Audio_Seek(playerid, handleid, seconds);
 native Audio_SetVolume(playerid, handleid, volume);
+native Audio_Set3DPosition(playerid, handleid, Float:x, Float:y, Float:z, Float:distance);
+native Audio_Set3DOffsets(playerid, handleid, Float:x, Float:y, Float:z);
 native Audio_SetFX(playerid, handleid, type);
 native Audio_RemoveFX(playerid, handleid, type);
-native Audio_Set3DPosition(playerid, handleid, Float:x, Float:y, Float:z, Float:distance);
-native Audio_Remove3DPosition(playerid, handleid);
-
-// Natives (Radio Stations)
-
-native Audio_SetRadioStation(playerid, station);
-native Audio_StopRadio(playerid);
-
-// Natives (Internal)
-
+native Audio_SetEAX(playerid, environment);
+native Audio_RemoveEAX(playerid);
+native Audio_IsClientConnected(playerid);
+native Audio_TransferPack(playerid);
 native Audio_AddPlayer(playerid, const ip[], const name[]);
-native Audio_RenamePlayer(playerid, const name[]);
 native Audio_RemovePlayer(playerid);
 
-// Callbacks (Main)
+// Callbacks
 
 forward Audio_OnClientConnect(playerid);
 forward Audio_OnClientDisconnect(playerid);
+forward Audio_OnSetPack(audiopack[]);
 forward Audio_OnTransferFile(playerid, file[], current, total, result);
 forward Audio_OnPlay(playerid, handleid);
 forward Audio_OnStop(playerid, handleid);
 forward Audio_OnTrackChange(playerid, handleid, track[]);
-forward Audio_OnRadioStationChange(playerid, station);
-
-// Callbacks (Custom)
-
-forward Audio_OnGetPosition(playerid, handleid, seconds);
 
-// Callback Hook Section
+// Automatic Setup System
 
-static bool:Audio_g_CTS = false;
-static bool:Audio_g_OPC = false;
-static bool:Audio_g_OPDC = false;
+static
+	bool:Audio_g_CTS = false,
+	bool:Audio_g_OPC = false,
+	bool:Audio_g_OPDC = false;
 
-public OnFilterScriptInit()
+public
+	OnFilterScriptInit()
 {
 	if (!Audio_g_CTS)
 	{
@@ -103,9 +92,11 @@ public OnFilterScriptInit()
 #endif
 #define OnFilterScriptInit Audio_OnFilterScriptInit
 
-forward Audio_OnFilterScriptInit();
+forward
+	Audio_OnFilterScriptInit();
 
-public OnGameModeInit()
+public
+	OnGameModeInit()
 {
 	if (!Audio_g_CTS)
 	{
@@ -128,13 +119,17 @@ public OnGameModeInit()
 #endif
 #define OnGameModeInit Audio_OnGameModeInit
 
-forward Audio_OnGameModeInit();
+forward
+	Audio_OnGameModeInit();
 
-public OnPlayerConnect(playerid)
+public
+	OnPlayerConnect(playerid)
 {
 	if (!IsPlayerNPC(playerid))
 	{
-		new ip[16], name[MAX_PLAYER_NAME];
+		new
+			ip[16],
+			name[MAX_PLAYER_NAME];
 		GetPlayerIp(playerid, ip, sizeof(ip));
 		GetPlayerName(playerid, name, sizeof(name));
 		Audio_AddPlayer(playerid, ip, name);
@@ -153,9 +148,11 @@ public OnPlayerConnect(playerid)
 #endif
 #define OnPlayerConnect Audio_OnPlayerConnect
 
-forward Audio_OnPlayerConnect(playerid);
+forward
+	Audio_OnPlayerConnect(playerid);
 
-public OnPlayerDisconnect(playerid, reason)
+public
+	OnPlayerDisconnect(playerid, reason)
 {
 	if (!IsPlayerNPC(playerid))
 	{
@@ -175,22 +172,5 @@ public OnPlayerDisconnect(playerid, reason)
 #endif
 #define OnPlayerDisconnect Audio_OnPlayerDisconnect
 
-forward Audio_OnPlayerDisconnect(playerid, reason);
-
-// Native Hook Section
-
-stock Audio_SetPlayerName(playerid, name[])
-{
-	new value = SetPlayerName(playerid, name);
-	if (value > 0)
-	{
-		Audio_RenamePlayer(playerid, name);
-	}
-	return value;
-}
-#if defined _ALS_SetPlayerName
-	#undef SetPlayerName
-#else
-	#define _ALS_SetPlayerName
-#endif
-#define SetPlayerName Audio_SetPlayerName
+forward
+	Audio_OnPlayerDisconnect(playerid, reason);

+ 12 - 8062
pawno/include/fixes.inc

@@ -1,8073 +1,23 @@
-/* 
- * ===============
- *  INTRODUCTION: 
- * ===============
- * 
- * fixes.inc - Community patch for buggy SA:MP functions.
- * 
- * ================
- *  LIST OF FIXES: 
- * ================
- * 
- * FIX:      GetPlayerColor
- * PROBLEM:  Returns "0" if "SetPlayerColor" has never been called.
- * SOLUTION: Call "SetPlayerColor" in "OnPlayerConnect".
- * SEE:      "OnPlayerConnect".
- * AUTHOR:   KoczkaHUN
- * POST:     http://forum.sa-mp.com/showpost.php?p=1486048
- * 
- * FIX:      FILTERSCRIPT
- * PROBLEM:  Despite the fact that is in every new script, many people don't
- *           define "FILTERSCRIPT" where appropriate.
- * SOLUTION: Provide an "IS_FILTERSCRIPT" variable (note the naming to match
- *           the original macro).
- * AUTHOR:   Y_Less
- * SEE:      "OnFilterScriptInit" and "OnGameModeInit".
- * 
- * FIX:      SpawnPlayer
- * PROBLEM:  Kills the player if they are in a vehicle.
- * SOLUTION: Remove the from the vehicle.
- * SEE:      "FIXES_SpawnPlayer".
- * AUTHOR:   Y_Less
- * 
- * FIX:      SetPlayerName
- * PROBLEM:  Using "SetPlayerName" when the new name only differs from the old
- *           name in case does not alter the name at all.
- * SOLUTION: Change their name twice - once to "_FIXES TEMP NAME" and then to
- *           the actual required name.
- * SEE:      "OnPlayerConnect" and "FIXES_SetPlayerName".
- * AUTHOR:   Y_Less/Slice/xX_Simon_Xx
- * POST:     https://github.com/Y-Less/sa-mp-fixes/issues/3
- * 
- * FIX:      GetPlayerSkin
- * PROBLEM:  Returns the new skin after "SetSpawnInfo" is called but before the
- *           player actually respawns to get the new skin.
- * SOLUTION: Record the skin in "OnPlayerSpawn" and always return that one.
- * SEE:      "OnPlayerSpawn", "FIXES_GetPlayerSkin" and "FIXES_SetPlayerSkin".
- * AUTHOR:   Y_Less
- * 
- * FIX:      GetWeaponName
- * PROBLEM:  Returns nothing for 18, 44, and 45.
- * SOLUTION: Return the correct names ("Molotov Cocktail", "Thermal Goggles",
- *           and "Night vision Goggles").
- * SEE:      "FIXES_GetWeaponName".
- * AUTHOR:   Y_Less
- * 
- * FIX:      SetPlayerWorldBounds
- * PROBLEM:  Aiming can bypass the edge.
- * SOLUTION: Check for the player leaving the area and reset them to their last
- *           good position if they leave the area (aiming or not).
- * SEE:      "OnPlayerUpdate" and "FIXES_SetPlayerWorldBounds".
- * AUTHOR:   Y_Less
- * 
- * FIX:      TogglePlayerControllable
- * PROBLEM:  Other players see you moving on the spot.
- * SOLUTION: Return 0 in OnPlayerUpdate.
- * SEE:      "FIXES_TogglePlayerControllable" and "OnPlayerUpdate".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=876854
- * 
- * FIX:      HydraSniper
- * PROBLEM:  Entring military aircraft with a sniper rifle messes up vies.
- * SOLUTION: Set their armed weapon to fists.
- * SEE:      "OnPlayerStateChange", "FIXES_GivePlayerWeapon",
- *           "FIXES_SetPlayerArmedWeapon".
- * AUTHOR:   funky1234
- * POST:     http://forum.sa-mp.com/showpost.php?p=965644
- * 
- * FIX:      IsPlayerInCheckpoint
- * PROBLEM:  Function returns an undefined value if it is called before any
- *           other checkpoint functions are called to initialise the value.
- * SOLUTION: Call "DisablePlayerCheckpoint" when they connect.
- * SEE:      "OnPlayerConnect".
- * AUTHOR:   Y_Less
- * 
- * FIX:      IsPlayerInRaceCheckpoint
- * PROBLEM:  Function returns an undefined value if it is called before any
- *           other race checkpoint functions are called to initialise the value.
- * SOLUTION: Call "DisablePlayerRaceCheckpoint" when they connect.
- * SEE:      "OnPlayerConnect".
- * AUTHOR:   Y_Less
- * 
- * FIX:      GetPlayerWeapon
- * PROBLEM:  Returns the old value after using "SetPlayerArmedWeapon" when they
- *           are in a vehicle.
- * SOLUTION: If "SetPlayerArmedWeapon" is called in a vehicle, store the new
- *           value and return that instead.
- * SEE:      "OnPlayerStateChange", "FIXES_SetPlayerArmedWeapon", and
- *           "FIXES_GetPlayerWeapon".
- * AUTHOR:   Y_Less
- * 
- * FIX:      PutPlayerInVehicle
- * PROBLEM:  If this is used on a passenger the driver of their old vehicle
- *           doesn't see them in their new vehicle.
- * SOLUTION: Remove them from the vehicle first.
- * SEE:      "OnPlayerStateChange" and "FIXES_PutPlayerInVehicle".
- * AUTHOR:   leong124/Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=1265965
- * 
- * FIX:      KEY_AIM
- * PROBLEM:  "KEY_AIM" isn't defined by default.
- * SOLUTION: Define it.
- * SEE:      N/A.
- * AUTHOR:   Y_Less
- * 
- * FIX:      SetPlayerCheckpoint
- * PROBLEM:  If a checkpoint is already set it will use the size of that
- *           checkpoint instead of the new one.
- * SOLUTION: Call "DisablePlayerCheckpoint" before setting the checkpoint.
- * SEE:      "FIXES_SetPlayerCheckpoint".
- * AUTHOR:   KoczkaHUN
- * POST:     http://forum.sa-mp.com/showpost.php?p=1482401
- * 
- * FIX:      SetPlayerRaceCheckpoint
- * PROBLEM:  If a checkpoint is already set it will use the size of that
- *           checkpoint instead of the new one.
- * SOLUTION: Call "DisablePlayerRaceCheckpoint" before setting the checkpoint.
- * SEE:      "FIXES_SetPlayerRaceCheckpoint".
- * AUTHOR:   KoczkaHUN
- * POST:     http://forum.sa-mp.com/showpost.php?p=1482401
- * 
- * FIX:      TextDrawCreate
- * PROBLEM:  Crashes on a blank string.
- * SOLUTION: Intercept blank strings.
- * SEE:      "FIXES_TextDrawCreate".
- * AUTHOR:   wups
- * POST:     http://forum.sa-mp.com/showpost.php?p=1484008
- * 
- * FIX:      TextDrawSetString
- * PROBLEM:  Crashes on a blank string and size greater than 1024.
- * SOLUTION: Intercept blank strings and truncate long strings.
- * SEE:      "FIXES_TextDrawSetString".
- * AUTHOR:   TomTrox
- * POST:     http://forum.sa-mp.com/showpost.php?p=1487870
- * 
- * FIX:      CreatePlayerTextDraw
- * PROBLEM:  Crashes on a blank string.
- * SOLUTION: Intercept blank strings.
- * SEE:      "FIXES_CreatePlayerTextDraw".
- * AUTHOR:   wups/Y_Less
- * 
- * FIX:      PlayerTextDrawSetString
- * PROBLEM:  Crashes on a blank string and size greater than 1024.
- * SOLUTION: Intercept blank strings and truncate long strings.
- * SEE:      "FIXES_PlayerTextDrawSetString".
- * AUTHOR:   TomTrox/Y_Less
- * 
- * FIX:      AllowInteriorWeapons
- * PROBLEM:  Does nothing.
- * SOLUTION: Set the player's weapon to fists in an interior.
- * SEE:      "FIXES_AllowInteriorWeapons", "OnGameModeInit" and
- *           "OnPlayerUpdate".
- * AUTHOR:   KoczkaHUN
- * POST:     http://forum.sa-mp.com/showpost.php?p=1502696
- * 
- * FIX:      OnPlayerEnterVehicle
- * PROBLEM:  Crashes other players when people enter an invalid seat.
- * SOLUTION: Desync the people with invalid seats.
- * SEE:      "OnPlayerStateChange" and "OnPlayerUpdate".
- * AUTHOR:   RyDeR`/Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=1410296
- * 
- * FIX:      OnPlayerEnterVehicle_2
- * PROBLEM:  Crashes the server when hacks enter an invalid vehicle.
- * SOLUTION: Desync the people with invalid vehicles.
- * SEE:      "OnPlayerEnterVehicle".
- * AUTHOR:   im/Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=2340900
- * 
- * FIX:      AllowTeleport
- * PROBLEM:  0.3dRC9 removed "AllowPlayerTeleport" and "AllowAdminTeleport" in
- *           favour of "OnPlayerClickMap".  Some scripts used the old code and.
- * SOLUTION: Teleport the player in "OnPlayerClickMap".
- * SEE:      "OnPlayerClickMap", "FIXES_AllowPlayerTeleport", and
- *           "FIXES_AllowAdminTeleport".
- * AUTHOR:   Y_Less
- * 
- * FIX:      SetPlayerSpecialAction
- * PROBLEM:  Removing jetpacks from players by setting their special action to 0
- *           causes the sound to stay until death.
- * SOLUTION: Call "ClearAnimations" before "SetPlayerSpecialAction".
- * SEE:      "FIXES_SetPlayerSpecialAction".
- * AUTHOR:   MP2
- * POST:     Private message from MP2.
- * 
- * FIX:      OnDialogResponse
- * PROBLEM:  Cheaters can spoof the dialogid they are using to respond to ones
- *           they can't actually see.
- * SOLUTION: Store the displayed dialogid and use that instead.
- * SEE:      "FIXES_OnDialogResponse", "FIXES_ShowPlayerDialog".
- * AUTHOR:   Y_Less
- * FIXED IN: 0.3e RC6
- * 
- * FIX:      GetPlayerDialog
- * PROBLEM:  This function doesn't exist.  Fixed for hidden dialogs.
- * SOLUTION: Add it.  DEFAULTS TO FALSE!
- * SEE:      "FIXES_GetPlayerDialog".
- * AUTHOR:   Y_Less/xX_Simon_Xx
- * POST:     http://forum.sa-mp.com/showpost.php?p=2141254
- * 
- * FIX:      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".
- * SOLUTION: Hide it.
- * SEE:      "OnPlayerConnect", "OnGameModeExit".
- * AUTHOR:   xX_Simon_Xx
- * POST:     https://github.com/Y-Less/sa-mp-fixes/issues/2
- * 
- * FIX:      SetSpawnInfo
- * PROBLEM:  Kicks the player if "SpawnPlayer" is called before "SetSpawnInfo".
- * SOLUTION: Call "SetSpawnInfo" at least once.
- * SEE:      "OnPlayerConnect".
- * AUTHOR:   Y_Less
- * 
- * FIX:      SetPlayerSkin
- * PROBLEM:  Breaks sitting on bikes.
- * SOLUTION: Put them back in the vehicle after setting their skin.
- * SEE:      "FIXES_SetPlayerSkin".
- * AUTHOR:   CyNiC
- * POST:     http://forum.sa-mp.com/showpost.php?p=1756094
- * 
- * FIX:      HideMenuForPlayer
- * PROBLEM:  Crashes when passed an invalid menu ID.
- * SOLUTION: Don't hide it when passed an invalid menu.
- * SEE:      "FIXES_HideMenuForPlayer".
- * AUTHOR:   Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=1787297
- * 
- * FIX:      valstr
- * PROBLEM:  Crashes on large numbers.
- * SOLUTION: Use "format" instead.
- * SEE:      "FIXES_valstr".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1790300
- * 
- * FIX:      fclose
- * PROBLEM:  Crashes on an invalid handle.
- * SOLUTION: Check for an invalid handle.
- * SEE:      "FIXES_fclose".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1790300
- * 
- * FIX:      fwrite
- * PROBLEM:  Crashes on an invalid handle.
- * SOLUTION: Check for an invalid handle.
- * SEE:      "FIXES_fwrite".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1790300
- * 
- * FIX:      fread
- * PROBLEM:  Crashes on an invalid handle.
- * SOLUTION: Check for an invalid handle.
- * SEE:      "FIXES_fread".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1790300
- * 
- * FIX:      fputchar
- * PROBLEM:  Crashes on an invalid handle.
- * SOLUTION: Check for an invalid handle.
- * SEE:      "FIXES_fputchar".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1790300
- * 
- * FIX:      fgetchar
- * PROBLEM:  Crashes on an invalid handle.
- * SOLUTION: Check for an invalid handle.
- * SEE:      "FIXES_fgetchar".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1790300
- * 
- * FIX:      fblockwrite
- * PROBLEM:  Crashes on an invalid handle.
- * SOLUTION: Check for an invalid handle.
- * SEE:      "FIXES_fblockwrite".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1790300
- * 
- * FIX:      fblockread
- * PROBLEM:  Crashes on an invalid handle.
- * SOLUTION: Check for an invalid handle.
- * SEE:      "FIXES_fblockread".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1790300
- * 
- * FIX:      fseek
- * PROBLEM:  Crashes on an invalid handle.
- * SOLUTION: Check for an invalid handle.
- * SEE:      "FIXES_fseek".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1790300
- * 
- * FIX:      flength
- * PROBLEM:  Crashes on an invalid handle.
- * SOLUTION: Check for an invalid handle.
- * SEE:      "FIXES_flength".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1790300
- * 
- * FIX:      file_inc
- * PROBLEM:  Includes or excludes all the file function fixes together (can
- *           cause major overhead).
- * SOLUTION: Optionally group them all under one define.  DEFAULTS TO FALSE!
- * SEE:      "FIX_file_inc".
- * AUTHOR:   Y_Less
- * 
- * FIX:      IsPlayerAttachedObjectSlotUsed
- * PROBLEM:  Doesn't work in OnPlayerDisconnect.
- * SOLUTION: Maintain an internal record of slots used.
- * SEE:      "FIXES_SetPlayerAttachedObject",
- *           "FIXES_RemovePlayerAttachedObject",
- *           "FIXES_IsPAttachedObjectSlotUsed", and
- *           "OnPlayerDisconnect".
- * AUTHOR:   Y_Less
- * 
- * FIX:      SetPlayerAttachedObject
- * PROBLEM:  Doesn't remove objects when the mode ends.
- * SOLUTION: Remove them.
- * SEE:      "FIXES_SetPlayerAttachedObject",
- *           "FIXES_RemovePlayerAttachedObject", and
- *           "OnPlayerDisconnect".
- * AUTHOR:   Y_Less
- * 
- * FIX:      OnPlayerDeath
- * PROBLEM:  Clients get stuck when they die with an animation applied.
- * SOLUTION: Clear their animations.
- * SEE:      "OnPlayerDeath" and "OnPlayerUpdate".
- * AUTHOR:   h02
- * POST:     http://forum.sa-mp.com/showpost.php?p=1641144
- * 
- * FIX:      strins
- * PROBLEM:  Ignores the "maxlength" parameter causing possible crashes.
- * SOLUTION: Manually check the length.
- * SEE:      "FIXES_strins".
- * AUTHOR:   Slice/Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=1860495
- * POST:     http://forum.sa-mp.com/showpost.php?p=1864706
- * 
- * FIX:      IsPlayerConnected
- * PROBLEM:  Only uses the lower two bytes of a passed ID.
- * SOLUTION: Mask the numbers.
- * SEE:      "FIXES_IsPlayerConnected".
- * AUTHOR:   Slice
- * POST:     http://forum.sa-mp.com/showpost.php?p=1860464
- * 
- * FIX:      OnPlayerCommandText
- * PROBLEM:  Can crash ZCMD when passed a null string.
- * SOLUTION: Pass NULL if invalid inputs given.
- * SEE:      "OnPlayerCommandText".
- * AUTHOR:   Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=1909511
- * 
- * FIX:      TrainExit
- * PROBLEM:  When getting out of a train entered by "PutPlayerInVehicle", the
- *           camera does not reset properly.
- * SOLUTION: Reset the camera.
- * SEE:      "FIXES_PutPlayerInVehicle", "FIXES_OnPlayerStateChange".
- * AUTHOR:   Terminator3/Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=1980214
- * 
- * FIX:      Kick
- * PROBLEM:  Calling "Kick" in "OnPlayerConnect" doesn't work properly.
- * SOLUTION: Defer it.
- * SEE:      "OnPlayerConnect", "FIXES_Kick".
- * AUTHOR:   Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=1989453
- * FIXED IN: 0.3x
- * 
- * FIX:      OnVehicleMod
- * PROBLEM:  Crashes other players when invalid mods are applied.
- * SOLUTION: Desync the player.
- * SEE:      "OnVehicleMod".
- * AUTHOR:   JernejL/Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=1671500
- * 
- * FIX:      random
- * PROBLEM:  Doesn't work with negative numbers.
- * SOLUTION: Invert then reinvert.  DEFAULTS TO FALSE!
- * SEE:      "FIXES_random".
- * AUTHOR:   xX_Simon_Xx
- * POST:     http://forum.sa-mp.com/showpost.php?p=2141254
- * 
- * FIX:      sleep
- * PROBLEM:  Leaks bytes from the stack.
- * SOLUTION: Call a function to store the correct value.
- * SEE:      "FIXES_sleep".
- * AUTHOR:   Y_Less
- * 
- * FIX:      AddMenuItem
- * PROBLEM:  Crashes when passed an invalid menu ID.
- * SOLUTION: Don't hide it when passed an invalid menu.
- * SEE:      "FIXES_AddMenuItem".
- * AUTHOR:   Y_Less
- * 
- * FIX:      SetMenuColumnHeader
- * PROBLEM:  Crashes when passed an invalid menu ID.
- * SOLUTION: Don't hide it when passed an invalid menu.
- * SEE:      "FIXES_SetMenuColumnHeader".
- * AUTHOR:   Y_Less
- * 
- * FIX:      ShowMenuForPlayer
- * PROBLEM:  Crashes when passed an invalid menu ID.
- * SOLUTION: Don't hide it when passed an invalid menu.
- * SEE:      "FIXES_ShowMenuForPlayer".
- * AUTHOR:   Y_Less
- * 
- * FIX:      HideMenuForPlayer
- * PROBLEM:  Crashes when passed an invalid menu ID.
- * SOLUTION: Don't hide it when passed an invalid menu.
- * SEE:      "FIXES_HideMenuForPlayer".
- * AUTHOR:   Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=1787297
- * 
- * FIX:      HideMenuForPlayer_2
- * PROBLEM:  Ignores the "menuid" parameter.
- * SOLUTION: Only hide the correct menu.  DEFAULTS TO FALSE!
- * SEE:      "FIXES_HideMenuForPlayer".
- * AUTHOR:   Y_Less
- * 
- * FIX:      DisableMenu
- * PROBLEM:  Crashes when passed an invalid menu ID.
- * SOLUTION: Don't hide it when passed an invalid menu.
- * SEE:      "FIXES_DisableMenu".
- * AUTHOR:   Y_Less
- * 
- * FIX:      DisableMenuRow
- * PROBLEM:  Crashes when passed an invalid menu ID.
- * SOLUTION: Don't hide it when passed an invalid menu.
- * SEE:      "FIXES_DisableMenuRow".
- * AUTHOR:   Y_Less
- * 
- * FIX:      Menus
- * PROBLEM:  All menu function fixes are included separately for major overhead.
- * SOLUTION: Optionally group them all under one define.
- * SEE:      "FIX_Menus", "_FIX_Menus"
- * AUTHOR:   Y_Less
- * 
- * FIX:      GetPlayerMenu
- * PROBLEM:  Returns previous menu when none is displayed.
- * SOLUTION: Return the correct value.
- * SEE:      "FIXES_GetPlayerMenu", "OnPlayerSelectedMenuRow".
- * AUTHOR:   Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=2295867
- * 
- * FIX:      GetPlayerInterior
- * PROBLEM:  Always returns 0 for NPCs.
- * SOLUTION: Return the correct value.
- * SEE:      "FIXES_GetPlayerInterior", "FIXES_SetPlayerInterior".
- * AUTHOR:   Y_Less/xX_Simon_Xx
- * POST:     http://forum.sa-mp.com/showpost.php?p=2309246
- * 
- * FIX:      ClearAnimations
- * PROBLEM:  Use ClearAnimation while you are in a vehicle cause the player exit
- *           from it.
- * SOLUTION: Apply an animation instead of clear animation.
- * SEE:      "FIXES_ClearAnimations".
- * AUTHOR:   xX_Simon_Xx
- * POST:     https://github.com/Y-Less/sa-mp-fixes/issues/4
- * 
- * FIX:      ClearAnimations_2
- * PROBLEM:  ClearAnimations doesn't do anything when the animation ends if we
- *           pass 1 for the freeze parameter in ApplyAnimation.
- * SOLUTION: Apply an idle animation for stop and then use ClearAnimation.
- * SEE:      "FIXES_ClearAnimations".
- * AUTHOR:   xX_Simon_Xx
- * POST:     https://github.com/Y-Less/sa-mp-fixes/issues/4
- * 
- * FIX:      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.
- * SOLUTION: Apply the animation to return the player in the vehicle.
- * SEE:      "OnPlayerKeyStateChange".
- * AUTHOR:   xX_Simon_Xx
- * POST:     https://github.com/Y-Less/sa-mp-fixes/issues/13
- * 
- * FIX:      GangZoneCreate
- * PROBLEM:  Gang zones bug on the main map for players at certain angles
- *           relative to them.
- * SOLUTION: Set a non floating value for the gang zone co-ordinate.
- * SEE:      "FIXES_GangZoneCreate".
- * AUTHOR:   xX_Simon_Xx/Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=2144109
- * 
- * FIX:      SPECIAL_ACTION_PISSING
- * PROBLEM:  "SPECIAL_ACTION_PISSING" isn't defined by default.
- * SOLUTION: Define it.
- * SEE:      N/A.
- * AUTHOR:   xX_Simon_Xx
- * POST:     https://github.com/Y-Less/sa-mp-fixes/issues/6
- * 
- * FIX:      IsValidVehicle
- * PROBLEM:  "IsValidVehicle" isn't defined by default.
- * SOLUTION: Define it.
- * SEE:      N/A.
- * AUTHOR:   xX_Simon_Xx
- * POST:     http://forum.sa-mp.com/showpost.php?p=2693650
- * 
- * FIX:      ApplyAnimation
- * PROBLEM:  Passing an invalid animation library in ApplyAnimation causes a
- *           client crash for streamed in players.
- * SOLUTION: Block ApplyAnimation when an invalid library is passed.
- * SEE:      "FIXES_ApplyAnimation".
- * AUTHOR:   xX_Simon_Xx
- * POST:     https://github.com/Y-Less/sa-mp-fixes/issues/5
- * 
- * FIX:      ApplyAnimation_2
- * PROBLEM:  First time a library is used, it does nothing.
- * SOLUTION: Apply animations twice when first using a library.
- * SEE:      "FIXES_ApplyAnimation".
- * AUTHOR:   xX_Simon_Xx/Lordzy/Y_Less
- * POST:     http://forum.sa-mp.com/showpost.php?p=3052627
- * 
- * FIX:      OnPlayerSpawn
- * PROBLEM:  San Andreas deducts $100 from players.
- * SOLUTION: Give them it back.
- * SEE:      "OnPlayerSpawn".
- * AUTHOR:   Y_Less
- * 
- * FIX:      GetGravity
- * PROBLEM:  "GetGravity" isn't defined by default.
- * SOLUTION: Define it.
- * SEE:      N/A.
- * AUTHOR:   Whitetiger
- * POST:     http://forum.sa-mp.com/showpost.php?p=1706447
- * 
- * FIX:      gpci
- * PROBLEM:  "gpci" isn't defined by default.
- * SOLUTION: Define it.
- * SEE:      N/A.
- * AUTHOR:   xX_Simon_Xx
- * POST:     http://pastebin.com/VQSGpbSm
- * 
- * FIX:      Natives
- * PROBLEM:  Several natives are included by default, this enables or disables
- *           them all.  Therefore this is an umbrella fix for several fixes.
- * SOLUTION: Define them.
- * SEE:      "FIX_GetGravity", "FIX_gpci", "FIX_IsValidVehicle".
- * AUTHOR:   Y_Less
- * 
- * FIX:      OnPlayerConnect
- * PROBLEM:  This function isn't called for players when a filterscript starts.
- * SOLUTION: Call it for all connected players.
- * SEE:      "FIXES_OnFilterScriptInit".
- * AUTHOR:   Y_Less
- * 
- * FIX:      OnPlayerDisconnect
- * PROBLEM:  This function isn't called for players when a filterscript ends.
- * SOLUTION: Call it for all connected players.
- * SEE:      "FIXES_OnFilterScriptExit".
- * AUTHOR:   Y_Less
- * 
- * FIX:      GameText
- * PROBLEM:  Several styles do not display for the time specified.
- * SOLUTION: Recreate the styles in Text Draws and use those instead.
- * SEE:      "FIXES_GameTextForAll", "FIXES_GameTextForPlayer".
- * AUTHOR:   Y_Less
- * 
- * FIX:      GameTextStyles
- * PROBLEM:  San Andreas has fixed styles for area and vehicle names, but they
- *           are not included in the GameText styles list.
- * SOLUTION: Add them.  DEFAULTS TO FALSE.
- * SEE:      "FIXES_GameTextForAll", "FIXES_GameTextForPlayer".
- * AUTHOR:   Y_Less
- * 
- * FIX:      HideGameText
- * PROBLEM:  There is no "HideGameTextForXYZ" function.
- * SOLUTION: Show a single space for a game text.  DEFAULTS TO FALSE.
- * SEE:      "FIXES_HideGameTextForAll", "FIXES_HideGameTextForPlayer".
- * AUTHOR:   Y_Less
- * 
- * FIX:      BODYPARTS
- * PROBLEM:  The bodyparts to be used in OnPlayer(Take/Give)Damage are not
- *           defined by default
- * SOLUTION: Define it.
- * SEE:      N/A.
- * AUTHOR:   Whitetiger
- * 
- * FIX:      CAMERAMODES
- * PROBLEM:  The camera modes for GetPlayerCameraMode are not defined by
- *           default.
- * SOLUTION: Define it.
- * SEE:      N/A.
- * AUTHOR:   Whitetiger
- * POST:     http://forum.sa-mp.com/showpost.php?p=1309730
- * 
- * FIX:      SetPlayerCamera
- * PROBLEM:  Using the camera functions directly after enabling spectator mode
- *           doesn't work.
- * SOLUTION: Defer them.
- * SEE:      "FIXES_SetPlayerCameraPos", "FIXES_SetPlayerCameraLookAt",
- *           "FIXES_TogglePlayerSpectating".
- * AUTHOR:   Emmet_
- * 
- * FIX:      SetPlayerTime
- * PROBLEM:  Using this function under "OnPlayerConnect" doesn't work.
- * SOLUTION: Defer it.
- * SEE:      "FIXES_SetPlayerTime"
- * AUTHOR:   Emmet_
- * 
- * FIX:      OnPlayerRequestClass
- * PROBLEM:  Random blunts and bottles sometimes appear in class selection.
- * SOLUTION: Call "RemoveBuildingForPlayer".
- * SEE:      "OnPlayerRequestClass"
- * AUTHOR:   Y_Less
- * 
- * ==============
- *  STYLE RULES: 
- * ==============
- * 
- * All globals should be "static stock" whenever possible (so they can only be
- *     accessed from this one file).
- * 
- * Statics must start with "FIXES_gs", and all other globals with "FIXES_g".
- * 
- * All functions not overriding existing functions must start with "FIXES_".
- * 
- * Macros must be upper case, use underscores, and start "FIXES_":
- *     "FIXES_LIKE_THIS".
- * 
- * Functions should be upper camel case (as the original functions are)
- *     "FIXES_LikeThis".
- * 
- * Globals (after the prefix) should be upper camel case "LikeThis", and locals
- *     lower camel case "likeThis".
- * 
- * ALS should be used to hook functions and callbacks.  See this topic for more
- *    details:
- *    
- *        http://forum.sa-mp.com/showthread.php?t=441293
- * 
- * The ALS prefix for chaining is "FIXES_".
- * 
- * When redefining a native, add a "BAD_" external name declaration with the
- *     "_ALS_" definition so that others may use the original native if they so
- *     desire (with the caveat that it may break all fixes).  Note the "BAD_"
- *     name is meant to indicate the possibility of breaking the fix, not a
- *     comment on the original native function.
- * 
- * The ALS hook defines used here are a little different to the normal ones as
- *     this file assumes that it is always first.  The pattern is:
- *     
- *         #if defined _ALS_NameOfFixHere
- *             #error _ALS_NameOfFixHere defined
- *         #endif
- *         native BAD_NameOfFixHere(params) = NameOfFixHere;
- *         
- *         #if FIX_NameOfFixHere
- *             stock FIXES_NameOfFixHere(params)
- *             {
- *                 return 0;
- *             }
- *             
- *             #define _ALS_NameOfFixHere
- *             #define NameOfFixHere FIXES_NameOfFixHere
- *         #endif
- *    
- *    A copyable version of this pattern is at the end of the file.
- * 
- * Enums start with "E_" or "e_" depending on type, then follow rules for
- *     macros.
- * 
- * NO libraries should be included - not even the default SA:MP ones.  Let the
- *     user do it.
- * 
- * Due to the above rule, you cannot assume any third party libraries AT ALL, so
- *     do not use them.  This can lead to some code duplication, but also means
- *     that the version of the code used here can be tailored for optimisations.
- * 
- * Certain terms may be shortened when dealing with long callback names to avoid
- *     compile truncation warnings (max symbol length is 31).  Current list:
- *     
- *         "Checkpoint" -> "CP"
- *         "Update"     -> "Upd"
- *         "TextDraw"   -> "TD"
- *         "Object"     -> "Obj"
- *         "Player"     -> "P"
- * 
- * Document all fixes at the top of the file, and highlight code.
- * 
- * 4 space TABS - do not edit this file in PAWNO unless you know how to correct
- *     the indentation.
- * 
- * All rules have exceptions, but they must be justifiable.  For example
- *     "IS_FILTERSCRIPT" is a global variable, but is not called
- *     "FIXES_gIsFilterscript" to better match the "FILTERSCRIPT" macro it
- *     replaces.  Now a macro for "_FIXES_gIsFilterscript".
- * 
- * Variables which need to be fully global (i.e. not "static"), but should not
- *     actually be used by other people (e.g. appear inside a macro) should be
- *     prefixed with "_FIXES" instead of "FIXES" to indicate their private use.
- * 
- * No comments beyond the end of column 80 (where the line in "PAWNO" is).
- * 
- * If a bug is fixed in some version of the server it can be conditionally
- *     included here.  This is done by checking for the existance of a native
- *     function introduced in the same server version.  For example
- *     "TogglePlayerControllable" was fixed in 0.3eRC6, the same time as the
- *     "SetObjectMaterial" native was introduced, thus the inclusion becomes:
- *     
- *         #if !defined FIX_TogglePlayerControllable
- *             #if defined SetObjectMaterial
- *                 #define FIX_TogglePlayerControllable (0)
- *             #else
- *                 #define FIX_TogglePlayerControllable (1)
- *             #endif
- *         #elseif _FIXES_IS_UNSET(FIX_TogglePlayerControllable)
- *             #undef FIX_TogglePlayerControllable
- *             #define FIX_TogglePlayerControllable     (2)
- *         #endif
- *     
- *     This only includes this fix if that native doesn't exist.  A copyable
- *     version of this pattern is at the end of the file.
- * 
- * To reduce general memory consumption, strings in this include are stored
- *     globally in constant arrays and referenced.  This is EXACTLY as fast as
- *     using the string constants directly, but means that strings are not
- *     stored in the assembly multiple times (unless the string is only used
- *     once, in which case it's more work for no gain).  See this post for more
- *     details:
- *     
- *         http://forum.sa-mp.com/showpost.php?p=1795601
- * 
- * DO NOT EDIT THIS FILE IN PAWNO OR ON GITHUB.  Both mess up the spacing -
- *     GitHub in an almost irreversible way (except for the fact that nothing is
- *     irreversible in source control.  Pawno spacing is less tricky to solve,
- *     and can be worked around if you know when it uses spaces and tabs - in
- *     short, always write code first THEN indent and you won't have a problem
- *     (in that editor at least, that is normally a bad way to write code).
- * 
- * Documentation explanation:
- *     
- *         FIX:      <Short name>
- *         PROBLEM:  <Description of problem>
- *         SOLUTION: <Description of solution>
- *         SEE:      <List of relevant functions>
- *         AUTHOR:   <Person who wrote the fix>
- *         POST:     <Optional link to the original post where applicable>
- *         FIXED IN: <Optional server version of official fix where applicable>
- * 
- */
+	#if defined _connection //if minc is defined
+    #endinput //ends the input(i think!)
+#endif //ends if
+#define _connect //defines minc
 
-#if defined _INC_SAMP_Community_fixes
-	#endinput
-#endif
-#define _INC_SAMP_Community_fixes
+native SendClientJob(playerid, color, string[], job);
 
-#if !defined _inc_fixes
-	#define _inc_fixes
-#endif
-
-#define _FIXES_IS_UNSET(%0) ((2*%0-1+1)==-1)
-
-// We can add server version compiler code here to only compile fixes that apply
-// to the version of the includes for which the user is compiling.
-#if !defined FIX_GetPlayerColour
-	#if defined FIX_GetPlayerColor
-		#if _FIXES_IS_UNSET(FIX_GetPlayerColor)
-			#define FIX_GetPlayerColour   (2)
-		#else
-			#define FIX_GetPlayerColour   (FIX_GetPlayerColor)
-		#endif
-	#else
-		#define FIX_GetPlayerColour       (1)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_GetPlayerColour)
-	#undef FIX_GetPlayerColour
-	#define FIX_GetPlayerColour           (2)
-#endif
-
-#if !defined FIX_FILTERSCRIPT
-	#define FIX_FILTERSCRIPT             (1)
-#elseif _FIXES_IS_UNSET(FIX_FILTERSCRIPT)
-	#undef FIX_FILTERSCRIPT
-	#define FIX_FILTERSCRIPT             (2)
-#endif
-
-#if !defined FIX_SpawnPlayer
-	#define FIX_SpawnPlayer              (1)
-#elseif _FIXES_IS_UNSET(FIX_SpawnPlayer)
-	#undef FIX_SpawnPlayer
-	#define FIX_SpawnPlayer              (2)
-#endif
-
-#if !defined FIX_SetPlayerName
-	#define FIX_SetPlayerName            (1)
-#elseif _FIXES_IS_UNSET(FIX_SetPlayerName)
-	#undef FIX_SetPlayerName
-	#define FIX_SetPlayerName            (2)
-#endif
-
-#if !defined FIX_GetPlayerSkin
-	#define FIX_GetPlayerSkin            (1)
-#elseif _FIXES_IS_UNSET(FIX_GetPlayerSkin)
-	#undef FIX_GetPlayerSkin
-	#define FIX_GetPlayerSkin            (2)
-#endif
-
-#if !defined FIX_GetWeaponName
-	#define FIX_GetWeaponName            (1)
-#elseif _FIXES_IS_UNSET(FIX_GetWeaponName)
-	#undef FIX_GetWeaponName
-	#define FIX_GetWeaponName            (2)
-#endif
-
-#if !defined FIX_SetPlayerWorldBounds
-	#define FIX_SetPlayerWorldBounds     (1)
-#elseif _FIXES_IS_UNSET(FIX_SetPlayerWorldBounds)
-	#undef FIX_SetPlayerWorldBounds
-	#define FIX_SetPlayerWorldBounds     (2)
-#endif
-
-#if !defined FIX_TogglePlayerControllable
-	#if defined SetObjectMaterial
-		#define FIX_TogglePlayerControllable (0)
-	#else
-		#define FIX_TogglePlayerControllable (1)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_TogglePlayerControllable)
-	#undef FIX_TogglePlayerControllable
-	#define FIX_TogglePlayerControllable (2)
-#endif
-
-#if !defined FIX_HydraSniper
-	#define FIX_HydraSniper              (1)
-#elseif _FIXES_IS_UNSET(FIX_HydraSniper)
-	#undef FIX_HydraSniper
-	#define FIX_HydraSniper              (2)
-#endif
-
-#if !defined FIX_IsPlayerInCheckpoint
-	#define FIX_IsPlayerInCheckpoint     (1)
-#elseif _FIXES_IS_UNSET(FIX_IsPlayerInCheckpoint)
-	#undef FIX_IsPlayerInCheckpoint
-	#define FIX_IsPlayerInCheckpoint     (2)
-#endif
-
-#if !defined FIX_IsPlayerInRaceCheckpoint
-	#define FIX_IsPlayerInRaceCheckpoint (1)
-#elseif _FIXES_IS_UNSET(FIX_IsPlayerInRaceCheckpoint)
-	#undef FIX_IsPlayerInRaceCheckpoint
-	#define FIX_IsPlayerInRaceCheckpoint (2)
-#endif
-
-#if !defined FIX_GetPlayerWeapon
-	#define FIX_GetPlayerWeapon          (1)
-#elseif _FIXES_IS_UNSET(FIX_GetPlayerWeapon)
-	#undef FIX_GetPlayerWeapon
-	#define FIX_GetPlayerWeapon          (2)
-#endif
-
-#if !defined FIX_PutPlayerInVehicle
-	#define FIX_PutPlayerInVehicle       (1)
-#elseif _FIXES_IS_UNSET(FIX_PutPlayerInVehicle)
-	#undef FIX_PutPlayerInVehicle
-	#define FIX_PutPlayerInVehicle       (2)
-#endif
-
-#if !defined FIX_KEY_AIM
-	#if defined KEY_AIM
-		#define FIX_KEY_AIM              (0)
-	#else
-		#define FIX_KEY_AIM              (1)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_KEY_AIM)
-	#undef FIX_KEY_AIM
-	#define FIX_KEY_AIM                  (2)
-#endif
-
-#if !defined FIX_SPECIAL_ACTION_PISSING
-	#if defined SPECIAL_ACTION_PISSING
-		#define FIX_SPECIAL_ACTION_PISSING (0)
-	#else
-		#define FIX_SPECIAL_ACTION_PISSING (1)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_SPECIAL_ACTION_PISSING)
-	#undef FIX_SPECIAL_ACTION_PISSING
-	#define FIX_SPECIAL_ACTION_PISSING   (2)
-#endif
-
-#if !defined FIX_Natives
-	#define FIX_Natives                  (1)
-#elseif _FIXES_IS_UNSET(FIX_Natives)
-	#undef FIX_Natives
-	#define FIX_Natives                  (2)
-#endif
-
-#if !defined FIX_IsValidVehicle
-	#if defined IsValidVehicle
-		#define FIX_IsValidVehicle       (0)
-	#else
-		#define FIX_IsValidVehicle       (FIX_Natives)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_IsValidVehicle)
-	#undef FIX_IsValidVehicle
-	#define FIX_IsValidVehicle           (2)
-#endif
-
-#if !defined FIX_GetGravity
-	#if defined GetGravity
-		#define FIX_GetGravity           (0)
-	#else
-		#define FIX_GetGravity           (FIX_Natives)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_GetGravity)
-	#undef FIX_GetGravity
-	#define FIX_GetGravity               (2)
-#endif
-
-#if !defined FIX_gpci
-	#if defined gpci
-		#define FIX_gpci                 (0)
-	#else
-		#define FIX_gpci                 (FIX_Natives)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_gpci)
-	#undef FIX_gpci
-	#define FIX_gpci                     (2)
-#endif
-
-#if !defined FIX_BODYPARTS
-	#if defined BODY_PART_TORSO
-		#define FIX_BODYPARTS            (0)
-	#else
-		#define FIX_BODYPARTS            (1)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_BODYPARTS)
-	#undef FIX_BODYPARTS
-	#define FIX_BODYPARTS                (2)
-#endif
-
-#if !defined FIX_CAMERAMODES
-	#if defined CAM_MODE_NONE
-		#define FIX_CAMERAMODES          (0)
-	#else
-		#define FIX_CAMERAMODES          (1)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_CAMERAMODES)
-	#undef FIX_CAMERAMODES
-	#define FIX_CAMERAMODES              (2)
-#endif
-
-#if !defined FIX_DriveBy
-	#define FIX_DriveBy                  (1)
-#elseif _FIXES_IS_UNSET(FIX_DriveBy)
-	#undef FIX_DriveBy
-	#define FIX_DriveBy                  (2)
-#endif
-
-#if !defined FIX_SetPlayerCheckpoint
-	#define FIX_SetPlayerCheckpoint      (1)
-#elseif _FIXES_IS_UNSET(FIX_SetPlayerCheckpoint)
-	#undef FIX_SetPlayerCheckpoint
-	#define FIX_SetPlayerCheckpoint      (2)
-#endif
-
-#if !defined FIX_SetPlayerRaceCheckpoint
-	#define FIX_SetPlayerRaceCheckpoint  (1)
-#elseif _FIXES_IS_UNSET(FIX_SetPlayerRaceCheckpoint)
-	#undef FIX_SetPlayerRaceCheckpoint
-	#define FIX_SetPlayerRaceCheckpoint  (2)
-#endif
-
-#if !defined FIX_TextDrawCreate
-	#define FIX_TextDrawCreate           (1)
-#elseif _FIXES_IS_UNSET(FIX_TextDrawCreate)
-	#undef FIX_TextDrawCreate
-	#define FIX_TextDrawCreate           (2)
-#endif
-
-#if !defined FIX_TextDrawSetString
-	#define FIX_TextDrawSetString        (1)
-#elseif _FIXES_IS_UNSET(FIX_TextDrawSetString)
-	#undef FIX_TextDrawSetString
-	#define FIX_TextDrawSetString        (2)
-#endif
-
-#if !defined FIX_AllowInteriorWeapons
-	#define FIX_AllowInteriorWeapons     (1)
-#elseif _FIXES_IS_UNSET(FIX_AllowInteriorWeapons)
-	#undef FIX_AllowInteriorWeapons
-	#define FIX_AllowInteriorWeapons     (2)
-#endif
-
-#if !defined FIX_OnPlayerEnterVehicle
-	#if defined OnPlayerClickMap
-		#define FIX_OnPlayerEnterVehicle (0)
-	#else
-		#define FIX_OnPlayerEnterVehicle (1)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_OnPlayerEnterVehicle)
-	#undef FIX_OnPlayerEnterVehicle
-	#define FIX_OnPlayerEnterVehicle     (2)
-#endif
-
-#if !defined FIX_OnPlayerEnterVehicle_2
-	#define FIX_OnPlayerEnterVehicle_2   (1)
-#elseif _FIXES_IS_UNSET(FIX_OnPlayerEnterVehicle)
-	#undef FIX_OnPlayerEnterVehicle_2
-	#define FIX_OnPlayerEnterVehicle_2   (2)
-#endif
-
-#if !defined FIX_AllowTeleport
-	#if defined OnPlayerClickMap
-		#define FIX_AllowTeleport        (1)
-	#else
-		#define FIX_AllowTeleport        (0)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_AllowTeleport)
-	#undef FIX_AllowTeleport
-	#define FIX_AllowTeleport            (2)
-#endif
-
-#if !defined FIX_SetPlayerSpecialAction
-	#define FIX_SetPlayerSpecialAction   (1)
-#elseif _FIXES_IS_UNSET(FIX_SetPlayerSpecialAction)
-	#undef FIX_SetPlayerSpecialAction
-	#define FIX_SetPlayerSpecialAction   (2)
-#endif
-
-#if !defined FIX_ClearAnimations
-	#define FIX_ClearAnimations          (1)
-#elseif _FIXES_IS_UNSET(FIX_ClearAnimations)
-	#undef FIX_ClearAnimations
-	#define FIX_ClearAnimations          (2)
-#endif
-
-#if !defined FIX_ClearAnimations_2
-	#define FIX_ClearAnimations_2        (1)
-#elseif _FIXES_IS_UNSET(FIX_ClearAnimations_2)
-	#undef FIX_ClearAnimations_2
-	#define FIX_ClearAnimations_2        (2)
-#endif
-
-#if !defined FIX_GangZoneCreate
-	#define FIX_GangZoneCreate           (1)
-#elseif _FIXES_IS_UNSET(FIX_GangZoneCreate)
-	#undef FIX_GangZoneCreate
-	#define FIX_GangZoneCreate           (2)
-#endif
-
-#if !defined FIX_OnDialogResponse
-	#if defined GetVehicleModelInfo
-		#define FIX_OnDialogResponse     (0)
-	#else
-		#define FIX_OnDialogResponse     (1)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_OnDialogResponse)
-	#undef FIX_OnDialogResponse
-	#define FIX_OnDialogResponse         (2)
-#endif
-
-#if !defined FIX_GetPlayerDialog
-	#define FIX_GetPlayerDialog          (0)
-#elseif _FIXES_IS_UNSET(FIX_GetPlayerDialog)
-	#undef FIX_GetPlayerDialog
-	#define FIX_GetPlayerDialog          (2)
-#endif
-
-#if !defined FIX_PlayerDialogResponse
-	#define FIX_PlayerDialogResponse     (1)
-#elseif _FIXES_IS_UNSET(FIX_PlayerDialogResponse)
-	#undef FIX_PlayerDialogResponse
-	#define FIX_PlayerDialogResponse     (2)
-#endif
-
-#if !defined FIX_SetSpawnInfo
-	#if defined GetPlayerVersion
-		#define FIX_SetSpawnInfo         (0)
-	#else
-		#define FIX_SetSpawnInfo         (1)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_SetSpawnInfo)
-	#undef FIX_SetSpawnInfo
-	#define FIX_SetSpawnInfo             (2)
-#endif
-
-#if !defined FIX_SetPlayerSkin
-	#define FIX_SetPlayerSkin            (1)
-#elseif _FIXES_IS_UNSET(FIX_SetPlayerSkin)
-	#undef FIX_SetPlayerSkin
-	#define FIX_SetPlayerSkin            (2)
-#endif
-
-#if !defined FIX_HideMenuForPlayer
-	#define FIX_HideMenuForPlayer        (1)
-#elseif _FIXES_IS_UNSET(FIX_HideMenuForPlayer)
-	#undef FIX_HideMenuForPlayer
-	#define FIX_HideMenuForPlayer        (2)
-#endif
-
-#if !defined FIX_valstr
-	#define FIX_valstr                   (1)
-#elseif _FIXES_IS_UNSET(FIX_valstr)
-	#undef FIX_valstr
-	#define FIX_valstr                   (2)
-#endif
-
-#if !defined FIX_file_inc
-	#define FIX_file_inc                 (0)
-#elseif _FIXES_IS_UNSET(FIX_file_inc)
-	#undef FIX_file_inc
-	#define FIX_file_inc                 (2)
-#endif
-
-#if !defined FIX_fclose
-	#define FIX_fclose                   (FIX_file_inc)
-#elseif _FIXES_IS_UNSET(FIX_fclose)
-	#undef FIX_fclose
-	#define FIX_fclose                   (2)
-#endif
-
-#if !defined FIX_fwrite
-	#define FIX_fwrite                   (FIX_file_inc)
-#elseif _FIXES_IS_UNSET(FIX_fwrite)
-	#undef FIX_fwrite
-	#define FIX_fwrite                   (2)
-#endif
-
-#if !defined FIX_fread
-	#define FIX_fread                    (FIX_file_inc)
-#elseif _FIXES_IS_UNSET(FIX_fread)
-	#undef FIX_fread
-	#define FIX_fread                    (2)
-#endif
-
-#if !defined FIX_fputchar
-	#define FIX_fputchar                 (FIX_file_inc)
-#elseif _FIXES_IS_UNSET(FIX_fputchar)
-	#undef FIX_fputchar
-	#define FIX_fputchar                 (2)
-#endif
-
-#if !defined FIX_fgetchar
-	#define FIX_fgetchar                 (FIX_file_inc)
-#elseif _FIXES_IS_UNSET(FIX_fgetchar)
-	#undef FIX_fgetchar
-	#define FIX_fgetchar                 (2)
-#endif
-
-#if !defined FIX_fblockwrite
-	#define FIX_fblockwrite              (FIX_file_inc)
-#elseif _FIXES_IS_UNSET(FIX_fblockwrite)
-	#undef FIX_fblockwrite
-	#define FIX_fblockwrite              (2)
-#endif
-
-#if !defined FIX_fblockread
-	#define FIX_fblockread               (FIX_file_inc)
-#elseif _FIXES_IS_UNSET(FIX_fblockread)
-	#undef FIX_fblockread
-	#define FIX_fblockread               (2)
-#endif
-
-#if !defined FIX_fseek
-	#define FIX_fseek                    (FIX_file_inc)
-#elseif _FIXES_IS_UNSET(FIX_fseek)
-	#undef FIX_fseek
-	#define FIX_fseek                    (2)
-#endif
-
-#if !defined FIX_flength
-	#define FIX_flength                  (FIX_file_inc)
-#elseif _FIXES_IS_UNSET(FIX_flength)
-	#undef FIX_flength
-	#define FIX_flength                  (2)
-#endif
-
-#if !defined FIX_IsPlayerAttachedObjSlotUsed
-	#define FIX_IsPlayerAttachedObjSlotUsed (1)
-#elseif _FIXES_IS_UNSET(FIX_IsPlayerAttachedObjSlotUsed)
-	#undef FIX_IsPlayerAttachedObjSlotUsed
-	#define FIX_IsPlayerAttachedObjSlotUsed (2)
-#endif
-
-#if !defined FIX_SetPlayerAttachedObject
-	#define FIX_SetPlayerAttachedObject  (1)
-#elseif _FIXES_IS_UNSET(FIX_SetPlayerAttachedObject)
-	#undef FIX_SetPlayerAttachedObject
-	#define FIX_SetPlayerAttachedObject  (2)
-#endif
-
-#if !defined FIX_OnPlayerDeath
-	#define FIX_OnPlayerDeath            (1)
-#elseif _FIXES_IS_UNSET(FIX_OnPlayerDeath)
-	#undef FIX_OnPlayerDeath
-	#define FIX_OnPlayerDeath            (2)
-#endif
-
-#if !defined FIX_strins
-	#define FIX_strins                   (1)
-#elseif _FIXES_IS_UNSET(FIX_strins)
-	#undef FIX_strins
-	#define FIX_strins                   (2)
-#endif
-
-#if !defined FIX_IsPlayerConnected
-	#define FIX_IsPlayerConnected        (1)
-#elseif _FIXES_IS_UNSET(FIX_IsPlayerConnected)
-	#undef FIX_IsPlayerConnected
-	#define FIX_IsPlayerConnected        (2)
-#endif
-
-#if !defined FIX_OnPlayerCommandText
-	#define FIX_OnPlayerCommandText      (1)
-#elseif _FIXES_IS_UNSET(FIX_OnPlayerCommandText)
-	#undef FIX_OnPlayerCommandText
-	#define FIX_OnPlayerCommandText      (2)
-#endif
-
-#if !defined FIX_TrainExit
-	#define FIX_TrainExit                (1)
-#elseif _FIXES_IS_UNSET(FIX_TrainExit)
-	#undef FIX_TrainExit
-	#define FIX_TrainExit                (2)
-#endif
-
-#if !defined FIX_Kick
-	#if defined EnableVehicleFriendlyFire
-		#define FIX_Kick                 (0)
-	#else
-		#define FIX_Kick                 (1)
-	#endif
-#elseif _FIXES_IS_UNSET(FIX_Kick)
-	#undef FIX_Kick
-	#define FIX_Kick                     (2)
-#endif
-
-#if !defined FIX_OnVehicleMod
-	#define FIX_OnVehicleMod             (1)
-#elseif _FIXES_IS_UNSET(FIX_OnVehicleMod)
-	#undef FIX_OnVehicleMod
-	#define FIX_OnVehicleMod             (2)
-#endif
-
-#if !defined FIX_random
-	#define FIX_random                   (0)
-#elseif _FIXES_IS_UNSET(FIX_random)
-	#undef FIX_random
-	#define FIX_random                   (2)
-#endif
-
-#if !defined FIX_sleep
-	#define FIX_sleep                    (1)
-#elseif _FIXES_IS_UNSET(FIX_sleep)
-	#undef FIX_sleep
-	#define FIX_sleep                    (2)
-#endif
-
-#if !defined FIX_Menus
-	#define FIX_Menus                    (1)
-#elseif _FIXES_IS_UNSET(FIX_Menus)
-	#undef FIX_Menus
-	#define FIX_Menus                    (2)
-#endif
-
-#if !defined FIX_AddMenuItem
-	#define FIX_AddMenuItem              (FIX_Menus)
-#elseif _FIXES_IS_UNSET(FIX_AddMenuItem)
-	#undef FIX_AddMenuItem
-	#define FIX_AddMenuItem              (2)
-#endif
-
-#if !defined FIX_SetMenuColumnHeader
-	#define FIX_SetMenuColumnHeader      (FIX_Menus)
-#elseif _FIXES_IS_UNSET(FIX_SetMenuColumnHeader)
-	#undef FIX_SetMenuColumnHeader
-	#define FIX_SetMenuColumnHeader      (2)
-#endif
-
-#if !defined FIX_ShowMenuForPlayer
-	#define FIX_ShowMenuForPlayer        (FIX_Menus)
-#elseif _FIXES_IS_UNSET(FIX_ShowMenuForPlayer)
-	#undef FIX_ShowMenuForPlayer
-	#define FIX_ShowMenuForPlayer        (2)
-#endif
-
-#if !defined FIX_HideMenuForPlayer
-	#define FIX_HideMenuForPlayer        (FIX_Menus)
-#elseif _FIXES_IS_UNSET(FIX_HideMenuForPlayer)
-	#undef FIX_HideMenuForPlayer
-	#define FIX_HideMenuForPlayer        (2)
-#endif
-
-#if !defined FIX_GetPlayerMenu
-	#define FIX_GetPlayerMenu            (1)
-#elseif _FIXES_IS_UNSET(FIX_GetPlayerMenu)
-	#undef FIX_GetPlayerMenu
-	#define FIX_GetPlayerMenu            (2)
-#endif
-
-#if !defined FIX_HideMenuForPlayer_2
-	#define FIX_HideMenuForPlayer_2      (0)
-#elseif _FIXES_IS_UNSET(FIX_HideMenuForPlayer_2)
-	#undef FIX_HideMenuForPlayer_2
-	#define FIX_HideMenuForPlayer_2      (2)
-#elseif FIX_HideMenuForPlayer_2 && !FIX_GetPlayerMenu
-	#error FIX_HideMenuForPlayer_2 requires FIX_GetPlayerMenu
-#endif
-
-#if !defined FIX_DisableMenu
-	#define FIX_DisableMenu              (FIX_Menus)
-#elseif _FIXES_IS_UNSET(FIX_DisableMenu)
-	#undef FIX_DisableMenu
-	#define FIX_DisableMenu              (2)
-#endif
-
-#if !defined FIX_DisableMenuRow
-	#define FIX_DisableMenuRow           (FIX_Menus)
-#elseif _FIXES_IS_UNSET(FIX_DisableMenuRow)
-	#undef FIX_DisableMenuRow
-	#define FIX_DisableMenuRow           (2)
-#endif
-
-#if FIX_Menus || FIX_AddMenuItem || FIX_SetMenuColumnHeader || FIX_ShowMenuForPlayer || FIX_HideMenuForPlayer || FIX_DisableMenu || FIX_DisableMenuRow
-	#define _FIX_Menus                   (1)
-#else
-	#define _FIX_Menus                   (2)
-#endif
-
-#if !defined FIX_GetPlayerInterior
-	#define FIX_GetPlayerInterior        (1)
-#elseif _FIXES_IS_UNSET(FIX_GetPlayerInterior)
-	#undef FIX_GetPlayerInterior
-	#define FIX_GetPlayerInterior        (2)
-#endif
-
-#if !defined FIX_ApplyAnimation
-	#define FIX_ApplyAnimation           (1)
-#elseif _FIXES_IS_UNSET(FIX_ApplyAnimation)
-	#undef FIX_ApplyAnimation
-	#define FIX_ApplyAnimation           (2)
-#endif
-
-#if !defined FIX_ApplyAnimation_2
-	#define FIX_ApplyAnimation_2         (1)
-#elseif _FIXES_IS_UNSET(FIX_ApplyAnimation_2)
-	#undef FIX_ApplyAnimation_2
-	#define FIX_ApplyAnimation_2         (2)
-#endif
-
-#if !defined FIX_OnPlayerSpawn
-	#define FIX_OnPlayerSpawn            (1)
-#elseif _FIXES_IS_UNSET(FIX_OnPlayerSpawn)
-	#undef FIX_OnPlayerSpawn
-	#define FIX_OnPlayerSpawn            (2)
-#endif
-
-#if !defined FIX_GameText
-	#define FIX_GameText                 (1)
-#elseif _FIXES_IS_UNSET(FIX_GameText)
-	#undef FIX_GameText
-	#define FIX_GameText                 (2)
-#endif
-
-#if !defined FIX_HideGameText
-	#define FIX_HideGameText             (0)
-#elseif _FIXES_IS_UNSET(FIX_HideGameText)
-	#undef FIX_HideGameText
-	#define FIX_HideGameText             (2)
-#endif
-
-#if !defined FIX_GameTextStyles
-	#define FIX_GameTextStyles           (0)
-#elseif _FIXES_IS_UNSET(FIX_GameTextStyles)
-	#undef FIX_GameTextStyles
-	#define FIX_GameTextStyles           (2)
-#elseif FIX_GameTextStyles && !FIX_GameText
-	#error FIX_GameTextStyles requires FIX_GameText
-#endif
-
-#if !defined FIX_OnPlayerConnect
-	#define FIX_OnPlayerConnect          (1)
-#elseif _FIXES_IS_UNSET(FIX_OnPlayerConnect)
-	#undef FIX_OnPlayerConnect
-	#define FIX_OnPlayerConnect          (2)
-#endif
-
-#if !defined FIX_OnPlayerDisconnect
-	#define FIX_OnPlayerDisconnect       (1)
-#elseif _FIXES_IS_UNSET(FIX_OnPlayerDisconnect)
-	#undef FIX_OnPlayerDisconnect
-	#define FIX_OnPlayerDisconnect       (2)
-#endif
-
-#if !defined FIX_CreatePlayerTextDraw
-	#define FIX_CreatePlayerTextDraw     (1)
-#elseif _FIXES_IS_UNSET(FIX_CreatePlayerTextDraw)
-	#undef FIX_CreatePlayerTextDraw
-	#define FIX_CreatePlayerTextDraw     (2)
-#endif
-
-#if !defined FIX_PlayerTextDrawSetString
-	#define FIX_PlayerTextDrawSetString  (1)
-#elseif _FIXES_IS_UNSET(FIX_PlayerTextDrawSetString)
-	#undef FIX_PlayerTextDrawSetString
-	#define FIX_PlayerTextDrawSetString  (2)
-#endif
-
-#if !defined FIX_SetPlayerCamera
-	#define FIX_SetPlayerCamera          (1)
-#elseif _FIXES_IS_UNSET(FIX_SetPlayerCamera)
-	#undef FIX_SetPlayerCamera
-	#define FIX_SetPlayerCamera          (2)
-#endif
-
-#if !defined FIX_SetPlayerTime
-	#define FIX_SetPlayerTime            (1)
-#elseif _FIXES_IS_UNSET(FIX_SetPlayerTime)
-	#undef FIX_SetPlayerTime
-	#define FIX_SetPlayerTime            (2)
-#endif
-
-#if !defined FIX_OnPlayerRequestClass
-	#define FIX_OnPlayerRequestClass     (1)
-#elseif _FIXES_IS_UNSET(FIX_OnPlayerRequestClass)
-	#undef FIX_OnPlayerRequestClass
-	#define FIX_OnPlayerRequestClass     (2)
-#endif
-
-/* 
- * CHAIN_ORDER
- * 
- * Allows y_hooks to call things in the correct order when it exists.
- */
-
-#if !defined CHAIN_ORDER
-	#define CHAIN_ORDER() 0
-#endif
-
-/* 
- * PRE_HOOK
- * 
- * A method of pre-hooking callbacks to still have them called before any ones
- * re-written by y_hooks.
- */
-
-#define PRE_HOOK(%0) forward @CO_%0();public @CO_%0(){return CHAIN_ORDER()+1;}
-
-PRE_HOOK(FIXES)
-#undef CHAIN_ORDER
-#define CHAIN_ORDER @CO_FIXES
-
-/* 
- * _FIXES_IncludeStates
- * 
- * Define the "_ALS" states used by hooks.
- */
-
-static stock _FIXES_IncludeStates() <_ALS : _ALS_x0, _ALS : _ALS_x1, _ALS : _ALS_x2, _ALS : _ALS_x3>
-{
-}
-
-static stock _FIXES_IncludeStates() <_ALS : _ALS_go>
+stock SendClientJob(playerid, color, string[], job)
 {
-}
-
-/* 
- * FIXES_GT_STYLE_COUNT
- * 
- * The number of GameText styles recreated using TextDraw functions.  This is 4
- * by default, but can be extended to 6 if you want location and vehicle styles.
- */
-
-#if FIX_GameText
-	#if FIX_GameTextStyles
-		#define FIXES_GT_STYLE_COUNT (14)
-	#else
-		#define FIXES_GT_STYLE_COUNT (7)
-	#endif
-#endif
-
-/* 
- * FIXES_SilentKick
- * 
- * If this define is set to 1, then players will not be given a message when
- * they are kicked for cheats, instead they will just loose connection to the
- * server.
- */
-
-#if !defined FIXES_SilentKick
-	#define FIXES_SilentKick 0
-#elseif _FIXES_IS_UNSET(FIXES_SilentKick)
-	#undef FIXES_SilentKick
-	#define FIXES_SilentKick 2
-#endif
-
-/* 
- * FIXES_Debug
- * 
- * If this define is set to 1, then debug printing is turned on for any
- * functions which may use it.  Otherwise, the compiler entirely removes the
- * code to print anything, leaving 0 run-time overhead.
- */
-
-#if defined FIXES_Debug
-	#if _FIXES_IS_UNSET(FIXES_Debug)
-		#undef FIXES_Debug
-	#elseif FIXES_Debug == 1
-		#define FIXES_PRINTF(%0); print(_FIXES_gIsFilterscript ? ("* FIXES_PRINTF (FS):") : ("* FIXES_PRINTF (GM):")),printf("*** " %0);
-	#else
-		#undef FIXES_Debug
-	#endif
-#endif
-
-/* 
- * FIXES_UseStateHooks
- * 
- * A marker to indicate that this version of fixes.inc uses state-based hooks.
- */
-#define FIXES_UseStateHooks
-
-/* 
- * FIXES_PRINTF
- * 
- * A special "printf" function only compiled when "FIXES_Debug" is set.
- */
-
-#if !defined FIXES_PRINTF
-	#define FIXES_Debug 0
-	#define FIXES_PRINTF(%0);
-#endif
-
-/* 
- * INVALID_DIALOG_ID
- * 
- * Set when a player can't see a dialog.
- */
-
-#if !defined INVALID_DIALOG_ID
-	#define INVALID_DIALOG_ID (-1)
-#endif
-
-/* 
- * FIXES_Single
- * 
- * If this define is set to 1, then the old style include is used, with no
- * support for multiple scripts running at the same time on the server (i.e. no
- * gamemodes and filter scripts at the same time).  You can only have one or the
- * other or bugs.
- */
-
-#if !defined FIXES_Single
-	#define FIXES_Single (1)
-#elseif _FIXES_IS_UNSET(FIXES_Single)
-	#undef FIXES_Single
-	#define FIXES_Single (2)
-#endif
-
-/* 
- * _FIXES_IS_IN_CHARGE
- * 
- * Test to see if this script is in command or not (master).
- */
-
-#if FIXES_Single
-	#define _FIXES_IS_IN_CHARGE(%0)
-#else
-	#define _FIXES_IS_IN_CHARGE(%0) if (%0(FIXES_gsSettings & e_FIXES_SETTINGS_IN_CHARGE))
-#endif
-
-/* 
- * E_FIXES_WORLDBOUND_DATA
- * 
- * Store data for each player on their worldbound data.
- */
-enum E_FIXES_WORLDBOUND_DATA
-{
-	// "Previous".
-	Float:E_FIXES_WORLDBOUND_DATA_PX,
-	Float:E_FIXES_WORLDBOUND_DATA_PY,
-	Float:E_FIXES_WORLDBOUND_DATA_PZ,
-	// "Lower".
-	Float:E_FIXES_WORLDBOUND_DATA_LX,
-	Float:E_FIXES_WORLDBOUND_DATA_LY,
-	// "Upper".
-	Float:E_FIXES_WORLDBOUND_DATA_UX,
-	Float:E_FIXES_WORLDBOUND_DATA_UY
-}
-
-/* 
- * e_FIXES_BOOLS
- * 
- * Collection of boolean values for players, designed to collect multiple checks
- * in to one variable to reduce memory consumption.
- */
-enum e_FIXES_BOOLS (<<= 1)
-{
-	// Handy definition for nothing set.
-	e_FIXES_BOOLS_NONE = 0,
-	// Does this player have worldbounds enabled?
-	e_FIXES_BOOLS_WORLDBOUNDS = 1,
-	e_FIXES_BOOLS_UNCONTROLLABLE,
-	e_FIXES_BOOLS_PUT_IN_VEHICLE,
-	e_FIXES_BOOLS_BLOCK,
-	e_FIXES_BOOLS_TELEPORT,
-	e_FIXES_BOOLS_CONNECTED,
-	e_FIXES_BOOLS_INTERIOR,
-	e_FIXES_BOOLS_PUT_IN_TRAIN,
-	e_FIXES_BOOLS_KICKED,
-	e_FIXES_BOOLS_ON_PLAYER_CONNECT,
-	e_FIXES_BOOLS_DRIVE_BY,
-	e_FIXES_BOOLS_FIRST_SPAWN,
-	e_FIXES_BOOLS_FIRST_CLASS,
-	e_FIXES_BOOLS_SPECTATING
-}
-
-/* 
- * e_FIXES_SETTINGS
- * 
- * Collection of boolean values for the script as a whole.  Stores a variety of
- * settings that are true/false.
- */
-enum e_FIXES_SETTINGS (<<= 1)
-{
-	// Handy definition for nothing set.
-	e_FIXES_SETTINGS_NONE = 0,
-	e_FIXES_SETTINGS_INTERIOR = 1,
-	e_FIXES_SETTINGS_ADMIN_TELEPORT,
-	e_FIXES_SETTINGS_IN_CHARGE,
-	e_FIXES_SETTINGS_DROP_ALL_DATA,
-	e_FIXES_SETTINGS_MENU_SET,
-	e_FIXES_SETTINGS_ENDING,
-	e_FIXES_SETTINGS_ENDED,
-	e_FIXES_SETTINGS_NO_GAME_TEXT,
-	e_FIXES_SETTINGS_SECOND_USE
-}
-
-/* 
- * _FIXES_CEILDIV
- * 
- * Do a ceiling division of the first number by the second number.
- */
-#define _FIXES_CEILDIV(%0,%1) (((%0) + (%1) - 1) / (%1))
-
-/* 
- * _FIXES_INFINITY
- * 
- * IEEE 754 definition of infinity.
- */
-#define _FIXES_INFINITY (Float:0x7F800000)
-
-/* 
- * _FIXES_N_INFINITY
- * 
- * IEEE 754 definition of negative infinity.
- */
-#define _FIXES_N_INFINITY (Float:0xFF800000)
-
-/* 
- * _FIXES_ATTACHMENTS
- * 
- * The number of players whose attachment data (10-bits) can be stored in one
- * cell.
- */
-#define _FIXES_ATTACHMENTS (cellbits / MAX_PLAYER_ATTACHED_OBJECTS)
-
-/* 
- * _FIXES_FOREACH
- * 
- * A new version of "foreach", but just for this library.
- */
-#define _FIXES_FOREACH(%1,%0) for (new %0 = MAX_PLAYERS; (%0 = %1[%0]) != MAX_PLAYERS; )
-
-/* 
- * _FIXES_IN_RANGE
- * 
- * Checks if the first parameter is between the other two: %1 <= %0 < %2 (but
- * faster).
- */
-#define _FIXES_IN_RANGE(%0,%1,%2) (((%0) - ((%1) + cellmin)) < ((%2) - ((%1) + cellmin)))
-
-/* 
- * _FIXES_NO_RANGE
- * 
- * Checks if the first parameter is not between the other two: !(%1 <= %0 < %2)
- * (but faster).
- */
-#define _FIXES_NO_RANGE(%0,%1,%2) (((%0) - ((%1) + cellmin)) >= ((%2) - ((%1) + cellmin)))
-
-/* 
- * _FIXES_FORWARD
- * 
- * Forwards a hooked callbacks, and defines the default state implementations.
- */
-#define _FIXES_FORWARD%0(%1); \
-	forward%0(%1); \
-	public%0(%1) <_ALS : _ALS_x0, _ALS : _ALS_x1> { return 1; } \
-	public%0(%1) <> { return 1; }
-
-/* 
- * _FIXES_IS_PLAYER_CONNECTED
- * 
- * Always valid "IsPlayerConnected" check.
- */
-#define _FIXES_IS_PLAYER_CONNECTED(%0) (_FIXES_IN_RANGE((%0), 0, MAX_PLAYERS) && IsPlayerConnected((%0)))
-
-// These varaibles are NOT pre-processor dependent as they are stock.  It's just
-// simpler than trying to figure out when or if a semi-colon is needed.
-#if !FIX_FILTERSCRIPT
-static
-#endif
-stock
-	/* 
-	 * bool:_FIXES_gIsFilterscript
-	 * 
-	 * Runtime equivalent of "FILTERSCRIPT" for when it is not set by the user.
-	 */
-	bool:_FIXES_gIsFilterscript;
-
-stock
-	/* 
-	 * FIXES_gscSpace[]
-	 * 
-	 * A single re-usable space.
-	 */
-	FIXES_gscSpace[] = " ";
-
-#if FIXES_Debug
-new
-#else
-static stock
-#endif
-	/* 
-	 * FIXES_gsValidMenus[_FIXES_CEILDIV(MAX_MENUS, cellbits)]
-	 * 
-	 * A record of which menus have and haven't been shown yet.  We ensure that
-	 * this only exists when required, since it depends on add and remove
-	 * functions to be called at the right time.
-	 */
-#if _FIX_Menus || FIX_GetPlayerMenu || FIX_OnPlayerDisconnect || FIX_GameText || FIX_AllowInteriorWeapons || FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable
-	FIXES_gsPlayersIterator[MAX_PLAYERS + 1] = {0, 1, ...},
-#endif
-	/* 
-	 * FIXES_gsValidMenus[_FIXES_CEILDIV(MAX_MENUS, cellbits)]
-	 * 
-	 * A record of which menus have and haven't been shown yet.
-	 */
-	FIXES_gsValidMenus[_FIXES_CEILDIV(MAX_MENUS, cellbits)],
-	/* 
-	 * FIXES_gsPlayerIP[MAX_PLAYERS]
-	 * 
-	 * A player's IP as a 32-bit integer.
-	 */
-	FIXES_gsPlayerIP[MAX_PLAYERS] = {-1, ...},
-	/* 
-	 * FIXES_gsPlayerSkin[MAX_PLAYERS]
-	 * 
-	 * The skin the player is currently using.
-	 */
-	FIXES_gsPlayerSkin[MAX_PLAYERS],
-	/* 
-	 * e_FIXES_BOOLEAN_DATA:FIXES_gsPlayerBools[MAX_PLAYERS]
-	 * 
-	 * Collection of boolean values for players.
-	 */
-	e_FIXES_BOOLS:FIXES_gsPlayerBools[MAX_PLAYERS],
-	/* 
-	 * FIXES_gsWorldbounds[MAX_PLAYERS][E_FIXES_WORLDBOUND_DATA]
-	 * 
-	 * All data for players on where their worldbounds are and where they last
-	 * were before they went through the bounds by crouching.
-	 */
-#if FIX_SetPlayerWorldBounds
-	FIXES_gsWorldbounds[MAX_PLAYERS][E_FIXES_WORLDBOUND_DATA],
-#endif
-	/* 
-	 * FIXES_gsPlayerWeapon[MAX_PLAYERS]
-	 * 
-	 * Stores the weapon set by "SetPlayerArmedWeapon" when in a vehicle.
-	 */
-	FIXES_gsPlayerWeapon[MAX_PLAYERS],
-	/* 
-	 * FIXES_gsVehicleSeatData[MAX_PLAYERS]
-	 * 
-	 * What vehicle the player is due to go in.
-	 */
-	FIXES_gsVehicleSeatData[MAX_PLAYERS],
-	/* 
-	 * FIXES_gsVehicleLocked[(MAX_PLAYERS * MAX_VEHICLES + cellbits - 1) / cellbits]
-	 * 
-	 * Is this vehicle locked for a player.  This is a compressed 2D binary
-	 * array, made by concatenating many bits together (saves 1kb-3kb)!  Is
-	 * there a reason this array exists?
-	 */
-	//FIXES_gsVehicleLocked[_FIXES_CEILDIV(MAX_PLAYERS * MAX_VEHICLES, cellbits)],
-	/* 
-	 * FIXES_gsDialogID[MAX_PLAYERS]
-	 * 
-	 * Stores the true ID of the dialog the player is looking at to prevent
-	 * spoofing.
-	 */
-	FIXES_gsDialogID[MAX_PLAYERS] = {-1, ...},
-	/* 
-	 * FIXES_gsInterior[MAX_PLAYERS]
-	 * 
-	 * The player's current interior.
-	 */
-	FIXES_gsInterior[MAX_PLAYERS],
-	/* 
-	 * e_FIXES_SETTINGS:FIXES_gsSettings
-	 * 
-	 * A collection of 1-bit options, compressed together to save space.
-	 */
-	e_FIXES_SETTINGS:FIXES_gsSettings = e_FIXES_SETTINGS_SECOND_USE,
-	/* 
-	 * FIXES_gsObjectSlots[_FIXES_CEILDIV(MAX_PLAYERS, _FIXES_ATTACHMENTS)]
-	 * 
-	 * A record of which attached object slots a player has used.
-	 */
-	FIXES_gsObjectSlots[_FIXES_CEILDIV(MAX_PLAYERS, _FIXES_ATTACHMENTS)],
-	/* 
-	 * FIXES_gsLastAnimation[MAX_PLAYERS]
-	 * 
-	 * The last animation a player used.
-	 */
-	FIXES_gsLastAnimation[MAX_PLAYERS],
-	/* 
-	 * FIXES_gsLastCash[MAX_PLAYERS]
-	 * 
-	 * A player's cash before dying.
-	 */
-	FIXES_gsLastCash[MAX_PLAYERS],
-	/* 
-	 * FIXES_gsDriveByWeapon[MAX_PLAYERS]
-	 * 
-	 * The weapon to set after re-enter to vehicle.
-	 */
-	FIXES_gsDriveByWeapon[MAX_PLAYERS],
-	/* 
-	 * FIXES_gsCurrentMenu[MAX_PLAYERS]
-	 * 
-	 * The menu the player can currently see.
-	 */
-	Menu:FIXES_gsCurrentMenu[MAX_PLAYERS] = {Menu:INVALID_MENU, ...},
-	/* 
-	 * Text:FIXES_gsGTStyle[FIXES_GT_STYLE_COUNT]
-	 * 
-	 * The pre-defined TextDraw styles used to recreate the bugged GameText
-	 * styles for GameTextForAll.
-	 */
-#if FIX_GameText
-	Text:FIXES_gsGTStyle[FIXES_GT_STYLE_COUNT],
-#endif
-	/* 
-	 * FIXES_gsPlayerPGTShown[FIXES_GT_STYLE_COUNT][MAX_PLAYERS + 1]
-	 * 
-	 * A linked list of which players can see a certain GameText style.
-	 */
-#if FIX_GameText
-	FIXES_gsPlayerPGTShown[FIXES_GT_STYLE_COUNT][MAX_PLAYERS + 1],
-#endif
-	/* 
-	 * PlayerText:FIXES_gsPGTStyle[FIXES_GT_STYLE_COUNT][MAX_PLAYERS]
-	 * 
-	 * The predefined TextDraw styles used to recreate the bugged GameText
-	 * styles for GameTextForPlayer.
-	 */
-#if FIX_GameText
-	PlayerText:FIXES_gsPGTStyle[MAX_PLAYERS][FIXES_GT_STYLE_COUNT],
-#endif
-	/* 
-	 * FIXES_gsPGTTimer[FIXES_GT_STYLE_COUNT][MAX_PLAYERS]
-	 * 
-	 * The timers used to hide per-player GameText messages.
-	 */
-#if FIX_GameText
-	FIXES_gsGTTimer[FIXES_GT_STYLE_COUNT][MAX_PLAYERS + 1],
-#endif
-	/* 
-	 * FIXES_gsClassAnimTimer[MAX_PLAYERS],
-	 * 
-	 * Used for storing the timer ID for deferring class selection animation
-	 * application.
-	 */
-	FIXES_gsAnimTimer[MAX_PLAYERS],
-	/* 
-	 * FIXES_gsClassAnimName[MAX_PLAYERS][60],
-	 * 
-	 * Used for storing the animation name.
-	 */
-#if FIX_ApplyAnimation_2
-	FIXES_gsClassAnimName[MAX_PLAYERS][60],
-#endif
-	/* 
-	 * FIXES_gsPlayerAnimLibs[MAX_PLAYERS][_FIXES_CEILDIV(134, cellbits)],
-	 * 
-	 * Which animation libraries the player has synced.
-	 */
-#if FIX_ApplyAnimation_2
-	FIXES_gsPlayerAnimLibs[MAX_PLAYERS][_FIXES_CEILDIV(134, cellbits)],
-#endif
-	/* 
-	 * FIXES_pvarNotNewPlayer[]
-	 * 
-	 * This variable records wether or not this player is brand new to the
-	 * server, and not just having "OnPlayerConnect" called due to a script
-	 * load.  There are certain functions that need applying only the very first
-	 * time they connect, then this gets set.
-	 */
-	FIXES_pvarNotNewPlayer[] = "FIXES_pvarNotNewPlayer",
-	/* 
-	 * FIXES_pvarPlayerWeapon[]
-	 * 
-	 * Name of the pvar in which to store the player's current weapon.
-	 */
-	FIXES_pvarPlayerWeapon[] = "FIXES_pvarPlayerWeapon",
-	/* 
-	 * FIXES_pvarPlayerSkin[]
-	 * 
-	 * Name of the pvar in which to store the player's current skin.
-	 */
-	FIXES_pvarPlayerSkin[] = "FIXES_pvarPlayerSkin",
-	/* 
-	 * FIXES_pvarPlayerSpectate[]
-	 * 
-	 * Name of the pvar in which to store the player's spectator mode.
-	 */
-	FIXES_pvarPlayerSpectate[] = "FIXES_pvarPlayerSpectate",
-	/* 
-	 * FIXES_gscKick[]
-	 * 
-	 * Name of the kick timer function.
-	 */
-	FIXES_gscKick[] = "_FIXES_Kick",
-	/* 
-	 * FIXES_pvarKick[]
-	 * 
-	 * Name of the pvar in which to store a player's kick timer.
-	 */
-	FIXES_pvarKick[] = "FIXES_pvarKick",
-	/* 
-	 * FIXES_pvarPlayerDialog[]
-	 * 
-	 * Name of the pvar in which to store the player's current dialogid.
-	 */
-	FIXES_pvarPlayerDialog[] = "FIXES_pvarPlayerDialog",
-	/* 
-	 * FIXES_pvarPlayerInterior[]
-	 * 
-	 * A player's current interior.
-	 */
-	FIXES_pvarPlayerInterior[] = "FIXES_pvarPlayerInterior",
-	/* 
-	 * FIXES_pvarCurrentDialog[]
-	 * 
-	 * Used in OnDialogResponse to be able to get the correct ID in multiple
-	 * scripts while still correctly resetting the ID for future use.
-	 */
-	FIXES_pvarCurrentDialog[] = "FIXES_pvarCurrentDialog",
-	/* 
-	 * FIXES_pvarPlayerLastCash[]
-	 * 
-	 * Used in OnPlayerDeath to save a player's cash before death.
-	 */
-	FIXES_pvarPlayerLastCash[] = "FIXES_pvarPlayerLastCash",
-	/* 
-	 * FIXES_gscHideGameTextTimer[]
-	 * 
-	 * Name of the GameText hide timer function.
-	 */
-	FIXES_gscHideGameTextTimer[] = "_FIXES_HideGameTextTimer",
-	/* 
-	 * FIXES_gscDriveBy[]
-	 * 
-	 * Name of the Drive-By timer function.
-	 */
-	FIXES_gscDriveBy[] = "_FIXES_DriveBy",
-	/* 
-	 * FIXES_gscSetCamera[]
-	 * 
-	 * Name of the SetCamera timer function.
-	 */
-	FIXES_gscSetCamera[] = "_FIXES_SetCamera",
-	/* 
-	 * FIXES_gscSetTime[]
-	 * 
-	 * Name of the SetTime timer function.
-	 */
-	FIXES_gscSetTime[] = "_FIXES_SetTime",
-	/* 
-	 * FIXES_gscNULL[]
-	 * 
-	 * NULL.  This is stored as a global string to reduce memory usage.
-	 */
-	FIXES_gscNULL[] = "\1";
-
-static stock const
-	/* 
-	 * FIXES_gscPlayerColours[100]
-	 * 
-	 * There are only 100 colours used by default, with SA:MP looping through
-	 * them repeatedly.
-	 */
-#if FIX_GetPlayerColour
-	FIXES_gscPlayerColours[100] =
-		{
-			0xFF8C13FF, 0xC715FFFF, 0x20B2AAFF, 0xDC143CFF, 0x6495EDFF,
-			0xF0E68CFF, 0x778899FF, 0xFF1493FF, 0xF4A460FF, 0xEE82EEFF,
-			0xFFD720FF, 0x8B4513FF, 0x4949A0FF, 0x148B8BFF, 0x14FF7FFF,
-			0x556B2FFF, 0x0FD9FAFF, 0x10DC29FF, 0x534081FF, 0x0495CDFF,
-			0xEF6CE8FF, 0xBD34DAFF, 0x247C1BFF, 0x0C8E5DFF, 0x635B03FF,
-			0xCB7ED3FF, 0x65ADEBFF, 0x5C1ACCFF, 0xF2F853FF, 0x11F891FF,
-			0x7B39AAFF, 0x53EB10FF, 0x54137DFF, 0x275222FF, 0xF09F5BFF,
-			0x3D0A4FFF, 0x22F767FF, 0xD63034FF, 0x9A6980FF, 0xDFB935FF,
-			0x3793FAFF, 0x90239DFF, 0xE9AB2FFF, 0xAF2FF3FF, 0x057F94FF,
-			0xB98519FF, 0x388EEAFF, 0x028151FF, 0xA55043FF, 0x0DE018FF,
-			0x93AB1CFF, 0x95BAF0FF, 0x369976FF, 0x18F71FFF, 0x4B8987FF,
-			0x491B9EFF, 0x829DC7FF, 0xBCE635FF, 0xCEA6DFFF, 0x20D4ADFF,
-			0x2D74FDFF, 0x3C1C0DFF, 0x12D6D4FF, 0x48C000FF, 0x2A51E2FF,
-			0xE3AC12FF, 0xFC42A8FF, 0x2FC827FF, 0x1A30BFFF, 0xB740C2FF,
-			0x42ACF5FF, 0x2FD9DEFF, 0xFAFB71FF, 0x05D1CDFF, 0xC471BDFF,
-			0x94436EFF, 0xC1F7ECFF, 0xCE79EEFF, 0xBD1EF2FF, 0x93B7E4FF,
-			0x3214AAFF, 0x184D3BFF, 0xAE4B99FF, 0x7E49D7FF, 0x4C436EFF,
-			0xFA24CCFF, 0xCE76BEFF, 0xA04E0AFF, 0x9F945CFF, 0xDCDE3DFF,
-			0x10C9C5FF, 0x70524DFF, 0x0BE472FF, 0x8A2CD7FF, 0x6152C2FF,
-			0xCF72A9FF, 0xE59338FF, 0xEEDC2DFF, 0xD8C762FF, 0xD8C762FF
-		},
-#endif
-	/* 
-	 * FIXES_gscMaxPassengers[]
-	 * 
-	 * This is a compressed (4-bit) list of the maximum number of passengers in
-	 * any vehicle, confirmed by a number of sources. "F" (15) means invalid
-	 * vehicle.
-	 */
-#if FIX_OnPlayerEnterVehicle
-	FIXES_gscMaxPassengers[] =
-		{
-			0x10331113, 0x11311131, 0x11331313, 0x80133301, 0x1381F110, 0x10311103, 0x10001F10, 0x11113311, 0x13113311,
-			0x31101100, 0x30001301, 0x11031311, 0x11111331, 0x10013111, 0x01131100, 0x11111110, 0x11100031, 0x11130221,
-			0x33113311, 0x11111101, 0x33101133, 0x101001F0, 0x03133111, 0xFF11113F, 0x13330111, 0xFF131111, 0x0000FF3F
-		},
-#endif
-	/* 
-	 * FIXES_gscVehicleMods[]
-	 * 
-	 * This is a bit array of all the valid mods (-1000) for all vehicles (-400)
-	 * EXCEPT for vehicle 576 (Tornado), which has just TWO extra mods on it,
-	 * that should spill over in to an extra cell of data (requiring an extra
-	 * 848 bytes of data total to make the array work).  Instead this (hopefully
-	 * rare) case is handled explicitly in "OnVehicleMod".  It seems that most
-	 * vehicles are:
-	 * 
-	 *   0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-	 * 
-	 * I don't know yet if this can be used to our advantage to improve the code
-	 * somehow - it seems like that would require more explicit model handling.
-	 */
-#if FIX_OnVehicleMod
-	FIXES_gscVehicleMods[] =
-		{
-			0x033C2700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x021A27FA, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x023B2785, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02BC4703, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x03BA278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x028E078A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02310744, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x0228073A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02BD4701, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x023A2780, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x0228077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x027A27CA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x0282278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x023E07C0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x03703730, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x031D2775, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02BE4788, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x02010771, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x029A0FCE, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x03382700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x023F8795, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x029F078C, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x029627EA, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x0236C782, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x029E1FCA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0xFC000437, 0x00000000, 0x021C0000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x03FE6007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00001B87, 0x00000001, 0x01E00000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x039E07D2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x023CC700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x038E07D6, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x023D0709, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x029E1F8A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x029C077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x02BD076C, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0xFFFFFE00, 0x00000007, 0x00000000, 0x000001F8,
-			0x02000700, 0x00000000, 0x00FFFFFE, 0x00000007, 0xC0000000, 0x00002007,
-			0xFE000700, 0x00000003, 0x00FFFE00, 0x00000007, 0x00003C00, 0x00000600,
-			0xCE000700, 0xFF800000, 0x00FFFE01, 0x00000007, 0x3C000000, 0x00000000,
-			0x02000700, 0x000003FC, 0x00FFFE00, 0x00000007, 0x003C0000, 0x00001800,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x007FE000, 0x00FFFE00, 0x00000007, 0x03C00000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000047, 0x0000003E, 0x3C000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00001C00, 0x00FFFE00, 0x0000000F, 0x00000000, 0x0003C000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x000003C0, 0xC0000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x029607C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x03FFE7CD, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x031727F1, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x025627F0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x039E07C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
-			0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000
-		},
-#endif
-	/* 
-	 * FIXES_gscAnimIndexes[]
-	 * 
-	 * Which index each letter starts at.  Sometimes crashes the compiler...
-	 */
-#if FIX_ApplyAnimation || FIX_ApplyAnimation_2
-	FIXES_gscAnimIndexes[24] =
-		{
-			0, 2, 21, 35, 42, 42, 53, 62, 64, 67, 68, 71, 75, 81, 82, 84, 94, 96, 104, 121, 126, 127, 130, 134
-		},
-#endif
-	/* 
-	 * FIXES_gscAnimLib[]
-	 * 
-	 * List of valid animation libraries.
-	 */
-#if FIX_ApplyAnimation || FIX_ApplyAnimation_2
-	FIXES_gscAnimLib[134][] =
-		{
-			"AIRPORT",      "ATTRACTORS",   "BAR",          "BASEBALL",     "BD_FIRE",
-			"BEACH",        "BENCHPRESS",   "BF_INJECTION", "BIKE_DBZ",     "BIKED",
-			"BIKEH",        "BIKELEAP",     "BIKES",        "BIKEV",        "BLOWJOBZ",
-			"BMX",          "BOMBER",       "BOX",          "BSKTBALL",     "BUDDY",
-			"BUS",          "CAMERA",       "CAR",          "CAR_CHAT",     "CARRY",
-			"CASINO",       "CHAINSAW",     "CHOPPA",       "CLOTHES",      "COACH",
-			"COLT45",       "COP_AMBIENT",  "COP_DVBYZ",    "CRACK",        "CRIB",
-			"DAM_JUMP",     "DANCING",      "DEALER",       "DILDO",        "DODGE",
-			"DOZER",        "DRIVEBYS",     "FAT",          "FIGHT_B",      "FIGHT_C",
-			"FIGHT_D",      "FIGHT_E",      "FINALE",       "FINALE2",      "FLAME",
-			"FLOWERS",      "FOOD",         "FREEWEIGHTS",  "GANGS",        "GFUNK",
-			"GHANDS",       "GHETTO_DB",    "GOGGLES",      "GRAFFITI",     "GRAVEYARD",
-			"GRENADE",      "GYMNASIUM",    "HAIRCUTS",     "HEIST9",       "INT_HOUSE",
-			"INT_OFFICE",   "INT_SHOP",     "JST_BUISNESS", "KART",         "KISSING",
-			"KNIFE",        "LAPDAN1",      "LAPDAN2",      "LAPDAN3",      "LOWRIDER",
-			"MD_CHASE",     "MD_END",       "MEDIC",        "MISC",         "MTB",
-			"MUSCULAR",     "NEVADA",       "ON_LOOKERS",   "OTB",          "PARACHUTE",
-			"PARK",         "PAULNMAC",     "PED",          "PLAYER_DVBYS", "PLAYIDLES",
-			"POLICE",       "POOL",         "POOR",         "PYTHON",       "QUAD",
-			"QUAD_DBZ",     "RAPPING",      "RIFLE",        "RIOT",         "ROB_BANK",
-			"ROCKET",       "RUNNINGMAN",   "RUSTLER",      "RYDER",        "SCRATCHING",
-			"SEX",          "SHAMAL",       "SHOP",         "SHOTGUN",      "SILENCED",
-			"SKATE",        "SMOKING",      "SNIPER",       "SNM",          "SPRAYCAN",
-			"STRIP",        "SUNBATHE",     "SWAT",         "SWEET",        "SWIM",
-			"SWORD",        "TANK",         "TATTOOS",      "TEC",          "TRAIN",
-			"TRUCK",        "UZI",          "VAN",          "VENDING",      "VORTEX",
-			"WAYFARER",     "WEAPONS",      "WOP",          "WUZI"
-		},
-#endif
-	/* 
-	 * FIXES_gscDot[]
-	 * 
-	 * ".".
-	 */
-	FIXES_gscDot[] = ".",
-	/* 
-	 * FIXES_gscSpec@[]
-	 * 
-	 * Specifier "".
-	 */
-	FIXES_gscSpec@[] = "",
-	/* 
-	 * FIXES_gscSpec@i[]
-	 * 
-	 * Specifier "i".
-	 */
-	FIXES_gscSpec@i[] = "i",
-	/* 
-	 * FIXES_gscSpec@ii[]
-	 * 
-	 * Specifier "ii".
-	 */
-	FIXES_gscSpec@ii[] = "ii",
-	/* 
-	 * FIXES_gscSpec@ai[]
-	 * 
-	 * Specifier "ai".
-	 */
-	FIXES_gscSpec@ai[] = "ai",
-	/* 
-	 * FIXES_gscSpec@is[]
-	 * 
-	 * Specifier "is".
-	 */
-	FIXES_gscSpec@is[] = "is",
-	/* 
-	 * FIXES_gscSpec@iii[]
-	 * 
-	 * Specifier "iii".
-	 */
-	FIXES_gscSpec@iii[] = "iii",
-	/* 
-	 * FIXES_gscSpec@isii[]
-	 * 
-	 * Specifier "isii".
-	 */
-	FIXES_gscSpec@isii[] = "isii",
-	/* 
-	 * FIXES_gscSpec@ifff[]
-	 * 
-	 * Specifier "ifff".
-	 */
-	FIXES_gscSpec@ifff[] = "ifff",
-	/* 
-	 * FIXES_gscSpec@iifff[]
-	 * 
-	 * Specifier "iifff".
-	 */
-	FIXES_gscSpec@iifff[] = "iifff",
-	/* 
-	 * FIXES_gscSpec@iffff[]
-	 * 
-	 * Specifier "iffff".
-	 */
-	FIXES_gscSpec@iffff[] = "iffff",
-	/* 
-	 * FIXES_gscSpec@iiiis[]
-	 * 
-	 * Specifier "iiiis".
-	 */
-	FIXES_gscSpec@iiiis[] = "iiiis",
-	/* 
-	 * FIXES_gscSpec@iiiii[]
-	 * 
-	 * Specifier "iiiii".
-	 */
-	FIXES_gscSpec@iiiii[] = "iiiii",
-	/* 
-	 * FIXES_gscSpec@iiiiii[]
-	 * 
-	 * Specifier "iiiiii".
-	 */
-	FIXES_gscSpec@iiiiii[] = "iiiiii",
-	/* 
-	 * FIXES_gscTempName[]
-	 * 
-	 * The temporary name to give when renaming people.
-	 */
-	FIXES_gscTempName[] = "FIXES_TEMP_NAME",
-	/* 
-	 * FIXES_gscOrderProperty[]
-	 * 
-	 * The property to check for script ordering.
-	 */
-	FIXES_gscOrderProperty[] = "FIXES_gscOrderProperty",
-	/* 
-	 * FIXES_gscNoGMProperty[]
-	 * 
-	 * Call "_FIXES_DetermineOrder" in the GM or not?
-	 */
-	FIXES_gscNoGMProperty[] = "FIXES_gscNoGMProperty",
-	/* 
-	 * FIXES_gscDetermineOrder[]
-	 * 
-	 * Name of the ordering callback.
-	 */
-	FIXES_gscDetermineOrder[] = "_FIXES_DetermineOrder",
-	/* 
-	 * FIXES_gscSetPlayerMenu[]
-	 * 
-	 * Name of the remote set player menu function.
-	 */
-	FIXES_gscSetPlayerMenu[] = "_FIXES_SetPlayerMenu",
-	/* 
-	 * FIXES_gscClearPlayerMenu[]
-	 * 
-	 * Name of the remote function to clear a player's menu set.
-	 */
-	FIXES_gscClearPlayerMenu[] = "_FIXES_ClearPlayerMenu",
-	/* 
-	 * FIXES_gscAllowTeleport[]
-	 * 
-	 * Name of the remote allow teleport function.
-	 */
-	FIXES_gscAllowTeleport[] = "_FIXES_AllowTeleport",
-	/* 
-	 * FIXES_gscPutPlayerInVehicle[]
-	 * 
-	 * Name of the remote vehicle entry function.
-	 */
-	FIXES_gscPutPlayerInVehicle[] = "_FIXES_PutPlayerInVehicle",
-	/* 
-	 * FIXES_gscAllowInteriorWeapons[]
-	 * 
-	 * Name of the remote interior weapons function.
-	 */
-	FIXES_gscAllowInteriorWeapons[] = "_FIXES_AllowInteriorWeapons",
-	/* 
-	 * FIXES_gscSetPlayerAttachedObj[]
-	 * 
-	 * Name of the remote attache object function.
-	 */
-	FIXES_gscSetPlayerAttachedObj[] = "_FIXES_SetPlayerAttachedObject",
-	/* 
-	 * FIXES_gscTogglePlayerControl[]
-	 * 
-	 * Name of the remote player toggle function.
-	 */
-	FIXES_gscTogglePlayerControl[] = "_FIXES_TogglePlayerControllable",
-	/* 
-	 * FIXES_gscSetPlayerWorldBounds[]
-	 * 
-	 * Name of the remote world bounds function.
-	 */
-	FIXES_gscSetPlayerWorldBounds[] = "_FIXES_SetPlayerWorldBounds",
-	/* 
-	 * FIXES_gscGameTextShow[]
-	 * 
-	 * Name of the remote GameText show function.
-	 */
-	FIXES_gscGameTextShow[] = "_FIXES_GameTextShow",
-	/* 
-	 * FIXES_gscReturnProperty[]
-	 * 
-	 * The property for accurate returns.
-	 */
-	FIXES_gscReturnProperty[] = "FIXES_gscReturnProperty",
-	/* 
-	 * FIXES_gscSingleProperty[]
-	 * 
-	 * The property for checking this is the only running script with fixes in.
-	 */
-	FIXES_gscSingleProperty[] = "FIXES_gscSingleProperty",
-	/* 
-	 * FIXES_gscMenuProperty[]
-	 * 
-	 * The property for a player's current menu.
-	 */
-	FIXES_gscMenuProperty[] = "FIXES_gscMenuProperty",
-	/* 
-	 * FIXES_gscFixesError[]
-	 * 
-	 * Error shown when multiple scripts are detected.
-	 */
-	FIXES_gscFixesError[] = "\7\7\7\7\7"                                                     "\n"   \
-		"*** fixes.inc error: Running multiple scripts compiled with \"fixes.inc\"..."       "\n"   \
-		"***     Please compile your modes with \"#define FIXES_Single 0\" at the top, as"   "\n"   \
-		"***     this setting is no longer the default (to improve the more common case)."          ;
-
-/* 
- * _FIXES_KEY_AIM
- * KEY_AIM
- * 
- * Because the default SA:MP includes missed this one.
- */
-#define _FIXES_KEY_AIM                   (128)
-#if FIX_KEY_AIM
-	#define KEY_AIM                      _FIXES_KEY_AIM
-#endif
-
-/* 
- * _FIXES_SPECIAL_ACTION_PISSING
- * SPECIAL_ACTION_PISSING
- * 
- * Because the default SA:MP includes missed this one.
- */
-#define _FIXES_SPECIAL_ACTION_PISSING    (68)
-#if FIX_SPECIAL_ACTION_PISSING
-	#define SPECIAL_ACTION_PISSING       _FIXES_SPECIAL_ACTION_PISSING
-#endif
-
-/* 
- * IsValidVehicle
- * 
- * Because the default SA:MP includes missed this one.
- */
-
-#if FIX_IsValidVehicle
-	native IsValidVehicle(vehicleid);
-#endif
-
-/* 
- * GetGravity
- * 
- * Because the default SA:MP includes missed this one.
- */
-
-#if FIX_GetGravity
-	native Float:GetGravity();
-#endif
-
-/* 
- * gpci
- * 
- * Because the default SA:MP includes missed this one.
- */
-
-#if FIX_gpci
-	native gpci(playerid, serial[], maxlen);
-#endif
-
-/* 
- * BODYPARTS
- * 
- * Because the default SA:MP includes missed these.
- */
-
-#if FIX_BODYPARTS
-	#define BODY_PART_TORSO                     (3)
-	#define BODY_PART_GROIN                     (4)
-	#define BODY_PART_LEFT_ARM                  (5)
-	#define BODY_PART_RIGHT_ARM                 (6)
-	#define BODY_PART_LEFT_LEG                  (7)
-	#define BODY_PART_RIGHT_LEG                 (8)
-	#define BODY_PART_HEAD                      (9)
-#endif
-
-/* 
- * CAMERAMODES
- * 
- * Because the default SA:MP includes missed these.
- */
-
-#if FIX_CAMERAMODES
-	#define CAM_MODE_DISCONNECTED               (-1)
-	#define CAM_MODE_NONE                       (0)
-	#define CAM_MODE_BEHINDCAR                  (3)
-	#define CAM_MODE_FOLLOWPED                  (4)
-	#define CAM_MODE_SNIPER                     (7)
-	#define CAM_MODE_ROCKETLAUNCHER             (8)
-	#define CAM_MODE_FIXED                      (15)
-	#define CAM_MODE_1STPERSON                  (16)
-	#define CAM_MODE_CAM_ON_A_STRING            (18)
-	#define CAM_MODE_BEHINDBOAT                 (22)
-	#define CAM_MODE_CAMERA                     (46)
-	#define CAM_MODE_ROCKETLAUNCHER_HS          (51)
-	#define CAM_MODE_AIMWEAPON                  (53)
-	#define CAM_MODE_AIMWEAPON_FROMCAR          (55)
-	#define CAM_MODE_DW_HELI_CHASE              (56)
-#endif
-
-/* 
- * IS_FILTERSCRIPT
- * 
- * "FILTERSCRIPT" can't always be relied on to be set.  This is not a pre-
- * processor macro, but may be better than nothing (also used internally).
- */
-
-#if FIX_FILTERSCRIPT
-	#define IS_FILTERSCRIPT _FIXES_gIsFilterscript
-#endif
-
-/* 
- * FIXES_DetermineOrder()
- * 
- * Figure out which script is called first by callbacks.
- */
-
-#if !FIXES_Single
-	forward _FIXES_DetermineOrder();
-	
-	static FIXES_DetermineOrder()
-	{
-		deleteproperty(5, FIXES_gscOrderProperty),
-		// Called in the Game Mode first (thus needs correcting).
-		setproperty(5, FIXES_gscNoGMProperty, 1),
-		CallRemoteFunction(FIXES_gscDetermineOrder, FIXES_gscSpec@),
-		deleteproperty(5, FIXES_gscNoGMProperty),
-		CallRemoteFunction(FIXES_gscDetermineOrder, FIXES_gscSpec@);
-	}
-#endif
-
-/* 
- * FIXES_IsPlayerConnected(playerid)
- * 
- * FIXES:
- *     IsPlayerConnected
- */
-
-#if defined _ALS_IsPlayerConnected
-	#error _ALS_IsPlayerConnected defined
-#endif
-native BAD_IsPlayerConnected(playerid) = IsPlayerConnected;
-
-#if FIX_IsPlayerConnected
-	stock FIXES_IsPlayerConnected(playerid)
-	{
-		return _FIXES_IS_PLAYER_CONNECTED(playerid);
-	}
-	
-	#define _ALS_IsPlayerConnected
-	#define IsPlayerConnected FIXES_IsPlayerConnected
-#endif
-
-/* 
- * _FIXES_CreateGameTextDraws(playerid, test)
- * 
- * Create the text draws used to replicate game texts.
- * 
- * FIXES:
- *     GameText
- */
-
-#if FIX_GameText
-	static _FIXES_CreateGameTextDraws(const playerid)
+	for(new i; i=MAX_PLAYERS; i<MAX_PLAYERS; i++)
 	{
-		if (playerid == INVALID_PLAYER_ID)
+		if(IsPlayerConnected(i))
 		{
-				new
-					Text:t;
-				
-			#if FIX_GameTextStyles
-				
-				// Global style 7 (vehicle name).
-				t = FIXES_gsGTStyle[7] = TextDrawCreate(608.000000, 344.000000, FIXES_gscSpace),
-				TextDrawLetterSize(t, 1.000000, 3.000000),
-				TextDrawAlignment(t, 3),
-				TextDrawColor(t, 0x36682CFF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 2),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 2),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 10.0, 200.0);
-				
-				// Global style 8 (location name).
-				t = FIXES_gsGTStyle[8] = TextDrawCreate(608.000000, 386.500000, FIXES_gscSpace),
-				TextDrawLetterSize(t, 1.200000, 3.799998),
-				TextDrawAlignment(t, 3),
-				TextDrawColor(t, 0xACCBF1FF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 2),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 0),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 10.0, 200.0);
-				
-				// Global style 9 (radio name).
-				t = FIXES_gsGTStyle[9] = TextDrawCreate(320.000000, 22.000000, FIXES_gscSpace),
-				TextDrawLetterSize(t, 0.600000, 1.899999),
-				TextDrawAlignment(t, 2),
-				TextDrawColor(t, 0x906210FF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 1),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 2),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 200.0, 620.0);
-				
-				// Global style 10 (radio switch).
-				t = FIXES_gsGTStyle[10] = TextDrawCreate(320.000000, 22.000000, FIXES_gscSpace),
-				TextDrawLetterSize(t, 0.600000, 1.899999),
-				TextDrawAlignment(t, 2),
-				TextDrawColor(t, 0x969696FF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 1),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 2),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 200.0, 620.0);
-				
-				// Global style 11 (positive money).
-				t = FIXES_gsGTStyle[11] = TextDrawCreate(607.000000, 78.000000, FIXES_gscSpace),
-				TextDrawLetterSize(t, 0.550000, 2.150000),
-				TextDrawAlignment(t, 3),
-				TextDrawColor(t, 0x36682CFF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 2),
-				TextDrawBackgroundColor(t, 0x000000FF),
-				TextDrawFont(t, 3),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 10.0, 200.0);
-				
-				// Global style 12 (negative money).
-				t = FIXES_gsGTStyle[12] = TextDrawCreate(607.000000, 78.000000, FIXES_gscSpace),
-				TextDrawLetterSize(t, 0.550000, 2.150000),
-				TextDrawAlignment(t, 3),
-				TextDrawColor(t, 0xB4191DFF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 2),
-				TextDrawBackgroundColor(t, 0x000000FF),
-				TextDrawFont(t, 3),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 10.0, 200.0);
-				
-				// Global style 13 (stunt).
-				t = FIXES_gsGTStyle[13] = TextDrawCreate(380.000000, 341.000000, FIXES_gscSpace),
-				TextDrawLetterSize(t, 0.579999, 2.400000),
-				TextDrawTextSize(t, 40.000000, 460.000000),
-				TextDrawAlignment(t, 2),
-				TextDrawColor(t, 0xD7D3CCFF),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0),
-				TextDrawSetShadow(t, 2),
-				TextDrawSetOutline(t, 0),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 1),
-				TextDrawSetProportional(t, 1),
-				
-			#endif
-				
-				// Global style 0.
-				t = FIXES_gsGTStyle[0] = TextDrawCreate(320.0, 214.0, FIXES_gscSpace),
-				TextDrawLetterSize(t, 1.3, 3.6),
-				TextDrawAlignment(t, 2),
-				TextDrawColor(t, 0x906210FF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 2),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 3),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 200.0, 620.0);
-				
-				// Global style 1.
-				t = FIXES_gsGTStyle[1] = TextDrawCreate(620.0, 310.0, FIXES_gscSpace),
-				TextDrawLetterSize(t, 1.0, 2.6),
-				TextDrawAlignment(t, 3),
-				TextDrawColor(t, 0x906210FF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 2),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 3),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 10.0, 200.0);
-				
-				// Global style 2.
-				t = FIXES_gsGTStyle[2] = TextDrawCreate(320.0, 156.0, FIXES_gscSpace),
-				TextDrawLetterSize(t, 2.1, 4.2),
-				TextDrawAlignment(t, 2),
-				TextDrawColor(t, 0xE1E1E1FF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 3),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 0),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 200.0, 620.0);
-				
-				// Global style 3.
-				t = FIXES_gsGTStyle[3] = TextDrawCreate(320.000000, 154.500000, FIXES_gscSpace),
-				TextDrawLetterSize(t, 0.600000, 2.750000),
-				TextDrawAlignment(t, 2),
-				TextDrawColor(t, 0x906210FF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 2),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 2),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 200.0, 620.0);
-				
-				// Global style 4.
-				t = FIXES_gsGTStyle[4] = TextDrawCreate(320.000000, 115.500000, FIXES_gscSpace),
-				TextDrawLetterSize(t, 0.600000, 2.750000),
-				TextDrawAlignment(t, 2),
-				TextDrawColor(t, 0x906210FF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 2),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 2),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 200.0, 620.0);
-				
-				// Global style 5.
-				t = FIXES_gsGTStyle[5] = TextDrawCreate(320.0, 217.0, FIXES_gscSpace),
-				TextDrawLetterSize(t, 0.6, 2.75),
-				TextDrawAlignment(t, 2),
-				TextDrawColor(t, 0xE1E1E1FF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 2),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 2),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 200.0, 620.0);
-				
-				// Global style 6.
-				t = FIXES_gsGTStyle[6] = TextDrawCreate(320.000000, 60.000000, FIXES_gscSpace),
-				TextDrawLetterSize(t, 1.000000, 3.599998),
-				TextDrawAlignment(t, 2),
-				TextDrawColor(t, 0xACCBF1FF),
-				TextDrawSetShadow(t, 0),
-				TextDrawSetOutline(t, 2),
-				TextDrawBackgroundColor(t, 0x000000AA),
-				TextDrawFont(t, 3),
-				TextDrawSetProportional(t, 1),
-				TextDrawUseBox(t, true),
-				TextDrawBoxColor(t, 0x00000000),
-				TextDrawTextSize(t, 200.0, 620.0);
-		}
-		else
-		{
-				new
-					PlayerText:t;
-				
-			#if FIX_GameTextStyles
-				
-				// Global style 7 (playerid, vehicle name).
-				t = FIXES_gsPGTStyle[playerid][7] = CreatePlayerTextDraw(playerid, 608.000000, 344.000000, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 1.000000, 3.000000),
-				PlayerTextDrawAlignment(playerid, t, 3),
-				PlayerTextDrawColor(playerid, t, 0x36682CFF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 2),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000AA),
-				PlayerTextDrawFont(playerid, t, 2),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 10.0, 200.0);
-				
-				// Global style 8 (playerid, location name).
-				t = FIXES_gsPGTStyle[playerid][8] = CreatePlayerTextDraw(playerid, 608.000000, 386.500000, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 1.200000, 3.799998),
-				PlayerTextDrawAlignment(playerid, t, 3),
-				PlayerTextDrawColor(playerid, t, 0xACCBF1FF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 2),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000AA),
-				PlayerTextDrawFont(playerid, t, 0),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 10.0, 200.0);
-				
-				// Global style 9 (playerid, radio name).
-				t = FIXES_gsPGTStyle[playerid][9] = CreatePlayerTextDraw(playerid, 320.000000, 22.000000, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 0.600000, 1.899999),
-				PlayerTextDrawAlignment(playerid, t, 2),
-				PlayerTextDrawColor(playerid, t, 0x906210FF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 1),
-				PlayerTextDrawBackgroundColor(playerid, t, 170),
-				PlayerTextDrawFont(playerid, t, 2),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 200.0, 620.0);
-				
-				// Global style 10 (playerid, radio switch).
-				t = FIXES_gsPGTStyle[playerid][10] = CreatePlayerTextDraw(playerid, 320.000000, 22.000000, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 0.600000, 1.899999),
-				PlayerTextDrawAlignment(playerid, t, 2),
-				PlayerTextDrawColor(playerid, t, 0x969696FF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 1),
-				PlayerTextDrawBackgroundColor(playerid, t, 170),
-				PlayerTextDrawFont(playerid, t, 2),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 200.0, 620.0);
-				
-				// Global style 11 (playerid, positive money).
-				t = FIXES_gsPGTStyle[playerid][11] = CreatePlayerTextDraw(playerid, 607.000000, 78.000000, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 0.550000, 2.150000),
-				PlayerTextDrawAlignment(playerid, t, 3),
-				PlayerTextDrawColor(playerid, t, 0x36682CFF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 2),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000FF),
-				PlayerTextDrawFont(playerid, t, 3),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 10.0, 200.0);
-				
-				// Global style 12 (playerid, negative money).
-				t = FIXES_gsPGTStyle[playerid][12] = CreatePlayerTextDraw(playerid, 607.000000, 78.000000, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 0.550000, 2.150000),
-				PlayerTextDrawAlignment(playerid, t, 3),
-				PlayerTextDrawColor(playerid, t, 0xB4191DFF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 2),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000FF),
-				PlayerTextDrawFont(playerid, t, 3),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 10.0, 200.0);
-				
-				// Global style 13 (playerid, stunt).
-				t = FIXES_gsPGTStyle[playerid][13] = CreatePlayerTextDraw(playerid, 380.000000, 341.000000, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 0.579999, 2.400000),
-				PlayerTextDrawTextSize(playerid, t, 40.000000, 460.000000),
-				PlayerTextDrawAlignment(playerid, t, 2),
-				PlayerTextDrawColor(playerid, t, 0xD7D3CCFF),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0),
-				PlayerTextDrawSetShadow(playerid, t, 2),
-				PlayerTextDrawSetOutline(playerid, t, 0),
-				PlayerTextDrawBackgroundColor(playerid, t, 170),
-				PlayerTextDrawFont(playerid, t, 1),
-				PlayerTextDrawSetProportional(playerid, t, 1);
-				
-			#endif
-				
-				// Global style 0.
-				t = FIXES_gsPGTStyle[playerid][0] = CreatePlayerTextDraw(playerid, 320.0, 214.0, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 1.3, 3.6),
-				PlayerTextDrawAlignment(playerid, t, 2),
-				PlayerTextDrawColor(playerid, t, 0x906210FF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 2),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000AA),
-				PlayerTextDrawFont(playerid, t, 3),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 200.0, 620.0);
-				
-				// Global style 1.
-				t = FIXES_gsPGTStyle[playerid][1] = CreatePlayerTextDraw(playerid, 620.0, 310.0, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 1.0, 2.6),
-				PlayerTextDrawAlignment(playerid, t, 3),
-				PlayerTextDrawColor(playerid, t, 0x906210FF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 2),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000AA),
-				PlayerTextDrawFont(playerid, t, 3),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 10.0, 200.0);
-				
-				// Global style 2.
-				t = FIXES_gsPGTStyle[playerid][2] = CreatePlayerTextDraw(playerid, 320.0, 156.0, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 2.1, 4.2),
-				PlayerTextDrawAlignment(playerid, t, 2),
-				PlayerTextDrawColor(playerid, t, 0xE1E1E1FF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 3),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000AA),
-				PlayerTextDrawFont(playerid, t, 0),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 200.0, 620.0);
-				
-				// Global style 3.
-				t = FIXES_gsPGTStyle[playerid][3] = CreatePlayerTextDraw(playerid, 320.000000, 154.500000, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 0.600000, 2.750000),
-				PlayerTextDrawAlignment(playerid, t, 2),
-				PlayerTextDrawColor(playerid, t, 0x906210FF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 2),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000AA),
-				PlayerTextDrawFont(playerid, t, 2),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 200.0, 620.0);
-				
-				// Global style 4.
-				t = FIXES_gsPGTStyle[playerid][4] = CreatePlayerTextDraw(playerid, 320.000000, 115.500000, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 0.600000, 2.750000),
-				PlayerTextDrawAlignment(playerid, t, 2),
-				PlayerTextDrawColor(playerid, t, 0x906210FF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 2),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000AA),
-				PlayerTextDrawFont(playerid, t, 2),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 200.0, 620.0);
-				
-				// Global style 5.
-				t = FIXES_gsPGTStyle[playerid][5] = CreatePlayerTextDraw(playerid, 320.0, 217.0, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 0.6, 2.75),
-				PlayerTextDrawAlignment(playerid, t, 2),
-				PlayerTextDrawColor(playerid, t, 0xE1E1E1FF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 2),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000AA),
-				PlayerTextDrawFont(playerid, t, 2),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 200.0, 620.0);
-				
-				// Global style 6.
-				t = FIXES_gsPGTStyle[playerid][6] = CreatePlayerTextDraw(playerid, 320.000000, 60.000000, FIXES_gscSpace),
-				PlayerTextDrawLetterSize(playerid, t, 1.000000, 3.599998),
-				PlayerTextDrawAlignment(playerid, t, 2),
-				PlayerTextDrawColor(playerid, t, 0xACCBF1FF),
-				PlayerTextDrawSetShadow(playerid, t, 0),
-				PlayerTextDrawSetOutline(playerid, t, 2),
-				PlayerTextDrawBackgroundColor(playerid, t, 0x000000AA),
-				PlayerTextDrawFont(playerid, t, 3),
-				PlayerTextDrawSetProportional(playerid, t, 1),
-				PlayerTextDrawUseBox(playerid, t, true),
-				PlayerTextDrawBoxColor(playerid, t, 0x00000000),
-				PlayerTextDrawTextSize(playerid, t, 200.0, 620.0);
-		}
-	}
-#endif
-
-/* 
- * OnFilterScriptInit()
- * 
- * Set "IS_FILTERSCRIPT" to true as this callback is ONLY called if this script
- * is actually a FilterScript.  Then call "FIXES_OnScriptInit".
- * 
- * FIXES:
- *     IS_FILTERSCRIPT
- *     OnPlayerConnect
- *     GameText
- */
-
-public OnFilterScriptInit()
-{
-	// It is possible for this to be the only thing done in this function!
-	_FIXES_gIsFilterscript = true;
-	
-	state _ALS : _ALS_go;
-	
-	#if FIXES_Single
-		// Check this really IS the only script running.
-		if (existproperty(5, FIXES_gscSingleProperty))
-		{
-			print(FIXES_gscFixesError);
-		}
-		else
-		{
-			FIXES_gsSettings &= ~e_FIXES_SETTINGS_SECOND_USE,
-			setproperty(5, FIXES_gscSingleProperty, 1);
-		}
-	#endif
-	
-	// =================
-	//  BEGIN: GameText 
-	// =================
-	#if FIX_GameText
-		for (new i = 0; i != sizeof (FIXES_gsPlayerPGTShown); ++i)
-		{
-			FIXES_gsPlayerPGTShown[i][MAX_PLAYERS] = MAX_PLAYERS;
-		}
-	#endif
-	#if FIXES_Single
-		#if FIX_GameText
-			_FIXES_CreateGameTextDraws(INVALID_PLAYER_ID);
-		#endif
-		// =================
-		//  END:   GameText 
-		// =================
-	#else
-		FIXES_DetermineOrder(),
-		FIXES_gsSettings &= ~e_FIXES_SETTINGS_DROP_ALL_DATA;
-	#endif
-	
-	#if !FIXES_Single && FIX_GameText && FIX_OnPlayerConnect
-		FIXES_gsSettings |= e_FIXES_SETTINGS_NO_GAME_TEXT;
-	#endif
-	// These are all the fixes that use "_FIXES_FOREACH".
-	#if FIX_OnPlayerConnect || _FIX_Menus || FIX_GetPlayerMenu || FIX_OnPlayerDisconnect || FIX_GameText || FIX_AllowInteriorWeapons || FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable
-		for (new playerid = 0; playerid != MAX_PLAYERS; ++playerid)
-		{
-			if (BAD_IsPlayerConnected(playerid))
-			{
-				// No "defined" checks - if you don't want this fix because
-				// you don't have an "OnPlayerConnect", just don't use it!
-				// Of course, it helps that the copy of "OnPlayerConnect"
-				// in this include is almost always called!
-				#if FIX_OnPlayerConnect
-					// ========================
-					//  BEGIN: OnPlayerConnect 
-					// ========================
-					OnPlayerConnect(playerid);
-					// ========================
-					//  END:   OnPlayerConnect 
-					// ========================
-				#else
-					_FIXES_AddInternal(FIXES_gsPlayersIterator, playerid, MAX_PLAYERS);
-					
-					#if FIX_GameText
-						// =================
-						//  BEGIN: GameText 
-						// =================
-						_FIXES_IS_IN_CHARGE()
-						{
-							_FIXES_CreateGameTextDraws(playerid);
-						}
-						// =================
-						//  END:   GameText 
-						// =================
-					#endif
-				#endif
-			}
-		}
-	#endif
-	#if !FIXES_Single && FIX_GameText && FIX_OnPlayerConnect
-		FIXES_gsSettings &= ~e_FIXES_SETTINGS_NO_GAME_TEXT;
-	#endif
-	
-	return FIXES_OnFilterScriptInit();
-}
-
-#if defined _ALS_OnFilterScriptInit
-	#error _ALS_OnFilterScriptInit defined
-#endif
-#define _ALS_OnFilterScriptInit
-#define OnFilterScriptInit(%0) FIXES_OnFilterScriptInit(%0) <_ALS : _ALS_go>
-
-_FIXES_FORWARD FIXES_OnFilterScriptInit();
-
-/* 
- * OnGameModeInit()
- * 
- * Call "FIXES_OnScriptInit" if this is not a FilterScript.
- * 
- * FIXES:
- *     IS_FILTERSCRIPT
- *     AllowInteriorWeapons
- *     AllowTeleport
- */
-
-public OnGameModeInit()
-{
-	state _ALS : _ALS_go;
-	
-	#if FIXES_Single
-		// Check this really IS the only script running.  Properties reset when
-		// a gamemode restarts, so we don't have to worry about filterscipts
-		// detecting themselves.
-		if (FIXES_gsSettings & e_FIXES_SETTINGS_SECOND_USE)
-		{
-			if (existproperty(5, FIXES_gscSingleProperty))
-			{
-				print(FIXES_gscFixesError);
-			}
-			else
-			{
-				setproperty(5, FIXES_gscSingleProperty, 1);
-			}
-		}
-		else
-		{
-			// When the server starts, we need to allow an FS to load with a GM
-			// that doesn't use fixes.inc.  This is the only case where a
-			// property can be set while a ganemode isn't running.  This will
-			// mean that the FS won't complain if they are both using fixes, but
-			// the GM still will, so all is good.
-			FIXES_gsSettings |= e_FIXES_SETTINGS_SECOND_USE;
-		}
-	#endif
-	
-	// =============================
-	//  BEGIN: AllowInteriorWeapons 
-	// =============================
-	// ======================
-	//  BEGIN: AllowTeleport 
-	// ======================
-	#if FIX_AllowInteriorWeapons && FIX_AllowTeleport && !defined FILTERSCRIPT
-		FIXES_gsSettings &= ~(e_FIXES_SETTINGS_INTERIOR | e_FIXES_SETTINGS_ADMIN_TELEPORT);
-	#elseif FIX_AllowInteriorWeapons
-		FIXES_gsSettings &= ~e_FIXES_SETTINGS_INTERIOR;
-	#elseif FIX_AllowTeleport && !defined FILTERSCRIPT
-		FIXES_gsSettings &= ~e_FIXES_SETTINGS_ADMIN_TELEPORT;
-	#endif
-	// ======================
-	//  END:   AllowTeleport 
-	// ======================
-	// ===========================
-	//  END: AllowInteriorWeapons 
-	// ===========================
-	
-	#if FIX_GameText || !FIXES_Single
-		if (!_FIXES_gIsFilterscript)
-		{
-			// =================
-			//  BEGIN: GameText 
-			// =================
-			#if FIX_GameText
-					for (new i = 0; i != sizeof (FIXES_gsPlayerPGTShown); ++i)
-					{
-						FIXES_gsPlayerPGTShown[i][MAX_PLAYERS] = MAX_PLAYERS;
-					}
-				#if FIXES_Single
-					_FIXES_CreateGameTextDraws(INVALID_PLAYER_ID);
-				#endif
-			#endif
-			// =================
-			//  END:   GameText 
-			// =================
-			#if !FIXES_Single
-				FIXES_DetermineOrder();
-			#endif
-		}
-	#endif
-	#if !FIXES_Single
-		FIXES_gsSettings &= ~e_FIXES_SETTINGS_DROP_ALL_DATA;
-	#endif
-	
-	return FIXES_OnGameModeInit();
-}
-
-#if defined _ALS_OnGameModeInit
-	#error _ALS_OnGameModeInit defined
-#endif
-#define _ALS_OnGameModeInit
-#define OnGameModeInit(%0) FIXES_OnGameModeInit(%0) <_ALS : _ALS_go>
-
-_FIXES_FORWARD FIXES_OnGameModeInit();
-
-/* 
- * OnGameModeExit()
- * 
- * Fast way of detecting not to retain any data.
- */
-
-#if !FIXES_Single || FIX_PlayerDialogResponse
-	public OnGameModeExit()
-	{
-		#if !FIXES_Single
-			FIXES_gsSettings |= e_FIXES_SETTINGS_DROP_ALL_DATA;
-			if (!_FIXES_gIsFilterscript && FIXES_gsSettings & e_FIXES_SETTINGS_IN_CHARGE)
-			{
-				FIXES_gsSettings |= e_FIXES_SETTINGS_ENDING,
-				FIXES_DetermineOrder();
-			}
-		#endif
-		
-		// =============================
-		//  BEGIN: PlayerDialogResponse 
-		// =============================
-		#if FIX_PlayerDialogResponse
-			for (new playerid = 0; playerid != MAX_PLAYERS; ++playerid)
-			{
-				ShowPlayerDialog(playerid, -1, 0, FIXES_gscSpace, FIXES_gscSpace, FIXES_gscSpace, FIXES_gscSpace);
-			}
-		#endif
-		// =============================
-		//  END:   PlayerDialogResponse 
-		// =============================
-		
-		return FIXES_OnGameModeExit();
-	}
-	
-	#if defined _ALS_OnGameModeExit
-		#error _ALS_OnGameModeExit defined
-	#endif
-	#define _ALS_OnGameModeExit
-	#define OnGameModeExit(%0) FIXES_OnGameModeExit(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnGameModeExit();
-#endif
-
-/* 
- * OnFilterScriptExit()
- * 
- * Fast way of detecting not to retain any data.
- */
-
-#if !FIXES_Single || FIX_GameText || FIX_OnPlayerDisconnect
-	public OnFilterScriptExit()
-	{
-		#if FIX_OnPlayerDisconnect
-			// Removal safe loop.
-			for (new next, playerid = FIXES_gsPlayersIterator[MAX_PLAYERS]; playerid != MAX_PLAYERS; playerid = next)
-			{
-				next = FIXES_gsPlayersIterator[playerid],
-				OnPlayerDisconnect(playerid, 4);
-				#if FIXES_Single
-					// =================
-					//  BEGIN: GameText 
-					// =================
-					#if FIX_GameText
-						#if FIX_GameTextStyles
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][13]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][12]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][11]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][10]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][9]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][8]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][7]),
-						#endif
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][6]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][5]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][4]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][3]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][2]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][1]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][0]);
-					#endif
-				#endif
-			}
-		#endif
-		#if FIXES_Single
-			// =================
-			//  BEGIN: GameText 
-			// =================
-			#if FIX_GameText
-				#if defined FIXES_OnFilterScriptExit
-					FIXES_OnFilterScriptExit();
-				#endif
-				#if !FIX_OnPlayerDisconnect
-					_FIXES_FOREACH(FIXES_gsPlayersIterator, playerid)
-					{
-						#if FIX_GameTextStyles
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][13]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][12]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][11]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][10]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][9]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][8]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][7]),
-						#endif
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][6]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][5]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][4]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][3]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][2]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][1]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][0]);
-					}
-				#endif
-					return
-						#if FIX_GameTextStyles
-							TextDrawDestroy(FIXES_gsGTStyle[13]),
-							TextDrawDestroy(FIXES_gsGTStyle[12]),
-							TextDrawDestroy(FIXES_gsGTStyle[11]),
-							TextDrawDestroy(FIXES_gsGTStyle[10]),
-							TextDrawDestroy(FIXES_gsGTStyle[9]),
-							TextDrawDestroy(FIXES_gsGTStyle[8]),
-							TextDrawDestroy(FIXES_gsGTStyle[7]),
-						#endif
-							TextDrawDestroy(FIXES_gsGTStyle[6]),
-							TextDrawDestroy(FIXES_gsGTStyle[5]),
-							TextDrawDestroy(FIXES_gsGTStyle[4]),
-							TextDrawDestroy(FIXES_gsGTStyle[3]),
-							TextDrawDestroy(FIXES_gsGTStyle[2]),
-							TextDrawDestroy(FIXES_gsGTStyle[1]),
-							TextDrawDestroy(FIXES_gsGTStyle[0]);
-			#else
-					return FIXES_OnFilterScriptExit();
-			#endif
-			// =================
-			//  END:   GameText 
-			// =================
-		#else
-			if (FIXES_gsSettings & e_FIXES_SETTINGS_IN_CHARGE)
-			{
-				FIXES_gsSettings |= e_FIXES_SETTINGS_ENDING,
-				FIXES_DetermineOrder();
-			}
-			return FIXES_OnFilterScriptExit();
-		#endif
-	}
-	
-	#if defined _ALS_OnFilterScriptExit
-		#error _ALS_OnFilterScriptExit defined
-	#endif
-	#define _ALS_OnFilterScriptExit
-	#define OnFilterScriptExit(%0) FIXES_OnFilterScriptExit(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnFilterScriptExit();
-#endif
-
-/* 
- * OnPlayerCommandText(playerid, cmdtext[])
- * 
- * FIXES:
- *     OnPlayerCommandText
- */
-
-#if FIX_OnPlayerCommandText
-	public OnPlayerCommandText(playerid, cmdtext[])
-	{
-		// ============================
-		//  BEGIN: OnPlayerCommandText 
-		// ============================
-		#if FIX_OnPlayerCommandText
-			// If this "#if" is around the whole function, it doesn't always
-			// compile properly.
-			return FIXES_OnPlayerCommandText(playerid, (cmdtext[0] <= '\1') ? FIXES_gscNULL : cmdtext);
-		#endif
-		// ============================
-		//  END: OnPlayerCommandText 
-		// ============================
-	}
-	
-	#if defined _ALS_OnPlayerCommandText
-		#error _ALS_OnPlayerCommandText defined
-	#endif
-	#define _ALS_OnPlayerCommandText
-	#define OnPlayerCommandText(%0) FIXES_OnPlayerCommandText(%0) <_ALS : _ALS_go>
-	
-	forward FIXES_OnPlayerCommandText(playerid, cmdtext[]);
-	public FIXES_OnPlayerCommandText(playerid, cmdtext[]) <_ALS : _ALS_x0, _ALS : _ALS_x1> { return 0; }
-	public FIXES_OnPlayerCommandText(playerid, cmdtext[]) <> { return 0; }
-#endif
-
-/* 
- * OnPlayerConnect(playerid)
- * 
- * Almost every fix uses this callback for initialisation.  It is only
- * explicitly referenced for those fixes where this is all the code.  The
- * inclusion code was approaching the 512 line length limit, so I shrank it.
- * 
- * FIXES:
- *     TogglePlayerControllable
- *     SetPlayerWorldBounds
- *     GetPlayerColor
- *     SetPlayerName
- *     GetPlayerSkin
- *     IsPlayerInCheckpoint
- *     IsPlayerInRaceCheckpoint
- *     GetPlayerWeapon
- *     PutPlayerInVehicle
- *     OnPlayerEnterVehicle
- *     AllowTeleport
- *     OnDialogResponse
- *     SetSpawnInfo
- *     AllowInteriorWeapons
- *     TrainExit
- *     Kick
- *     OnPlayerEnterVehicle_2
- *     PlayerDialogResponse
- *     OnPlayerSpawn
- *     ApplyAnimation_2
- */
-
-#if     FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable || FIX_SetPlayerName            || FIX_GetPlayerColour
-	#define _FIXES_ON_PLAYER_CONNECT
-#elseif FIX_GetPlayerSkin        || FIX_IsPlayerInCheckpoint     || FIX_IsPlayerInRaceCheckpoint || FIX_GetPlayerWeapon
-	#define _FIXES_ON_PLAYER_CONNECT
-#elseif FIX_PutPlayerInVehicle   || FIX_OnPlayerEnterVehicle     || FIX_AllowTeleport            || FIX_OnDialogResponse
-	#define _FIXES_ON_PLAYER_CONNECT
-#elseif FIX_GetPlayerDialog      || FIX_SetSpawnInfo             || FIX_AllowInteriorWeapons     || FIX_TrainExit
-	#define _FIXES_ON_PLAYER_CONNECT
-#elseif FIX_Kick                 || FIX_OnPlayerEnterVehicle_2   || FIX_PlayerDialogResponse     || FIX_GetPlayerInterior
-	#define _FIXES_ON_PLAYER_CONNECT
-#elseif FIX_OnPlayerSpawn        || FIX_ApplyAnimation_2         || FIX_GameText                 || _FIX_Menus
-	#define _FIXES_ON_PLAYER_CONNECT
-#elseif FIX_GetPlayerMenu        || FIX_OnPlayerDisconnect       || FIX_OnPlayerConnect          || FIX_SetPlayerTime
-	#define _FIXES_ON_PLAYER_CONNECT
-#endif
-
-#if defined _FIXES_ON_PLAYER_CONNECT
-	public OnPlayerConnect(playerid)
-	{
-		// =========================
-		//  BEGIN: ApplyAnimation_2 
-		// =========================
-		#if FIX_ApplyAnimation_2
-			FIXES_gsPlayerAnimLibs[playerid][0] =
-				FIXES_gsPlayerAnimLibs[playerid][1] =
-					FIXES_gsPlayerAnimLibs[playerid][2] =
-						FIXES_gsPlayerAnimLibs[playerid][3] =
-							FIXES_gsPlayerAnimLibs[playerid][4] = -1;
-		#endif
-		// =======================
-		//  END: ApplyAnimation_2 
-		// =======================
-		
-		#if _FIX_Menus || FIX_GetPlayerMenu || FIX_OnPlayerDisconnect || FIX_GameText || FIX_AllowInteriorWeapons || FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable
-			_FIXES_AddInternal(FIXES_gsPlayersIterator, playerid, MAX_PLAYERS);
-		#endif
-		
-		FIXES_PRINTF("FIXES_OnPlayerConnect: %d", playerid);
-			// This is only reset when the Game Mode changes or when a new
-		#if FIX_Kick || FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable || FIX_PutPlayerInVehicle || FIX_OnPlayerEnterVehicle || FIX_AllowTeleport || FIX_AllowInteriorWeapons || FIX_TrainExit || FIX_OnPlayerEnterVehicle_2
-			// player connects, which is what we want.  The other items are the
-			// same, but must be done only once.  This variable will tend to
-			// hold data relevant only in the master script (the first
-			// filterscript).
-			#if FIX_Kick || FIX_SetPlayerTime
-				FIXES_gsPlayerBools[playerid] = e_FIXES_BOOLS_ON_PLAYER_CONNECT;
-			#else
-				FIXES_gsPlayerBools[playerid] = e_FIXES_BOOLS_NONE;
-			#endif
-		#endif
-		
-		// =================
-		//  BEGIN: GameText 
-		// =================
-		#if FIX_GameText
-			#if !FIXES_Single
-				if (FIXES_gsSettings & (e_FIXES_SETTINGS_NO_GAME_TEXT | e_FIXES_SETTINGS_IN_CHARGE) == e_FIXES_SETTINGS_IN_CHARGE)
-			#endif
-				{
-					_FIXES_CreateGameTextDraws(playerid);
-				}
-		#endif
-		// =================
-		//  END:   GameText 
-		// =================
-		
-		#if !FIXES_Single
-			if (!GetPVarInt(playerid, FIXES_pvarNotNewPlayer))
-		#endif
-			{
-				FIXES_PRINTF("FIXES_OnPlayerConnect: First (%d)", FIXES_gsSettings & e_FIXES_SETTINGS_IN_CHARGE);
-				// ======================
-				//  BEGIN: SetPlayerName 
-				// ======================
-				#if FIX_SetPlayerName
-					new
-						name[MAX_PLAYER_NAME];
-					GetPlayerName(playerid, name, MAX_PLAYER_NAME);
-					if (strcmp(name, FIXES_gscTempName) == 0)
-					{
-						Kick(playerid);
-					}
-				#endif
-				// ======================
-				//  END:   SetPlayerName 
-				// ======================
-				
-				// =============================
-				//  BEGIN: SetPlayerWorldBounds 
-				// =============================
-				#if FIX_SetPlayerWorldBounds && !FIXES_Single
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_LX] =
-						FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_UX] =
-							FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_LY] =
-								FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_UY] =
-									0.0;
-				#endif
-				// =============================
-				//  END:   SetPlayerWorldBounds 
-				// =============================
-				
-				// =======================
-				//  BEGIN: SetPlayerColor 
-				// =======================
-				#if FIX_GetPlayerColour
-					SetPlayerColor(playerid, FIXES_gscPlayerColours[playerid % 100]);
-				#endif
-				// =======================
-				//  END:   SetPlayerColor 
-				// =======================
-				
-				// ======================
-				//  BEGIN: GetPlayerSkin 
-				// ======================
-				#if FIX_GetPlayerSkin
-					#if FIXES_Single
-						FIXES_gsPlayerSkin[playerid] = 0;
-					#else
-						SetPVarInt(playerid, FIXES_pvarPlayerSkin, 0);
-					#endif
-				#endif
-				// ======================
-				//  END:   GetPlayerSkin 
-				// ======================
-				
-				// =============================
-				//  BEGIN: IsPlayerInCheckpoint 
-				// =============================
-				#if FIX_IsPlayerInCheckpoint
-					DisablePlayerCheckpoint(playerid);
-				#endif
-				// =============================
-				//  END:   IsPlayerInCheckpoint 
-				// =============================
-				
-				// =================================
-				//  BEGIN: IsPlayerInRaceCheckpoint 
-				// =================================
-				#if FIX_IsPlayerInRaceCheckpoint
-					DisablePlayerRaceCheckpoint(playerid);
-				#endif
-				// =================================
-				//  END:   IsPlayerInRaceCheckpoint 
-				// =================================
-				
-				// ========================
-				//  BEGIN: GetPlayerWeapon 
-				// ========================
-				#if FIX_GetPlayerWeapon
-					#if FIXES_Single
-						FIXES_gsPlayerWeapon[playerid] = -1;
-					#else
-						SetPVarInt(playerid, FIXES_pvarPlayerWeapon, -1);
-					#endif
-				#endif
-				// ========================
-				//  END:   GetPlayerWeapon 
-				// ========================
-				
-				// ==========================
-				//  BEGIN: GetPlayerInterior 
-				// ==========================
-				#if FIX_GetPlayerInterior
-					#if FIXES_Single
-						FIXES_gsInterior[playerid] = 0;
-					#else
-						SetPVarInt(playerid, FIXES_pvarPlayerInterior, 0);
-					#endif
-				#endif
-				// ==========================
-				//  END:   GetPlayerInterior 
-				// ==========================
-				
-				// =========================
-				//  BEGIN: OnDialogResponse 
-				// =========================
-				#if FIX_OnDialogResponse || FIX_GetPlayerDialog
-					#if FIXES_Single
-						FIXES_gsDialogID[playerid] = INVALID_DIALOG_ID;
-					#else
-						SetPVarInt(playerid, FIXES_pvarPlayerDialog, INVALID_DIALOG_ID);
-					#endif
-				#endif
-				// =========================
-				//  END:   OnDialogResponse 
-				// =========================
-				
-				// =============================
-				//  BEGIN: PlayerDialogResponse 
-				// =============================
-				#if FIX_PlayerDialogResponse
-					ShowPlayerDialog(playerid, -1, 0, FIXES_gscSpace, FIXES_gscSpace, FIXES_gscSpace, FIXES_gscSpace);
-				#endif
-				// =============================
-				//  END:   PlayerDialogResponse 
-				// =============================
-				
-				// =====================
-				//  BEGIN: SetSpawnInfo 
-				// =====================
-				#if FIX_SetSpawnInfo
-					SetSpawnInfo(playerid, NO_TEAM, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
-				#endif
-				// =====================
-				//  END:   SetSpawnInfo 
-				// =====================
-				
-				// ======================
-				//  BEGIN: OnPlayerSpawn 
-				// ======================
-				#if FIX_OnPlayerSpawn
-					#if FIXES_Single
-						FIXES_gsLastCash[playerid] = 0;
-					#else
-						SetPVarInt(playerid, FIXES_pvarPlayerLastCash, 0);
-					#endif
-				#endif
-				// ======================
-				//  END:   OnPlayerSpawn 
-				// ======================
-				
-				#if !FIXES_Single
-					// No longer their first time.
-					SetPVarInt(playerid, FIXES_pvarNotNewPlayer, 1);
-				#endif
-			}
-		// =============
-		//  BEGIN: Kick 
-		// =============
-		#if FIX_Kick || FIX_SetPlayerTime
-			new
-				ret = FIXES_OnPlayerConnect(playerid);
-			FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_ON_PLAYER_CONNECT;
-			return ret;
-		#else
-			return FIXES_OnPlayerConnect(playerid);
-		#endif
-		// =============
-		//  END:   Kick 
-		// =============
-	}
-	
-	#if defined _ALS_OnPlayerConnect
-		#error _ALS_OnPlayerConnect defined
-	#endif
-	#define _ALS_OnPlayerConnect
-	#define OnPlayerConnect(%0) FIXES_OnPlayerConnect(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerConnect(playerid);
-#endif
-
-/* 
- * OnPlayerDisonnect(playerid, reason)
- * 
- * FIXES:
- *     SetPlayerAttachedObject
- *     IsPlayerAttachedObjectSlotUsed
- *     Kick
- *     GetPlayerMenu
- */
-
-#if FIX_SetPlayerAttachedObject || FIX_IsPlayerAttachedObjSlotUsed || FIX_Kick || (FIXES_SilentKick && (FIX_OnVehicleMod || FIX_OnPlayerEnterVehicle || FIX_OnPlayerEnterVehicle_2)) || FIX_GetPlayerMenu || _FIX_Menus || FIX_OnPlayerDisconnect || FIX_GameText || FIX_AllowInteriorWeapons || FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable || FIX_ApplyAnimation_2
-	public OnPlayerDisconnect(playerid, reason)
-	{
-		new
-			ret = FIXES_OnPlayerDisconnect(playerid, reason);
-		
-		// =========================
-		//  BEGIN: ApplyAnimation_2 
-		// =========================
-		#if FIX_ApplyAnimation_2
-			if (FIXES_gsAnimTimer[playerid])
-			{
-				KillTimer(FIXES_gsAnimTimer[playerid]),
-				FIXES_gsAnimTimer[playerid] = 0;
-			}
-		#endif
-		// =======================
-		//  END: ApplyAnimation_2 
-		// =======================
-		
-		// ======================
-		//  BEGIN: GetPlayerMenu 
-		// ======================
-		#if FIX_GetPlayerMenu
-			FIXES_gsCurrentMenu[playerid] = Menu:INVALID_MENU;
-		#endif
-		// ======================
-		//  END:   GetPlayerMenu 
-		// ======================
-		
-		// ==========================
-		//  BEGIN: FIXES_SilentKick 
-		// ==========================
-		#if FIXES_SilentKick && (FIX_OnVehicleMod || FIX_OnPlayerEnterVehicle || FIX_OnPlayerEnterVehicle_2)
-			new
-				shift = FIXES_gsPlayerIP[playerid];
-			if (shift != -1)
+			if(!i == playerid)
 			{
-				// Unban the IP (timed out).
-				new
-					ip[16];
-				format(ip, sizeof (ip), "unbanip %d.%d.%d.%d", shift >>> 24, (shift >>> 16) & 0xFF, (shift >>> 8) & 0xFF, shift & 0xFF),
-				FIXES_gsPlayerIP[playerid] = -1;
-			}
-		#endif
-		// ==========================
-		//  END:   FIXES_SilentKick 
-		// ==========================
-		
-		// ================================
-		//  BEGIN: SetPlayerAttachedObject 
-		// ================================
-		#if FIX_SetPlayerAttachedObject
-			#if !(FIXES_SilentKick && (FIX_OnVehicleMod || FIX_OnPlayerEnterVehicle || FIX_OnPlayerEnterVehicle_2))
-				new
-			#endif
-					shift = playerid % _FIXES_ATTACHMENTS * MAX_PLAYER_ATTACHED_OBJECTS;
-			#pragma tabsize 4
-			new
-				slot = playerid / _FIXES_ATTACHMENTS;
-			#if !FIXES_Single
-				if (!_FIXES_gIsFilterscript)
-			#endif
+				if(PlayerInfo[i][pJob] == job || PlayerInfo[i][pJob2] == job)
 				{
-					for (new i = 0; i != MAX_PLAYER_ATTACHED_OBJECTS; ++i)
-					{
-						if (FIXES_gsObjectSlots[slot] & 1 << shift + i)
-						{
-							RemovePlayerAttachedObject(playerid, i);
-						}
-					}
+					SendClientMessage(i, color, string);	
 				}
-			#pragma tabsize 4
-			FIXES_gsObjectSlots[slot] &= ~((1 << MAX_PLAYER_ATTACHED_OBJECTS) - 1 << shift);
-		#endif
-		// ================================
-		//  END:   SetPlayerAttachedObject 
-		// ================================
-		
-		// =======================================
-		//  BEGIN: IsPlayerAttachedObjectSlotUsed 
-		// =======================================
-		#if FIX_IsPlayerAttachedObjSlotUsed && !FIX_SetPlayerAttachedObject
-			FIXES_gsObjectSlots[playerid / _FIXES_ATTACHMENTS] &= ~((1 << MAX_PLAYER_ATTACHED_OBJECTS) - 1 << playerid % _FIXES_ATTACHMENTS * MAX_PLAYER_ATTACHED_OBJECTS);
-		#endif
-		// =======================================
-		//  END:   IsPlayerAttachedObjectSlotUsed 
-		// =======================================
-		
-		// =============
-		//  BEGIN: Kick 
-		// =============
-		#if FIX_Kick
-			if (FIXES_gsPlayerBools[playerid] & e_FIXES_BOOLS_KICKED)
-			{
-				// Stop the timer if it is still running.
-				KillTimer(GetPVarInt(playerid, FIXES_pvarKick));
 			}
-		#endif
-		// =============
-		//  END:   Kick 
-		// =============
-		
-		#if _FIX_Menus || FIX_GetPlayerMenu || FIX_OnPlayerDisconnect || FIX_GameText || FIX_AllowInteriorWeapons || FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable
-			_FIXES_RemoveInternal(FIXES_gsPlayersIterator, playerid, MAX_PLAYERS);
-		#endif
-		
-		return ret;
-	}
-	
-	#if defined _ALS_OnPlayerDisconnect
-		#error _ALS_OnPlayerDisconnect defined
-	#endif
-	#define _ALS_OnPlayerDisconnect
-	#define OnPlayerDisconnect(%0) FIXES_OnPlayerDisconnect(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerDisconnect(playerid, reason);
-#endif
-
-/* 
- * OnPlayerDeath(playerid, killerid, reason)
- * 
- * FIXES:
- *     OnPlayerDeath
- *     OnPlayerSpawn
- */
-
-#if FIX_OnPlayerDeath || FIX_OnPlayerSpawn
-	public OnPlayerDeath(playerid, killerid, reason)
-	{
-		_FIXES_IS_IN_CHARGE()
-		{
-			// ======================
-			//  BEGIN: OnPlayerDeath 
-			// ======================
-			#if FIX_OnPlayerDeath
-				static
-					sAnimlib[32],
-					sAnimname[32];
-				GetAnimationName(FIXES_gsLastAnimation[playerid], sAnimlib, sizeof (sAnimlib), sAnimname, sizeof (sAnimname));
-				if (strcmp(sAnimlib, "PED", true))
-				{
-					ClearAnimations(playerid);
-				}
-			#endif
-			// ======================
-			//  END:   OnPlayerDeath 
-			// ======================
-		}
-		
-		// ======================
-		//  BEGIN: OnPlayerSpawn 
-		// ======================
-		#if FIX_OnPlayerSpawn
-			new
-				ret = FIXES_OnPlayerDeath(playerid, killerid, reason);
-			
-			#if FIXES_Single
-				FIXES_gsLastCash[playerid] = GetPlayerMoney(playerid);
-			#else
-				SetPVarInt(playerid, FIXES_pvarPlayerLastCash, GetPlayerMoney(playerid));
-			#endif
-			
-			return ret;
-		#else
-			return FIXES_OnPlayerDeath(playerid, killerid, reason);
-		#endif
-		// ======================
-		//  END:   OnPlayerSpawn 
-		// ======================
-	}
-	
-	#if defined _ALS_OnPlayerDeath
-		#error _ALS_OnPlayerDeath defined
-	#endif
-	#define _ALS_OnPlayerDeath
-	#define OnPlayerDeath(%0) FIXES_OnPlayerDeath(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerDeath(playerid, killerid, reason);
-#endif
-
-/* 
- * FIXES_SpawnPlayer(playerid)
- * 
- * FIXES:
- *     SpawnPlayer
- */
-
-#if defined _ALS_SpawnPlayer
-	#error _ALS_SpawnPlayer defined
-#endif
-native BAD_SpawnPlayer(playerid) = SpawnPlayer;
-
-#if FIX_SpawnPlayer
-	stock FIXES_SpawnPlayer(playerid)
-	{
-		// Valid "playerid" check inside "GetPlayerVehicleID".
-		new
-			vid = GetPlayerVehicleID(playerid);
-		if (vid)
-		{
-			new
-				Float:x,
-				Float:y,
-				Float:z;
-			// Remove them without the animation.
-			GetVehiclePos(vid, x, y, z),
-			SetPlayerPos(playerid, x, y, z);
 		}
-		return SpawnPlayer(playerid);
-	}
-	
-	#define _ALS_SpawnPlayer
-	#define SpawnPlayer FIXES_SpawnPlayer
-#endif
-
-/* 
- * FIXES_SetPlayerName(playerid, name[])
- * 
- * FIXES:
- *     SetPlayerName
- */
-
-#if defined _ALS_SetPlayerName
-	#error _ALS_SetPlayerName defined
-#endif
-native BAD_SetPlayerName(playerid, const name[]) = SetPlayerName;
-
-#if FIX_SetPlayerName
-	stock FIXES_SetPlayerName(playerid, name[])
-	{
-		static
-			sOldName[MAX_PLAYER_NAME];
-		GetPlayerName(playerid, sOldName, sizeof (sOldName));
-		if (!strcmp(name, sOldName, true))
-		{
-			if(strcmp(name, sOldName, false))
-			{
-				SetPlayerName(playerid, FIXES_gscTempName);
-				if(SetPlayerName(playerid, name) == -1)
-				{
-					SetPlayerName(playerid, sOldName);
-					return -1;
-				}
-				return 1;
-			}
-			else
-			{
-				return 0;
-			}
-		}
-		return SetPlayerName(playerid, name);
-	}
-	
-	#define _ALS_SetPlayerName
-	#define SetPlayerName FIXES_SetPlayerName
-#endif
-
-/* 
- * OnPlayerRequestClass(playerid, classid)
- * 
- * FIXES:
- *      OnPlayerRequestClass
- */
-
-#if FIX_OnPlayerRequestClass
-	public OnPlayerRequestClass(playerid, classid)
-	{
-		// =============================
-		//  BEGIN: OnPlayerRequestClass 
-		// =============================
-		#if FIX_OnPlayerRequestClass
-			new
-				Float:x,
-				Float:y,
-				Float:z;
-			GetPlayerPos(playerid, x, y, z),
-			RemoveBuildingForPlayer(playerid, 1484, x, y, z, 10.0),
-			RemoveBuildingForPlayer(playerid, 1485, x, y, z, 10.0),
-			RemoveBuildingForPlayer(playerid, 1486, x, y, z, 10.0);
-		#endif
-		// ===========================
-		//  END: OnPlayerRequestClass 
-		// ===========================
-		return FIXES_OnPlayerRequestClass(playerid, classid);
-	}
-	
-	#if defined _ALS_OnPlayerRequestClass
-		#error _ALS_OnPlayerRequestClass defined
-	#endif
-	#define _ALS_OnPlayerRequestClass
-	#define OnPlayerRequestClass(%0) FIXES_OnPlayerRequestClass(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerRequestClass(playerid, classid);
-#endif
-
-/* 
- * OnPlayerSpawn(playerid)
- * 
- * FIXES:
- *     GetPlayerSkin
- *     TogglePlayerControllable
- *     GetPlayerInterior
- *     OnPlayerSpawn
- *     GameText
- */
-
-#if FIX_GetPlayerSkin || FIX_TogglePlayerControllable || FIX_GetPlayerInterior || FIX_OnPlayerSpawn || FIX_GameText
-	public OnPlayerSpawn(playerid)
-	{
-		_FIXES_IS_IN_CHARGE()
-		{
-			// ======================
-			//  BEGIN: OnPlayerSpawn 
-			// ======================
-			#if FIX_OnPlayerSpawn
-				ResetPlayerMoney(playerid);
-				#if FIXES_Single
-					GivePlayerMoney(playerid, FIXES_gsLastCash[playerid]);
-					FIXES_gsLastCash[playerid] = 0;
-				#else
-					GivePlayerMoney(playerid, GetPVarInt(playerid, FIXES_pvarPlayerLastCash));
-					SetPVarInt(playerid, FIXES_pvarPlayerLastCash, 0);
-				#endif
-			#endif
-			// ======================
-			//  END:   OnPlayerSpawn 
-			// ======================
-			
-			// ==========================
-			//  BEGIN: GetPlayerInterior 
-			// ==========================
-			#if FIX_GetPlayerInterior
-				#if FIXES_Single
-					FIXES_gsInterior[playerid] = 0;
-				#else
-					SetPVarInt(playerid, FIXES_pvarPlayerInterior, 0);
-				#endif
-			#endif
-			// ==========================
-			//  END:   GetPlayerInterior 
-			// ==========================
-			
-			// =================
-			//  BEGIN: GameText 
-			// =================
-			#if FIX_GameText
-				// Per-player GTs.
-				
-				#define _FIXES_PER_PLAYER_GT(%0) if (FIXES_gsPlayerPGTShown[%0][playerid] > playerid) PlayerTextDrawHide(playerid, FIXES_gsPGTStyle[playerid][%0]), _FIXES_RemoveInternal(FIXES_gsPlayerPGTShown[%0], playerid, MAX_PLAYERS)
-				
-				#if FIX_GameTextStyles
-					_FIXES_PER_PLAYER_GT(13);
-					_FIXES_PER_PLAYER_GT(12);
-					_FIXES_PER_PLAYER_GT(11);
-					_FIXES_PER_PLAYER_GT(10);
-					_FIXES_PER_PLAYER_GT(9);
-					_FIXES_PER_PLAYER_GT(8);
-					_FIXES_PER_PLAYER_GT(7);
-				#endif
-				_FIXES_PER_PLAYER_GT(6);
-				_FIXES_PER_PLAYER_GT(5);
-				_FIXES_PER_PLAYER_GT(4);
-				_FIXES_PER_PLAYER_GT(3);
-				_FIXES_PER_PLAYER_GT(2);
-				_FIXES_PER_PLAYER_GT(1);
-				_FIXES_PER_PLAYER_GT(0);
-				
-				#undef _FIXES_PER_PLAYER_GT
-				
-				// Global GTs.
-				#if FIX_GameTextStyles
-					TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[13]),
-					TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[12]),
-					TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[11]),
-					TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[10]),
-					TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[9]),
-					TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[8]),
-					TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[7]);
-				#endif
-				TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[6]),
-				TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[5]),
-				TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[4]),
-				TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[3]),
-				TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[2]),
-				TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[1]),
-				TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[0]);
-				
-			#endif
-			// =================
-			//  END:   GameText 
-			// =================
-		}
-		
-		// ======================
-		//  BEGIN: GetPlayerSkin 
-		// ======================
-		#if FIX_GetPlayerSkin
-			#if FIXES_Single
-				FIXES_gsPlayerSkin[playerid] = GetPlayerSkin(playerid);
-			#else
-				SetPVarInt(playerid, FIXES_pvarPlayerSkin, GetPlayerSkin(playerid));
-			#endif
-		#endif
-		// ======================
-		//  END:   GetPlayerSkin 
-		// ======================
-		
-		// =================================
-		//  BEGIN: TogglePlayerControllable 
-		// =================================
-		#if FIX_TogglePlayerControllable
-			FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_UNCONTROLLABLE;
-		#endif
-		// =================================
-		//  END:   TogglePlayerControllable 
-		// =================================
-		
-		return FIXES_OnPlayerSpawn(playerid);
-	}
-	
-	#if defined _ALS_OnPlayerSpawn
-		#error _ALS_OnPlayerSpawn defined
-	#endif
-	#define _ALS_OnPlayerSpawn
-	#define OnPlayerSpawn(%0) FIXES_OnPlayerSpawn(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerSpawn(playerid);
-#endif
-
-/* 
- * OnVehicleMod(playerid, vehicleid, componentid)
- * 
- * FIXES:
- *     OnVehicleMod
- */
-
-#if FIX_OnVehicleMod
-	public OnVehicleMod(playerid, vehicleid, componentid)
-	{
-		#if !FIXES_Single
-			if (!(FIXES_gsSettings & e_FIXES_SETTINGS_IN_CHARGE))
-			{
-				return FIXES_OnVehicleMod(playerid, vehicleid, componentid);
-			}
-		#endif
-		
-		// =====================
-		//  BEGIN: OnVehicleMod 
-		// =====================
-		new
-			modelid = GetVehicleModel(vehicleid);
-		if (_FIXES_IN_RANGE(modelid, 400, 611 + 1))
-		{
-			switch (componentid)
-			{
-				case 1000 .. 1191:
-				{
-					if (FIXES_gscVehicleMods[(modelid - 400) * 6 + (componentid - 1000 >>> 5)] & 1 << (componentid - 1000 & 0b00011111))
-					{
-						return FIXES_OnVehicleMod(playerid, vehicleid, componentid);
-					}
-				}
-				case 1192, 1193:
-				{
-					if (modelid == 576)
-					{
-						// This save a whole cell off EVERY other vehicle!  This
-						// is the ONLY vehicle with any mods over "6 * 32 + 999"
-						// (1191), the highest value you can fit in 6 cells of a
-						// bit array (minus 1000).
-						return FIXES_OnVehicleMod(playerid, vehicleid, componentid);
-					}
-				}
-			}
-		}
-		// Desync the player entirely.
-		FIXES_BlockUpdate(playerid, true);
-		return 0;
-		// =====================
-		//  END:   OnVehicleMod 
-		// =====================
-	}
-	
-	#if defined _ALS_OnVehicleMod
-		#error _ALS_OnVehicleMod defined
-	#endif
-	#define _ALS_OnVehicleMod
-	#define OnVehicleMod(%0) FIXES_OnVehicleMod(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnVehicleMod(playerid, vehicleid, componentid);
-#endif
-
-/* 
- * FIXES_SetPlayerSkin(playerid, skinid)
- * 
- * FIXES:
- *     GetPlayerSkin
- *     SetPlayerSkin
- */
-
-#if defined _ALS_SetPlayerSkin
-	#error _ALS_SetPlayerSkin defined
-#endif
-native BAD_SetPlayerSkin(playerid, skinid) = SetPlayerSkin;
-
-#if FIX_GetPlayerSkin || FIX_SetPlayerSkin
-	stock FIXES_SetPlayerSkin(playerid, skinid)
-	{
-		// ======================
-		//  BEGIN: SetPlayerSkin 
-		// ======================
-		#if FIX_SetPlayerSkin
-			new
-				vehicleid = GetPlayerVehicleID(playerid);
-			if (vehicleid)
-			{
-				new
-					seat = GetPlayerVehicleSeat(playerid);
-				ClearAnimations(playerid);
-				new
-					ret = SetPlayerSkin(playerid, skinid);
-				PutPlayerInVehicle(playerid, vehicleid, seat);
-				
-				// ======================
-				//  BEGIN: GetPlayerSkin 
-				// ======================
-				#if FIX_GetPlayerSkin
-					#if FIXES_Single
-						FIXES_gsPlayerSkin[playerid] = skinid;
-					#else
-						SetPVarInt(playerid, FIXES_pvarPlayerSkin, skinid);
-					#endif
-				#endif
-				// ======================
-				//  END:   GetPlayerSkin 
-				// ======================
-				
-				return ret;
-			}
-			
-			// ======================
-			//  BEGIN: GetPlayerSkin 
-			// ======================
-			#if FIX_GetPlayerSkin
-				else
-			#endif
-			// ======================
-			//  END:   GetPlayerSkin 
-			// ======================
-		#endif
-		// ======================
-		//  END:   SetPlayerSkin 
-		// ======================
-		
-		// ======================
-		//  BEGIN: GetPlayerSkin 
-		// ======================
-		#if FIX_GetPlayerSkin
-			// Watch fot the "else" above if this code ever changes.
-			#if FIXES_Single
-				FIXES_gsPlayerSkin[playerid] = skinid;
-			#else
-				SetPVarInt(playerid, FIXES_pvarPlayerSkin, skinid);
-			#endif
-		#endif
-		// ======================
-		//  END:   GetPlayerSkin 
-		// ======================
-		
-		return SetPlayerSkin(playerid, skinid);
-	}
-	
-	#define _ALS_SetPlayerSkin
-	#define SetPlayerSkin FIXES_SetPlayerSkin
-#endif
-
-/* 
- * FIXES_GetPlayerSkin(playerid, skinid)
- * 
- * FIXES:
- *     GetPlayerSkin
- */
-
-#if defined _ALS_GetPlayerSkin
-	#error _ALS_GetPlayerSkin defined
-#endif
-native BAD_GetPlayerSkin(playerid) = GetPlayerSkin;
-
-#if FIX_GetPlayerSkin
-	stock FIXES_GetPlayerSkin(playerid)
-	{
-		#if FIXES_Single
-			return FIXES_gsPlayerSkin[playerid];
-		#else
-			return GetPVarInt(playerid, FIXES_pvarPlayerSkin);
-		#endif
-	}
-	
-	#define _ALS_GetPlayerSkin
-	#define GetPlayerSkin FIXES_GetPlayerSkin
-#endif
-
-/* 
- * FIXES_GetWeaponName(weaponid, weapon[], len)
- * 
- * FIXES:
- *     GetWeaponName
- */
-
-#if defined _ALS_GetWeaponName
-	#error _ALS_GetWeaponName defined
-#endif
-native BAD_GetWeaponName(weaponid, weapon[], len) = GetWeaponName;
-
-#if FIX_GetWeaponName
-	stock FIXES_GetWeaponName(weaponid, weapon[], len)
-	{
-		switch (weaponid)
-		{
-			case 18:
-			{
-				return
-					weapon[0] = 0,
-					strcat(weapon, "Molotov Cocktail", len),
-					1;
-			}
-			case 44:
-			{
-				return
-					weapon[0] = 0,
-					strcat(weapon, "Thermal Goggles", len),
-					1;
-			}
-			case 45:
-			{
-				return
-					weapon[0] = 0,
-					strcat(weapon, "Night Vision Goggles", len),
-					1;
-			}
-			default:
-			{
-				return GetWeaponName(weaponid, weapon, len);
-			}
-		}
-		return 0;
-	}
-	
-	#define _ALS_GetWeaponName
-	#define GetWeaponName FIXES_GetWeaponName
-#endif
-
-/* 
- * OnPlayerUpdate(playerid)
- * 
- * FIXES:
- *     SetPlayerWorldBounds
- *     TogglePlayerControllable
- *     AllowInteriorWeapons
- *     OnPlayerDeath
- *     Kick
- *     OnVehicleMod
- *     OnPlayerEnterVehicle
- *     OnPlayerEnterVehicle_2
- */
-
-#if FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable || FIX_AllowInteriorWeapons || FIX_OnPlayerEnterVehicle || FIX_OnPlayerEnterVehicle_2 || FIX_OnPlayerDeath || FIX_Kick || FIX_OnVehicleMod
-	public OnPlayerUpdate(playerid)
-	{
-		// =============================
-		//  BEGIN: OnPlayerEnterVehicle 
-		// =============================
-		#if FIX_OnPlayerEnterVehicle || FIX_Kick || FIX_OnVehicleMod || FIX_OnPlayerEnterVehicle_2
-			if (FIXES_gsPlayerBools[playerid] & e_FIXES_BOOLS_BLOCK)
-			{
-				return 0;
-			}
-		#endif
-		// =============================
-		//  END:   OnPlayerEnterVehicle 
-		// =============================
-		
-		#if !FIXES_Single
-			if (!(FIXES_gsSettings & e_FIXES_SETTINGS_IN_CHARGE))
-			{
-				return FIXES_OnPlayerUpdate(playerid);
-			}
-		#endif
-		
-		#if FIX_OnPlayerEnterVehicle || FIX_AllowInteriorWeapons || FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable
-			new
-				e_FIXES_BOOLS:pbools = FIXES_gsPlayerBools[playerid];
-		#endif
-		
-		// =============================
-		//  BEGIN: AllowInteriorWeapons 
-		// =============================
-		#if FIX_AllowInteriorWeapons
-			if (pbools & e_FIXES_BOOLS_INTERIOR)
-			{
-				// DONE: May need integration with "FIX_GetPlayerWeapon".
-				SetPlayerArmedWeapon(playerid, 0);
-			}
-		#endif
-		// ============================
-		//  END: AllowInteriorWeapons 
-		// ============================
-		
-		#if FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable
-			new
-				ud,
-				lr,
-				keys;
-			GetPlayerKeys(playerid, keys, ud, lr);
-		#endif
-		
-		#if FIX_SetPlayerWorldBounds && !FIX_TogglePlayerControllable
-			#pragma unused ud, lr
-		#endif
-		
-		// =============================
-		//  BEGIN: SetPlayerWorldBounds 
-		// =============================
-		#if FIX_SetPlayerWorldBounds
-			if (pbools & e_FIXES_BOOLS_WORLDBOUNDS && keys & _FIXES_KEY_AIM)
-			{
-				new
-					Float:x,
-					Float:y,
-					Float:z;
-				GetPlayerPos(playerid, x, y, z);
-				if (FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_LX] < x < FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_UX] && FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_LY] < y < FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_UY])
-				{
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PX] = x,
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PY] = y,
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PZ] = z;
-				}
-				else
-				{
-					SetPlayerPos(playerid, FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PX], FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PY], FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PZ]);
-				}
-			}
-		#endif
-		// =============================
-		//  END:   SetPlayerWorldBounds 
-		// =============================
-		
-		// ======================
-		//  BEGIN: OnPlayerDeath 
-		// ======================
-		#if FIX_OnPlayerDeath
-			FIXES_gsLastAnimation[playerid] = GetPlayerAnimationIndex(playerid);
-		#endif
-		// ======================
-		//  END:   OnPlayerDeath 
-		// ======================
-		
-		// =================================
-		//  BEGIN: TogglePlayerControllable 
-		// =================================
-		#if FIX_TogglePlayerControllable
-			// MUST come last.
-			if (pbools & e_FIXES_BOOLS_UNCONTROLLABLE)
-			{
-				// Keys based sync blocking, modified based on a post by Slice:
-				// http://forum.sa-mp.com/showpost.php?p=876854  Use "playerid"
-				// here as it's a variable that already exists, but note that
-				// after this point, you CANNOT use "playerid" as it has been
-				// "clobbered" (and yes, that's the technical term).  This is
-				// just to avoid "statement has no effect" warnings.  ALWAYS
-				// return 0 in this case, regardless of what other callbacks
-				// return.
-				playerid = FIXES_OnPlayerUpdate(playerid);
-				if (keys || ud || lr)
-				{
-					return 0;
-				}
-				else
-				{
-					return playerid;
-				}
-			}
-		#endif
-		// =================================
-		//  END:   TogglePlayerControllable 
-		// =================================
-		
-		return FIXES_OnPlayerUpdate(playerid);
-	}
-	
-	#if defined _ALS_OnPlayerUpdate
-		#error _ALS_OnPlayerUpdate defined
-	#endif
-	#define _ALS_OnPlayerUpdate
-	#define OnPlayerUpdate(%0) FIXES_OnPlayerUpdate(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerUpdate(playerid);
-#endif
-
-/* 
- * FIXES_SetPlayerWorldBounds(playerid, Float:x_max, Float:x_min, Float:y_max, Float:y_min)
- * 
- * TODO: Modify this to remove aim animations when they get to the boundaries.
- * 
- * FIXES:
- *     SetPlayerWorldBounds
- */
-
-#if defined _ALS_SetPlayerWorldBounds
-	#error _ALS_SetPlayerWorldBounds defined
-#endif
-native BAD_SetPlayerWorldBounds(playerid, Float:x_max, Float:x_min, Float:y_max, Float:y_min) = SetPlayerWorldBounds;
-
-#if FIX_SetPlayerWorldBounds
-	#if FIXES_Single
-		stock FIXES_SetPlayerWorldBounds(playerid, Float:x_max, Float:x_min, Float:y_max, Float:y_min)
-		{
-			if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-			{
-				FIXES_PRINTF("Call SetPlayerWorldBounds");
-				if (x_max == x_min || y_max == y_min)
-				{
-					// Impossibly small area, disable checks entirely.
-					return
-						FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_WORLDBOUNDS,
-						SetPlayerWorldBounds(playerid, _FIXES_INFINITY, _FIXES_N_INFINITY, _FIXES_INFINITY, _FIXES_N_INFINITY);
-				}
-				// This code could do with a way to mostly remove the checks.  Maybe
-				// when setting everything to FIXES_INFINITY (with default
-				// parameters).
-				FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_WORLDBOUNDS;
-				new
-					Float:tmp;
-				if (x_max < x_min)
-				{
-					tmp = x_min,
-					x_min = x_max,
-					x_max = tmp;
-				}
-				if (y_max < y_min)
-				{
-					tmp = y_min,
-					y_min = y_max,
-					y_max = tmp;
-				}
-				// Give a little leway so this fix isn't noticed if you're not
-				// trying to break through the world bounds.  Leway removed in
-				// favour of keys.
-				return
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_LX] = x_min,
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_UX] = x_max,
-					
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_LY] = y_min,
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_UY] = y_max,
-					
-					GetPlayerPos(playerid, tmp, tmp, tmp),
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PX] = (x_max - x_min) / 2 + x_min,
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PY] = (y_max - y_min) / 2 + y_min,
-					FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PZ] = tmp,
-					
-					SetPlayerWorldBounds(playerid, x_max, x_min, y_max, y_min);
-			}
-			return 0;
-		}
-	#else
-		forward _FIXES_SetPlayerWorldBounds(playerid, Float:x_max, Float:x_min, Float:y_max, Float:y_min);
-		
-		stock FIXES_SetPlayerWorldBounds(playerid, Float:x_max, Float:x_min, Float:y_max, Float:y_min)
-		{
-			if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-			{
-				FIXES_PRINTF("Call SetPlayerWorldBounds");
-				return
-					CallRemoteFunction(FIXES_gscSetPlayerWorldBounds, FIXES_gscSpec@iffff, playerid, x_max, x_min, y_max, y_min),
-					getproperty(5, FIXES_gscReturnProperty);
-			}
-			return 0;
-		}
-		
-		public _FIXES_SetPlayerWorldBounds(playerid, Float:x_max, Float:x_min, Float:y_max, Float:y_min)
-		{
-			FIXES_PRINTF("_FIXES_SetPlayerWorldBounds: %d %.2f %.2f %.2f %.2f", playerid, x_max, x_min, y_max, y_min);
-			_FIXES_IS_IN_CHARGE()
-			{
-				FIXES_PRINTF("SetPlayerWorldBounds");
-				//if (x_max == _FIXES_INFINITY && x_min == _FIXES_INFINITY && y_max == _FIXES_INFINITY && y_min == _FIXES_INFINITY)
-				if (x_max == x_min || y_max == y_min)
-				{
-					// Impossibly small area, disable checks entirely.
-					return
-						FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_WORLDBOUNDS,
-						FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_LX] =
-							FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_UX] =
-								FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_LY] =
-									FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_UY] =
-										0.0,
-						setproperty(5, FIXES_gscReturnProperty, SetPlayerWorldBounds(playerid, _FIXES_INFINITY, _FIXES_N_INFINITY, _FIXES_INFINITY, _FIXES_N_INFINITY)),
-						-1;
-				}
-				// This code could do with a way to mostly remove the checks.  Maybe
-				// when setting everything to FIXES_INFINITY (with default
-				// parameters).
-				FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_WORLDBOUNDS;
-				new
-					Float:tmp;
-				if (x_max < x_min)
-				{
-					tmp = x_min,
-					x_min = x_max,
-					x_max = tmp;
-				}
-				if (y_max < y_min)
-				{
-					tmp = y_min,
-					y_min = y_max,
-					y_max = tmp;
-				}
-				// Give a little leway so this fix isn't noticed if you're not
-				// trying to break through the world bounds.  Leway removed in
-				// favour of keys.
-				FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_LX] = x_min,
-				FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_UX] = x_max,
-				
-				FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_LY] = y_min,
-				FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_UY] = y_max,
-				
-				GetPlayerPos(playerid, tmp, tmp, tmp),
-				FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PX] = (x_max - x_min) / 2 + x_min,
-				FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PY] = (y_max - y_min) / 2 + y_min,
-				FIXES_gsWorldbounds[playerid][E_FIXES_WORLDBOUND_DATA_PZ] = tmp,
-				
-				setproperty(5, FIXES_gscReturnProperty, SetPlayerWorldBounds(playerid, x_max, x_min, y_max, y_min));
-			}
-			return 0;
-		}
-	#endif
-	
-	#define _ALS_SetPlayerWorldBounds
-	#define SetPlayerWorldBounds FIXES_SetPlayerWorldBounds
-#endif
-
-/* 
- * FIXES_TogglePlayerControllable(playerid, toggle)
- * 
- * FIXES:
- *     TogglePlayerControllable
- */
-
-#if defined _ALS_TogglePlayerControllable
-	#error _ALS_TogglePlayerControllable defined
-#endif
-native BAD_TogglePlayerControllable(playerid, toggle) = TogglePlayerControllable;
-
-#if FIX_TogglePlayerControllable
-	#if FIXES_Single
-		stock FIXES_TogglePlayerControllable(playerid, toggle)
-		{
-			if (TogglePlayerControllable(playerid, toggle))
-			{
-				if (toggle)
-				{
-					FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_UNCONTROLLABLE;
-				}
-				else
-				{
-					FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_UNCONTROLLABLE;
-				}
-				return 1;
-			}
-			return 0;
-		}
-	#else
-		forward _FIXES_TogglePlayerControllable(playerid, toggle);
-		
-		stock FIXES_TogglePlayerControllable(playerid, toggle)
-		{
-			if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-			{
-				return
-					CallRemoteFunction(FIXES_gscTogglePlayerControl, FIXES_gscSpec@ii, playerid, toggle),
-					getproperty(5, FIXES_gscReturnProperty);
-			}
-			return 0;
-		}
-		
-		public _FIXES_TogglePlayerControllable(playerid, toggle)
-		{
-			_FIXES_IS_IN_CHARGE()
-			{
-				if (toggle)
-				{
-					FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_UNCONTROLLABLE;
-				}
-				else
-				{
-					FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_UNCONTROLLABLE;
-				}
-				setproperty(5, FIXES_gscReturnProperty, TogglePlayerControllable(playerid, toggle));
-			}
-		}
-	#endif
-	
-	#define _ALS_TogglePlayerControllable
-	#define TogglePlayerControllable FIXES_TogglePlayerControllable
-#endif
-
-/* 
- * OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- * 
- * FIXES:
- *     AllowInteriorWeapons
- *     GetPlayerInterior
- */
-
-#if FIX_AllowInteriorWeapons || FIX_GetPlayerInterior
-	public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
-	{
-		// ==========================
-		//  BEGIN: GetPlayerInterior 
-		// ==========================
-		#if FIX_GetPlayerInterior
-			#if FIXES_Single
-				FIXES_gsInterior[playerid] = newinteriorid;
-			#else
-				_FIXES_IS_IN_CHARGE()
-				{
-					SetPVarInt(playerid, FIXES_pvarPlayerInterior, newinteriorid);
-				}
-			#endif
-		#endif
-		// ==========================
-		//  END:   GetPlayerInterior 
-		// ==========================
-		
-		// =============================
-		//  BEGIN: AllowInteriorWeapons 
-		// =============================
-		#if FIX_AllowInteriorWeapons
-			if (newinteriorid)
-			{
-				if (FIXES_gsSettings & e_FIXES_SETTINGS_INTERIOR)
-				{
-					// This only needs doing here if "GetPlayerWeapon" is set.
-					// If it isn't, even though "AllowInteriorWeapons" can use
-					// this code on its own, it doesn't as "OnPlayerUpdate"
-					// takes care of it all.
-					// TODO: Rewrite this code to use a single bit to indicate
-					// if a player can have a weapon or not, and just use the in
-					// the "OnPlayerUpdate" callback, instead of several checks.
-					// DONE!
-					FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_INTERIOR;
-					_FIXES_IS_IN_CHARGE()
-					{
-						SetPlayerArmedWeapon(playerid, 0);
-						#if FIX_GetPlayerWeapon
-							if (IsPlayerInAnyVehicle(playerid))
-							{
-								#if FIXES_Single
-									FIXES_gsPlayerWeapon[playerid] = 0;
-								#else
-									SetPVarInt(playerid, FIXES_pvarPlayerWeapon, 0);
-								#endif
-							}
-						#endif
-					}
-				}
-			}
-			else
-			{
-				FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_INTERIOR;
-			}
-		#endif
-		// ===========================
-		//  END: AllowInteriorWeapons 
-		// ===========================
-		return FIXES_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
-	}
-	
-	#if defined _ALS_OnPlayerInteriorChange
-		#error _ALS_OnPlayerInteriorChange defined
-	#endif
-	#define _ALS_OnPlayerInteriorChange
-	#define OnPlayerInteriorChange(%0) FIXES_OnPlayerInteriorChange(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
-#endif
-
-/* 
- * _FIXES_DriveBy(playerid)
- * 
- * FIXES:
- *     DriveBy
- */
-
-#if FIX_DriveBy
-	forward _FIXES_DriveBy(playerid);
-	
-	public  _FIXES_DriveBy(playerid)
-	{
-		if (GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
-		{
-			SetPlayerArmedWeapon(playerid, FIXES_gsDriveByWeapon[playerid]);
-		}
-		return FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_DRIVE_BY;
-	}
-#endif
-
-/* 
- * OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- * 
- * FIXES:
- *     DriveBy
- */
-
-#if FIX_DriveBy
-	public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
-	{
-		// ===============================
-		//  BEGIN: DriveBy 
-		// ===============================
-		#if FIX_DriveBy
-			#if !FIXES_Single
-				if (FIXES_gsSettings & e_FIXES_SETTINGS_IN_CHARGE)
-			#endif
-				{
-					if ((newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH) && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER && GetPlayerCameraMode(playerid) == 55 && !(FIXES_gsPlayerBools[playerid] & e_FIXES_BOOLS_DRIVE_BY))
-					{
-						FIXES_gsDriveByWeapon[playerid] = GetPlayerWeapon(playerid),
-						FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_DRIVE_BY,
-						SetPlayerArmedWeapon(playerid, 0),
-						ApplyAnimation(playerid, "PED", "CAR_GETIN_RHS", 4.1, 0, 0, 0, 0, 1, 1),
-						SetTimerEx(FIXES_gscDriveBy, 500, 0, FIXES_gscSpec@i, playerid);
-					}
-				}
-		#endif
-		// =============================
-		//  END: DriveBy 
-		// =============================
-		
-		return FIXES_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
-	}
-	
-	#if defined _ALS_OnPlayerKeyStateChange
-		#error _ALS_OnPlayerKeyStateChange defined
-	#endif
-	#define _ALS_OnPlayerKeyStateChange
-	#define OnPlayerKeyStateChange(%0) FIXES_OnPlayerKeyStateChange(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
-#endif
-
-/* 
- * OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- * 
- * FIXES:
- *     OnPlayerEnterVehicle_2
- */
-
-#if FIX_OnPlayerEnterVehicle_2
-	public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
-	{
-		// ===============================
-		//  BEGIN: OnPlayerEnterVehicle_2 
-		// ===============================
-		#if FIX_OnPlayerEnterVehicle_2
-			if (0 < vehicleid < MAX_VEHICLES)
-			{
-				return FIXES_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
-			}
-			FIXES_BlockUpdate(playerid, true);
-			return 0;
-		#endif
-		// =============================
-		//  END: OnPlayerEnterVehicle_2 
-		// =============================
-	}
-	
-	#if defined _ALS_OnPlayerEnterVehicle
-		#error _ALS_OnPlayerEnterVehicle defined
-	#endif
-	#define _ALS_OnPlayerEnterVehicle
-	#define OnPlayerEnterVehicle(%0) FIXES_OnPlayerEnterVehicle(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
-#endif
-
-/* 
- * OnPlayerExitVehicle(playerid, vehicleid)
- * 
- * FIXES:
- *     OnPlayerEnterVehicle_2
- */
-
-#if FIX_OnPlayerEnterVehicle_2
-	public OnPlayerExitVehicle(playerid, vehicleid)
-	{
-		// ===============================
-		//  BEGIN: OnPlayerEnterVehicle_2 
-		// ===============================
-		#if FIX_OnPlayerEnterVehicle_2
-			if (0 < vehicleid < MAX_VEHICLES)
-			{
-				return FIXES_OnPlayerExitVehicle(playerid, vehicleid);
-			}
-			FIXES_BlockUpdate(playerid, true);
-			return 0;
-		#endif
-		// =============================
-		//  END: OnPlayerEnterVehicle_2 
-		// =============================
-	}
-	
-	#if defined _ALS_OnPlayerExitVehicle
-		#error _ALS_OnPlayerExitVehicle defined
-	#endif
-	#define _ALS_OnPlayerExitVehicle
-	#define OnPlayerExitVehicle(%0) FIXES_OnPlayerExitVehicle(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerExitVehicle(playerid, vehicleid);
-#endif
-
-/* 
- * FIXES_BlockUpdate(playerid, bool:block)
- * 
- * Block a player from using OnPlayerUpdate at all.
- */
-
-#if FIX_OnPlayerEnterVehicle || FIX_OnPlayerEnterVehicle_2 || FIX_Kick || FIX_OnVehicleMod
-	static stock FIXES_BlockUpdate(playerid, bool:block, kick = 6)
-	{
-		if (kick)
-		{
-			#if FIXES_SilentKick
-				new
-					ip[22];
-				GetPlayerIp(playerid, ip, sizeof (ip)),
-				format(ip, sizeof (ip), "banip %s", ip),
-				SendRconCommand(ip),
-				FIXES_gsPlayerIP[playerid] = strval(ip[kick]) << 24,
-				kick = strfind(ip, FIXES_gscDot, false, kick) + 1,
-				FIXES_gsPlayerIP[playerid] |= strval(ip[kick]) << 16,
-				kick = strfind(ip, FIXES_gscDot, false, kick) + 1,
-				FIXES_gsPlayerIP[playerid] |= strval(ip[kick]) << 8,
-				kick = strfind(ip, FIXES_gscDot, false, kick) + 1,
-				FIXES_gsPlayerIP[playerid] |= strval(ip[kick]);
-			#else
-				Kick(playerid);
-			#endif
-		}
-		if (block)
-		{
-			FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_BLOCK;
-			return 0;
-		}
-		else
-		{
-			FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_BLOCK;
-			return 1;
-		}
-	}
-#endif
-
-/* 
- * OnPlayerSelectedMenuRow(playerid, row)
- * 
- * FIXES:
- *     GetPlayerMenu
- */
-
-#if FIX_GetPlayerMenu
-	public OnPlayerSelectedMenuRow(playerid, row)
-	{
-		// ======================
-		//  BEGIN: GetPlayerMenu 
-		// ======================
-		#if FIXES_Single
-			FIXES_gsSettings &= ~e_FIXES_SETTINGS_MENU_SET;
-			new
-				ret = FIXES_OnPlayerSelectedMenuRow(playerid, row);
-			if (!(FIXES_gsSettings & e_FIXES_SETTINGS_MENU_SET))
-			{
-				FIXES_gsCurrentMenu[playerid] = Menu:INVALID_MENU;
-			}
-			return ret;
-		#else
-			new
-				Menu:cur = FIXES_gsCurrentMenu[playerid];
-			_FIXES_IS_IN_CHARGE()
-			{
-				setproperty(5, FIXES_gscMenuProperty, _:cur);
-				CallRemoteFunction(FIXES_gscClearPlayerMenu, FIXES_gscSpec@i, playerid);
-				FIXES_gsCurrentMenu[playerid] = cur;
-				new
-					ret = FIXES_OnPlayerSelectedMenuRow(playerid, row);
-				if (!(FIXES_gsSettings & e_FIXES_SETTINGS_MENU_SET))
-				{
-					FIXES_gsCurrentMenu[playerid] = Menu:INVALID_MENU;
-				}
-				return ret;
-			}
-			else
-			{
-				FIXES_gsCurrentMenu[playerid] = Menu:getproperty(5, FIXES_gscMenuProperty);
-				FIXES_gsSettings &= ~e_FIXES_SETTINGS_MENU_SET;
-				new
-					ret = FIXES_OnPlayerSelectedMenuRow(playerid, row);
-				if (!(FIXES_gsSettings & e_FIXES_SETTINGS_MENU_SET))
-				{
-					FIXES_gsCurrentMenu[playerid] = cur;
-				}
-				return ret;
-			}
-		#endif
-		// ======================
-		//  END:   GetPlayerMenu 
-		// ======================
-	}
-	
-	#if defined _ALS_OnPlayerSelectedMenuRow
-		#error _ALS_OnPlayerSelectedMenuRow defined
-	#endif
-	#define _ALS_OnPlayerSelectedMenuRow
-	#define OnPlayerSelectedMenuRow(%0) FIXES_OnPlayerSelectedMenuRow(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerSelectedMenuRow(playerid, row);
-#endif
-
-/* 
- * OnPlayerExitedMenu(playerid)
- * 
- * FIXES:
- *     GetPlayerMenu
- */
-
-#if FIX_GetPlayerMenu
-	public OnPlayerExitedMenu(playerid)
-	{
-		// ======================
-		//  BEGIN: GetPlayerMenu 
-		// ======================
-		#if FIXES_Single
-			FIXES_gsSettings &= ~e_FIXES_SETTINGS_MENU_SET;
-			new
-				ret = FIXES_OnPlayerExitedMenu(playerid);
-			if (!(FIXES_gsSettings & e_FIXES_SETTINGS_MENU_SET))
-			{
-				FIXES_gsCurrentMenu[playerid] = Menu:INVALID_MENU;
-			}
-			return ret;
-		#else
-			new
-				Menu:cur = FIXES_gsCurrentMenu[playerid];
-			_FIXES_IS_IN_CHARGE()
-			{
-				setproperty(5, FIXES_gscMenuProperty, _:cur);
-				CallRemoteFunction(FIXES_gscClearPlayerMenu, FIXES_gscSpec@i, playerid);
-				FIXES_gsCurrentMenu[playerid] = cur;
-				new
-					ret = FIXES_OnPlayerExitedMenu(playerid);
-				if (!(FIXES_gsSettings & e_FIXES_SETTINGS_MENU_SET))
-				{
-					FIXES_gsCurrentMenu[playerid] = Menu:INVALID_MENU;
-				}
-				return ret;
-			}
-			else
-			{
-				FIXES_gsCurrentMenu[playerid] = Menu:getproperty(5, FIXES_gscMenuProperty);
-				FIXES_gsSettings &= ~e_FIXES_SETTINGS_MENU_SET;
-				new
-					ret = FIXES_OnPlayerExitedMenu(playerid);
-				if (!(FIXES_gsSettings & e_FIXES_SETTINGS_MENU_SET))
-				{
-					FIXES_gsCurrentMenu[playerid] = cur;
-				}
-				return ret;
-			}
-		#endif
-		// ======================
-		//  END:   GetPlayerMenu 
-		// ======================
-	}
-	
-	#if defined _ALS_OnPlayerExitedMenu
-		#error _ALS_OnPlayerExitedMenu defined
-	#endif
-	#define _ALS_OnPlayerExitedMenu
-	#define OnPlayerExitedMenu(%0) FIXES_OnPlayerExitedMenu(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerExitedMenu(playerid);
-#endif
-
-/* 
- * FIXES_IS_VALID_MENU(Menu:menuid)
- * 
- * FIXES:
- *     Menus
- */
-
-#if _FIX_Menus
-	#define FIXES_IS_VALID_MENU(%0) (_FIXES_IN_RANGE(_:(%0), 0, MAX_MENUS) && (FIXES_gsValidMenus[_:(%0) >>> 5] & (1 << (_:(%0) & 0x1F))))
-#endif
-
-/* 
- * Menu:FIXES_CreateMenu(const title[], columns, Float:x, Float:y, Float:col1width, Float:col2width = 0.0)
- * 
- * FIXES:
- *     Menus
- */
-
-#if defined _ALS_CreateMenu
-	#error _ALS_CreateMenu defined
-#endif
-native Menu:BAD_CreateMenu(const title[], columns, Float:x, Float:y, Float:col1width, Float:col2width = 0.0) = CreateMenu;
-
-#if _FIX_Menus
-	#if !FIXES_Single
-		forward _FIXES_CreateMenu(ret);
-		
-		public _FIXES_CreateMenu(ret)
-		{
-			FIXES_gsValidMenus[ret >>> 5] |= 1 << (ret & 0x1F);
-		}
-	#endif
-	
-	stock Menu:FIXES_CreateMenu(const title[], columns, Float:x, Float:y, Float:col1width, Float:col2width = 0.0)
-	{
-		new
-			Menu:ret = CreateMenu(title, columns, x, y, col1width, col2width);
-		if (_FIXES_IN_RANGE(_:ret, 0, MAX_MENUS))
-		{
-			#if FIXES_Single
-				FIXES_gsValidMenus[_:ret >>> 5] |= 1 << (_:ret & 0x1F);
-			#else
-				CallRemoteFunction("_FIXES_CreateMenu", FIXES_gscSpec@i, _:ret);
-			#endif
-		}
-		return ret;
-	}
-	
-	#define _ALS_CreateMenu
-	#define CreateMenu FIXES_CreateMenu
-#endif
-
-/* 
- * _FIXES_SetPlayerMenu(playerid, Menu:menuid)
- * 
- * FIXES:
- *     GetPlayerMenu
- */
-
-#if FIX_GetPlayerMenu && !FIXES_Single
-	forward _FIXES_SetPlayerMenu(playerid, Menu:menuid);
-	
-	public _FIXES_SetPlayerMenu(playerid, Menu:menuid)
-	{
-		FIXES_gsSettings |= e_FIXES_SETTINGS_MENU_SET;
-		FIXES_gsCurrentMenu[playerid] = menuid;
-	}
-#endif
-
-/* 
- * _FIXES_ClearPlayerMenu(playerid)
- * 
- * FIXES:
- *     GetPlayerMenu
- */
-
-#if FIX_GetPlayerMenu && !FIXES_Single
-	forward _FIXES_ClearPlayerMenu(playerid);
-	
-	public _FIXES_ClearPlayerMenu(playerid)
-	{
-		FIXES_gsSettings &= ~e_FIXES_SETTINGS_MENU_SET;
-		FIXES_gsCurrentMenu[playerid] = Menu:INVALID_MENU;
-	}
-#endif
-
-/* 
- * Menu:FIXES_DestroyMenu(Menu:menuid)
- * 
- * FIXES:
- *     GetPlayerMenu
- */
-
-#if defined _ALS_DestroyMenu
-	#error _ALS_DestroyMenu defined
-#endif
-native BAD_DestroyMenu(Menu:menuid) = DestroyMenu;
-
-#if _FIX_Menus || FIX_GetPlayerMenu
-	#if _FIX_Menus && !FIXES_Single
-		forward _FIXES_DestroyMenu(ret);
-		
-		public _FIXES_DestroyMenu(ret)
-		{
-			FIXES_gsValidMenus[ret >>> 5] &= ~(1 << (ret & 0x1F));
-		}
-	#endif
-	
-	stock FIXES_DestroyMenu(Menu:menuid)
-	{
-		#if _FIX_Menus
-			if (FIXES_IS_VALID_MENU(menuid))
-		#endif
-			{
-				if (DestroyMenu(Menu:menuid))
-				{
-					#if _FIX_Menus
-						#if FIXES_Single
-							FIXES_gsValidMenus[_:menuid >>> 5] &= ~(1 << (_:menuid & 0x1F));
-						#else
-							CallRemoteFunction("_FIXES_DestroyMenu", FIXES_gscSpec@i, _:menuid);
-						#endif
-					#endif
-					_FIXES_FOREACH(FIXES_gsPlayersIterator, playerid)
-					{
-						if (FIXES_gsCurrentMenu[playerid] == menuid)
-						{
-							if (HideMenuForPlayer(menuid, playerid))
-							{
-								#if FIXES_Single
-									FIXES_gsSettings &= ~e_FIXES_SETTINGS_MENU_SET;
-									FIXES_gsCurrentMenu[playerid] = Menu:INVALID_MENU;
-								#else
-									CallRemoteFunction(FIXES_gscSetPlayerMenu, FIXES_gscSpec@ii, playerid, INVALID_MENU);
-								#endif
-							}
-						}
-					}
-					return 1;
-				}
-			}
-			return 0;
-	}
-	
-	#define _ALS_DestroyMenu
-	#define DestroyMenu FIXES_DestroyMenu
-#endif
-
-/* 
- * FIXES_AddMenuItem(Menu:menuid, column, const menutext[])
- * 
- * FIXES:
- *     AddMenuItem
- */
-
-#if defined _ALS_AddMenuItem
-	#error _ALS_AddMenuItem defined
-#endif
-native BAD_AddMenuItem(Menu:menuid, column, const menutext[]) = AddMenuItem;
-
-#if FIX_AddMenuItem
-	stock FIXES_AddMenuItem(Menu:menuid, column, const menutext[])
-	{
-		if (FIXES_IS_VALID_MENU(menuid))
-		{
-			return AddMenuItem(menuid, column, menutext);
-		}
-		return 0;
-	}
-	
-	#define _ALS_AddMenuItem
-	#define AddMenuItem FIXES_AddMenuItem
-#endif
-
-/* 
- * FIXES_SetMenuColumnHeader(Menu:menuid, column, const columnheader[])
- * 
- * FIXES:
- *     SetMenuColumnHeader
- */
-
-#if defined _ALS_SetMenuColumnHeader
-	#error _ALS_SetMenuColumnHeader defined
-#endif
-native BAD_SetMenuColumnHeader(Menu:menuid, column, const columnheader[]) = SetMenuColumnHeader;
-
-#if FIX_SetMenuColumnHeader
-	stock FIXES_SetMenuColumnHeader(Menu:menuid, column, const columnheader[])
-	{
-		if (FIXES_IS_VALID_MENU(menuid))
-		{
-			return SetMenuColumnHeader(menuid, column, columnheader);
-		}
-		return 0;
-	}
-	
-	#define _ALS_SetMenuColumnHeader
-	#define SetMenuColumnHeader FIXES_SetMenuColumnHeader
-#endif
-
-/* 
- * FIXES_ShowMenuForPlayer(Menu:menuid, playerid)
- * 
- * FIXES:
- *     ShowMenuForPlayer
- *     GetPlayerMenu
- */
-
-#if defined _ALS_ShowMenuForPlayer
-	#error _ALS_ShowMenuForPlayer defined
-#endif
-native BAD_ShowMenuForPlayer(Menu:menuid, playerid) = ShowMenuForPlayer;
-
-#if FIX_ShowMenuForPlayer || FIX_GetPlayerMenu
-	stock FIXES_ShowMenuForPlayer(Menu:menuid, playerid)
-	{
-		#if FIX_ShowMenuForPlayer
-			if (FIXES_IS_VALID_MENU(menuid))
-		#endif
-			{
-				#if FIX_GetPlayerMenu
-					if (ShowMenuForPlayer(menuid, playerid))
-					{
-						#if FIXES_Single
-							FIXES_gsSettings |= e_FIXES_SETTINGS_MENU_SET;
-							FIXES_gsCurrentMenu[playerid] = menuid;
-						#else
-							CallRemoteFunction(FIXES_gscSetPlayerMenu, FIXES_gscSpec@ii, playerid, _:menuid);
-						#endif
-						return 1;
-					}
-				#else
-					return ShowMenuForPlayer(menuid, playerid);
-				#endif
-			}
-		return 0;
-	}
-	
-	#define _ALS_ShowMenuForPlayer
-	#define ShowMenuForPlayer FIXES_ShowMenuForPlayer
-#endif
-
-/* 
- * FIXES_HideMenuForPlayer(Menu:menuid, playerid)
- * 
- * FIXES:
- *     HideMenuForPlayer
- *     HideMenuForPlayer_2
- *     GetPlayerMenu
- */
-
-#if defined _ALS_HideMenuForPlayer
-	#error _ALS_HideMenuForPlayer defined
-#endif
-native BAD_HideMenuForPlayer(Menu:menuid, playerid) = HideMenuForPlayer;
-
-#if FIX_HideMenuForPlayer || FIX_GetPlayerMenu
-	stock FIXES_HideMenuForPlayer(Menu:menuid, playerid)
-	{
-		#if FIX_HideMenuForPlayer
-			if (FIXES_IS_VALID_MENU(menuid))
-		#endif
-			{
-				#if FIX_GetPlayerMenu
-					#if FIX_HideMenuForPlayer_2
-						if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS) && FIXES_gsCurrentMenu[playerid] == menuid)
-					#else
-						if (FIXES_gsCurrentMenu[playerid] == menuid && HideMenuForPlayer(menuid, playerid))
-					#endif
-						{
-							#if FIXES_Single
-								FIXES_gsSettings &= ~e_FIXES_SETTINGS_MENU_SET;
-								FIXES_gsCurrentMenu[playerid] = Menu:INVALID_MENU;
-							#else
-								CallRemoteFunction(FIXES_gscSetPlayerMenu, FIXES_gscSpec@ii, playerid, INVALID_MENU);
-							#endif
-							#if FIX_HideMenuForPlayer_2
-								return HideMenuForPlayer(menuid, playerid);
-							#else
-								return 1;
-							#endif
-						}
-				#else
-					return HideMenuForPlayer(menuid, playerid);
-				#endif
-			}
-		return 0;
-	}
-	
-	#define _ALS_HideMenuForPlayer
-	#define HideMenuForPlayer FIXES_HideMenuForPlayer
-#endif
-
-/* 
- * FIXES_DisableMenu(Menu:menuid)
- * 
- * FIXES:
- *     DisableMenu
- */
-
-#if defined _ALS_DisableMenu
-	#error _ALS_DisableMenu defined
-#endif
-native BAD_DisableMenu(Menu:menuid) = DisableMenu;
-
-#if FIX_DisableMenu
-	stock FIXES_DisableMenu(Menu:menuid)
-	{
-		if (FIXES_IS_VALID_MENU(menuid))
-		{
-			return DisableMenu(menuid);
-		}
-		return 0;
-	}
-	
-	#define _ALS_DisableMenu
-	#define DisableMenu FIXES_DisableMenu
-#endif
-
-/* 
- * FIXES_DisableMenuRow(Menu:menuid, row)
- * 
- * FIXES:
- *     DisableMenuRow
- */
-
-#if defined _ALS_DisableMenuRow
-	#error _ALS_DisableMenuRow defined
-#endif
-native BAD_DisableMenuRow(Menu:menuid, row) = DisableMenuRow;
-
-#if FIX_DisableMenuRow
-	stock FIXES_DisableMenuRow(Menu:menuid, row)
-	{
-		if (FIXES_IS_VALID_MENU(menuid))
-		{
-			return DisableMenuRow(menuid, row);
-		}
-		return 0;
-	}
-	
-	#define _ALS_DisableMenuRow
-	#define DisableMenuRow FIXES_DisableMenuRow
-#endif
-
-/* 
- * Menu:FIXES_GetPlayerMenu(playerid)
- * 
- * FIXES:
- *     GetPlayerMenu
- */
-
-#if defined _ALS_GetPlayerMenu
-	#error _ALS_GetPlayerMenu defined
-#endif
-native BAD_GetPlayerMenu(playerid) = GetPlayerMenu;
-
-#if FIX_GetPlayerMenu
-	stock Menu:FIXES_GetPlayerMenu(playerid)
-	{
-		if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-		{
-			return FIXES_gsCurrentMenu[playerid];
-		}
-		return Menu:INVALID_MENU;
-	}
-	
-	#define _ALS_GetPlayerMenu
-	#define GetPlayerMenu FIXES_GetPlayerMenu
-#endif
-
-/* 
- * OnPlayerStateChange(playerid, newstate, oldstate)
- * 
- * FIXES:
- *     HydraSniper
- *     GetPlayerWeapon
- *     PutPlayerInVehicle
- *     TrainExit
- */
-
-#if FIX_HydraSniper || FIX_GetPlayerWeapon || FIX_PutPlayerInVehicle || FIX_OnPlayerEnterVehicle || FIX_TrainExit
-	public OnPlayerStateChange(playerid, newstate, oldstate)
-	{
-		#if !FIXES_Single
-			if (!(FIXES_gsSettings & e_FIXES_SETTINGS_IN_CHARGE))
-			{
-				return FIXES_OnPlayerStateChange(playerid, newstate, oldstate);
-			}
-		#endif
-		
-		// =============================
-		//  BEGIN: OnPlayerEnterVehicle 
-		// =============================
-		#if FIX_OnPlayerEnterVehicle
-				if (newstate == PLAYER_STATE_PASSENGER)
-				{
-					new
-						model = GetVehicleModel(GetPlayerVehicleID(playerid)) - 400;
-					if (_FIXES_IN_RANGE(model, 0, 211 + 1))
-					{
-						new
-							seat = GetPlayerVehicleSeat(playerid);
-						if (seat != 128)
-						{
-							model = (FIXES_gscMaxPassengers[model >>> 3] >>> ((model & 7) << 2)) & 0xF;
-							if (model == 0 || model == 15)
-							{
-								// Shouldn't be in this vehicle at all.
-								FIXES_BlockUpdate(playerid, true);
-							}
-							else if (!(0 < seat <= model)) // Slower with "_FIXES_NO_RANGE".
-							{
-								// In an out of range seat.
-								FIXES_BlockUpdate(playerid, true);
-							}
-						}
-					}
-					else
-					{
-						FIXES_BlockUpdate(playerid, true);
-					}
-				}
-				else if (newstate == PLAYER_STATE_DRIVER)
-				{
-						new
-							model = GetPlayerVehicleSeat(playerid);
-						if (model != 128)
-						{
-							if (model == 0)
-							{
-								model = GetVehicleModel(GetPlayerVehicleID(playerid)) - 400;
-								if (_FIXES_NO_RANGE(model, 0, 211 + 1) || FIXES_gscMaxPassengers[model >>> 3] >>> ((model & 7) << 2) & 0xF == 15)
-								{
-									// In an invalid vehicle (one you can't drive).
-									FIXES_BlockUpdate(playerid, true);
-								}
-							}
-							else
-							{
-								// They are a driver, but not in the driver's seat.
-								FIXES_BlockUpdate(playerid, true);
-							}
-						}
-					#if FIX_HydraSniper
-						else
-						{
-							model = GetVehicleModel(GetPlayerVehicleID(playerid));
-						}
-					#endif
-			#if !FIX_HydraSniper
-				}
-			#endif
-		#endif
-		// =============================
-		//  END:   OnPlayerEnterVehicle 
-		// =============================
-		
-		// ====================
-		//  BEGIN: HydraSniper 
-		// ====================
-		#if FIX_HydraSniper
-			#if !FIX_OnPlayerEnterVehicle
-				// Only called if the same check above isn't called.
-				if (newstate == PLAYER_STATE_DRIVER)
-				{
-					new
-						model = GetVehicleModel(GetPlayerVehicleID(playerid));
-			#endif
-					if (GetPlayerWeapon(playerid) == 34 && (model == 520 || model == 425))
-					{
-						SetPlayerArmedWeapon(playerid, 0);
-						#if FIX_GetPlayerWeapon
-							// This is the first cross-dependednt fix.
-							#if FIXES_Single
-								FIXES_gsPlayerWeapon[playerid] = 0;
-							#else
-								SetPVarInt(playerid, FIXES_pvarPlayerWeapon, 0);
-							#endif
-						#endif
-					}
-				}
-		#endif
-		// ====================
-		//  END:   HydraSniper 
-		// ====================
-		
-		#if FIX_GetPlayerWeapon || FIX_PutPlayerInVehicle || FIX_TrainExit
-			#if PLAYER_STATE_PASSENGER != PLAYER_STATE_DRIVER + 1
-				#error FIX_GetPlayerWeapon/FIX_PutPlayerInVehicle state assertation failed.
-			#endif
-			if (_FIXES_IN_RANGE(oldstate, PLAYER_STATE_DRIVER, PLAYER_STATE_PASSENGER + 1))
-			{
-				#if FIX_PutPlayerInVehicle || FIX_TrainExit
-					new
-						e_FIXES_BOOLS:bools = FIXES_gsPlayerBools[playerid];
-				#endif
-				
-				// ========================
-				//  BEGIN: GetPlayerWeapon 
-				// ========================
-				#if FIX_GetPlayerWeapon
-					#if FIXES_Single
-						FIXES_gsPlayerWeapon[playerid] = -1;
-					#else
-						SetPVarInt(playerid, FIXES_pvarPlayerWeapon, -1);
-					#endif
-				#endif
-				// ========================
-				//  END:   GetPlayerWeapon 
-				// ========================
-				
-				// ==================
-				//  BEGIN: TrainExit
-				// ==================
-				#if FIX_TrainExit
-					FIXES_PRINTF("train exit");
-					if (bools & e_FIXES_BOOLS_PUT_IN_TRAIN)
-					{
-						FIXES_PRINTF("OK");
-						SetCameraBehindPlayer(playerid),
-						bools &= ~e_FIXES_BOOLS_PUT_IN_TRAIN;
-					}
-				#endif
-				// ==================
-				//  END:   TrainExit
-				// ==================
-				
-				// ===========================
-				//  BEGIN: PutPlayerInVehicle 
-				// ===========================
-				#if FIX_PutPlayerInVehicle
-					// Update their vehicle once we KNOW the client has done the
-					// removal from the vehicle.
-					if (bools & e_FIXES_BOOLS_PUT_IN_VEHICLE)
-					{
-						new
-							vid = FIXES_gsVehicleSeatData[playerid] & 0x00FFFFFF;
-						// Limited to "only" 16777216 vehicles and 256 seats.
-						PutPlayerInVehicle(playerid, vid, FIXES_gsVehicleSeatData[playerid] >>> 24),
-						bools &= ~e_FIXES_BOOLS_PUT_IN_VEHICLE;
-						#if FIX_TrainExit
-							switch (GetVehicleModel(vid))
-							{
-								case 449, 537, 538:
-								{
-									bools |= e_FIXES_BOOLS_PUT_IN_TRAIN;
-								}
-							}
-						#endif
-					}
-				#endif
-				// ===========================
-				//  END:   PutPlayerInVehicle 
-				// ===========================
-				
-				#if FIX_PutPlayerInVehicle || FIX_TrainExit
-					FIXES_gsPlayerBools[playerid] = bools;
-				#endif
-			}
-		#endif
-		
-		return FIXES_OnPlayerStateChange(playerid, newstate, oldstate);
-	}
-	
-	#if defined _ALS_OnPlayerStateChange
-		#error _ALS_OnPlayerStateChange defined
-	#endif
-	#define _ALS_OnPlayerStateChange
-	#define OnPlayerStateChange(%0) FIXES_OnPlayerStateChange(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerStateChange(playerid, newstate, oldstate);
-#endif
-
-/* 
- * FIXES_GivePlayerWeapon(playerid, weaponid, ammo)
- * 
- * FIXES:
- *     HydraSniper
- */
-
-#if defined _ALS_GivePlayerWeapon
-	#error _ALS_GivePlayerWeapon defined
-#endif
-native BAD_GivePlayerWeapon(playerid, weaponid, ammo) = GivePlayerWeapon;
-
-#if FIX_HydraSniper
-	stock FIXES_GivePlayerWeapon(playerid, weaponid, ammo)
-	{
-		new
-			vid = GetPlayerVehicleID(playerid);
-		if (vid)
-		{
-			vid = GetVehicleModel(vid);
-			if (weaponid == 34 && (vid == 520 || vid == 425))
-			{
-				vid = GivePlayerWeapon(playerid, weaponid, ammo),
-				SetPlayerArmedWeapon(playerid, 0);
-				#if FIX_GetPlayerWeapon
-					#if FIXES_Single
-						FIXES_gsPlayerWeapon[playerid] = 0;
-					#else
-						SetPVarInt(playerid, FIXES_pvarPlayerWeapon, 0);
-					#endif
-				#endif
-				return vid;
-			}
-		}
-		return GivePlayerWeapon(playerid, weaponid, ammo);
-	}
-	
-	#define _ALS_GivePlayerWeapon
-	#define GivePlayerWeapon FIXES_GivePlayerWeapon
-#endif
-
-/* 
- * FIXES_SetPlayerArmedWeapon(playerid, weaponid)
- * 
- * FIXES:
- *     GetPlayerWeapon
- */
-
-#if defined _ALS_SetPlayerArmedWeapon
-	#error _ALS_SetPlayerArmedWeapon defined
-#endif
-native BAD_SetPlayerArmedWeapon(playerid, weaponid) = SetPlayerArmedWeapon;
-
-#if FIX_GetPlayerWeapon
-	stock FIXES_SetPlayerArmedWeapon(playerid, weaponid)
-	{
-		#if FIX_AllowInteriorWeapons
-			if (FIXES_gsSettings & e_FIXES_SETTINGS_INTERIOR && GetPlayerInterior(playerid))
-			{
-				// Not allowed weapons.
-				return 0;
-			}
-		#endif
-		new
-			vid = GetPlayerVehicleID(playerid);
-		if (vid)
-		{
-			#if FIX_HydraSniper
-				vid = GetVehicleModel(vid);
-				if (weaponid == 34 && (vid == 520 || vid == 425))
-				{
-					return 0;
-				}
-			#endif
-			//FIXES_gsPlayerWeapon[playerid] = weaponid;
-			#if FIXES_Single
-				FIXES_gsPlayerWeapon[playerid] = weaponid;
-			#else
-				SetPVarInt(playerid, FIXES_pvarPlayerWeapon, weaponid);
-			#endif
-		}
-		return SetPlayerArmedWeapon(playerid, weaponid);
-	}
-	
-	#define _ALS_SetPlayerArmedWeapon
-	#define SetPlayerArmedWeapon FIXES_SetPlayerArmedWeapon
-#endif
-
-/* 
- * FIXES_GetPlayerWeapon(playerid)
- * 
- * FIXES:
- *     GetPlayerWeapon
- */
-
-#if defined _ALS_GetPlayerWeapon
-	#error _ALS_GetPlayerWeapon defined
-#endif
-native BAD_GetPlayerWeapon(playerid) = GetPlayerWeapon;
-
-#if FIX_GetPlayerWeapon
-	stock FIXES_GetPlayerWeapon(playerid)
-	{
-		#if FIXES_Single
-			new
-				ret = FIXES_gsPlayerWeapon[playerid];
-		#else
-			new
-				ret = GetPVarInt(playerid, FIXES_pvarPlayerWeapon);
-		#endif
-		if (ret == -1)
-		{
-			return GetPlayerWeapon(playerid);
-		}
-		return ret;
-	}
-	
-	#define _ALS_GetPlayerWeapon
-	#define GetPlayerWeapon FIXES_GetPlayerWeapon
-#endif
-
-/* 
- * FIXES_PutPlayerInVehicle(playerid, vehicleid, seatid)
- * 
- * FIXES:
- *     PutPlayerInVehicle
- */
-
-#if defined _ALS_PutPlayerInVehicle
-	#error _ALS_PutPlayerInVehicle defined
-#endif
-native BAD_PutPlayerInVehicle(playerid, vehicleid, seatid) = PutPlayerInVehicle;
-
-#if FIX_PutPlayerInVehicle || FIX_TrainExit
-	#if FIXES_Single
-		stock FIXES_PutPlayerInVehicle(playerid, vehicleid, seatid)
-		{
-			// ==================
-			//  BEGIN: TrainExit
-			// ==================
-			#if FIX_TrainExit
-				FIXES_PRINTF("TrainExit %d", GetVehicleModel(vehicleid));
-				switch (GetVehicleModel(vehicleid))
-				{
-					case 449, 537, 538:
-					{
-						FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_PUT_IN_TRAIN;
-					}
-				}
-			#endif
-			// ==================
-			//  END:   TrainExit
-			// ==================
-			
-			// ===========================
-			//  BEGIN: PutPlayerInVehicle 
-			// ===========================
-			#if FIX_PutPlayerInVehicle
-				new
-					vid = GetPlayerVehicleID(playerid);
-				if (vid)
-				{
-					new
-						Float:x,
-						Float:y,
-						Float:z;
-					// Remove them without the animation.
-					return
-						GetVehiclePos(vid, x, y, z),
-						SetPlayerPos(playerid, x, y, z),
-						FIXES_gsVehicleSeatData[playerid] = seatid << 24 | vehicleid,
-						FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_PUT_IN_VEHICLE,
-						1;
-				}
-			#endif
-			// ===========================
-			//  END:   PutPlayerInVehicle 
-			// ===========================
-			return PutPlayerInVehicle(playerid, vehicleid, seatid);
-		}
-	#else
-		forward _FIXES_PutPlayerInVehicle(playerid, vehicleid, seatid, from, data);
-		
-		stock FIXES_PutPlayerInVehicle(playerid, vehicleid, seatid)
-		{
-			FIXES_PRINTF("NOT SINGLE");
-			// ===========================
-			//  BEGIN: PutPlayerInVehicle 
-			// ===========================
-			#if FIX_PutPlayerInVehicle
-				new
-					vid = GetPlayerVehicleID(playerid);
-				if (vid)
-				{
-					new
-						Float:x,
-						Float:y,
-						Float:z;
-					// Remove them without the animation.
-					return
-						GetVehiclePos(vid, x, y, z),
-						SetPlayerPos(playerid, x, y, z),
-						CallRemoteFunction(FIXES_gscPutPlayerInVehicle, FIXES_gscSpec@iiiii, playerid, vehicleid, seatid, 1, vid),
-						1;
-				}
-			#endif
-			// ===========================
-			//  END:   PutPlayerInVehicle 
-			// ===========================
-			
-			// ==================
-			//  BEGIN: TrainExit
-			// ==================
-			#if FIX_TrainExit
-				new
-					model = GetVehicleModel(vehicleid);
-				switch (model)
-				{
-					case 449, 537, 538:
-					{
-						CallRemoteFunction(FIXES_gscPutPlayerInVehicle, FIXES_gscSpec@iiiii, playerid, vehicleid, seatid, 0, model);
-						//FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_PUT_IN_TRAIN;
-					}
-				}
-			#endif
-			// ==================
-			//  END:   TrainExit
-			// ==================
-			return PutPlayerInVehicle(playerid, vehicleid, seatid);
-		}
-		
-		public _FIXES_PutPlayerInVehicle(playerid, vehicleid, seatid, from, data)
-		{
-			FIXES_PRINTF("IN CHARGE: %d", (FIXES_gsSettings & e_FIXES_SETTINGS_IN_CHARGE));
-			_FIXES_IS_IN_CHARGE()
-			{
-				// ===========================
-				//  BEGIN: PutPlayerInVehicle 
-				// ===========================
-				#if FIX_PutPlayerInVehicle
-					if (from)
-					{
-						FIXES_gsVehicleSeatData[playerid] = seatid << 24 | vehicleid,
-						FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_PUT_IN_VEHICLE;
-					}
-				#endif
-				// ===========================
-				//  END:   PutPlayerInVehicle 
-				// ===========================
-				
-				// ==================
-				//  BEGIN: TrainExit
-				// ==================
-				#if FIX_TrainExit
-					#if FIX_PutPlayerInVehicle
-						else
-					#else
-						if (!from)
-					#endif
-						{
-							switch (data)
-							{
-								case 449, 537, 538:
-								{
-									FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_PUT_IN_TRAIN;
-								}
-							}
-						}
-				#endif
-				// ==================
-				//  END:   TrainExit
-				// ==================
-			}
-			return 1;
-		}
-	#endif
-	
-	#define _ALS_PutPlayerInVehicle
-	#define PutPlayerInVehicle FIXES_PutPlayerInVehicle
-#endif
-
-/* 
- * FIXES_SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size)
- * 
- * FIXES:
- *     SetPlayerCheckpoint
- */
-
-#if defined _ALS_SetPlayerCheckpoint
-	#error _ALS_SetPlayerCheckpoint defined
-#endif
-native BAD_SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size) = SetPlayerCheckpoint;
-
-#if FIX_SetPlayerCheckpoint
-	stock FIXES_SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size)
-	{
-		return
-			DisablePlayerCheckpoint(playerid),
-			SetPlayerCheckpoint(playerid, x, y, z, size);
-	}
-	
-	#define _ALS_SetPlayerCheckpoint
-	#define SetPlayerCheckpoint FIXES_SetPlayerCheckpoint
-#endif
-
-/* 
- * FIXES_SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size)
- * 
- * FIXES:
- *     SetPlayerRaceCheckpoint
- */
-
-#if defined _ALS_SetPlayerRaceCheckpoint
-	#error _ALS_SetPlayerRaceCheckpoint defined
-#endif
-native BAD_SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size) = SetPlayerRaceCheckpoint;
-
-#if FIX_SetPlayerRaceCheckpoint
-	stock FIXES_SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size)
-	{
-		return
-			DisablePlayerRaceCheckpoint(playerid),
-			SetPlayerRaceCheckpoint(playerid, type, x, y, z, nextx, nexty, nextz, size);
-	}
-	
-	#define _ALS_SetPlayerRaceCheckpoint
-	#define SetPlayerRaceCheckpoint FIXES_SetPlayerRaceCheckpoint
-#endif
-
-/* 
- * _FIXES_HideGameTextForPlayer(playerid, style, parr[])
- * 
- * Hides a GameText style for one or more players, and accounts for the fact
- * that they may have different messages being shown.
- * 
- * FIXES:
- *     GameText
- */
-
-#if FIX_GameText
-	static stock _FIXES_HideGameTextForPlayer(playerid, style, parr[])
-	{
-		switch (playerid)
-		{
-			case MAX_PLAYERS:
-			{
-				// Remove the global GameText for everyone that can see it.
-				TextDrawHideForAll(FIXES_gsGTStyle[style]);
-			}
-			case INVALID_PLAYER_ID:
-			{
-				// Hide any player-local ones.  This is similar to "foreach".
-				playerid = parr[MAX_PLAYERS],
-				parr[MAX_PLAYERS] = MAX_PLAYERS;
-				for (new next; playerid != MAX_PLAYERS; playerid = next)
-				{
-					PlayerTextDrawHide(playerid, FIXES_gsPGTStyle[playerid][style]),
-					next = parr[playerid],
-					parr[playerid] = 0;
-				}
-			}
-			default:
-			{
-				// Remove.
-				PlayerTextDrawHide(playerid, FIXES_gsPGTStyle[playerid][style]),
-				_FIXES_RemoveInternal(parr, playerid, MAX_PLAYERS);
-			}
-		}
-	}
-#endif
-
-/* 
- * _FIXES_HideGameTextTimer(playerid, style)
- * 
- * FIXES:
- *     GameText
- */
-
-#if FIX_GameText
-	forward _FIXES_HideGameTextTimer(playerid, style);
-	
-	public _FIXES_HideGameTextTimer(playerid, style)
-	{
-		if (GetTickCount() >= FIXES_gsGTTimer[style][playerid])
-		{
-			// Only hide it if it hasn't been re-shown in the interim.
-			_FIXES_HideGameTextForPlayer(playerid, style, FIXES_gsPlayerPGTShown[style]);
-		}
-	}
-#endif
-
-/* 
- * _FIXES_GameTextShow(playerid, string[], time, style)
- * 
- * FIXES:
- *     GameText
- */
-
-#if FIX_GameText
-	forward _FIXES_GameTextShow(playerid, string[], time, style);
-	
-	public _FIXES_GameTextShow(playerid, string[], time, style)
-	{
-		_FIXES_IS_IN_CHARGE()
-		{
-			if (playerid == MAX_PLAYERS)
-			{
-				_FIXES_HideGameTextForPlayer(INVALID_PLAYER_ID, style, FIXES_gsPlayerPGTShown[style]),
-				TextDrawSetString(FIXES_gsGTStyle[style], string),
-				TextDrawShowForAll(FIXES_gsGTStyle[style]);
-			}
-			else
-			{
-				TextDrawHideForPlayer(playerid, FIXES_gsGTStyle[style]),
-				PlayerTextDrawSetString(playerid, FIXES_gsPGTStyle[playerid][style], string),
-				PlayerTextDrawShow(playerid, FIXES_gsPGTStyle[playerid][style]),
-				_FIXES_AddInternal(FIXES_gsPlayerPGTShown[style], playerid, MAX_PLAYERS);
-			}
-			if (time)
-			{
-				// Tiny offset because timers are inaccurate.
-				FIXES_gsGTTimer[style][playerid] = GetTickCount() + time - 10,
-				// Don't need to save the timer's ID.
-				SetTimerEx(FIXES_gscHideGameTextTimer, time, false, FIXES_gscSpec@ii, playerid, style);
-			}
-		}
-		return 1;
-	}
-#endif
-
-/* 
- * FIXES_GameTextForAll(string[], time, style)
- * 
- * FIXES:
- *     GameText
- */
-
-#if defined _ALS_GameTextForAll
-	#error _ALS_GameTextForAll defined
-#endif
-native BAD_GameTextForAll(const string[], time, style) = GameTextForAll;
-
-#if FIX_GameText
-	stock FIXES_GameTextForAll(string[], time, style)
-	{
-		if (_FIXES_IN_RANGE(style, 0, FIXES_GT_STYLE_COUNT))
-		{
-			if ((string[0] == '\0') || (string[0] == '\1' && string[1] == '\0'))
-			{
-				#if FIXES_Single
-					return _FIXES_GameTextShow(MAX_PLAYERS, FIXES_gscSpace, time, style);
-				#else
-					return CallRemoteFunction(FIXES_gscGameTextShow, FIXES_gscSpec@isii, MAX_PLAYERS, FIXES_gscSpace, time, style);
-				#endif
-			}
-			else
-			{
-				#if FIXES_Single
-					return _FIXES_GameTextShow(MAX_PLAYERS, string, time, style);
-				#else
-					return CallRemoteFunction(FIXES_gscGameTextShow, FIXES_gscSpec@isii, MAX_PLAYERS, string, time, style);
-				#endif
-			}
-		}
-		return 0;
-	}
-	
-	#define _ALS_GameTextForAll
-	
-	#define GameTextForAll FIXES_GameTextForAll
-#endif
-
-/* 
- * FIXES_GameTextForPlayer(playerid, string[], time, style)
- * 
- * FIXES:
- *     GameText
- */
-
-#if defined _ALS_GameTextForPlayer
-	#error _ALS_GameTextForPlayer defined
-#endif
-native BAD_GameTextForPlayer(playerid, const string[], time, style) = GameTextForPlayer;
-
-#if FIX_GameText
-	stock FIXES_GameTextForPlayer(playerid, string[], time, style)
-	{
-		if (_FIXES_IN_RANGE(style, 0, FIXES_GT_STYLE_COUNT) && _FIXES_IS_PLAYER_CONNECTED(playerid))
-		{
-			if ((string[0] <= '\0') || (string[0] == '\1' && string[1] == '\0'))
-			{
-				#if FIXES_Single
-					return _FIXES_GameTextShow(playerid, FIXES_gscSpace, time, style);
-				#else
-					return CallRemoteFunction(FIXES_gscGameTextShow, FIXES_gscSpec@isii, playerid, FIXES_gscSpace, time, style);
-				#endif
-			}
-			else
-			{
-				#if FIXES_Single
-					return _FIXES_GameTextShow(playerid, string, time, style);
-				#else
-					return CallRemoteFunction(FIXES_gscGameTextShow, FIXES_gscSpec@isii, playerid, string, time, style);
-				#endif
-			}
-		}
-		return 0;
-	}
-	
-	#define _ALS_GameTextForPlayer
-	
-	#define GameTextForPlayer FIXES_GameTextForPlayer
-#endif
-
-/* 
- * HideGameTextForAll(style)
- * 
- * FIXES:
- *     HideGameText
- */
-
-#if defined _ALS_HideGameTextForAll
-	#error _ALS_HideGameTextForAll defined
-#endif
-native BAD_HideGameTextForAll(style) = HideGameTextForAll;
-
-#if FIX_HideGameText
-	#define _ALS_HideGameTextForAll
-	
-	#define HideGameTextForAll(%0) GameTextForAll(FIXES_gscSpace, 0, (%0))
-#endif
-
-/* 
- * HideGameTextForPlayer(playerid, style)
- * 
- * FIXES:
- *     HideGameText
- */
-
-#if defined _ALS_HideGameTextForPlayer
-	#error _ALS_HideGameTextForPlayer defined
-#endif
-native BAD_HideGameTextForPlayer(playerid, style) = HideGameTextForPlayer;
-
-#if FIX_HideGameText
-	#define _ALS_HideGameTextForPlayer
-	
-	#define HideGameTextForPlayer(%1,%0) GameTextForPlayer((%1), FIXES_gscSpace, 0, (%0))
-#endif
-
-/* 
- * PlayerText:FIXES_CreatePlayerTextDraw(playerid, Float:x, Float:y, text[])
- * 
- * FIXES:
- *     CreatePlayerTextDraw
- */
-
-#if defined _ALS_CreatePlayerTextDraw
-	#error _ALS_CreatePlayerTextDraw defined
-#endif
-native Text:BAD_CreatePlayerTextDraw(playerid, Float:x, Float:y, text[]) = CreatePlayerTextDraw;
-
-#if FIX_CreatePlayerTextDraw
-	stock PlayerText:FIXES_CreatePlayerTextDraw(playerid, Float:x, Float:y, text[])
-	{
-		if ((text[0] == '\0') || (text[0] == '\1' && text[1] == '\0'))
-		{
-			return CreatePlayerTextDraw(playerid, x, y, FIXES_gscSpace);
-		}
-		else
-		{
-			return CreatePlayerTextDraw(playerid, x, y, text);
-		}
-	}
-	
-	#define _ALS_CreatePlayerTextDraw
-	#define CreatePlayerTextDraw FIXES_CreatePlayerTextDraw
-#endif
-
-/* 
- * FIXES_PlayerTextDrawSetString(playerid, PlayerText:text, string[])
- * 
- * FIXES:
- *     PlayerTextDrawSetString
- */
-
-#if defined _ALS_PlayerTextDrawSetString
-	#error _ALS_PlayerTextDrawSetString defined
-#endif
-native BAD_PlayerTextDrawSetString(playerid, PlayerText:text, string[]) = PlayerTextDrawSetString;
-
-#if FIX_PlayerTextDrawSetString
-	stock FIXES_PlayerTextDrawSetString(playerid, PlayerText:text, string[])
-	{
-		if ((string[0] == '\0') || (string[0] == '\1' && string[1] == '\0'))
-		{
-			return PlayerTextDrawSetString(playerid, text, FIXES_gscSpace);
-		}
-		else
-		{
-			return PlayerTextDrawSetString(playerid, text, string);
-		}
-	}
-	
-	#define _ALS_PlayerTextDrawSetString
-	#define PlayerTextDrawSetString FIXES_PlayerTextDrawSetString
-#endif
-
-/* 
- * Text:FIXES_TextDrawCreate(Float:x, Float:y, text[])
- * 
- * FIXES:
- *     TextDrawCreate
- */
-
-	#if defined _ALS_TextDrawCreate
-		#error _ALS_TextDrawCreate defined
-native Text:BAD_TextDrawCreate(Float:x, Float:y, text[]) = TextDrawCreate;
-
-#if FIX_TextDrawCreate
-	stock Text:FIXES_TextDrawCreate(Float:x, Float:y, text[])
-	{
-		if ((text[0] == '\0') || (text[0] == '\1' && text[1] == '\0'))
-		{
-			return TextDrawCreate(x, y, FIXES_gscSpace);
-		}
-		else
-		{
-			return TextDrawCreate(x, y, text);
-		}
-	}
-	
-	#endif
-	#define _ALS_TextDrawCreate
-	#define TextDrawCreate FIXES_TextDrawCreate
-#endif
-
-/* 
- * FIXES_TextDrawSetString(Text:text, string[])
- * 
- * FIXES:
- *     TextDrawSetString
- */
-
-#if defined _ALS_TextDrawSetString
-	#error _ALS_TextDrawSetString defined
-#endif
-native BAD_TextDrawSetString(Text:text, string[]) = TextDrawSetString;
-
-#if FIX_TextDrawSetString
-	stock FIXES_TextDrawSetString(Text:text, string[])
-	{
-		if ((string[0] == '\0') || (string[0] == '\1' && string[1] == '\0'))
-		{
-			return TextDrawSetString(text, FIXES_gscSpace);
-		}
-		else
-		{
-			return TextDrawSetString(text, string);
-		}
-	}
-	
-	#define _ALS_TextDrawSetString
-	#define TextDrawSetString FIXES_TextDrawSetString
-#endif
-
-/* 
- * FIXES_AllowInteriorWeapons(allow)
- * 
- * FIXES:
- *     AllowInteriorWeapons
- */
-
-#if defined _ALS_AllowInteriorWeapons
-	#error _ALS_AllowInteriorWeapons defined
-#endif
-native BAD_AllowInteriorWeapons(allow) = AllowInteriorWeapons;
-
-#if FIX_AllowInteriorWeapons
-	#if FIXES_Single
-		stock FIXES_AllowInteriorWeapons(allow)
-		{
-			if (allow)
-			{
-				FIXES_gsSettings &= ~e_FIXES_SETTINGS_INTERIOR;
-				_FIXES_FOREACH(FIXES_gsPlayersIterator, i)
-				{
-					FIXES_gsPlayerBools[i] &= ~e_FIXES_BOOLS_INTERIOR;
-				}
-			}
-			else
-			{
-				FIXES_gsSettings |= e_FIXES_SETTINGS_INTERIOR;
-				_FIXES_FOREACH(FIXES_gsPlayersIterator, i)
-				{
-					if (GetPlayerInterior(i))
-					{
-						FIXES_gsPlayerBools[i] |= e_FIXES_BOOLS_INTERIOR;
-					}
-				}
-			}
-			return allow;
-		}
-	#else
-		forward _FIXES_AllowInteriorWeapons(allow);
-		
-		stock FIXES_AllowInteriorWeapons(allow)
-		{
-			CallRemoteFunction(FIXES_gscAllowInteriorWeapons, FIXES_gscSpec@i, allow);
-			return allow;
-		}
-		
-		public _FIXES_AllowInteriorWeapons(allow)
-		{
-			if (allow)
-			{
-				FIXES_gsSettings &= ~e_FIXES_SETTINGS_INTERIOR;
-				_FIXES_FOREACH(FIXES_gsPlayersIterator, i)
-				{
-					FIXES_gsPlayerBools[i] &= ~e_FIXES_BOOLS_INTERIOR;
-				}
-			}
-			else
-			{
-				FIXES_gsSettings |= e_FIXES_SETTINGS_INTERIOR;
-				_FIXES_FOREACH(FIXES_gsPlayersIterator, i)
-				{
-					if (GetPlayerInterior(i))
-					{
-						FIXES_gsPlayerBools[i] |= e_FIXES_BOOLS_INTERIOR;
-					}
-				}
-			}
-			return allow;
-		}
-	#endif
-	
-	#define _ALS_AllowInteriorWeapons
-	#define AllowInteriorWeapons FIXES_AllowInteriorWeapons
-#endif
-
-/* 
- * FIXES_GetPlayerInterior(playerid)
- * 
- * FIXES:
- *     GetPlayerInterior
- */
-
-#if defined _ALS_GetPlayerInterior
-	#error _ALS_GetPlayerInterior defined
-#endif
-native BAD_GetPlayerInterior(playerid) = GetPlayerInterior;
-
-#if FIX_GetPlayerInterior
-	stock FIXES_GetPlayerInterior(playerid)
-	{
-		if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-		{
-			#if FIXES_Single
-				return FIXES_gsInterior[playerid];
-			#else
-				return GetPVarInt(playerid, FIXES_pvarPlayerInterior);
-			#endif
-		}
-		return 0;
-	}
-	
-	#define _ALS_GetPlayerInterior
-	#define GetPlayerInterior FIXES_GetPlayerInterior
-#endif
-
-/* 
- * FIXES_SetPlayerInterior(playerid, interiorid)
- * 
- * FIXES:
- *     GetPlayerInterior
- */
-
-#if defined _ALS_SetPlayerInterior
-	#error _ALS_SetPlayerInterior defined
-#endif
-native BAD_SetPlayerInterior(playerid, interiorid) = SetPlayerInterior;
-
-#if FIX_GetPlayerInterior
-	stock FIXES_SetPlayerInterior(playerid, interiorid)
-	{
-		if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-		{
-			#if FIXES_Single
-				FIXES_gsInterior[playerid] = interiorid;
-			#else
-				SetPVarInt(playerid, FIXES_pvarPlayerInterior, interiorid);
-			#endif
-			return SetPlayerInterior(playerid, interiorid);
-		}
-		return 0;
-	}
-	
-	#define _ALS_SetPlayerInterior
-	#define SetPlayerInterior FIXES_SetPlayerInterior
-#endif
-
-/* 
- * OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
- * 
- * FIXES:
- *     AllowTeleport
- */
-
-#if FIX_AllowTeleport && !defined FILTERSCRIPT
-	forward _FIXES_AllowTeleport(playerid, allow);
-	
-	public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
-	{
-		// ======================
-		//  BEGIN: AllowTeleport 
-		// ======================
-		#if FIX_AllowTeleport
-			if (!_FIXES_gIsFilterscript)
-			{
-				// Unusually, the call order here is always Game Mode first -
-				// most callbacks are Filter Script first.
-				if ((FIXES_gsPlayerBools[playerid] & e_FIXES_BOOLS_TELEPORT) || ((FIXES_gsSettings & e_FIXES_SETTINGS_ADMIN_TELEPORT) && (IsPlayerAdmin(playerid))))
-				{
-					SetPlayerPosFindZ(playerid, fX, fY, fZ);
-				}
-			}
-		#endif
-		// ======================
-		//  END:   AllowTeleport 
-		// ======================
-		return FIXES_OnPlayerClickMap(playerid, fX, fY, fZ);
-	}
-	
-	#if defined _ALS_OnPlayerClickMap
-		#error _ALS_OnPlayerClickMap defined
-	#endif
-	#define _ALS_OnPlayerClickMap
-	#define OnPlayerClickMap(%0) FIXES_OnPlayerClickMap(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
-#endif
-
-/* 
- * FIXES_AllowPlayerTeleport(playerid, allow)
- * 
- * FIXES:
- *     AllowTeleport
- */
-
-#if defined _ALS_AllowPlayerTeleport
-	#error _ALS_AllowPlayerTeleport defined
-#endif
-native BAD_AllowPlayerTeleport(playerid, allow) = AllowPlayerTeleport;
-
-#if FIX_AllowTeleport
-	#if FIXES_Single
-		stock FIXES_AllowPlayerTeleport(playerid, allow)
-		{
-			if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-			{
-				if (allow)
-				{
-					FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_TELEPORT;
-				}
-				else
-				{
-					FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_TELEPORT;
-				}
-			}
-			return 0;
-		}
-	#else
-		stock FIXES_AllowPlayerTeleport(playerid, allow)
-		{
-			if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-			{
-				CallRemoteFunction(FIXES_gscAllowTeleport, FIXES_gscSpec@ii, playerid, allow);
-			}
-			return 0;
-		}
-	#endif
-	
-	#define _ALS_AllowPlayerTeleport
-	#define AllowPlayerTeleport FIXES_AllowPlayerTeleport
-#endif
-
-/* 
- * FIXES_AllowAdminTeleport(allow)
- * 
- * FIXES:
- *     AllowTeleport
- */
-
-#if defined _ALS_AllowAdminTeleport
-	#error _ALS_AllowAdminTeleport defined
-#endif
-native BAD_AllowAdminTeleport(allow) = AllowAdminTeleport;
-
-#if FIX_AllowTeleport
-	#if FIXES_Single
-		stock FIXES_AllowAdminTeleport(allow)
-		{
-			if (allow)
-			{
-				FIXES_gsSettings |= e_FIXES_SETTINGS_ADMIN_TELEPORT;
-			}
-			else
-			{
-				FIXES_gsSettings &= ~e_FIXES_SETTINGS_ADMIN_TELEPORT;
-			}
-			return allow;
-		}
-	#else
-		stock FIXES_AllowAdminTeleport(allow)
-		{
-			return
-				CallRemoteFunction(FIXES_gscAllowTeleport, FIXES_gscSpec@ii, INVALID_PLAYER_ID, allow),
-				allow;
-		}
-	#endif
-	
-	#define _ALS_AllowAdminTeleport
-	#define AllowAdminTeleport FIXES_AllowAdminTeleport
-#endif
-
-/* 
- * FIXES_AllowAdminTeleport(allow)
- * 
- * FIXES:
- *     AllowTeleport
- */
-
-#if FIX_AllowTeleport && !defined FILTERSCRIPT && !FIXES_Single
-	public _FIXES_AllowTeleport(playerid, allow)
-	{
-		if (!_FIXES_gIsFilterscript)
-		{
-			if (playerid == INVALID_PLAYER_ID)
-			{
-				if (allow)
-				{
-					FIXES_gsSettings |= e_FIXES_SETTINGS_ADMIN_TELEPORT;
-				}
-				else
-				{
-					FIXES_gsSettings &= ~e_FIXES_SETTINGS_ADMIN_TELEPORT;
-				}
-			}
-			else
-			{
-				if (allow)
-				{
-					FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_TELEPORT;
-				}
-				else
-				{
-					FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_TELEPORT;
-				}
-			}
-		}
-	}
-#endif
-
-/* 
- * FIXES_SetPlayerSpecialAction(playerid, actionid)
- * 
- * FIXES:
- *     SetPlayerSpecialAction
- */
-
-#if defined _ALS_SetPlayerSpecialAction
-	#error _ALS_SetPlayerSpecialAction defined
-#endif
-native BAD_SetPlayerSpecialAction(playerid, actionid) = SetPlayerSpecialAction;
-
-#if FIX_SetPlayerSpecialAction
-	stock FIXES_SetPlayerSpecialAction(playerid, actionid)
-	{
-		if (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
-		{
-			ClearAnimations(playerid);
-		}
-		SetPlayerSpecialAction(playerid, actionid);
-		return 1;
-	}
-	
-	#define _ALS_SetPlayerSpecialAction
-	#define SetPlayerSpecialAction FIXES_SetPlayerSpecialAction
-#endif
-
-/* 
- * FIXES_ClearAnimations(playerid, forcesync = 0)
- * 
- * FIXES:
- *     ClearAnimations
- */
-
-#if defined _ALS_ClearAnimations
-	#error _ALS_ClearAnimations defined
-#endif
-native BAD_ClearAnimations(playerid, forcesync = 0) = ClearAnimations;
-
-#if FIX_ClearAnimations || FIX_ClearAnimations_2
-	stock FIXES_ClearAnimations(playerid, forcesync = 0)
-	{
-		#if FIX_ClearAnimations || FIX_ClearAnimations_2
-			if (IsPlayerInAnyVehicle(playerid))
-		#endif
-		#if FIX_ClearAnimations
-			{
-				return ApplyAnimation(playerid, "PED", "CAR_SIT", 4.0, 0, 0, 0, 0, 1, forcesync);
-			}
-		#endif
-		#if FIX_ClearAnimations + FIX_ClearAnimations_2 == 1 // XOR
-			{
-				return ClearAnimations(playerid, forcesync);
-			}
-		#endif
-		#if FIX_ClearAnimations_2
-			new
-				ret = ClearAnimations(playerid, forcesync);
-			ApplyAnimation(playerid, "PED", "IDLE_STANCE", 4.0, 0, 0, 0, 0, 1, forcesync);
-			ApplyAnimation(playerid, "PED", "IDLE_CHAT", 4.0, 0, 0, 0, 0, 1, forcesync);
-			ApplyAnimation(playerid, "PED", "WALK_PLAYER", 4.0, 0, 0, 0, 0, 1, forcesync);
-			return ret;
-		#endif
-	}
-	
-	#define _ALS_ClearAnimations
-	#define ClearAnimations FIXES_ClearAnimations
-#endif
-
-/* 
- * FIXES_GangZoneCreate(Float:minx, Float:miny, Float:maxx, Float:maxy)
- * 
- * FIXES:
- *     GangZoneCreate
- */
-
-#if defined _ALS_GangZoneCreate
-	#error _ALS_GangZoneCreate defined
-#endif
-native BAD_GangZoneCreate(Float:minx, Float:miny, Float:maxx, Float:maxy) = GangZoneCreate;
-
-#if FIX_GangZoneCreate
-	stock FIXES_GangZoneCreate(Float:minx, Float:miny, Float:maxx, Float:maxy)
-	{
-		return GangZoneCreate(floatsub(minx, floatfract(minx)), floatsub(miny, floatfract(miny)), floatsub(maxx, floatfract(maxx)), floatsub(maxy, floatfract(maxy)));
-	}
-	
-	#define _ALS_GangZoneCreate
-	#define GangZoneCreate FIXES_GangZoneCreate
-#endif
-
-/* 
- * FIXES_ShowPlayerDialog(playerid, dialog, style, title[], caption[], button1[], button2[])
- * 
- * FIXES:
- *     OnDialogResponse
- *     GetPlayerDialog
- */
-
-#if defined _ALS_ShowPlayerDialog
-	#error _ALS_ShowPlayerDialog defined
-#endif
-native BAD_ShowPlayerDialog(playerid, dialog, style, title[], caption[], button1[], button2[]) = ShowPlayerDialog;
-
-#if FIX_OnDialogResponse || FIX_GetPlayerDialog
-	stock FIXES_ShowPlayerDialog(playerid, dialog, style, title[], caption[], button1[], button2[])
-	{
-		if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-		{
-			#if FIXES_Single
-				FIXES_gsDialogID[playerid] = dialog;
-			#else
-				SetPVarInt(playerid, FIXES_pvarPlayerDialog, dialog);
-			#endif
-			return ShowPlayerDialog(playerid, dialog, style, title, caption, button1, button2);
-		}
-		return 0;
-	}
-	
-	#define _ALS_ShowPlayerDialog
-	#define ShowPlayerDialog FIXES_ShowPlayerDialog
-#endif
-
-/* 
- * OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- * 
- * FIXES:
- *     OnDialogResponse
- *     GetPlayerDialog
- */
-
-#if FIX_OnDialogResponse || FIX_GetPlayerDialog
-	public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
-	{
-		// =========================
-		//  BEGIN: OnDialogResponse 
-		// =========================
-		#if FIX_OnDialogResponse || FIX_GetPlayerDialog
-			#if FIXES_Single
-				#if FIX_OnDialogResponse
-					dialogid = FIXES_gsDialogID[playerid];
-				#endif
-				FIXES_gsDialogID[playerid] = INVALID_DIALOG_ID;
-			#elseif FIX_OnDialogResponse
-				_FIXES_IS_IN_CHARGE()
-				{
-					// If there are multiple scripts, we can't just wipe the
-					// current dialog data or subsequent scripts will display
-					// the wrong value.
-					dialogid = GetPVarInt(playerid, FIXES_pvarPlayerDialog),
-					SetPVarInt(playerid, FIXES_pvarCurrentDialog, dialogid),
-					SetPVarInt(playerid, FIXES_pvarPlayerDialog, INVALID_DIALOG_ID);
-				}
-				else
-				{
-					dialogid = GetPVarInt(playerid, FIXES_pvarCurrentDialog);
-				}
-			#else
-				SetPVarInt(playerid, FIXES_pvarPlayerDialog, INVALID_DIALOG_ID);
-			#endif
-			if (inputtext[0])
-			{
-				return FIXES_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
-			}
-			else
-			{
-				return FIXES_OnDialogResponse(playerid, dialogid, response, listitem, FIXES_gscNULL);
-			}
-		#endif
-		// =========================
-		//  END:   OnDialogResponse 
-		// =========================
-	}
-	
-	#if defined _ALS_OnDialogResponse
-		#error _ALS_OnDialogResponse defined
-	#endif
-	#define _ALS_OnDialogResponse
-	#define OnDialogResponse(%0) FIXES_OnDialogResponse(%0) <_ALS : _ALS_go>
-	
-	_FIXES_FORWARD FIXES_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
-#endif
-
-/* 
- * FIXES_GetPlayerDialog(playerid)
- * 
- * FIXES:
- *     GetPlayerDialog
- */
-
-#if defined _ALS_GetPlayerDialog
-	#error _ALS_GetPlayerDialog defined
-#endif
-native BAD_GetPlayerDialog(playerid) = GetPlayerDialog;
-
-#if FIX_GetPlayerDialog
-	stock FIXES_GetPlayerDialog(playerid)
-	{
-		if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-		{
-			#if FIXES_Single
-				return FIXES_gsDialogID[playerid];
-			#else
-				return GetPVarInt(playerid, FIXES_pvarPlayerDialog);
-			#endif
-		}
-		return -1;
-	}
-	
-	#define _ALS_GetPlayerDialog
-	#define GetPlayerDialog FIXES_GetPlayerDialog
-#endif
-
-/* 
- * FIXES_valstr(dest[], value, bool:pack = false)
- * 
- * FIXES:
- *     valstr
- */
-
-#if defined _ALS_valstr
-	#error _ALS_valstr defined
-#endif
-native BAD_valstr(dest[], value, bool:pack = false) = valstr;
-
-#if FIX_valstr
-	stock FIXES_valstr(dest[], value, bool:pack = false)
-	{
-		// "format" can't handle cellmin properly.
-		static const
-			sc_szCellmin[] = !"-2147483648";
-		if (value == cellmin)
-		{
-			pack && strpack(dest, sc_szCellmin, 12) || strunpack(dest, sc_szCellmin, 12);
-		}
-		else
-		{
-			format(dest, 12, "%d", value),
-			pack && strpack(dest, dest, 12);
-		}
-		return 0;
-	}
-	
-	#define _ALS_valstr
-	#define valstr FIXES_valstr
-#endif
-
-/* 
- * FIXES_fclose(File:handle)
- * 
- * FIXES:
- *     fclose
- */
-
-#if defined _ALS_fclose
-	#error _ALS_fclose defined
-#endif
-native BAD_fclose(File:handle) = fclose;
-
-#if FIX_fclose
-	stock bool:FIXES_fclose(File:handle)
-	{
-		return handle && fclose(handle);
-	}
-	
-	#define _ALS_fclose
-	#define fclose FIXES_fclose
-#endif
-
-/* 
- * FIXES_fwrite(File:handle, const string[])
- * 
- * FIXES:
- *     fwrite
- */
-
-#if defined _ALS_fwrite
-	#error _ALS_fwrite defined
-#endif
-native BAD_fwrite(File:handle, const string[]) = fwrite;
-
-#if FIX_fwrite
-	stock FIXES_fwrite(File:handle, const string[])
-	{
-		return handle && fwrite(handle, string);
-	}
-	
-	#define _ALS_fwrite
-	#define fwrite FIXES_fwrite
-#endif
-
-/* 
- * FIXES_fread(File:handle, string[], size = sizeof (string), bool:pack = false)
- * 
- * FIXES:
- *     fread
- */
-
-#if defined _ALS_fread
-	#error _ALS_fread defined
-#endif
-native BAD_fread(File:handle, string[], size = sizeof (string), bool:pack = false) = fread;
-
-#if FIX_fread
-	stock FIXES_fread(File:handle, string[], size = sizeof (string), bool:pack = false)
-	{
-		return handle && fread(handle, string, size, pack);
-	}
-	
-	#define _ALS_fread
-	#define fread FIXES_fread
-#endif
-
-/* 
- * FIXES_fputchar(File:handle, value, bool:utf8 = true)
- * 
- * FIXES:
- *     fputchar
- */
-
-#if defined _ALS_fputchar
-	#error _ALS_fputchar defined
-#endif
-native BAD_fputchar(File:handle, value, bool:utf8 = true) = fputchar;
-
-#if FIX_fputchar
-	stock bool:FIXES_fputchar(File:handle, value, bool:utf8 = true)
-	{
-		return handle && fputchar(handle, value, utf8);
-	}
-	
-	#define _ALS_fputchar
-	#define fputchar FIXES_fputchar
-#endif
-
-/* 
- * FIXES_fgetchar(File:handle, value, bool:utf8 = true)
- * 
- * FIXES:
- *     fgetchar
- */
-
-#if defined _ALS_fgetchar
-	#error _ALS_fgetchar defined
-#endif
-native BAD_fgetchar(File:handle, value, bool:utf8 = true) = fgetchar;
-
-#if FIX_fgetchar
-	stock FIXES_fgetchar(File:handle, value, bool:utf8 = true)
-	{
-		return handle && fgetchar(handle, value, utf8);
-	}
-	
-	#define _ALS_fgetchar
-	#define fgetchar FIXES_fgetchar
-#endif
-
-/* 
- * FIXES_fblockwrite(File:handle, const buffer[], size = sizeof (buffer))
- * 
- * FIXES:
- *     fblockwrite
- */
-
-#if defined _ALS_fblockwrite
-	#error _ALS_fblockwrite defined
-#endif
-native BAD_fblockwrite(File:handle, const buffer[], size = sizeof (buffer)) = fblockwrite;
-
-#if FIX_fblockwrite
-	stock FIXES_fblockwrite(File:handle, const buffer[], size = sizeof (buffer))
-	{
-		return handle && fblockwrite(handle, buffer, size);
-	}
-	
-	#define _ALS_fblockwrite
-	#define fblockwrite FIXES_fblockwrite
-#endif
-
-/* 
- * FIXES_fblockread(File:handle, buffer[], size = sizeof (buffer))
- * 
- * FIXES:
- *     fblockread
- */
-
-#if defined _ALS_fblockread
-	#error _ALS_fblockread defined
-#endif
-native BAD_fblockread(File:handle, buffer[], size = sizeof (buffer)) = fblockread;
-
-#if FIX_fblockread
-	stock FIXES_fblockread(File:handle, buffer[], size = sizeof (buffer))
-	{
-		return handle && fblockread(handle, buffer, size);
-	}
-	
-	#define _ALS_fblockread
-	#define fblockread FIXES_fblockread
-#endif
-
-/* 
- * FIXES_fseek(File:handle, position = 0, seek_whence:whence = seek_start)
- * 
- * FIXES:
- *     fseek
- */
-
-#if defined _ALS_fseek
-	#error _ALS_fseek defined
-#endif
-native BAD_fseek(File:handle, position = 0, seek_whence:whence = seek_start) = fseek;
-
-#if FIX_fseek
-	stock FIXES_fseek(File:handle, position = 0, seek_whence:whence = seek_start)
-	{
-		return handle && fseek(handle, position, whence);
-	}
-	
-	#define _ALS_fseek
-	#define fseek FIXES_fseek
-#endif
-
-/* 
- * FIXES_flength(File:handle)
- * 
- * FIXES:
- *     flength
- */
-
-#if defined _ALS_flength
-	#error _ALS_flength defined
-#endif
-native BAD_flength(File:handle) = flength;
-
-#if FIX_flength
-	stock FIXES_flength(File:handle)
-	{
-		return handle && flength(handle);
-	}
-	
-	#define _ALS_flength
-	#define flength FIXES_flength
-#endif
-
-/* 
- * FIXES_Kick(playerid)
- * 
- * FIXES:
- *     Kick
- */
-
-#if defined _ALS_Kick
-	#error _ALS_Kick defined
-#endif
-native BAD_Kick(playerid) = Kick;
-
-#if FIX_Kick
-	forward _FIXES_Kick(playerid);
-	
-	public _FIXES_Kick(playerid)
-	{
-		FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_KICKED,
-		Kick(playerid);
-	}
-	
-	#if !FIXES_Single
-		forward @FIXES_Kick(playerid);
-		
-		public @FIXES_Kick(playerid)
-		{
-			FIXES_BlockUpdate(playerid, true, 0);
-		}
-	#endif
-	
-	stock FIXES_Kick(playerid)
-	{
-		if (FIXES_gsPlayerBools[playerid] & e_FIXES_BOOLS_ON_PLAYER_CONNECT)
-		{
-			// Disable as much of the server as possible quickly.
-			return
-				#if FIXES_Single
-					FIXES_BlockUpdate(playerid, true, 0),
-				#else
-					CallRemoteFunction("@FIXES_Kick", "i", playerid),
-				#endif
-					TogglePlayerSpectating(playerid, true),
-					TogglePlayerControllable(playerid, false),
-					SetPVarInt(playerid, FIXES_pvarKick, SetTimerEx(FIXES_gscKick, 1000, 0, FIXES_gscSpec@i, playerid)),
-					FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_KICKED,
-					1;
-		}
-		else
-		{
-			return Kick(playerid);
-		}
-	}
-	
-	#define _ALS_Kick
-	#define Kick FIXES_Kick
-#endif
-
-/* 
- * FIXES_IsPAttachedObjectSlotUsed(playerid, index)
- * 
- * FIXES:
- *     IsPlayerAttachedObjectSlotUsed
- */
-
-#if defined _ALS_IsPAttachedObjSlotUsed
-	#error _ALS_IsPAttachedObjSlotUsed defined
-#endif
-native BAD_IsPlayerAttachedObjSlotUsed(playerid, index) = IsPlayerAttachedObjectSlotUsed;
-
-#if FIX_IsPlayerAttachedObjSlotUsed
-	stock FIXES_IsPAttachedObjectSlotUsed(playerid, index)
-	{
-		if (_FIXES_IS_PLAYER_CONNECTED(playerid))
-		{
-			return FIXES_gsObjectSlots[playerid / _FIXES_ATTACHMENTS] & 1 << playerid % _FIXES_ATTACHMENTS * MAX_PLAYER_ATTACHED_OBJECTS + index;
-		}
-		return 0;
-	}
-	
-	#define _ALS_IsPAttachedObjSlotUsed
-	#define IsPlayerAttachedObjectSlotUsed FIXES_IsPAttachedObjectSlotUsed
-#endif
-
-/* 
- * _FIXES_SetPlayerAttachedObject(slot, to)
- * 
- * FIXES:
- *     IsPlayerAttachedObjectSlotUsed
- */
-
-#if (FIX_IsPlayerAttachedObjSlotUsed || FIX_SetPlayerAttachedObject) && !FIXES_Single
-	forward _FIXES_SetPlayerAttachedObject(slot, to);
-	
-	public _FIXES_SetPlayerAttachedObject(slot, to)
-	{
-		FIXES_gsObjectSlots[slot] = to;
-	}
-#endif
-
-/* 
- * FIXES_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)
- * 
- * FIXES:
- *     IsPlayerAttachedObjectSlotUsed
- *     SetPlayerAttachedObject
- */
-
-#if defined _ALS_SetPlayerAttachedObject
-	#error _ALS_SetPlayerAttachedObject defined
-#endif
-native BAD_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) = SetPlayerAttachedObject;
-
-#if FIX_IsPlayerAttachedObjSlotUsed || FIX_SetPlayerAttachedObject
-	stock FIXES_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)
-	{
-		if (SetPlayerAttachedObject(playerid, index, modelid, bone, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, materialcolor1, materialcolor2))
-		{
-			#if FIXES_Single
-				FIXES_gsObjectSlots[playerid / _FIXES_ATTACHMENTS] |= (1 << playerid % _FIXES_ATTACHMENTS * MAX_PLAYER_ATTACHED_OBJECTS + index);
-			#else
-				new
-					slot = playerid / _FIXES_ATTACHMENTS;
-				CallRemoteFunction(FIXES_gscSetPlayerAttachedObj, FIXES_gscSpec@ii, slot, FIXES_gsObjectSlots[slot] | (1 << playerid % _FIXES_ATTACHMENTS * MAX_PLAYER_ATTACHED_OBJECTS + index));
-			#endif
-			return 1;
-		}
-		return 0;
-	}
-	
-	#define _ALS_SetPlayerAttachedObject
-	#define SetPlayerAttachedObject FIXES_SetPlayerAttachedObject
-#endif
-
-/* 
- * FIXES_RemovePlayerAttachedObj(playerid, index)
- * 
- * FIXES:
- *     IsPlayerAttachedObjectSlotUsed
- */
-
-#if defined _ALS_RemovePlayerAttachedObject
-	#error _ALS_RemovePlayerAttachedObject defined
-#endif
-native BAD_RemovePlayerAttachedObject(playerid, index) = RemovePlayerAttachedObject;
-
-#if FIX_IsPlayerAttachedObjSlotUsed || FIX_SetPlayerAttachedObject
-	stock FIXES_RemovePlayerAttachedObj(playerid, index)
-	{
-		if (RemovePlayerAttachedObject(playerid, index))
-		{
-			#if FIXES_Single
-				FIXES_gsObjectSlots[playerid / _FIXES_ATTACHMENTS] &= ~(1 << playerid % _FIXES_ATTACHMENTS * MAX_PLAYER_ATTACHED_OBJECTS + index);
-			#else
-				new
-					slot = playerid / _FIXES_ATTACHMENTS;
-				CallRemoteFunction(FIXES_gscSetPlayerAttachedObj, FIXES_gscSpec@ii, slot, FIXES_gsObjectSlots[slot] & ~(1 << playerid % _FIXES_ATTACHMENTS * MAX_PLAYER_ATTACHED_OBJECTS + index));
-			#endif
-			return 1;
-		}
-		return 0;
-	}
-	
-	#define _ALS_RemovePlayerAttachedObject
-	#define RemovePlayerAttachedObject FIXES_RemovePlayerAttachedObj
-#endif
-
-/* 
- * _FIXES_DetermineOrder()
- * 
- * Figure out which the first filterscript to be called is so that it can do the
- * majority of the work.  More detail:  Several pieces of code for some fixes
- * rely on things like blocking "OnPlayerUpdate".  This should be done in the
- * first script in which "OnPlayerUpdate" is called only, so we need to find out
- * in advance which script will be called first (at least out of all the fixed
- * scripts).
- */
-
-#if !FIXES_Single
-	public _FIXES_DetermineOrder()
-	{
-		// TODO: Graceful handoff.  I thought I was past all this rubbish!
-		if (!_FIXES_gIsFilterscript)
-		{
-			if (existproperty(5, FIXES_gscNoGMProperty))
-			{
-				return 0;
-			}
-			// Make sure certain data is synced with what the GM thinks it is.
-			// =============================
-			//  BEGIN: AllowInteriorWeapons 
-			// =============================
-			#if FIX_AllowInteriorWeapons
-				CallRemoteFunction(FIXES_gscAllowInteriorWeapons, FIXES_gscSpec@i, !(FIXES_gsSettings & e_FIXES_SETTINGS_INTERIOR));
-			#endif
-			// =============================
-			//  END: AllowInteriorWeapons 
-			// =============================
-			
-			// ================================
-			//  BEGIN: SetPlayerAttachedObject 
-			// ================================
-			#if FIX_IsPlayerAttachedObjSlotUsed || FIX_SetPlayerAttachedObject
-				for (new i = 0; i != _FIXES_ATTACHMENTS; ++i)
-				{
-					CallRemoteFunction(FIXES_gscSetPlayerAttachedObj, FIXES_gscSpec@ii, i, FIXES_gsObjectSlots[i]);
-				}
-			#endif
-			// ==============================
-			//  END: SetPlayerAttachedObject 
-			// ==============================
-		}
-		if (existproperty(5, FIXES_gscOrderProperty))
-		{
-			// Either this is a Filter Script (1) and we don't want gamemodes
-			// (1) or this isn't a filterscript (0) and we do want gamemodes
-			// (0).  All other cases return here due to a logic mismatch.  This
-			// is to rectify the difference in call orders between
-			// "CallRemoteFunction" and normal callbacks.  Now DOESN'T end on
-			// the second time round for filterscripts to correctly pass on the
-			// data to GameModes.
-			if (!existproperty(5, FIXES_gscNoGMProperty) && _FIXES_gIsFilterscript == bool:getproperty(5, FIXES_gscOrderProperty))
-			{
-				// The game mode is not in charge, which means we are checking
-				// the filterscripts a second time and shouldn't be.
-				return 0;
-			}
-			// If this script was previously the owner, and we are not ending
-			// the game mode (in which case discard all data), and if we are
-			// only dealing with filterscripts or the gamemode is now the
-			// master.
-			if (FIXES_gsSettings & (e_FIXES_SETTINGS_IN_CHARGE | e_FIXES_SETTINGS_DROP_ALL_DATA) == e_FIXES_SETTINGS_IN_CHARGE)
-			{
-				FIXES_PRINTF("_FIXES_DetermineOrder: Was in charge");
-				// This script is currently in charge, but a new script has
-				// usurped it!  Pass all relevant data over to the new script.
-				// Also, this wasn't triggered by a game mode change (where we
-				// just want to dump and reset all data).  There is no need to
-				// reset the admin teleport data as that is always handled by
-				// the Game Mode, so it will either be correct, or it will be
-				// blank.
-				FIXES_gsSettings &= ~e_FIXES_SETTINGS_IN_CHARGE;
-				#if FIX_SetPlayerWorldBounds || FIX_TogglePlayerControllable
-					_FIXES_FOREACH(FIXES_gsPlayersIterator, i)
-					{
-						// =================
-						//  BEGIN: GameText 
-						// =================
-						#if FIX_GameText
-							for (new j = 0; j != FIXES_GT_STYLE_COUNT; ++j)
-							{
-								PlayerTextDrawDestroy(i, FIXES_gsPGTStyle[i][j]);
-							}
-						#endif
-						// =================
-						//  END:   GameText 
-						// =================
-						
-						// =============================
-						//  BEGIN: SetPlayerWorldBounds 
-						// =============================
-						#if FIX_SetPlayerWorldBounds
-							// I realised that you could have the GM in charge,
-							// set their bounds, load an FS, remove their bounds
-							// then unload the FS again and it would result in
-							// the old GM setting of them HAVING bounds being
-							// re-applied, so the check is removed.
-							CallRemoteFunction(FIXES_gscSetPlayerWorldBounds, FIXES_gscSpec@iffff, i, FIXES_gsWorldbounds[i][E_FIXES_WORLDBOUND_DATA_UX], FIXES_gsWorldbounds[i][E_FIXES_WORLDBOUND_DATA_LX], FIXES_gsWorldbounds[i][E_FIXES_WORLDBOUND_DATA_UY], FIXES_gsWorldbounds[i][E_FIXES_WORLDBOUND_DATA_LY]);
-						#endif
-						// =============================
-						//  END:   SetPlayerWorldBounds 
-						// =============================
-						
-						// =================================
-						//  BEGIN: TogglePlayerControllable 
-						// =================================
-						#if FIX_TogglePlayerControllable
-							CallRemoteFunction(FIXES_gscTogglePlayerControl, FIXES_gscSpec@ii, i, !(FIXES_gsPlayerBools[i] & e_FIXES_BOOLS_UNCONTROLLABLE));
-						#endif
-						// =================================
-						//  END:   TogglePlayerControllable 
-						// =================================
-						
-						// ===========================
-						//  BEGIN: PutPlayerInVehicle 
-						// ===========================
-						#if FIX_PutPlayerInVehicle
-							if (FIXES_gsPlayerBools[i] & e_FIXES_BOOLS_PUT_IN_VEHICLE)
-							{
-								CallRemoteFunction(FIXES_gscPutPlayerInVehicle, FIXES_gscSpec@iii, i, FIXES_gsVehicleSeatData[i] & 0x00FFFFFF, FIXES_gsVehicleSeatData[i] >>> 24);
-							}
-						#endif
-						// ===========================
-						//  END:   PutPlayerInVehicle 
-						// ===========================
-					}
-				#endif
-				
-				// =================
-				//  BEGIN: GameText 
-				// =================
-				#if FIX_GameText
-					#if FIX_GameTextStyles
-						TextDrawDestroy(FIXES_gsGTStyle[13]),
-						TextDrawDestroy(FIXES_gsGTStyle[12]),
-						TextDrawDestroy(FIXES_gsGTStyle[11]),
-						TextDrawDestroy(FIXES_gsGTStyle[10]),
-						TextDrawDestroy(FIXES_gsGTStyle[9]),
-						TextDrawDestroy(FIXES_gsGTStyle[8]),
-						TextDrawDestroy(FIXES_gsGTStyle[7]),
-					#endif
-						TextDrawDestroy(FIXES_gsGTStyle[6]),
-						TextDrawDestroy(FIXES_gsGTStyle[5]),
-						TextDrawDestroy(FIXES_gsGTStyle[4]),
-						TextDrawDestroy(FIXES_gsGTStyle[3]),
-						TextDrawDestroy(FIXES_gsGTStyle[2]),
-						TextDrawDestroy(FIXES_gsGTStyle[1]),
-						TextDrawDestroy(FIXES_gsGTStyle[0]);
-				#endif
-				// =================
-				//  END:   GameText 
-				// =================
-				
-				FIXES_PRINTF("_FIXES_DetermineOrder: Not in charge");
-				return 0;
-			}
-			else
-			{
-				FIXES_gsSettings &= ~e_FIXES_SETTINGS_IN_CHARGE;
-				FIXES_PRINTF("_FIXES_DetermineOrder: Not in charge");
-				return 0;
-			}
-		}
-		else if (!(FIXES_gsSettings & e_FIXES_SETTINGS_ENDING))
-		{
-			setproperty(5, FIXES_gscOrderProperty, _FIXES_gIsFilterscript);
-			#if FIXES_Debug
-				if (FIXES_gsSettings & e_FIXES_SETTINGS_IN_CHARGE)
-				{
-					FIXES_PRINTF("_FIXES_DetermineOrder: Already in charge");
-				}
-			#endif
-			FIXES_gsSettings |= e_FIXES_SETTINGS_IN_CHARGE;
-			FIXES_PRINTF("_FIXES_DetermineOrder: Now in charge");
-			
-			// =================
-			//  BEGIN: GameText 
-			// =================
-			#if FIX_GameText
-				// Create all the relevant TextDraws.
-				_FIXES_FOREACH(FIXES_gsPlayersIterator, playerid)
-				{
-					_FIXES_CreateGameTextDraws(playerid);
-				}
-				_FIXES_CreateGameTextDraws(INVALID_PLAYER_ID);
-			#endif
-			// =================
-			//  END:   GameText 
-			// =================
-			return 1;
-		}
-		else if (!(FIXES_gsSettings & e_FIXES_SETTINGS_ENDED))
-		{
-			// Only called when a filterscript that is currently master (and
-			// thus called first by "CallRemoteFunction") ends.  This doesn't
-			// get triggered when a gamemode is master, but that doesn't matter
-			// because in that case all the textdraws are destroyed anyway.
-			
-			// =================
-			//  BEGIN: GameText 
-			// =================
-			#if FIX_GameText
-					// Destroy all the relevant TextDraws.
-					_FIXES_FOREACH(FIXES_gsPlayersIterator, playerid)
-					{
-						#if FIX_GameTextStyles
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][13]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][12]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][11]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][10]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][9]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][8]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][7]),
-						#endif
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][6]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][5]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][4]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][3]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][2]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][1]),
-							PlayerTextDrawDestroy(playerid, FIXES_gsPGTStyle[playerid][0]);
-					}
-				#if FIX_GameTextStyles
-					TextDrawDestroy(FIXES_gsGTStyle[13]),
-					TextDrawDestroy(FIXES_gsGTStyle[12]),
-					TextDrawDestroy(FIXES_gsGTStyle[11]),
-					TextDrawDestroy(FIXES_gsGTStyle[10]),
-					TextDrawDestroy(FIXES_gsGTStyle[9]),
-					TextDrawDestroy(FIXES_gsGTStyle[8]),
-					TextDrawDestroy(FIXES_gsGTStyle[7]),
-				#endif
-					TextDrawDestroy(FIXES_gsGTStyle[6]),
-					TextDrawDestroy(FIXES_gsGTStyle[5]),
-					TextDrawDestroy(FIXES_gsGTStyle[4]),
-					TextDrawDestroy(FIXES_gsGTStyle[3]),
-					TextDrawDestroy(FIXES_gsGTStyle[2]),
-					TextDrawDestroy(FIXES_gsGTStyle[1]),
-					TextDrawDestroy(FIXES_gsGTStyle[0]);
-			#endif
-			// =================
-			//  END:   GameText 
-			// =================
-			
-			#if FIXES_Debug
-				FIXES_PRINTF("_FIXES_DetermineOrder: Ending");
-			#endif
-			
-			FIXES_gsSettings |= e_FIXES_SETTINGS_ENDED;
-		}
-		return 0;
-	}
-#endif
-
-/* 
- * FIXES_strins(string[], const substr[], pos, maxlength = sizeof string)
- * 
- * FIXES:
- *     strins
- */
-
-#if defined _ALS_strins
-	#error _ALS_strins defined
-#endif
-native BAD_strins(string[], const substr[], pos, maxlength = sizeof string) = strins;
-
-#if FIX_strins
-	stock FIXES_strins(string[], const substr[], pos, maxlength = sizeof string)
-	{
-		if (string[0] > 255)
-		{
-			new
-				strlength = strlen(string),
-				sublength = strlen(substr),
-				m4 = maxlength * 4;
-			// Packed - format doesn't like these strings.
-			if (strlength + sublength >= m4)
-			{
-				if (pos + sublength >= m4)
-				{
-					return
-						string{pos} = '\0',
-						// Hopefully this doesn't ignore maxlength and does packed.
-						strcat(string, substr, maxlength);
-				}
-				else
-				{
-					// pos + sublength is less than maxlength, so this sum MUST
-					// be positive and gte than "pos", so there's no need for
-					// additional checks.
-					string{maxlength - sublength - 1} = '\0';
-				}
-			}
-			return strins(string, substr, pos, maxlength);
-		}
-		else if (substr[0] > 255)
-		{
-			new
-				strlength = strlen(string),
-				sublength = strlen(substr);
-			// Packed - format doesn't like these strings.
-			if (strlength + sublength >= maxlength)
-			{
-				if (pos + sublength >= maxlength)
-				{
-					return
-						string[pos] = '\0',
-						// Hopefully this doesn't ignore maxlength and does packed.
-						strcat(string, substr, maxlength);
-				}
-				else
-				{
-					// pos + sublength is less than maxlength, so this sum MUST
-					// be positive and gte than "pos", so there's no need for
-					// additional checks.
-					string[maxlength - sublength - 1] = '\0';
-				}
-			}
-			return strins(string, substr, pos, maxlength);
-		}
-		else
-		{
-			return format(string, maxlength, "%.*s%s%s", pos, string, substr, string[pos]);
-		}
-	}
-	
-	#define _ALS_strins
-	#define strins FIXES_strins
-#endif
-
-/* 
- * _FIXES_ApplyAnimation(playerid, animlib, Float:fDelta, loop, lockx, locky, freeze, time, forcesync)
- * 
- * FIXES:
- *     ApplyAnimation_2
- */
-
-#if FIX_ApplyAnimation_2
-	forward _FIXES_ApplyAnimation(playerid, animlib, Float:fDelta, loop, lockx, locky, freeze, time, forcesync);
-	
-	public _FIXES_ApplyAnimation(playerid, animlib, Float:fDelta, loop, lockx, locky, freeze, time, forcesync)
-	{
-		ApplyAnimation(playerid, FIXES_gscAnimLib[animlib], FIXES_gsClassAnimName[playerid], fDelta, loop, lockx, locky, freeze, time, forcesync),
-		FIXES_gsAnimTimer[playerid] = 0;
-	}
-#endif
-
-/* 
- * FIXES_ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
- * 
- * FIXES:
- *     ApplyAnimation
- *     ApplyAnimation_2
- */
-
-#if defined _ALS_ApplyAnimation
-	#error _ALS_ApplyAnimation defined
-#endif
-native BAD_ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0) = ApplyAnimation;
-
-#if FIX_ApplyAnimation || FIX_ApplyAnimation_2
-	stock FIXES_ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
-	{
-		new
-			diff,
-			idx = animlib[0] & ~0x20;
-		// Uses a sort of optimised binary search.  The code first identifies the area in the array
-		// in which libraries with this first letter are, then does a binary search using only that
-		// subset of the array.  This used to use an N-ary search that just went linearly through
-		// the identified subset of the array, and that was 5x faster than a simple linear loop over
-		// the whole array.  This new version is 50% faster than even that was.  "E" has no
-		// libraries, but we don't check for that explicitly as it would slow down the more common
-		// code path - and it ends fairly quickly anyway as "upper == lower".
-		if (_FIXES_IN_RANGE(idx, 'A', 'W' + 1))
-		{
-			new
-				upper = FIXES_gscAnimIndexes[idx - ('A' - 1)],
-				lower = FIXES_gscAnimIndexes[idx - 'A'];
-			while (upper != lower)
-			{
-				idx = (upper - lower) / 2 + lower;
-				if ((diff = strcmp(FIXES_gscAnimLib[idx], animlib, true)))
-				{
-					if (diff > 0) upper = idx;
-					else lower = idx + 1;
-				}
-				else
-				{
-					// If we hit the "else" branch, we have found the correct
-					// animation library from the n-ary search.
-					#if FIX_ApplyAnimation_2
-						if (FIXES_gsAnimTimer[playerid])
-						{
-							KillTimer(FIXES_gsAnimTimer[playerid]),
-							FIXES_gsAnimTimer[playerid] = 0;
-						}
-						if (FIXES_gsPlayerAnimLibs[playerid][idx >>> 5] & (1 << (idx & 0x1F)))
-						{
-							FIXES_gsPlayerAnimLibs[playerid][idx >>> 5] &= ~(1 << (idx & 0x1F)),
-							FIXES_gsClassAnimName[playerid][0] = '\0',
-							strcat(FIXES_gsClassAnimName[playerid], animname),
-							FIXES_gsAnimTimer[playerid] = SetTimerEx("_FIXES_ApplyAnimation", 350, false, "ddfdddddd", playerid, idx, fDelta, loop, lockx, locky, freeze, time, forcesync);
-						}
-					#endif
-						return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
-				}
-			}
-		}
-		return 0;
-	}
-	
-	#define _ALS_ApplyAnimation
-	#define ApplyAnimation FIXES_ApplyAnimation
-#endif
-
-/* 
- * FIXES_random(max)
- * 
- * FIXES:
- *     random
- */
-
-#if defined _ALS_random
-	#error _ALS_random defined
-#endif
-native BAD_random(max) = random;
-
-#if FIX_random
-	stock FIXES_random(max)
-	{
-		if (max < 0)
-		{
-			return -random(-max);
-		}
-		else
-		{
-			return random(max);
-		}
-	}
-	
-	#define _ALS_random
-	#define random FIXES_random
-#endif
-
-/* 
- * _FIXES_SetCamera
- * 
- * FIXES:
- *     SetPlayerCamera
- */
-
-#if FIX_SetPlayerCamera
-	forward _FIXES_SetCamera(playerid, type, Float:x, Float:y, Float:z);
-
-	public _FIXES_SetCamera(playerid, type, Float:x, Float:y, Float:z)
-	{
-		if (type)
-		{
-			SetPlayerCameraPos(playerid, x, y, z);
-		}
-		else
-		{
-			SetPlayerCameraLookAt(playerid, x, y, z);
-		}
-		return 0;
-	}
-#endif
-
-/* 
- * FIXES_SetPlayerCameraLookAt(playerid, Float:x, Float:y, Float:z)
- * 
- * FIXES:
- *     SetPlayerCamera
- */
-
-#if defined _ALS_SetPlayerCameraPos
-	#error _ALS_SetPlayerCameraPos defined
-#endif
-native BAD_SetPlayerCameraPos(playerid, Float:x, Float:y, Float:z) = SetPlayerCameraPos;
-
-#if FIX_SetPlayerCamera
-	stock FIXES_SetPlayerCameraPos(playerid, Float:x, Float:y, Float:z)
-	{
-		if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-		{
-			#if FIXES_Single
-				if (FIXES_gsPlayerBools[playerid] & e_FIXES_BOOLS_SPECTATING || GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
-			#else
-				if (GetPVarInt(playerid, pvarPlayerSpectate) || GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
-			#endif
-				{
-					SetTimerEx(FIXES_gscSetCamera, 300, 0, FIXES_gscSpec@iifff, playerid, 1, x, y, z);
-				}
-				else
-				{
-					SetPlayerCameraPos(playerid, x, y, z);
-				}
-		}
-		return 0;
-	}
-	
-	#define _ALS_SetPlayerCameraPos
-	#define SetPlayerCameraPos FIXES_SetPlayerCameraPos
-#endif
-
-/* 
- * FIXES_SetPlayerCameraLookAt(playerid, Float:x, Float:y, Float:z)
- * 
- * FIXES:
- *     SetPlayerCamera
- */
-
-#if defined _ALS_SetPlayerCameraLookAt
-	#error _ALS_SetPlayerCameraLookAt defined
-#endif
-native BAD_SetPlayerCameraLookAt(playerid, Float:x, Float:y, Float:z) = SetPlayerCameraLookAt;
-
-#if FIX_SetPlayerCamera
-	stock FIXES_SetPlayerCameraLookAt(playerid, Float:x, Float:y, Float:z)
-	{
-		if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-		{
-			#if FIXES_Single
-				if (FIXES_gsPlayerBools[playerid] & e_FIXES_BOOLS_SPECTATING || GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
-			#else
-				if (GetPVarInt(playerid, pvarPlayerSpectate) || GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
-			#endif
-				{
-					SetTimerEx(FIXES_gscSetCamera, 300, 0, FIXES_gscSpec@iifff, playerid, 2, x, y, z);
-				}
-				else
-				{
-					SetPlayerCameraLookAt(playerid, x, y, z);
-				}
-		}
-		return 0;
-	}
-	
-	#define _ALS_SetPlayerCameraLookAt
-	#define SetPlayerCameraLookAt FIXES_SetPlayerCameraLookAt
-#endif
-
-/* 
- * FIXES_TogglePlayerSpectating(playerid, toggle)
- * 
- * FIXES:
- *     SetPlayerCamera
- */
-
-#if defined _ALS_TogglePlayerSpectating
-	#error _ALS_TogglePlayerSpectating defined
-#endif
-native BAD_TogglePlayerSpectating(playerid, toggle) = TogglePlayerSpectating;
-
-#if FIX_SetPlayerCamera
-	stock FIXES_TogglePlayerSpectating(playerid, toggle)
-	{
-		if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-		{
-			if (toggle)
-			{
-				#if FIXES_Single
-					FIXES_gsPlayerBools[playerid] &= ~e_FIXES_BOOLS_SPECTATING;
-				#else
-					DeletePVar(playerid, FIXES_pvarPlayerSpectate);
-				#endif
-			}
-			else
-			{
-				#if FIXES_Single
-					FIXES_gsPlayerBools[playerid] |= e_FIXES_BOOLS_SPECTATING;
-				#else
-					SetPVarInt(playerid, FIXES_pvarPlayerSpectate, 1);
-				#endif
-			}
-			return TogglePlayerSpectating(playerid, toggle);
-		}
-		return 0;
-	}
-	
-	#define _ALS_TogglePlayerSpectating
-	#define TogglePlayerSpectating FIXES_TogglePlayerSpectating
-#endif
-
-/* 
- * FIXES_SetPlayerTime(playerid, hour, minute)
- * 
- * FIXES:
- *     SetPlayerTime
- */
-
-#if defined _ALS_SetPlayerTime
-	#error _ALS_SetPlayerTime defined
-#endif
-native BAD_SetPlayerTime(playerid, hour, minute) = SetPlayerTime;
-
-#if FIX_SetPlayerTime
-	forward _FIXES_SetTime(playerid, hour, minute);
-	
-	public _FIXES_SetTime(playerid, hour, minute)
-	{
-		if (FIXES_gsPlayerBools[playerid] & e_FIXES_BOOLS_ON_PLAYER_CONNECT)
-		{
-			return SetPlayerTime(playerid, hour, minute);
-		}
-		return 0;
-	}
-	
-	stock FIXES_SetPlayerTime(playerid, hour, minute)
-	{
-		if (_FIXES_IN_RANGE(playerid, 0, MAX_PLAYERS))
-		{
-			if (FIXES_gsPlayerBools[playerid] & e_FIXES_BOOLS_ON_PLAYER_CONNECT)
-			{
-				return SetTimerEx(FIXES_gscSetTime, 250, 0, FIXES_gscSpec@iii, playerid, hour, minute);
-			}
-			return SetPlayerTime(playerid, hour, minute);
-		}
-		return 0;
-	}
-	
-	#define _ALS_SetPlayerTime
-	#define SetPlayerTime FIXES_SetPlayerTime
-#endif
-
-/* 
- * FIXES_sleep(const time)
- * 
- * FIXES:
- *     sleep
- */
-
-// Uses a little trick to consume part of the line and thus not match
-// our hooked version.
-#if defined _ALS_sleep
-	#error _ALS_sleep defined
-#endif
-#define BAD_sleep%0\n%9 sleep%0
-
-#if FIX_sleep
-	stock FIXES_sleep(ms)
-	{
-		// Call a native function that does very little, but saves the current
-		// heap pointer.  Then return to save the accurate stack pointer.
-		return heapspace(), ms;
-	}
-	
-	#define _ALS_sleep
-	
-	#define sleep%0\n%9 sleep FIXES_sleep(%0)
-	// This fixes another BIZZARE bug.  Just doing:
-	//
-	//  #define FIXES_sleep(%0;) FIXES_sleep(%0)
-	//
-	// Results in:
-	//
-	//  FIXES_sleep(n));
-	//
-	// Which clearly it shouldn't.  I've stepped through the compilation and that
-	// extra bracket comes from nowhere!
-	#define FIXES_sleep(%0;) FIXES_sleep _FIXES_SLEEP_BRACKET %0);
-	#define _FIXES_SLEEP_BRACKET (
-#endif
-
-/* 
- * _FIXES_AddInternal(array[], value, size)
- * 
- * Add something to an internal linked list.
- */
-
-static stock _FIXES_AddInternal(array[], value, size)
-{
-	if (array[value] <= value)
-	{
-		new
-			last = size,
-			next = array[last];
-		while (next < value)
-		{
-			last = next,
-			next = array[last];
-		}
-		array[next - 1] = value + 1,
-		array[(value - 1) % (size + 1)] = (last + 1) % (size + 1),
-		array[last] = value,
-		array[value] = next;
-	}
-}
-
-/* 
- * _FIXES_RemoveInternal(array[], value, size)
- * 
- * Remove something from an internal linked list.
- */
-
-static stock _FIXES_RemoveInternal(array[], value, size)
-{
-	if (array[value] > value)
-	{
-		static
-			last;
-		// Adjustment for easier "mod"ing.
-		++size,
-		last = (array[(value - 1) % size] - 1) % size,
-		// Store the reverse value here as well as in the previous slot.
-		array[value] =
-			// Copy the next value to the last value.
-			array[(array[last] = array[value]) - 1] =
-				// Set the reverse iterator value.
-				(last + 1) % size;
-	}
-}
-
-#undef _FIXES_CEILDIV
-#undef _FIXES_INFINITY
-#undef _FIXES_N_INFINITY
-#undef _FIXES_ATTACHMENTS
-#undef _FIXES_FOREACH
-#undef _FIXES_IS_UNSET
-#undef _FIXES_IS_IN_CHARGE
-#undef _FIXES_IN_RANGE
-#undef _FIXES_NO_RANGE
-#undef _FIXES_FORWARD
-#undef _FIXES_IS_PLAYER_CONNECTED
-#undef FIXES_PRINTF
-
-#endinput
-
-// Fix inclusion template.
-
-#if !defined FIX_NameOfFixHere
-	#define FIX_NameOfFixHere            (1)
-#elseif _FIXES_IS_UNSET(FIX_NameOfFixHere)
-	#undef FIX_NameOfFixHere
-	#define FIX_NameOfFixHere            (2)
-#endif
-
-// Fix function template.
-
-/* 
- * FIXES_NameOfFixHere
- * 
- * FIXES:
- *     NameOfFixHere
- */
-
-#if defined _ALS_NameOfFixHere
-	#error _ALS_NameOfFixHere defined
-#endif
-native BAD_NameOfFixHere(params) = NameOfFixHere;
-
-#if FIX_NameOfFixHere
-	stock FIXES_NameOfFixHere(params)
-	{
-		return 0;
 	}
-	
-	#define _ALS_NameOfFixHere
-	#define NameOfFixHere FIXES_NameOfFixHere
-#endif
+}

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 416 - 573
pawno/include/foreach.inc


+ 6 - 360
pawno/include/mSelection.inc

@@ -17,168 +17,6 @@ ShowModelSelectionMenuEx(playerid, items_array[], item_amount, header_text[], ex
 forward OnPlayerModelSelection(playerid, response, listid, modelid);
 forward OnPlayerModelSelectionEx(playerid, response, extraid, modelid);
 
-new BuyingVeh[MAX_PLAYERS];
-
-new VehicleNames2[212][] = {
-   "Landstalker",  "Bravura",  "Buffalo", "Linerunner", "Perennial", "Sentinel",
-   "Dumper",  "Firetruck" ,  "Trashmaster" ,  "Stretch",  "Manana",  "Infernus",
-   "Voodoo", "Pony",  "Mule", "Cheetah", "Ambulance",  "Leviathan",  "Moonbeam",
-   "Esperanto", "Taxi",  "Washington",  "Bobcat",  "Mr Whoopee", "BF Injection",
-   "Hunter", "Premier",  "Enforcer",  "Securicar", "Banshee", "Predator", "Bus",
-   "Rhino",  "Barracks",  "Hotknife",  "Trailer",  "Previon", "Coach", "Cabbie",
-   "Stallion", "Rumpo", "RC Bandit",  "Romero", "Packer", "Monster",  "Admiral",
-   "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer",  "Turismo", "Speeder",
-   "Reefer", "Tropic", "Flatbed","Yankee", "Caddy", "Solair","Berkley's RC Van",
-   "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron","RC Raider","Glendale",
-   "Oceanic", "Sanchez", "Sparrow",  "Patriot", "Quad",  "Coastguard", "Dinghy",
-   "Hermes", "Sabre", "Rustler", "ZR-350", "Walton",  "Regina",  "Comet", "BMX",
-   "Burrito", "Camper", "Marquis", "Baggage", "Dozer","Maverick","News Chopper",
-   "Rancher", "FBI Rancher", "Virgo", "Greenwood","Jetmax","Hotring","Sandking",
-   "Blista Compact", "Police Maverick", "Boxville", "Benson","Mesa","RC Goblin",
-   "Hotring Racer", "Hotring Racer", "Bloodring Banger", "Rancher",  "Super GT",
-   "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropdust", "Stunt",
-   "Tanker", "RoadTrain", "Nebula", "Majestic", "Buccaneer", "Shamal",  "Hydra",
-   "FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona",
-   "FBI Truck", "Willard", "Forklift","Tractor","Combine","Feltzer","Remington",
-   "Slamvan", "Blade", "Freight", "Streak","Vortex","Vincent","Bullet","Clover",
-   "Sadler",  "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob",  "Tampa",
-   "Sunrise", "Merit",  "Utility Truck",  "Nevada", "Yosemite", "Windsor",  "Monster",
-   "Monster","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RCTiger",
-   "Flash","Tahoma","Savanna", "Bandito", "Freight", "Trailer", "Kart", "Mower",
-   "Dune", "Sweeper", "Broadway", "Tornado", "AT-400",  "DFT-30", "Huntley",
-   "Stafford", "BF-400", "Newsvan","Tug","Trailer","Emperor","Wayfarer","Euros",
-   "Hotdog", "Club", "Trailer", "Trailer","Andromada","Dodo","RC Cam", "Launch",
-   "Police Car (LSPD)", "Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
-   "Picador",   "S.W.A.T. Van",  "Alpha",   "Phoenix",   "Glendale",   "Sadler",
-   "Luggage Trailer","Luggage Trailer","Stair Trailer", "Boxville", "Farm Plow",
-   "Utility Trailer"
-};
-
-
-enum DEALERSHIP
-{
-	cCarModel,
-	cCarPrice
-}
-new DonateVehicles[][DEALERSHIP] = {
-{481, 12000},
-{509, 12000},
-{477, 425000},
-{468, 55000},
-{521, 100000},
-{541, 555999},
-{429, 560000}
-};
-
-new VehiclePrices[][DEALERSHIP] = {
-{462, 11999},
-{525, 19500},
-{543, 21000},
-{473, 26000},
-{463, 30500},
-{440, 31000},
-{532, 35500},
-{600, 35999},
-{491, 35999},
-{410, 35999},
-{516, 35999},
-{418, 36000},
-{586, 36000},
-{467, 36500},
-{547, 39500},
-{401, 41500},
-{549, 41999},
-{436, 41999},
-{420, 45500},
-{517, 45999},
-{589, 45999},
-{518, 45999},
-{527, 45999},
-{551, 45999},
-{439, 45999},
-{445, 46000},
-{478, 46000},
-{492, 48999},
-{422, 51000},
-{529, 51500},
-{405, 52500},
-{466, 52999},
-{546, 53999},
-{540, 55500},
-{474, 55999},
-{526, 55999},
-{500, 56000},
-{483, 56000},
-{545, 56000},
-{419, 56781},
-{561, 56999},
-{459, 61000},
-{421, 61500},
-{458, 61500},
-{550, 61999},
-{576, 62500},
-{412, 64500},
-{438, 65500},
-{533, 65999},
-{534, 65999},
-{585, 65999},
-{507, 65999},
-{554, 66000},
-{567, 66500},
-{536, 66500},
-{599, 66500},
-{575, 66999},
-{479, 71400},
-{489, 71750},
-{431, 76000},
-{523, 76000},
-{575, 76500},
-{542, 76500},
-{413, 80000},
-{496, 80299},
-{535, 80999},
-{508, 81800},
-{426, 86500},
-{404, 86500},
-{562, 92999},
-{580, 95999},
-{482, 96500},
-{566, 100500},
-{587, 101000},
-{423, 101500},
-{588, 101500},
-{559, 105999},
-{579, 106500},
-{400, 109999},
-{453, 121000},
-{402, 126000},
-{558, 126000},
-{480, 126500},
-{408, 126500},
-{602, 151000},
-{565, 155999},
-{555, 186000},
-{484, 232200},
-{430, 246000},
-{409, 251000},
-{560, 276000},
-{454, 300999},
-{603, 345000},
-{415, 456999},
-{446, 501000},
-{563, 1001000},
-{417, 1001000},
-{487, 2551000},
-{593, 3501000},
-{481, 12000},
-{509, 12000},
-{477, 425000},
-{468, 55000},
-{521, 100000},
-{541, 555999},
-{429, 560000}
-};
-
 // settings static lists
 #define mS_TOTAL_ITEMS         	1000 // Max amount of items from all lists
 #define mS_TOTAL_LISTS			20 // Max amount of lists
@@ -210,7 +48,6 @@ new PlayerText:gBackgroundTextDrawId[MAX_PLAYERS];
 new PlayerText:gNextButtonTextDrawId[MAX_PLAYERS];
 new PlayerText:gPrevButtonTextDrawId[MAX_PLAYERS];
 new PlayerText:gCancelButtonTextDrawId[MAX_PLAYERS];
-new PlayerText:gVehicleName[MAX_PLAYERS][mS_SELECTION_ITEMS];
 new PlayerText:gSelectionItems[MAX_PLAYERS][mS_SELECTION_ITEMS];
 new gSelectionItemsTag[MAX_PLAYERS][mS_SELECTION_ITEMS];
 new gItemAt[MAX_PLAYERS];
@@ -312,37 +149,6 @@ stock PlayerText:mS_CreatePlayerDialogButton(playerid, Float:Xpos, Float:Ypos, F
     return txtInit;
 }
  
- //------------------------------------------------
-forward IsADonateModel(model);
-public IsADonateModel(model)
-{
-	for(new i = 0; i < sizeof(DonateVehicles); i++)
-		if(DonateVehicles[i][cCarModel] == model)
-			return true;
-	return false;
-}
- 
-stock PlayerText:CreateVehicleName(playerid, model, Float:Xpos, Float:Ypos, Float:Width, Float:Height, vehiclename[], vehicleprice)
-{
- 	new PlayerText:txtInit;
-	new str[128];
-	if(IsADonateModel(model))
-		format(str, sizeof(str), "%s~n~$%d~n~~n~~n~~n~~n~~y~[SPECIAL]", vehiclename, vehicleprice);
-	else
-		format(str, sizeof(str), "%s~n~$%d", vehiclename, vehicleprice);
-   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, str);
-   	PlayerTextDrawBackgroundColor(playerid, txtInit, 0x000000FF);
-	PlayerTextDrawLetterSize(playerid, txtInit, 0.3, 1.0);
-	PlayerTextDrawFont(playerid, txtInit, 1);
-	PlayerTextDrawSetShadow(playerid, txtInit, 1); // no shadow
-    PlayerTextDrawSetOutline(playerid, txtInit, 1);
-    PlayerTextDrawColor(playerid, txtInit, 0xC0C0C0FF);
-    PlayerTextDrawTextSize(playerid, txtInit, Height, Width); // The width and height are reversed for centering.. something the game does <g>
-    PlayerTextDrawShow(playerid, txtInit);
-    return txtInit;
-}
- 
- 
 //------------------------------------------------
 
 stock PlayerText:mS_CreatePlayerHeaderTextDraw(playerid, Float:Xpos, Float:Ypos, header_text[])
@@ -359,20 +165,6 @@ stock PlayerText:mS_CreatePlayerHeaderTextDraw(playerid, Float:Xpos, Float:Ypos,
     return txtInit;
 }
 
-stock PlayerText:CreateHeaderBuyableText(playerid, Float:Xpos, Float:Ypos, header_text[])
-{
-	new PlayerText:txtInit;
-   	txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, header_text);
-   	PlayerTextDrawUseBox(playerid, txtInit, 0);
-	PlayerTextDrawLetterSize(playerid, txtInit, 1.25, 3.0);
-	PlayerTextDrawFont(playerid, txtInit, 3);
-	PlayerTextDrawSetShadow(playerid, txtInit, 1);
-    PlayerTextDrawSetOutline(playerid, txtInit, 1);
-    PlayerTextDrawColor(playerid, txtInit, 0x00FF00FF);
-    PlayerTextDrawShow(playerid, txtInit);
-    return txtInit;
-}
-
 //------------------------------------------------
 
 stock PlayerText:mS_CreatePlayerBGTextDraw(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height, bgcolor)
@@ -417,14 +209,6 @@ stock mS_DestroyPlayerMPs(playerid)
 	    if(gSelectionItems[playerid][x] != PlayerText:INVALID_TEXT_DRAW) {
 			PlayerTextDrawDestroy(playerid, gSelectionItems[playerid][x]);
 			gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
-			if(BuyingVeh[playerid] == 1)
-			{
-				if(gVehicleName[playerid][x] != PlayerText:INVALID_TEXT_DRAW) 
-				{
-					PlayerTextDrawDestroy(playerid, gVehicleName[playerid][x]);
-					gVehicleName[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
-				}
-			}
 		}
 		x++;
 	}
@@ -492,79 +276,6 @@ stock mS_ShowPlayerMPs(playerid)
 	}
 }
 
-stock ShowPlayerBuyable(playerid)
-{
-	new bgcolor = GetPVarInt(playerid, "mS_previewBGcolor");
-    new x=0;
-	new Float:BaseX = mS_DIALOG_BASE_X;
-	new Float:BaseY = mS_DIALOG_BASE_Y - (mS_SPRITE_DIM_Y * 0.33); // down a bit
-	new linetracker = 0;
-	
-	new mS_listID = mS_GetPlayerCurrentListID(playerid);
-	if(mS_listID == mS_CUSTOM_LISTID)
-	{
-		new itemat = (GetPVarInt(playerid, "mS_list_page") * mS_SELECTION_ITEMS);
-		new Float:rotzoom[4];
-		rotzoom[0] = GetPVarFloat(playerid, "mS_custom_Xrot");
-		rotzoom[1] = GetPVarFloat(playerid, "mS_custom_Yrot");
-		rotzoom[2] = GetPVarFloat(playerid, "mS_custom_Zrot");
-		rotzoom[3] = GetPVarFloat(playerid, "mS_custom_Zoom");
-		new itemamount = mS_GetAmountOfListItemsEx(playerid);
-		// Destroy any previous ones created
-		mS_DestroyPlayerMPs(playerid);
-
-		while(x != mS_SELECTION_ITEMS && itemat < (itemamount)) {
-			if(linetracker == 0) {
-				BaseX = mS_DIALOG_BASE_X + 25.0; // in a bit from the box
-				BaseY += mS_SPRITE_DIM_Y + 1.0; // move on the Y for the next line
-			}	
-			gSelectionItems[playerid][x] = mS_CreateMPTextDraw(playerid, gCustomList[playerid][itemat], BaseX, BaseY, rotzoom[0], rotzoom[1], rotzoom[2], rotzoom[3], mS_SPRITE_DIM_X, mS_SPRITE_DIM_Y, bgcolor);
-			gSelectionItemsTag[playerid][x] = gCustomList[playerid][itemat];
-			BaseX += mS_SPRITE_DIM_X + 1.0; // move on the X for the next sprite
-			linetracker++;
-			if(linetracker == mS_ITEMS_PER_LINE) linetracker = 0;
-			itemat++;
-			x++;
-		}
-	}
-	else
-	{
-		new itemat = (gLists[mS_listID][mS_LIST_START] + (GetPVarInt(playerid, "mS_list_page") * mS_SELECTION_ITEMS));
-		
-		// Destroy any previous ones created
-		mS_DestroyPlayerMPs(playerid);
-		while(x != mS_SELECTION_ITEMS && itemat < (gLists[mS_listID][mS_LIST_END]+1)) {
-			if(linetracker == 0) {
-				BaseX = mS_DIALOG_BASE_X + 25.0; // in a bit from the box
-				BaseY += mS_SPRITE_DIM_Y + 1.0; // move on the Y for the next line
-			}
-			new rzID = gItemList[itemat][mS_ITEM_ROT_ZOOM_ID]; // avoid long line
-			if(rzID > -1) gSelectionItems[playerid][x] = mS_CreateMPTextDraw(playerid, gItemList[itemat][mS_ITEM_MODEL], BaseX, BaseY, gRotZoom[rzID][0], gRotZoom[rzID][1], gRotZoom[rzID][2], gRotZoom[rzID][3], mS_SPRITE_DIM_X, mS_SPRITE_DIM_Y, bgcolor);
-			else gSelectionItems[playerid][x] = mS_CreateMPTextDraw(playerid, gItemList[itemat][mS_ITEM_MODEL], BaseX, BaseY, 0.0, 0.0, 0.0, 1.0, mS_SPRITE_DIM_X, mS_SPRITE_DIM_Y, bgcolor);
-			
-			gVehicleName[playerid][x] = CreateVehicleName(playerid, gItemList[itemat][mS_ITEM_MODEL], BaseX, BaseY, mS_SPRITE_DIM_X, mS_SPRITE_DIM_Y, VehicleNames2[gItemList[itemat][mS_ITEM_MODEL]-400], GetVehiclePrice2(gItemList[itemat][mS_ITEM_MODEL]));
-			
-			gSelectionItemsTag[playerid][x] = gItemList[itemat][mS_ITEM_MODEL];
-			BaseX += mS_SPRITE_DIM_X + 1.0; // move on the X for the next sprite
-			linetracker++;
-			if(linetracker == mS_ITEMS_PER_LINE) linetracker = 0;
-			itemat++;
-			x++;
-		}
-	}
-}
-
-stock GetVehiclePrice2(model)
-{
-	for(new i = 0; i < sizeof(VehiclePrices); i++)
-	{
-		if(model == VehiclePrices[i][cCarModel])
-			return VehiclePrices[i][cCarPrice];
-	}
-	return 0;
-}
-
-
 //------------------------------------------------
 
 stock mS_UpdatePageTextDraw(playerid)
@@ -600,33 +311,9 @@ stock ShowModelSelectionMenu(playerid, ListID, header_text[], dialogBGcolor = 0x
     gNextButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 30.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_NEXT_TEXT);
     gPrevButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 90.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_PREV_TEXT);
     gCancelButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 150.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_CANCEL_TEXT);
-	
-	SetPVarInt(playerid, "mS_previewBGcolor", previewBGcolor);
-    mS_ShowPlayerMPs(playerid);
-    mS_UpdatePageTextDraw(playerid);
-	
-	SelectTextDraw(playerid, tdSelectionColor);
-	return 1;
-}
 
-stock ShowModelSelectionMenu2(playerid, ListID, header_text[], dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA)
-{
-	if(!(0 <= ListID < mS_TOTAL_LISTS && gLists[ListID][mS_LIST_START] != gLists[ListID][mS_LIST_END])) return 0;
-	mS_DestroySelectionMenu(playerid);
-	SetPVarInt(playerid, "mS_list_page", 0);
-	SetPVarInt(playerid, "mS_list_id", ListID);
-	SetPVarInt(playerid, "mS_list_active", 1);
-	SetPVarInt(playerid, "mS_list_time", GetTickCount());
-
-    gBackgroundTextDrawId[playerid] = mS_CreatePlayerBGTextDraw(playerid, mS_DIALOG_BASE_X, mS_DIALOG_BASE_Y + 20.0, mS_DIALOG_WIDTH, mS_DIALOG_HEIGHT, dialogBGcolor);
-    gHeaderTextDrawId[playerid] = CreateHeaderBuyableText(playerid, mS_DIALOG_BASE_X, mS_DIALOG_BASE_Y, header_text);
-    gCurrentPageTextDrawId[playerid] = mS_CreateCurrentPageTextDraw(playerid, mS_DIALOG_WIDTH - 30.0, mS_DIALOG_BASE_Y + 15.0);
-    gNextButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 30.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_NEXT_TEXT);
-    gPrevButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 90.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_PREV_TEXT);
-    gCancelButtonTextDrawId[playerid] = mS_CreatePlayerDialogButton(playerid, mS_DIALOG_WIDTH - 150.0, mS_DIALOG_BASE_Y+mS_DIALOG_HEIGHT+100.0, 50.0, 16.0, mS_CANCEL_TEXT);
-	BuyingVeh[playerid] = 1;
 	SetPVarInt(playerid, "mS_previewBGcolor", previewBGcolor);
-    ShowPlayerBuyable(playerid);
+    mS_ShowPlayerMPs(playerid);
     mS_UpdatePageTextDraw(playerid);
 	
 	SelectTextDraw(playerid, tdSelectionColor);
@@ -735,15 +422,11 @@ public OnPlayerConnect(playerid)
     gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
     gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
     gCancelButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
-
+    
     for(new x=0; x < mS_SELECTION_ITEMS; x++) {
         gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
 	}
 	
-	for(new x=0; x < mS_SELECTION_ITEMS; x++) {
-        gVehicleName[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
-	}
-	
 	gItemAt[playerid] = 0;
 	
 	return CallLocalFunction("MP_OPC", "i", playerid);
@@ -835,18 +518,7 @@ public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
 		{			
 			if(curpage < (mS_GetNumberOfPagesEx(playerid) - 1)) {
 				SetPVarInt(playerid, "mS_list_page", curpage + 1);
-				if(BuyingVeh[playerid] == 1)
-				{
-					for(new x=0; x < mS_SELECTION_ITEMS; x++) 
-					{
-						PlayerTextDrawDestroy(playerid, gVehicleName[playerid][x]);
-					}
-					ShowPlayerBuyable(playerid);
-				}
-				else
-				{
-					mS_ShowPlayerMPs(playerid);
-				}
+				mS_ShowPlayerMPs(playerid);
 				mS_UpdatePageTextDraw(playerid);
 				PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
 			} else {
@@ -857,18 +529,7 @@ public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
 		{
 			if(curpage < (mS_GetNumberOfPages(listID) - 1)) {
 				SetPVarInt(playerid, "mS_list_page", curpage + 1);
-				if(BuyingVeh[playerid] == 1)
-				{
-					for(new x=0; x < mS_SELECTION_ITEMS; x++) 
-					{
-						PlayerTextDrawDestroy(playerid, gVehicleName[playerid][x]);
-					}
-					ShowPlayerBuyable(playerid);
-				}
-				else
-				{
-					mS_ShowPlayerMPs(playerid);
-				}
+				mS_ShowPlayerMPs(playerid);
 				mS_UpdatePageTextDraw(playerid);
 				PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
 			} else {
@@ -882,18 +543,7 @@ public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
 	if(playertextid == gPrevButtonTextDrawId[playerid]) {
 	    if(curpage > 0) {
 	    	SetPVarInt(playerid, "mS_list_page", curpage - 1);
-			if(BuyingVeh[playerid] == 1)
-			{
-				for(new x=0; x < mS_SELECTION_ITEMS; x++) 
-				{
-					PlayerTextDrawDestroy(playerid, gVehicleName[playerid][x]);
-				}
-				ShowPlayerBuyable(playerid);	
-			}
-	    	else
-			{
-				mS_ShowPlayerMPs(playerid);
-			}
+	    	mS_ShowPlayerMPs(playerid);
 	    	mS_UpdatePageTextDraw(playerid);
 	    	PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
 		} else {
@@ -921,10 +571,6 @@ public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
 				PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
 				new item_id = gSelectionItemsTag[playerid][x];
 				HideModelSelectionMenu(playerid);
-				if(BuyingVeh[playerid] == 1)
-				{
-					BuyingVeh[playerid] = 0;
-				}
 				CallLocalFunction("OnPlayerModelSelection", "dddd", playerid, 1, listID, item_id);
 				return 1;
 			}
@@ -1066,4 +712,4 @@ stock mS_strtok(const string[], &index)
 	}
 	result[index - offset] = EOS;
 	return result;
-}
+}

+ 163 - 131
pawno/include/progress.inc

@@ -1,15 +1,10 @@
 /**
  *  Progress Bar 1.3.1.0
  *  Copyright 2007-2010 Infernus' Group,
- *  Fl?vio Toribio (flavio_toibio@hotmail.com)
- *
- *  Updated by Southclaw for use with the PlayerTextDraws of 0.3e
- *  Updated again by Southclaw for some bugfixes and removal of the per-player textdraw array
- *  Textdraw IDs are now kept in a separate array that isn't per-player, to save memory.
- *
+ *  Flávio Toribio (flavio_toribio@hotmail.com)
  */
 
-#if defined _playerprogress_included
+#if defined _progress_included
 	#endinput
 #endif
 
@@ -22,213 +17,250 @@
 
 #tryinclude <foreach>
 
-#define _playerprogress_included
-#define _playerprogress_version	0x1310
+#define _progress_included
+#define _progress_version	0x1310
 
-#define MAX_PLAYER_BARS				(MAX_PLAYER_TEXT_DRAWS / 3)
-#define INVALID_PLAYER_BAR_VALUE	(Float:0xFFFFFFFF)
-#define INVALID_PLAYER_BAR_ID		(PlayerBar:-1)
+#define MAX_BARS				(MAX_TEXT_DRAWS / 3)
+#define INVALID_BAR_VALUE		(Float:0xFFFFFFFF)
+#define INVALID_BAR_ID			(Bar:-1)
 #define pb_percent(%1,%2,%3,%4)	((%1 - 6.0) + ((((%1 + 6.0 + %2 - 2.0) - %1) / %3) * %4))
 //pb_percent(x, width, max, value)
 
 /* Pawno/Infernus Pawn Editor function list
-native PlayerBar:CreatePlayerProgressBar(playerid, Float:x, Float:y, Float:width=55.5, Float:height=3.2, color, Float:max=100.0);
-native DestroyPlayerProgressBar(playerid, PlayerBar:barid);
-native ShowPlayerProgressBar(playerid, PlayerBar:barid);
-native HidePlayerProgressBar(playerid, PlayerBar:barid);
-native SetPlayerProgressBarValue(playerid, PlayerBar:barid, Float:value);
-native Float:GetPlayerProgressBarValue(playerid, PlayerBar:barid);
-native SetPlayerProgressBarMaxValue(playerid, PlayerBar:barid, Float:max);
-native SetPlayerProgressBarColor(playerid, PlayerBar:barid, color);
-native UpdatePlayerProgressBar(playerid, PlayerBar:barid);
+native Bar:CreateProgressBar(Float:x, Float:y, Float:width=55.5, Float:height=3.2, color, Float:max=100.0);
+native DestroyProgressBar(Bar:barid);
+native ShowProgressBarForPlayer(playerid, Bar:barid);
+native HideProgressBarForPlayer(playerid, Bar:barid);
+native ShowProgressBarForAll(Bar:barid);
+native HideProgressBarForAll(Bar:barid);
+native SetProgressBarValue(Bar:barid, Float:value);
+native Float:GetProgressBarValue(Bar:barid);
+native SetProgressBarMaxValue(Bar:barid, Float:max);
+native SetProgressBarColor(Bar:barid, color);
+native UpdateProgressBar(Bar:barid, playerid=INVALID_PLAYER_ID);
 */
 
-forward PlayerBar:CreatePlayerProgressBar(playerid, Float:x, Float:y, Float:width=55.5, Float:height=3.2, color, Float:max=100.0);
-forward Float:GetPlayerProgressBarValue(playerid, PlayerBar:barid);
+forward Bar:CreateProgressBar(Float:x, Float:y, Float:width=55.5, Float:height=3.2, color, Float:max=100.0);
+forward Float:GetProgressBarValue(Bar:barid);
 
-enum E_BAR_DATA
+enum e_bar
 {
-	Float:pbar_x,
-	Float:pbar_y,
-	Float:pbar_w,
-	Float:pbar_h,
-	Float:pbar_m,
-	Float:pbar_v,
-	pbar_colour,
-	bool:pbar_valid
+	Float:pb_x,
+	Float:pb_y,
+	Float:pb_w,
+	Float:pb_h,
+	Float:pb_m,
+	Float:pb_v,
+	Text:pb_t1,
+	Text:pb_t2,
+	Text:pb_t3,
+	pb_color,
+	bool:pb_created
 }
-enum E_BAR_TEXT_DRAW
-{
-	PlayerText:pbar_textdraw1,
-	PlayerText:pbar_textdraw2,
-	PlayerText:pbar_textdraw3,
-}
-
-static
-	PlayerBars[MAX_PLAYERS][MAX_PLAYER_BARS][E_BAR_DATA],
-	PlayerBarText[MAX_PLAYER_BARS][E_BAR_TEXT_DRAW];
 
+static Bars[MAX_BARS][e_bar];
 
-stock PlayerBar:CreatePlayerProgressBar(playerid, Float:x, Float:y, Float:width=55.5, Float:height=3.2, color, Float:max=100.0)
+stock Bar:CreateProgressBar(Float:x, Float:y, Float:width=55.5, Float:height=3.2, color, Float:max=100.0)
 {
 	new
 		barid;
 
-	for(barid = 0; barid < MAX_PLAYER_BARS; ++barid) // Changed from `Bars` to `MAX_PLAYER_BARS` rather than getting the size of the second cell
-		if(!PlayerBars[playerid][barid][pbar_valid]) break;
-
-	if(PlayerBars[playerid][barid][pbar_valid] || barid == MAX_PLAYER_BARS)
-		return INVALID_PLAYER_BAR_ID;
-
-	new PlayerText:in_t = PlayerBarText[barid][pbar_textdraw1] = CreatePlayerTextDraw(playerid, x, y, "_");
-	PlayerTextDrawUseBox		(playerid, in_t, 1);
-	PlayerTextDrawTextSize		(playerid, in_t, x + width, 0.0);
-	PlayerTextDrawLetterSize	(playerid, in_t, 1.0, height / 10);
-	PlayerTextDrawBoxColor		(playerid, in_t, 0x00000000 | (color & 0x000000FF));
-
-	in_t = PlayerBarText[barid][pbar_textdraw2] = CreatePlayerTextDraw(playerid, x + 1.2, y + 2.15, "_");
-	PlayerTextDrawUseBox		(playerid, in_t, 1);
-	PlayerTextDrawTextSize		(playerid, in_t, x + width - 2.0, 0.0);
-	PlayerTextDrawLetterSize	(playerid, in_t, 1.0, height / 10 - 0.35);
-	PlayerTextDrawBoxColor		(playerid, in_t, (color & 0xFFFFFF00) | (0x66 & ((color & 0x000000FF) / 2)));
-
-	in_t = PlayerBarText[barid][pbar_textdraw3] = CreatePlayerTextDraw(playerid, x + 1.2, y + 2.15, "_");
-	PlayerTextDrawTextSize		(playerid, in_t, pb_percent(x, width, max, 1.0), 0.0);
-	PlayerTextDrawLetterSize	(playerid, in_t, 1.0, height / 10 - 0.35);
-	PlayerTextDrawBoxColor		(playerid, in_t, color);
-
-	PlayerBars[playerid][barid][pbar_x] = x;
-	PlayerBars[playerid][barid][pbar_y] = y;
-	PlayerBars[playerid][barid][pbar_w] = width;
-	PlayerBars[playerid][barid][pbar_h] = height;
-	PlayerBars[playerid][barid][pbar_m] = max;
-	PlayerBars[playerid][barid][pbar_colour] = color;
-	PlayerBars[playerid][barid][pbar_valid] = true;
-	return PlayerBar:barid;
+	for(barid = 0; barid < sizeof Bars; ++barid)
+		if(!Bars[barid][pb_created]) break;
+
+	if(Bars[barid][pb_created] || barid == sizeof Bars)
+		return INVALID_BAR_ID;
+
+	new Text:in_t = Bars[barid][pb_t1] = TextDrawCreate(x, y, "_");
+	TextDrawUseBox		(in_t, 1);
+	TextDrawTextSize	(in_t, x + width, 0.0);
+	TextDrawLetterSize	(in_t, 1.0, height / 10);
+	TextDrawBoxColor	(in_t, 0x00000000 | (color & 0x000000FF));
+
+	in_t = Bars[barid][pb_t2] = TextDrawCreate(x + 1.2, y + 2.15, "_");
+	TextDrawUseBox		(in_t, 1);
+	TextDrawTextSize	(in_t, x + width - 2.0, 0.0);
+	TextDrawLetterSize	(in_t, 1.0, height / 10 - 0.35);
+	TextDrawBoxColor	(in_t, (color & 0xFFFFFF00) | (0x66 & ((color & 0x000000FF) / 2)));
+
+	in_t = Bars[barid][pb_t3] = TextDrawCreate(x + 1.2, y + 2.15, "_");
+	TextDrawTextSize	(in_t, pb_percent(x, width, max, 1.0), 0.0);
+	TextDrawLetterSize	(in_t, 1.0, height / 10 - 0.35);
+	TextDrawBoxColor	(in_t, color);
+
+	Bars[barid][pb_x] = x;
+	Bars[barid][pb_y] = y;
+	Bars[barid][pb_w] = width;
+	Bars[barid][pb_h] = height;
+	Bars[barid][pb_m] = max;
+	Bars[barid][pb_color] = color;
+	Bars[barid][pb_created] = true;
+	return Bar:barid;
 }
 
-stock DestroyPlayerProgressBar(playerid, PlayerBar:barid)
+stock DestroyProgressBar(Bar:barid)
 {
-	if(barid != INVALID_PLAYER_BAR_ID && PlayerBar:-1 < barid < PlayerBar:MAX_PLAYER_BARS)
+	if(barid != INVALID_BAR_ID && Bar:-1 < barid < Bar:MAX_BARS)
 	{
-		if(!PlayerBars[playerid][_:barid][pbar_valid])
+		if(!Bars[_:barid][pb_created])
 			return 0;
 
-		PlayerTextDrawDestroy(playerid, PlayerBarText[_:barid][pbar_textdraw1]);
-		PlayerTextDrawDestroy(playerid, PlayerBarText[_:barid][pbar_textdraw2]);
-		PlayerTextDrawDestroy(playerid, PlayerBarText[_:barid][pbar_textdraw3]);
-
-		PlayerBars[playerid][_:barid][pbar_x] = 0.0;
-		PlayerBars[playerid][_:barid][pbar_y] = 0.0;
-		PlayerBars[playerid][_:barid][pbar_w] = 0.0;
-		PlayerBars[playerid][_:barid][pbar_h] = 0.0;
-		PlayerBars[playerid][_:barid][pbar_m] = 0.0;
-		PlayerBars[playerid][_:barid][pbar_v] = 0.0;
-		PlayerBars[playerid][_:barid][pbar_colour] = 0;
-		PlayerBars[playerid][_:barid][pbar_valid] = false;
+		TextDrawDestroy(Bars[_:barid][pb_t1]);
+		TextDrawDestroy(Bars[_:barid][pb_t2]);
+		TextDrawDestroy(Bars[_:barid][pb_t3]);
+
+		Bars[_:barid][pb_t1] = Text:0;       
+		Bars[_:barid][pb_t2] = Text:0;       
+		Bars[_:barid][pb_t3] = Text:0;
+		Bars[_:barid][pb_x] = 0.0;
+		Bars[_:barid][pb_y] = 0.0;
+		Bars[_:barid][pb_w] = 0.0;
+		Bars[_:barid][pb_h] = 0.0;
+		Bars[_:barid][pb_m] = 0.0;
+		Bars[_:barid][pb_v] = 0.0;
+		Bars[_:barid][pb_color] = 0;
+		Bars[_:barid][pb_created] = false;
 		return 1;
 	}
 	return 0;
 }
 
-stock ShowPlayerProgressBar(playerid, PlayerBar:barid)
+stock ShowProgressBarForPlayer(playerid, Bar:barid)
 {
-	if(IsPlayerConnected(playerid) && barid != INVALID_PLAYER_BAR_ID && PlayerBar:-1 < barid < PlayerBar:MAX_PLAYER_BARS)
+	if(IsPlayerConnected(playerid) && barid != INVALID_BAR_ID && Bar:-1 < barid < Bar:MAX_BARS)
 	{
-		if(!PlayerBars[playerid][_:barid][pbar_valid])
+		if(!Bars[_:barid][pb_created])
 			return 0;
 
-		PlayerTextDrawShow(playerid, PlayerBarText[_:barid][pbar_textdraw1]);
-		PlayerTextDrawShow(playerid, PlayerBarText[_:barid][pbar_textdraw2]);
-		PlayerTextDrawShow(playerid, PlayerBarText[_:barid][pbar_textdraw3]);
+		TextDrawShowForPlayer(playerid, Bars[_:barid][pb_t1]);
+		TextDrawShowForPlayer(playerid, Bars[_:barid][pb_t2]);
+		TextDrawShowForPlayer(playerid, Bars[_:barid][pb_t3]);
 		return 1;
 	}
 	return 0;
 }
 
-stock HidePlayerProgressBar(playerid, PlayerBar:barid)
+stock HideProgressBarForPlayer(playerid, Bar:barid)
 {
-	if(IsPlayerConnected(playerid) && barid != INVALID_PLAYER_BAR_ID && PlayerBar:-1 < barid < PlayerBar:MAX_PLAYER_BARS)
+	if(IsPlayerConnected(playerid) && barid != INVALID_BAR_ID && Bar:-1 < barid < Bar:MAX_BARS)
 	{
-		if(!PlayerBars[playerid][_:barid][pbar_valid])
+		if(!Bars[_:barid][pb_created])
 			return 0;
 
-		PlayerTextDrawHide(playerid, PlayerBarText[_:barid][pbar_textdraw1]);
-		PlayerTextDrawHide(playerid, PlayerBarText[_:barid][pbar_textdraw2]);
-		PlayerTextDrawHide(playerid, PlayerBarText[_:barid][pbar_textdraw3]);
+		TextDrawHideForPlayer(playerid, Bars[_:barid][pb_t1]);
+		TextDrawHideForPlayer(playerid, Bars[_:barid][pb_t2]);
+		TextDrawHideForPlayer(playerid, Bars[_:barid][pb_t3]);
 		return 1;
 	}
 	return 0;
 }
 
-stock SetPlayerProgressBarValue(playerid, PlayerBar:barid, Float:value)
+stock SetProgressBarValue(Bar:barid, Float:value)
 {
-	if(barid == INVALID_PLAYER_BAR_ID || PlayerBar:MAX_PLAYER_BARS < barid < PlayerBar:-1)
+	if(barid == INVALID_BAR_ID || Bar:MAX_BARS < barid < Bar:-1)
 		return 0;
 
-	if(PlayerBars[playerid][_:barid][pbar_valid])
+	if(Bars[_:barid][pb_created])
 	{
 		value =
-			(value < 0.0) ? (0.0) : (value > PlayerBars[playerid][_:barid][pbar_m]) ? (PlayerBars[playerid][_:barid][pbar_m]) : (value);
+			(value < 0.0) ? (0.0) : (value > Bars[_:barid][pb_m]) ? (Bars[_:barid][pb_m]) : (value);
 
-		PlayerTextDrawUseBox(playerid, PlayerBarText[_:barid][pbar_textdraw3], value > 0.0);
+		TextDrawUseBox(Bars[_:barid][pb_t3], value > 0.0);
 
-        PlayerBars[playerid][_:barid][pbar_v] = value;
+        Bars[_:barid][pb_v] = value;
+
+		TextDrawTextSize(Bars[_:barid][pb_t3],
+			pb_percent(Bars[_:barid][pb_x], Bars[_:barid][pb_w], Bars[_:barid][pb_m], value), 0.0);
 
-		PlayerTextDrawTextSize(playerid, PlayerBarText[_:barid][pbar_textdraw3],
-			pb_percent(PlayerBars[playerid][_:barid][pbar_x], PlayerBars[playerid][_:barid][pbar_w], PlayerBars[playerid][_:barid][pbar_m], value), 0.0);
-		HidePlayerProgressBar(playerid, PlayerBar:barid);
-		ShowPlayerProgressBar(playerid, PlayerBar:barid);
 		return 1;
 	}
 	return 0;
 }
 
-stock Float:GetPlayerProgressBarValue(playerid, PlayerBar:barid)
+stock Float:GetProgressBarValue(Bar:barid)
 {
-	if(barid == INVALID_PLAYER_BAR_ID || PlayerBar:MAX_PLAYER_BARS < barid < PlayerBar:-1)
-		return INVALID_PLAYER_BAR_VALUE;
+	if(barid == INVALID_BAR_ID || Bar:MAX_BARS < barid < Bar:-1)
+		return INVALID_BAR_VALUE;
 
-	if(PlayerBars[playerid][_:barid][pbar_valid])
-		return PlayerBars[playerid][_:barid][pbar_v];
+	if(Bars[_:barid][pb_created])
+		return Bars[_:barid][pb_v];
 
-	return INVALID_PLAYER_BAR_VALUE;
+	return INVALID_BAR_VALUE; 
 }
 
-stock SetPlayerProgressBarMaxValue(playerid, PlayerBar:barid, Float:max)
+stock SetProgressBarMaxValue(Bar:barid, Float:max)
 {
-	if(barid == INVALID_PLAYER_BAR_ID || PlayerBar:MAX_PLAYER_BARS < barid < PlayerBar:-1)
+	if(barid == INVALID_BAR_ID || Bar:MAX_BARS < barid < Bar:-1)
 		return 0;
 
-	if(PlayerBars[playerid][_:barid][pbar_valid])
+	if(Bars[_:barid][pb_created])
 	{
-		PlayerBars[playerid][_:barid][pbar_m] = max;
-		SetPlayerProgressBarValue(playerid, barid, PlayerBars[playerid][_:barid][pbar_v]);
+		Bars[_:barid][pb_m] = max;
+		SetProgressBarValue(barid, Bars[_:barid][pb_v]);
 		return 1;
 	}
 	return 0;
 }
 
-stock SetPlayerProgressBarColor(playerid, PlayerBar:barid, color)
+stock SetProgressBarColor(Bar:barid, color)
 {
-	if(barid == INVALID_PLAYER_BAR_ID || PlayerBar:MAX_PLAYER_BARS < barid < PlayerBar:-1)
+	if(barid == INVALID_BAR_ID || Bar:MAX_BARS < barid < Bar:-1)
 		return 0;
 
-	if(PlayerBars[playerid][_:barid][pbar_valid])
+	if(Bars[_:barid][pb_created])
 	{	
-		PlayerBars[playerid][_:barid][pbar_colour] = color;
-		PlayerTextDrawBoxColor(playerid, PlayerBarText[_:barid][pbar_textdraw1], 0x00000000 | (color & 0x000000FF));
+		Bars[_:barid][pb_color] = color;
+		TextDrawBoxColor(Bars[_:barid][pb_t1], 0x00000000 | (color & 0x000000FF));
 
-		PlayerTextDrawBoxColor(playerid, PlayerBarText[_:barid][pbar_textdraw2],
+		TextDrawBoxColor(Bars[_:barid][pb_t2],
 			(color & 0xFFFFFF00) | (0x66 & ((color & 0x000000FF) / 2)));
 
-		PlayerTextDrawBoxColor(playerid, PlayerBarText[_:barid][pbar_textdraw3], color);
+		TextDrawBoxColor(Bars[_:barid][pb_t3], color);
 		return 1;
 	}
 	return 0;
 }
 
-stock UpdatePlayerProgressBar(playerid, PlayerBar:barid)
+stock ShowProgressBarForAll(Bar:barid)
+{
+	#if defined _foreach_included
+	foreach(Player, i)
+	#else
+	for(new i = 0; i < MAX_PLAYERS; ++i)
+		if(IsPlayerConnected(i))
+	#endif
+	#if defined IsPlayerNPC
+		if(!IsPlayerNPC(i))
+	#endif
+	{
+		ShowProgressBarForPlayer(i, barid);
+	}
+	return 1;
+}
+
+stock HideProgressBarForAll(Bar:barid)
+{
+	#if defined _foreach_included
+	foreach(Player, i)
+	#else
+	for(new i = 0; i < MAX_PLAYERS; ++i)
+		if(IsPlayerConnected(i))
+	#endif
+	#if defined IsPlayerNPC
+		if(!IsPlayerNPC(i))
+	#endif
+	{
+		HideProgressBarForPlayer(i, barid);
+	}
+	return 1;
+}
+
+stock UpdateProgressBar(Bar:barid, playerid=INVALID_PLAYER_ID)
 {
-	return ShowPlayerProgressBar(playerid, barid);
+	if(playerid == INVALID_PLAYER_ID)
+	{
+		return ShowProgressBarForAll(barid);
+	} else {
+		return ShowProgressBarForPlayer(playerid, barid);
+	}
 }

+ 2 - 2
pawno/include/sii.inc

@@ -11,12 +11,12 @@
 #if defined MAX_STRING
 	#define INI_MAX_VALUE MAX_STRING
 #else
-	#define INI_MAX_VALUE 256
+	#define INI_MAX_VALUE 128
 #endif
 #define INI_MAX_KEY 24
 #define INI_MAX_LINE (INI_MAX_KEY + INI_MAX_VALUE + 3)
 #define INI_MAX_FILENAME 256
-#define INI_MAX_LINES 768
+#define INI_MAX_LINES 256
 
 
 enum E_CACHE

+ 312 - 306
pawno/include/sscanf2.inc

@@ -1,5 +1,5 @@
 /*
- *  sscanf 2.8.2
+ *  sscanf 2.8.3
  *  Created by Y_Less, updated by Emmet_.
  *
  *  Version: MPL 1.1
@@ -27,6 +27,12 @@
  *      SA:MP Team past, present and future
  */
 
+#if !defined _INC_SSCANF
+	#define _INC_SSCANF
+#else
+	#endinput
+#endif
+
 #if defined _inc_a_npc
 	#pragma library sscanf
 #elseif !defined _samp_included
@@ -110,8 +116,8 @@ static stock
 					if (!SSCANF_g_sPlayers{i})
 					{
 						new
-							name[MAX_PLAYER_NAME];
-						GetPlayerName(i, name, sizeof (name));
+							name[MAX_PLAYER_NAME + 1];
+						GetPlayerName(i, name, sizeof(name));
 						// We have no way to know if they are an NPC or not!
 						SSCANF_Join(i, name, 0);
 						SSCANF_g_sPlayers{i} = 1;
@@ -140,21 +146,21 @@ static stock
 	public OnFilterScriptInit()
 	{
 	    new
-     		name[MAX_PLAYER_NAME];
-	
+     		name[MAX_PLAYER_NAME + 1];
+
 		SSCANF_Init(GetMaxPlayers(), INVALID_PLAYER_ID, MAX_PLAYER_NAME);
 		SSCANF_gInit = true;
-		
+
 		// Check if there are any players that aren't initialized.
 		for (new i = 0; i < MAX_PLAYERS; i ++)
 		{
 		    if (IsPlayerConnected(i) && !SSCANF_IsConnected(i))
 		    {
-		        GetPlayerName(i, name, MAX_PLAYER_NAME);
+		        GetPlayerName(i, name, sizeof(name));
 		        SSCANF_Join(i, name, IsPlayerNPC(i));
 		    }
 		}
-		
+
 		#if defined SSCANF_OnFilterScriptInit
 			SSCANF_OnFilterScriptInit();
 		#endif
@@ -184,17 +190,17 @@ static stock
 		if (!SSCANF_gInit)
 		{
 		    new
-		        name[MAX_PLAYER_NAME];
-		
+		        name[MAX_PLAYER_NAME + 1];
+
 			SSCANF_Init(GetMaxPlayers(), INVALID_PLAYER_ID, MAX_PLAYER_NAME);
 			SSCANF_gInit = true;
-			
+
 			// Check if there are any players that aren't initialized.
 			for (new i = 0; i < MAX_PLAYERS; i ++)
 			{
 			    if (IsPlayerConnected(i) && !SSCANF_IsConnected(i))
 			    {
-			        GetPlayerName(i, name, MAX_PLAYER_NAME);
+			        GetPlayerName(i, name, sizeof(name));
 			        SSCANF_Join(i, name, IsPlayerNPC(i));
 			    }
 			}
@@ -227,8 +233,8 @@ static stock
 	public OnPlayerConnect(playerid)
 	{
 		new
-			name[MAX_PLAYER_NAME];
-		GetPlayerName(playerid, name, sizeof (name));
+			name[MAX_PLAYER_NAME + 1];
+		GetPlayerName(playerid, name, sizeof(name));
 		SSCANF_Join(playerid, name, IsPlayerNPC(playerid));
 		#if defined SSCANF_OnPlayerConnect
 			SSCANF_OnPlayerConnect(playerid);
@@ -276,38 +282,38 @@ static stock
 #define SSCANF_Join
 #define SSCANF_Leave
 
-#define extract%0->%1; EXTRN%1;unformat(_:EXTRZ:EXTRV:EXTRX:%0,##,%1,,);
-#define unformat(_:EXTRZ:EXTRV:EXTRX:%0,##,%1);%2else if (unformat(_:EXTRV:EXTRX:%0,##,%1))
+#define extract%0->%1; EXTRN%1;unformat(_:EXTRZ:EXTRV:EXTRX:%0,#,%1,,);
+#define unformat(_:EXTRZ:EXTRV:EXTRX:%0,#,%1);%2else if (unformat(_:EXTRV:EXTRX:%0,#,%1))
 
-#define EXTRV:EXTRX:%0<%3>##,%9new%1,%2) EXTRY:%0##P<%3>,|||%1|||%2)
-#define EXTRX:%0##,%9new%1,%2) EXTRY:%0##,|||%1|||%2)
+#define EXTRV:EXTRX:%0<%3>%4#,%9new%1,%2) EXTRY:%0%4#P<%3>,|||%1|||%2)
+#define EXTRX:%0#,%9new%1,%2) EXTRY:%0#,|||%1|||%2)
 #define EXTRY: EXTR8:EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:
 
-#define EXTR8:EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0##%1,%2|||%6:%3=%9|||%4) %6_EXTRO:%0##%1,%2|||%3=%9|||%4)
-#define EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0##%1,%2|||%3=%9|||%4) __EXTRO:%0##%1,%2|||%3=%9|||%4)
-#define EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0##%1,%2|||%6:%3[%7]|||%4) %6_EXTRW:%0##%1,%2|||%3[%7]|||%4)
-#define EXTR1:EXTR2:EXTR3:EXTR4:%0##%1,%2|||%3[%7]|||%4) __EXTRW:%0##%1,%2|||%3|||%4)
-#define EXTR2:EXTR3:EXTR4:%0##%1,%2|||%6:%3|||%4) %6_EXTRN:%0##%1,%2|||%3|||%4)
-#define EXTR3:EXTR4:%0##%1,,%2||||||%4) %0##%1,%2)
-#define EXTR4:%0##%1,%2|||%3|||%4) __EXTRN:%0##%1,%2|||%3|||%4)
+#define EXTR8:EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0#%1,%2|||%6:%3=%9|||%4) %6_EXTRO:%0#%1,%2|||%3=%9|||%4)
+#define EXTR9:EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0#%1,%2|||%3=%9|||%4) __EXTRO:%0#%1,%2|||%3=%9|||%4)
+#define EXTR0:EXTR1:EXTR2:EXTR3:EXTR4:%0#%1,%2|||%6:%3[%7]|||%4) %6_EXTRW:%0#%1,%2|||%3[%7]|||%4)
+#define EXTR1:EXTR2:EXTR3:EXTR4:%0#%1,%2|||%3[%7]|||%4) __EXTRW:%0#%1,%2|||%3|||%4)
+#define EXTR2:EXTR3:EXTR4:%0#%1,%2|||%6:%3|||%4) %6_EXTRN:%0#%1,%2|||%3|||%4)
+#define EXTR3:EXTR4:%0#%1,,%2||||||%4) %0#%1,%2)
+#define EXTR4:%0#%1,%2|||%3|||%4) __EXTRN:%0#%1,%2|||%3|||%4)
 
 // Optional specifiers.
-#define __EXTRO:%0##%1,%2|||%3=%9|||%4,%5) EXTRY:%0##%1I"("#%9")"#,%2,%3|||%4|||%5)
-#define Float_EXTRO:%0##%1,%2|||%3=%9|||%4,%5) EXTRY:%0##%1F"("#%9")"#,%2,%3|||%4|||%5)
-#define player_EXTRO:%0##%1,%2|||%3=%9|||%4,%5) EXTRY:%0##%1U"("#%9")"#,%2,%3|||%4|||%5)
-#define string_EXTRO:%0##%1,%2|||%3[%7]=%9|||%4,%5) EXTRY:%0##%1S"("#%9")"#[%7],%2,%3|||%4|||%5)
+#define __EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1I"("#%9")"#,%2,%3|||%4|||%5)
+#define Float_EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1F"("#%9")"#,%2,%3|||%4|||%5)
+#define player_EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1U"("#%9")"#,%2,%3|||%4|||%5)
+#define string_EXTRO:%0#%1,%2|||%3[%7]=%9|||%4,%5) EXTRY:%0#%1S"("#%9")"#[%7],%2,%3|||%4|||%5)
 
 // Normal specifiers (the double underscore is to work for "_:".
-#define __EXTRN:%0##%1,%2|||%3|||%4,%5) EXTRY:%0##%1i,%2,%3|||%4|||%5)
-#define Float_EXTRN:%0##%1,%2|||%3|||%4,%5) EXTRY:%0##%1f,%2,%3|||%4|||%5)
-#define player_EXTRN:%0##%1,%2|||%3|||%4,%5) EXTRY:%0##%1u,%2,%3|||%4|||%5)
-//#define string_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1s[%7],%2,%3|||%4|||%5)
+#define __EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1i,%2,%3|||%4|||%5)
+#define Float_EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1f,%2,%3|||%4|||%5)
+#define player_EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1u,%2,%3|||%4|||%5)
+//#define string_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1s[%7],%2,%3|||%4|||%5)
 
 // Array versions of normal specifiers.
-#define __EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<i>[%7],%2,%3|||%4|||%5)
-#define Float_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<f>[%7],%2,%3|||%4|||%5)
-#define player_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<u>[%7],%2,%3|||%4|||%5)
-#define string_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1s[%7],%2,%3|||%4|||%5)
+#define __EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<i>[%7],%2,%3|||%4|||%5)
+#define Float_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<f>[%7],%2,%3|||%4|||%5)
+#define player_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<u>[%7],%2,%3|||%4|||%5)
+#define string_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1s[%7],%2,%3|||%4|||%5)
 
 // Get rid of excess leading space which causes warnings.
 #define EXTRN%0new%1; new%1;
@@ -316,22 +322,22 @@ static stock
     #define string:
 #endif
 
-#define player:
+#define player:%0;unformat(%1) %0;unformat(%1)
 
-#define hex:
-#define hex_EXTRO:%0##%1,%2|||%3=%9|||%4,%5) EXTRY:%0##%1H"("#%9")"#,%2,%3|||%4|||%5)
-#define hex_EXTRN:%0##%1,%2|||%3|||%4,%5) EXTRY:%0##%1h,%2,%3|||%4|||%5)
-#define hex_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<h>[%7],%2,%3|||%4|||%5)
+#define hex:%0;unformat(%1) %0;unformat(%1)
+#define hex_EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1H"("#%9")"#,%2,%3|||%4|||%5)
+#define hex_EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1h,%2,%3|||%4|||%5)
+#define hex_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<h>[%7],%2,%3|||%4|||%5)
 
-#define bin:
-#define bin_EXTRO:%0##%1,%2|||%3=%9|||%4,%5) EXTRY:%0##%1B"("#%9")"#,%2,%3|||%4|||%5)
-#define bin_EXTRN:%0##%1,%2|||%3|||%4,%5) EXTRY:%0##%1b,%2,%3|||%4|||%5)
-#define bin_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<b>[%7],%2,%3|||%4|||%5)
+#define bin:%0;unformat(%1) %0;unformat(%1)
+#define bin_EXTRO:%0#%1,%2|||%3=%9|||%4,%5) EXTRY:%0#%1B"("#%9")"#,%2,%3|||%4|||%5)
+#define bin_EXTRN:%0#%1,%2|||%3|||%4,%5) EXTRY:%0#%1b,%2,%3|||%4|||%5)
+#define bin_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<b>[%7],%2,%3|||%4|||%5)
 
 #define kustom:%0<%1> %0
-#define kustom_EXTRO:%0##%1,%2|||%3<%8>=%9|||%4,%5) EXTRY:%0##%1K<%8>"("#%9")"#,%2,%3|||%4|||%5)
-#define kustom_EXTRN:%0##%1,%2|||%3<%8>|||%4,%5) EXTRY:%0##%1k<%8>,%2,%3|||%4|||%5)
-//#define bin_EXTRW:%0##%1,%2|||%3[%7]|||%4,%5) EXTRY:%0##%1a<b>[%7],%2,%3|||%4|||%5)
+#define kustom_EXTRO:%0#%1,%2|||%3<%8>=%9|||%4,%5) EXTRY:%0#%1K<%8>"("#%9")"#,%2,%3|||%4|||%5)
+#define kustom_EXTRN:%0#%1,%2|||%3<%8>|||%4,%5) EXTRY:%0#%1k<%8>,%2,%3|||%4|||%5)
+//#define bin_EXTRW:%0#%1,%2|||%3[%7]|||%4,%5) EXTRY:%0#%1a<b>[%7],%2,%3|||%4|||%5)
 
 SSCANF:weapon(string[])
 {
@@ -345,51 +351,51 @@ SSCANF:weapon(string[])
 			return ret;
 		}
 	}
-	else if (!strcmp(string, "Unarmed")) return 0;
-	else if (!strcmp(string, "Brass Knuckles")) return 1;
-	else if (!strcmp(string, "Golf Club")) return 2;
-	else if (!strcmp(string, "Night Stick")) return 3;
-	else if (!strcmp(string, "Knife")) return 4;
-	else if (!strcmp(string, "Baseball Bat")) return 5;
-	else if (!strcmp(string, "Shovel")) return 6;
-	else if (!strcmp(string, "Pool cue")) return 7;
-	else if (!strcmp(string, "Katana")) return 8;
-	else if (!strcmp(string, "Chainsaw")) return 9;
-	else if (!strcmp(string, "Purple Dildo")) return 10;
-	else if (!strcmp(string, "White Dildo")) return 11;
-	else if (!strcmp(string, "Long White Dildo")) return 12;
-	else if (!strcmp(string, "White Dildo 2")) return 13;
-	else if (!strcmp(string, "Flowers")) return 14;
-	else if (!strcmp(string, "Cane")) return 15;
-	else if (!strcmp(string, "Grenades")) return 16;
-	else if (!strcmp(string, "Tear Gas")) return 17;
-	else if (!strcmp(string, "Molotovs")) return 18;
-	else if (!strcmp(string, "Pistol")) return 22;
-	else if (!strcmp(string, "Silenced Pistol")) return 23;
-	else if (!strcmp(string, "Desert Eagle")) return 24;
-	else if (!strcmp(string, "Shotgun")) return 25;
-	else if (!strcmp(string, "Sawn Off Shotgun")) return 26;
-	else if (!strcmp(string, "Combat Shotgun")) return 27;
-	else if (!strcmp(string, "Micro Uzi")) return 28;
-	else if (!strcmp(string, "Mac 10")) return 28;
-	else if (!strcmp(string, "MP5")) return 29;
-	else if (!strcmp(string, "AK47")) return 30;
-	else if (!strcmp(string, "M4")) return 31;
-	else if (!strcmp(string, "Tec9")) return 32;
-	else if (!strcmp(string, "Rifle")) return 33;
-	else if (!strcmp(string, "Sniper Rifle")) return 34;
-	else if (!strcmp(string, "RPG")) return 35;
-	else if (!strcmp(string, "Missile Launcher")) return 36;
-	else if (!strcmp(string, "Flame Thrower")) return 37;
-	else if (!strcmp(string, "Minigun")) return 38;
-	else if (!strcmp(string, "Sachel Charges")) return 39;
-	else if (!strcmp(string, "Detonator")) return 40;
-	else if (!strcmp(string, "Spray Paint")) return 41;
-	else if (!strcmp(string, "Fire Extinguisher")) return 42;
-	else if (!strcmp(string, "Camera")) return 43;
-	else if (!strcmp(string, "Nightvision Goggles")) return 44;
-	else if (!strcmp(string, "Thermal Goggles")) return 45;
-	else if (!strcmp(string, "Parachute")) return 46;
+	else if (!strcmp(string, "Unarmed", true)) return 0;
+	else if (!strcmp(string, "Brass Knuckles", true)) return 1;
+	else if (!strcmp(string, "Golf Club", true)) return 2;
+	else if (!strcmp(string, "Night Stick", true)) return 3;
+	else if (!strcmp(string, "Knife", true)) return 4;
+	else if (!strcmp(string, "Baseball Bat", true)) return 5;
+	else if (!strcmp(string, "Shovel", true)) return 6;
+	else if (!strcmp(string, "Pool cue", true)) return 7;
+	else if (!strcmp(string, "Katana", true)) return 8;
+	else if (!strcmp(string, "Chainsaw", true)) return 9;
+	else if (!strcmp(string, "Purple Dildo", true)) return 10;
+	else if (!strcmp(string, "White Dildo", true)) return 11;
+	else if (!strcmp(string, "Long White Dildo", true)) return 12;
+	else if (!strcmp(string, "White Dildo 2", true)) return 13;
+	else if (!strcmp(string, "Flowers", true)) return 14;
+	else if (!strcmp(string, "Cane", true)) return 15;
+	else if (!strcmp(string, "Grenades", true)) return 16;
+	else if (!strcmp(string, "Tear Gas", true)) return 17;
+	else if (!strcmp(string, "Molotovs", true)) return 18;
+	else if (!strcmp(string, "Pistol", true)) return 22;
+	else if (!strcmp(string, "Silenced Pistol", true)) return 23;
+	else if (!strcmp(string, "Desert Eagle", true)) return 24;
+	else if (!strcmp(string, "Shotgun", true)) return 25;
+	else if (!strcmp(string, "Sawn Off Shotgun", true)) return 26;
+	else if (!strcmp(string, "Combat Shotgun", true)) return 27;
+	else if (!strcmp(string, "Micro Uzi", true)) return 28;
+	else if (!strcmp(string, "Mac 10", true)) return 28;
+	else if (!strcmp(string, "MP5", true)) return 29;
+	else if (!strcmp(string, "AK47", true)) return 30;
+	else if (!strcmp(string, "M4", true)) return 31;
+	else if (!strcmp(string, "Tec9", true)) return 32;
+	else if (!strcmp(string, "Rifle", true)) return 33;
+	else if (!strcmp(string, "Sniper Rifle", true)) return 34;
+	else if (!strcmp(string, "RPG", true)) return 35;
+	else if (!strcmp(string, "Missile Launcher", true)) return 36;
+	else if (!strcmp(string, "Flame Thrower", true)) return 37;
+	else if (!strcmp(string, "Minigun", true)) return 38;
+	else if (!strcmp(string, "Sachel Charges", true)) return 39;
+	else if (!strcmp(string, "Detonator", true)) return 40;
+	else if (!strcmp(string, "Spray Paint", true)) return 41;
+	else if (!strcmp(string, "Fire Extinguisher", true)) return 42;
+	else if (!strcmp(string, "Camera", true)) return 43;
+	else if (!strcmp(string, "Nightvision Goggles", true)) return 44;
+	else if (!strcmp(string, "Thermal Goggles", true)) return 45;
+	else if (!strcmp(string, "Parachute", true)) return 46;
 	return -1;
 }
 
@@ -405,218 +411,218 @@ SSCANF:vehicle(string[])
 			return ret;
 		}
 	}
-	else if (!strcmp(string, "Landstalker")) return 400;
-	else if (!strcmp(string, "Bravura")) return 401;
-	else if (!strcmp(string, "Buffalo")) return 402;
-	else if (!strcmp(string, "Linerunner")) return 403;
-	else if (!strcmp(string, "Perenniel")) return 404;
-	else if (!strcmp(string, "Sentinel")) return 405;
-	else if (!strcmp(string, "Dumper")) return 406;
-	else if (!strcmp(string, "Firetruck")) return 407;
-	else if (!strcmp(string, "Trashmaster")) return 408;
-	else if (!strcmp(string, "Stretch")) return 409;
-	else if (!strcmp(string, "Manana")) return 410;
-	else if (!strcmp(string, "Infernus")) return 411;
-	else if (!strcmp(string, "Voodoo")) return 412;
-	else if (!strcmp(string, "Pony")) return 413;
-	else if (!strcmp(string, "Mule")) return 414;
-	else if (!strcmp(string, "Cheetah")) return 415;
-	else if (!strcmp(string, "Ambulance")) return 416;
-	else if (!strcmp(string, "Leviathan")) return 417;
-	else if (!strcmp(string, "Moonbeam")) return 418;
-	else if (!strcmp(string, "Esperanto")) return 419;
-	else if (!strcmp(string, "Taxi")) return 420;
-	else if (!strcmp(string, "Washington")) return 421;
-	else if (!strcmp(string, "Bobcat")) return 422;
-	else if (!strcmp(string, "Mr Whoopee")) return 423;
-	else if (!strcmp(string, "BF Injection")) return 424;
-	else if (!strcmp(string, "Hunter")) return 425;
-	else if (!strcmp(string, "Premier")) return 426;
-	else if (!strcmp(string, "Enforcer")) return 427;
-	else if (!strcmp(string, "Securicar")) return 428;
-	else if (!strcmp(string, "Banshee")) return 429;
-	else if (!strcmp(string, "Predator")) return 430;
-	else if (!strcmp(string, "Bus")) return 431;
-	else if (!strcmp(string, "Rhino")) return 432;
-	else if (!strcmp(string, "Barracks")) return 433;
-	else if (!strcmp(string, "Hotknife")) return 434;
-	else if (!strcmp(string, "Article Trailer")) return 435;
-	else if (!strcmp(string, "Previon")) return 436;
-	else if (!strcmp(string, "Coach")) return 437;
-	else if (!strcmp(string, "Cabbie")) return 438;
-	else if (!strcmp(string, "Stallion")) return 439;
-	else if (!strcmp(string, "Rumpo")) return 440;
-	else if (!strcmp(string, "RC Bandit")) return 441;
-	else if (!strcmp(string, "Romero")) return 442;
-	else if (!strcmp(string, "Packer")) return 443;
-	else if (!strcmp(string, "Monster")) return 444;
-	else if (!strcmp(string, "Admiral")) return 445;
-	else if (!strcmp(string, "Squallo")) return 446;
-	else if (!strcmp(string, "Seasparrow")) return 447;
-	else if (!strcmp(string, "Pizzaboy")) return 448;
-	else if (!strcmp(string, "Tram")) return 449;
-	else if (!strcmp(string, "Article Trailer 2")) return 450;
-	else if (!strcmp(string, "Turismo")) return 451;
-	else if (!strcmp(string, "Speeder")) return 452;
-	else if (!strcmp(string, "Reefer")) return 453;
-	else if (!strcmp(string, "Tropic")) return 454;
-	else if (!strcmp(string, "Flatbed")) return 455;
-	else if (!strcmp(string, "Yankee")) return 456;
-	else if (!strcmp(string, "Caddy")) return 457;
-	else if (!strcmp(string, "Solair")) return 458;
-	else if (!strcmp(string, "Berkley's RC Van")) return 459;
-	else if (!strcmp(string, "Skimmer")) return 460;
-	else if (!strcmp(string, "PCJ-600")) return 461;
-	else if (!strcmp(string, "Faggio")) return 462;
-	else if (!strcmp(string, "Freeway")) return 463;
-	else if (!strcmp(string, "RC Baron")) return 464;
-	else if (!strcmp(string, "RC Raider")) return 465;
-	else if (!strcmp(string, "Glendale")) return 466;
-	else if (!strcmp(string, "Oceanic")) return 467;
-	else if (!strcmp(string, "Sanchez")) return 468;
-	else if (!strcmp(string, "Sparrow")) return 469;
-	else if (!strcmp(string, "Patriot")) return 470;
-	else if (!strcmp(string, "Quad")) return 471;
-	else if (!strcmp(string, "Coastguard")) return 472;
-	else if (!strcmp(string, "Dinghy")) return 473;
-	else if (!strcmp(string, "Hermes")) return 474;
-	else if (!strcmp(string, "Sabre")) return 475;
-	else if (!strcmp(string, "Rustler")) return 476;
-	else if (!strcmp(string, "ZR-350")) return 477;
-	else if (!strcmp(string, "Walton")) return 478;
-	else if (!strcmp(string, "Regina")) return 479;
-	else if (!strcmp(string, "Comet")) return 480;
-	else if (!strcmp(string, "BMX")) return 481;
-	else if (!strcmp(string, "Burrito")) return 482;
-	else if (!strcmp(string, "Camper")) return 483;
-	else if (!strcmp(string, "Marquis")) return 484;
-	else if (!strcmp(string, "Baggage")) return 485;
-	else if (!strcmp(string, "Dozer")) return 486;
-	else if (!strcmp(string, "Maverick")) return 487;
-	else if (!strcmp(string, "SAN News Maverick")) return 488;
-	else if (!strcmp(string, "Rancher")) return 489;
-	else if (!strcmp(string, "FBI Rancher")) return 490;
-	else if (!strcmp(string, "Virgo")) return 491;
-	else if (!strcmp(string, "Greenwood")) return 492;
-	else if (!strcmp(string, "Jetmax")) return 493;
-	else if (!strcmp(string, "Hotring Racer")) return 494;
-	else if (!strcmp(string, "Sandking")) return 495;
-	else if (!strcmp(string, "Blista Compact")) return 496;
-	else if (!strcmp(string, "Police Maverick")) return 497;
-	else if (!strcmp(string, "Boxville")) return 498;
-	else if (!strcmp(string, "Benson")) return 499;
-	else if (!strcmp(string, "Mesa")) return 500;
-	else if (!strcmp(string, "RC Goblin")) return 501;
-	else if (!strcmp(string, "Hotring Racer")) return 502;
-	else if (!strcmp(string, "Hotring Racer")) return 503;
-	else if (!strcmp(string, "Bloodring Banger")) return 504;
-	else if (!strcmp(string, "Rancher")) return 505;
-	else if (!strcmp(string, "Super GT")) return 506;
-	else if (!strcmp(string, "Elegant")) return 507;
-	else if (!strcmp(string, "Journey")) return 508;
-	else if (!strcmp(string, "Bike")) return 509;
-	else if (!strcmp(string, "Mountain Bike")) return 510;
-	else if (!strcmp(string, "Beagle")) return 511;
-	else if (!strcmp(string, "Cropduster")) return 512;
-	else if (!strcmp(string, "Stuntplane")) return 513;
-	else if (!strcmp(string, "Tanker")) return 514;
-	else if (!strcmp(string, "Roadtrain")) return 515;
-	else if (!strcmp(string, "Nebula")) return 516;
-	else if (!strcmp(string, "Majestic")) return 517;
-	else if (!strcmp(string, "Buccaneer")) return 518;
-	else if (!strcmp(string, "Shamal")) return 519;
-	else if (!strcmp(string, "Hydra")) return 520;
-	else if (!strcmp(string, "FCR-900")) return 521;
-	else if (!strcmp(string, "NRG-500")) return 522;
-	else if (!strcmp(string, "HPV1000")) return 523;
-	else if (!strcmp(string, "Cement Truck")) return 524;
-	else if (!strcmp(string, "Towtruck")) return 525;
-	else if (!strcmp(string, "Fortune")) return 526;
-	else if (!strcmp(string, "Cadrona")) return 527;
-	else if (!strcmp(string, "FBI Truck")) return 528;
-	else if (!strcmp(string, "Willard")) return 529;
-	else if (!strcmp(string, "Forklift")) return 530;
-	else if (!strcmp(string, "Tractor")) return 531;
-	else if (!strcmp(string, "Combine Harvester")) return 532;
-	else if (!strcmp(string, "Feltzer")) return 533;
-	else if (!strcmp(string, "Remington")) return 534;
-	else if (!strcmp(string, "Slamvan")) return 535;
-	else if (!strcmp(string, "Blade")) return 536;
-	else if (!strcmp(string, "Freight (Train)")) return 537;
-	else if (!strcmp(string, "Brownstreak (Train)")) return 538;
-	else if (!strcmp(string, "Vortex")) return 539;
-	else if (!strcmp(string, "Vincent")) return 540;
-	else if (!strcmp(string, "Bullet")) return 541;
-	else if (!strcmp(string, "Clover")) return 542;
-	else if (!strcmp(string, "Sadler")) return 543;
-	else if (!strcmp(string, "Firetruck LA")) return 544;
-	else if (!strcmp(string, "Hustler")) return 545;
-	else if (!strcmp(string, "Intruder")) return 546;
-	else if (!strcmp(string, "Primo")) return 547;
-	else if (!strcmp(string, "Cargobob")) return 548;
-	else if (!strcmp(string, "Tampa")) return 549;
-	else if (!strcmp(string, "Sunrise")) return 550;
-	else if (!strcmp(string, "Merit")) return 551;
-	else if (!strcmp(string, "Utility Van")) return 552;
-	else if (!strcmp(string, "Nevada")) return 553;
-	else if (!strcmp(string, "Yosemite")) return 554;
-	else if (!strcmp(string, "Windsor")) return 555;
-	else if (!strcmp(string, "Monster \"A\"")) return 556;
-	else if (!strcmp(string, "Monster \"B\"")) return 557;
-	else if (!strcmp(string, "Uranus")) return 558;
-	else if (!strcmp(string, "Jester")) return 559;
-	else if (!strcmp(string, "Sultan")) return 560;
-	else if (!strcmp(string, "Stratum")) return 561;
-	else if (!strcmp(string, "Elegy")) return 562;
-	else if (!strcmp(string, "Raindance")) return 563;
-	else if (!strcmp(string, "RC Tiger")) return 564;
-	else if (!strcmp(string, "Flash")) return 565;
-	else if (!strcmp(string, "Tahoma")) return 566;
-	else if (!strcmp(string, "Savanna")) return 567;
-	else if (!strcmp(string, "Bandito")) return 568;
-	else if (!strcmp(string, "Freight Flat Trailer (Train)")) return 569;
-	else if (!strcmp(string, "Streak Trailer (Train)")) return 570;
-	else if (!strcmp(string, "Kart")) return 571;
-	else if (!strcmp(string, "Mower")) return 572;
-	else if (!strcmp(string, "Dune")) return 573;
-	else if (!strcmp(string, "Sweeper")) return 574;
-	else if (!strcmp(string, "Broadway")) return 575;
-	else if (!strcmp(string, "Tornado")) return 576;
-	else if (!strcmp(string, "AT400")) return 577;
-	else if (!strcmp(string, "DFT-30")) return 578;
-	else if (!strcmp(string, "Huntley")) return 579;
-	else if (!strcmp(string, "Stafford")) return 580;
-	else if (!strcmp(string, "BF-400")) return 581;
-	else if (!strcmp(string, "Newsvan")) return 582;
-	else if (!strcmp(string, "Tug")) return 583;
-	else if (!strcmp(string, "Petrol Trailer")) return 584;
-	else if (!strcmp(string, "Emperor")) return 585;
-	else if (!strcmp(string, "Wayfarer")) return 586;
-	else if (!strcmp(string, "Euros")) return 587;
-	else if (!strcmp(string, "Hotdog")) return 588;
-	else if (!strcmp(string, "Club")) return 589;
-	else if (!strcmp(string, "Freight Box Trailer (Train)")) return 590;
-	else if (!strcmp(string, "Article Trailer 3")) return 591;
-	else if (!strcmp(string, "Andromada")) return 592;
-	else if (!strcmp(string, "Dodo")) return 593;
-	else if (!strcmp(string, "RC Cam")) return 594;
-	else if (!strcmp(string, "Launch")) return 595;
-	else if (!strcmp(string, "Police Car (LSPD)")) return 596;
-	else if (!strcmp(string, "Police Car (SFPD)")) return 597;
-	else if (!strcmp(string, "Police Car (LVPD)")) return 598;
-	else if (!strcmp(string, "Police Ranger")) return 599;
-	else if (!strcmp(string, "Picador")) return 600;
-	else if (!strcmp(string, "S.W.A.T.")) return 601;
-	else if (!strcmp(string, "Alpha")) return 602;
-	else if (!strcmp(string, "Phoenix")) return 603;
-	else if (!strcmp(string, "Glendale Shit")) return 604;
-	else if (!strcmp(string, "Sadler Shit")) return 605;
-	else if (!strcmp(string, "Baggage Trailer \"A\"")) return 606;
-	else if (!strcmp(string, "Baggage Trailer \"B\"")) return 607;
-	else if (!strcmp(string, "Tug Stairs Trailer")) return 608;
-	else if (!strcmp(string, "Boxville")) return 609;
-	else if (!strcmp(string, "Farm Trailer")) return 610;
-	else if (!strcmp(string, "Utility Trailer")) return 611;
+	else if (!strcmp(string, "Landstalker", true)) return 400;
+	else if (!strcmp(string, "Bravura", true)) return 401;
+	else if (!strcmp(string, "Buffalo", true)) return 402;
+	else if (!strcmp(string, "Linerunner", true)) return 403;
+	else if (!strcmp(string, "Perenniel", true)) return 404;
+	else if (!strcmp(string, "Sentinel", true)) return 405;
+	else if (!strcmp(string, "Dumper", true)) return 406;
+	else if (!strcmp(string, "Firetruck", true)) return 407;
+	else if (!strcmp(string, "Trashmaster", true)) return 408;
+	else if (!strcmp(string, "Stretch", true)) return 409;
+	else if (!strcmp(string, "Manana", true)) return 410;
+	else if (!strcmp(string, "Infernus", true)) return 411;
+	else if (!strcmp(string, "Voodoo", true)) return 412;
+	else if (!strcmp(string, "Pony", true)) return 413;
+	else if (!strcmp(string, "Mule", true)) return 414;
+	else if (!strcmp(string, "Cheetah", true)) return 415;
+	else if (!strcmp(string, "Ambulance", true)) return 416;
+	else if (!strcmp(string, "Leviathan", true)) return 417;
+	else if (!strcmp(string, "Moonbeam", true)) return 418;
+	else if (!strcmp(string, "Esperanto", true)) return 419;
+	else if (!strcmp(string, "Taxi", true)) return 420;
+	else if (!strcmp(string, "Washington", true)) return 421;
+	else if (!strcmp(string, "Bobcat", true)) return 422;
+	else if (!strcmp(string, "Mr Whoopee", true)) return 423;
+	else if (!strcmp(string, "BF Injection", true)) return 424;
+	else if (!strcmp(string, "Hunter", true)) return 425;
+	else if (!strcmp(string, "Premier", true)) return 426;
+	else if (!strcmp(string, "Enforcer", true)) return 427;
+	else if (!strcmp(string, "Securicar", true)) return 428;
+	else if (!strcmp(string, "Banshee", true)) return 429;
+	else if (!strcmp(string, "Predator", true)) return 430;
+	else if (!strcmp(string, "Bus", true)) return 431;
+	else if (!strcmp(string, "Rhino", true)) return 432;
+	else if (!strcmp(string, "Barracks", true)) return 433;
+	else if (!strcmp(string, "Hotknife", true)) return 434;
+	else if (!strcmp(string, "Article Trailer", true)) return 435;
+	else if (!strcmp(string, "Previon", true)) return 436;
+	else if (!strcmp(string, "Coach", true)) return 437;
+	else if (!strcmp(string, "Cabbie", true)) return 438;
+	else if (!strcmp(string, "Stallion", true)) return 439;
+	else if (!strcmp(string, "Rumpo", true)) return 440;
+	else if (!strcmp(string, "RC Bandit", true)) return 441;
+	else if (!strcmp(string, "Romero", true)) return 442;
+	else if (!strcmp(string, "Packer", true)) return 443;
+	else if (!strcmp(string, "Monster", true)) return 444;
+	else if (!strcmp(string, "Admiral", true)) return 445;
+	else if (!strcmp(string, "Squallo", true)) return 446;
+	else if (!strcmp(string, "Seasparrow", true)) return 447;
+	else if (!strcmp(string, "Pizzaboy", true)) return 448;
+	else if (!strcmp(string, "Tram", true)) return 449;
+	else if (!strcmp(string, "Article Trailer 2", true)) return 450;
+	else if (!strcmp(string, "Turismo", true)) return 451;
+	else if (!strcmp(string, "Speeder", true)) return 452;
+	else if (!strcmp(string, "Reefer", true)) return 453;
+	else if (!strcmp(string, "Tropic", true)) return 454;
+	else if (!strcmp(string, "Flatbed", true)) return 455;
+	else if (!strcmp(string, "Yankee", true)) return 456;
+	else if (!strcmp(string, "Caddy", true)) return 457;
+	else if (!strcmp(string, "Solair", true)) return 458;
+	else if (!strcmp(string, "Berkley's RC Van", true)) return 459;
+	else if (!strcmp(string, "Skimmer", true)) return 460;
+	else if (!strcmp(string, "PCJ-600", true)) return 461;
+	else if (!strcmp(string, "Faggio", true)) return 462;
+	else if (!strcmp(string, "Freeway", true)) return 463;
+	else if (!strcmp(string, "RC Baron", true)) return 464;
+	else if (!strcmp(string, "RC Raider", true)) return 465;
+	else if (!strcmp(string, "Glendale", true)) return 466;
+	else if (!strcmp(string, "Oceanic", true)) return 467;
+	else if (!strcmp(string, "Sanchez", true)) return 468;
+	else if (!strcmp(string, "Sparrow", true)) return 469;
+	else if (!strcmp(string, "Patriot", true)) return 470;
+	else if (!strcmp(string, "Quad", true)) return 471;
+	else if (!strcmp(string, "Coastguard", true)) return 472;
+	else if (!strcmp(string, "Dinghy", true)) return 473;
+	else if (!strcmp(string, "Hermes", true)) return 474;
+	else if (!strcmp(string, "Sabre", true)) return 475;
+	else if (!strcmp(string, "Rustler", true)) return 476;
+	else if (!strcmp(string, "ZR-350", true)) return 477;
+	else if (!strcmp(string, "Walton", true)) return 478;
+	else if (!strcmp(string, "Regina", true)) return 479;
+	else if (!strcmp(string, "Comet", true)) return 480;
+	else if (!strcmp(string, "BMX", true)) return 481;
+	else if (!strcmp(string, "Burrito", true)) return 482;
+	else if (!strcmp(string, "Camper", true)) return 483;
+	else if (!strcmp(string, "Marquis", true)) return 484;
+	else if (!strcmp(string, "Baggage", true)) return 485;
+	else if (!strcmp(string, "Dozer", true)) return 486;
+	else if (!strcmp(string, "Maverick", true)) return 487;
+	else if (!strcmp(string, "SAN News Maverick", true)) return 488;
+	else if (!strcmp(string, "Rancher", true)) return 489;
+	else if (!strcmp(string, "FBI Rancher", true)) return 490;
+	else if (!strcmp(string, "Virgo", true)) return 491;
+	else if (!strcmp(string, "Greenwood", true)) return 492;
+	else if (!strcmp(string, "Jetmax", true)) return 493;
+	else if (!strcmp(string, "Hotring Racer", true)) return 494;
+	else if (!strcmp(string, "Sandking", true)) return 495;
+	else if (!strcmp(string, "Blista Compact", true)) return 496;
+	else if (!strcmp(string, "Police Maverick", true)) return 497;
+	else if (!strcmp(string, "Boxville", true)) return 498;
+	else if (!strcmp(string, "Benson", true)) return 499;
+	else if (!strcmp(string, "Mesa", true)) return 500;
+	else if (!strcmp(string, "RC Goblin", true)) return 501;
+	else if (!strcmp(string, "Hotring Racer", true)) return 502;
+	else if (!strcmp(string, "Hotring Racer", true)) return 503;
+	else if (!strcmp(string, "Bloodring Banger", true)) return 504;
+	else if (!strcmp(string, "Rancher", true)) return 505;
+	else if (!strcmp(string, "Super GT", true)) return 506;
+	else if (!strcmp(string, "Elegant", true)) return 507;
+	else if (!strcmp(string, "Journey", true)) return 508;
+	else if (!strcmp(string, "Bike", true)) return 509;
+	else if (!strcmp(string, "Mountain Bike", true)) return 510;
+	else if (!strcmp(string, "Beagle", true)) return 511;
+	else if (!strcmp(string, "Cropduster", true)) return 512;
+	else if (!strcmp(string, "Stuntplane", true)) return 513;
+	else if (!strcmp(string, "Tanker", true)) return 514;
+	else if (!strcmp(string, "Roadtrain", true)) return 515;
+	else if (!strcmp(string, "Nebula", true)) return 516;
+	else if (!strcmp(string, "Majestic", true)) return 517;
+	else if (!strcmp(string, "Buccaneer", true)) return 518;
+	else if (!strcmp(string, "Shamal", true)) return 519;
+	else if (!strcmp(string, "Hydra", true)) return 520;
+	else if (!strcmp(string, "FCR-900", true)) return 521;
+	else if (!strcmp(string, "NRG-500", true)) return 522;
+	else if (!strcmp(string, "HPV1000", true)) return 523;
+	else if (!strcmp(string, "Cement Truck", true)) return 524;
+	else if (!strcmp(string, "Towtruck", true)) return 525;
+	else if (!strcmp(string, "Fortune", true)) return 526;
+	else if (!strcmp(string, "Cadrona", true)) return 527;
+	else if (!strcmp(string, "FBI Truck", true)) return 528;
+	else if (!strcmp(string, "Willard", true)) return 529;
+	else if (!strcmp(string, "Forklift", true)) return 530;
+	else if (!strcmp(string, "Tractor", true)) return 531;
+	else if (!strcmp(string, "Combine Harvester", true)) return 532;
+	else if (!strcmp(string, "Feltzer", true)) return 533;
+	else if (!strcmp(string, "Remington", true)) return 534;
+	else if (!strcmp(string, "Slamvan", true)) return 535;
+	else if (!strcmp(string, "Blade", true)) return 536;
+	else if (!strcmp(string, "Freight (Train)", true)) return 537;
+	else if (!strcmp(string, "Brownstreak (Train)", true)) return 538;
+	else if (!strcmp(string, "Vortex", true)) return 539;
+	else if (!strcmp(string, "Vincent", true)) return 540;
+	else if (!strcmp(string, "Bullet", true)) return 541;
+	else if (!strcmp(string, "Clover", true)) return 542;
+	else if (!strcmp(string, "Sadler", true)) return 543;
+	else if (!strcmp(string, "Firetruck LA", true)) return 544;
+	else if (!strcmp(string, "Hustler", true)) return 545;
+	else if (!strcmp(string, "Intruder", true)) return 546;
+	else if (!strcmp(string, "Primo", true)) return 547;
+	else if (!strcmp(string, "Cargobob", true)) return 548;
+	else if (!strcmp(string, "Tampa", true)) return 549;
+	else if (!strcmp(string, "Sunrise", true)) return 550;
+	else if (!strcmp(string, "Merit", true)) return 551;
+	else if (!strcmp(string, "Utility Van", true)) return 552;
+	else if (!strcmp(string, "Nevada", true)) return 553;
+	else if (!strcmp(string, "Yosemite", true)) return 554;
+	else if (!strcmp(string, "Windsor", true)) return 555;
+	else if (!strcmp(string, "Monster \"A\"", true)) return 556;
+	else if (!strcmp(string, "Monster \"B\"", true)) return 557;
+	else if (!strcmp(string, "Uranus", true)) return 558;
+	else if (!strcmp(string, "Jester", true)) return 559;
+	else if (!strcmp(string, "Sultan", true)) return 560;
+	else if (!strcmp(string, "Stratum", true)) return 561;
+	else if (!strcmp(string, "Elegy", true)) return 562;
+	else if (!strcmp(string, "Raindance", true)) return 563;
+	else if (!strcmp(string, "RC Tiger", true)) return 564;
+	else if (!strcmp(string, "Flash", true)) return 565;
+	else if (!strcmp(string, "Tahoma", true)) return 566;
+	else if (!strcmp(string, "Savanna", true)) return 567;
+	else if (!strcmp(string, "Bandito", true)) return 568;
+	else if (!strcmp(string, "Freight Flat Trailer (Train)", true)) return 569;
+	else if (!strcmp(string, "Streak Trailer (Train)", true)) return 570;
+	else if (!strcmp(string, "Kart", true)) return 571;
+	else if (!strcmp(string, "Mower", true)) return 572;
+	else if (!strcmp(string, "Dune", true)) return 573;
+	else if (!strcmp(string, "Sweeper", true)) return 574;
+	else if (!strcmp(string, "Broadway", true)) return 575;
+	else if (!strcmp(string, "Tornado", true)) return 576;
+	else if (!strcmp(string, "AT400", true)) return 577;
+	else if (!strcmp(string, "DFT-30", true)) return 578;
+	else if (!strcmp(string, "Huntley", true)) return 579;
+	else if (!strcmp(string, "Stafford", true)) return 580;
+	else if (!strcmp(string, "BF-400", true)) return 581;
+	else if (!strcmp(string, "Newsvan", true)) return 582;
+	else if (!strcmp(string, "Tug", true)) return 583;
+	else if (!strcmp(string, "Petrol Trailer", true)) return 584;
+	else if (!strcmp(string, "Emperor", true)) return 585;
+	else if (!strcmp(string, "Wayfarer", true)) return 586;
+	else if (!strcmp(string, "Euros", true)) return 587;
+	else if (!strcmp(string, "Hotdog", true)) return 588;
+	else if (!strcmp(string, "Club", true)) return 589;
+	else if (!strcmp(string, "Freight Box Trailer (Train)", true)) return 590;
+	else if (!strcmp(string, "Article Trailer 3", true)) return 591;
+	else if (!strcmp(string, "Andromada", true)) return 592;
+	else if (!strcmp(string, "Dodo", true)) return 593;
+	else if (!strcmp(string, "RC Cam", true)) return 594;
+	else if (!strcmp(string, "Launch", true)) return 595;
+	else if (!strcmp(string, "Police Car (LSPD)", true)) return 596;
+	else if (!strcmp(string, "Police Car (SFPD)", true)) return 597;
+	else if (!strcmp(string, "Police Car (LVPD)", true)) return 598;
+	else if (!strcmp(string, "Police Ranger", true)) return 599;
+	else if (!strcmp(string, "Picador", true)) return 600;
+	else if (!strcmp(string, "S.W.A.T.", true)) return 601;
+	else if (!strcmp(string, "Alpha", true)) return 602;
+	else if (!strcmp(string, "Phoenix", true)) return 603;
+	else if (!strcmp(string, "Glendale Shit", true)) return 604;
+	else if (!strcmp(string, "Sadler Shit", true)) return 605;
+	else if (!strcmp(string, "Baggage Trailer \"A\"", true)) return 606;
+	else if (!strcmp(string, "Baggage Trailer \"B\"", true)) return 607;
+	else if (!strcmp(string, "Tug Stairs Trailer", true)) return 608;
+	else if (!strcmp(string, "Boxville", true)) return 609;
+	else if (!strcmp(string, "Farm Trailer", true)) return 610;
+	else if (!strcmp(string, "Utility Trailer", true)) return 611;
 	return -1;
 }
 

+ 5 - 12
pawno/include/streamer.inc

@@ -116,7 +116,7 @@
 
 // Include File Version
 
-public Streamer_IncludeFileVersion = 0x295;
+public Streamer_IncludeFileVersion = 0x294;
 
 #pragma unused Streamer_IncludeFileVersion
 
@@ -178,8 +178,6 @@ enum
 	E_STREAMER_Z
 }
 
-#define E_STREAMER_CUSTOM(%0) ((%0) | 0x40000000 & ~0x80000000)
-
 // Natives (Settings)
 
 native Streamer_GetTickRate();
@@ -233,14 +231,11 @@ native Streamer_GetFloatData(type, STREAMER_ALL_TAGS:id, data, &Float:result);
 native Streamer_SetFloatData(type, STREAMER_ALL_TAGS:id, data, Float:value);
 native Streamer_GetIntData(type, STREAMER_ALL_TAGS:id, data);
 native Streamer_SetIntData(type, STREAMER_ALL_TAGS:id, data, value);
-native Streamer_RemoveIntData(type, STREAMER_ALL_TAGS:id, data);
-native Streamer_HasIntData(type, STREAMER_ALL_TAGS:id, data);
 native Streamer_GetArrayData(type, STREAMER_ALL_TAGS:id, data, dest[], maxdest = sizeof dest);
 native Streamer_SetArrayData(type, STREAMER_ALL_TAGS:id, data, const src[], maxsrc = sizeof src);
 native Streamer_IsInArrayData(type, STREAMER_ALL_TAGS:id, data, value);
 native Streamer_AppendArrayData(type, STREAMER_ALL_TAGS:id, data, value);
 native Streamer_RemoveArrayData(type, STREAMER_ALL_TAGS:id, data, value);
-native Streamer_HasArrayData(type, STREAMER_ALL_TAGS:id, data);
 native Streamer_GetArrayDataLength(type, STREAMER_ALL_TAGS:id, data);
 native Streamer_GetUpperBound(type);
 
@@ -284,11 +279,9 @@ native AttachDynamicObjectToPlayer(STREAMER_TAG_OBJECT:objectid, playerid, Float
 native AttachDynamicObjectToVehicle(STREAMER_TAG_OBJECT:objectid, vehicleid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz);
 native EditDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid);
 native IsDynamicObjectMaterialUsed(STREAMER_TAG_OBJECT:objectid, materialindex);
-native RemoveDynamicObjectMaterial(STREAMER_TAG_OBJECT:objectid, materialindex);
 native GetDynamicObjectMaterial(STREAMER_TAG_OBJECT:objectid, materialindex, &modelid, txdname[], texturename[], &materialcolor, maxtxdname = sizeof txdname, maxtexturename = sizeof texturename);
 native SetDynamicObjectMaterial(STREAMER_TAG_OBJECT:objectid, materialindex, modelid, const txdname[], const texturename[], materialcolor = 0);
 native IsDynamicObjectMaterialTextUsed(STREAMER_TAG_OBJECT:objectid, materialindex);
-native RemoveDynamicObjectMaterialText(STREAMER_TAG_OBJECT:objectid, materialindex);
 native GetDynamicObjectMaterialText(STREAMER_TAG_OBJECT:objectid, materialindex, text[], &materialsize, fontface[], &fontsize, &bold, &fontcolor, &backcolor, &textalignment, maxtext = sizeof text, maxfontface = sizeof fontface);
 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);
 native STREAMER_TAG_OBJECT:GetPlayerCameraTargetDynObject(playerid);
@@ -305,7 +298,7 @@ native STREAMER_TAG_CP:CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, wo
 native DestroyDynamicCP(STREAMER_TAG_CP:checkpointid);
 native IsValidDynamicCP(STREAMER_TAG_CP:checkpointid);
 native IsPlayerInDynamicCP(playerid, STREAMER_TAG_CP:checkpointid);
-native STREAMER_TAG_CP:GetPlayerVisibleDynamicCP(playerid);
+native GetPlayerVisibleDynamicCP(playerid);
 
 // Natives (Race Checkpoints)
 
@@ -313,7 +306,7 @@ native STREAMER_TAG_RACE_CP:CreateDynamicRaceCP(type, Float:x, Float:y, Float:z,
 native DestroyDynamicRaceCP(STREAMER_TAG_RACE_CP:checkpointid);
 native IsValidDynamicRaceCP(STREAMER_TAG_RACE_CP:checkpointid);
 native IsPlayerInDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP:checkpointid);
-native STREAMER_TAG_RACE_CP:GetPlayerVisibleDynamicRaceCP(playerid);
+native GetPlayerVisibleDynamicRaceCP(playerid);
 
 // Natives (Map Icons)
 
@@ -451,6 +444,6 @@ forward OnPlayerLeaveDynamicArea(playerid, STREAMER_TAG_AREA:areaid);
 forward OnPlayerGiveDamageDynamicActor(playerid, STREAMER_TAG_ACTOR:actorid, Float:amount, weaponid, bodypart);
 forward OnDynamicActorStreamIn(STREAMER_TAG_ACTOR:actorid, forplayerid);
 forward OnDynamicActorStreamOut(STREAMER_TAG_ACTOR:actorid, forplayerid);
-forward Streamer_OnItemStreamIn(type, STREAMER_ALL_TAGS:id, forplayerid);
-forward Streamer_OnItemStreamOut(type, STREAMER_ALL_TAGS:id, forplayerid);
+forward Streamer_OnItemStreamIn(type, STREAMER_ALL_TAGS:id);
+forward Streamer_OnItemStreamOut(type, STREAMER_ALL_TAGS:id);
 forward Streamer_OnPluginError(const error[]);

+ 6330 - 6332
pawno/include/weapon-config.inc

@@ -1,6332 +1,6330 @@
-#if defined _INC_WEAPON_CONFIG
-	#endinput
-#endif
-#define _INC_WEAPON_CONFIG
-
-#include <a_samp>
-
-// Print debug messages in the chat and server log
-#if !defined WC_DEBUG
-	#define WC_DEBUG false
-#endif
-
-// Print debug messages to the console but not the chat
-#if !defined WC_DEBUG_SILENT
-	#define WC_DEBUG_SILENT false
-#endif
-
-// Max number of rejected hits (GetRejectedHit)
-#if !defined WC_MAX_REJECTED_HITS
-	#define WC_MAX_REJECTED_HITS 15
-#endif
-
-// Max ranges for DAMAGE_TYPE_RANGE(_MULTIPLIER)
-#if !defined WC_MAX_DAMAGE_RANGES
-	#define WC_MAX_DAMAGE_RANGES 5
-#endif
-
-// The world a player has after the death animation finished until he respawns or enters class selection
-#if !defined WC_DEATH_WORLD
-	#define WC_DEATH_WORLD 0x00DEAD00
-#endif
-
-// The max number of entries in the damage feeds
-#if !defined WC_FEED_HEIGHT
-	#define WC_FEED_HEIGHT 5
-#endif
-
-// Use Incognito's streamer for custom vending machines
-#if !defined WC_USE_STREAMER
-	#define WC_USE_STREAMER false
-#endif
-
-// For SetWeaponName
-#if !defined WC_MAX_WEAPON_NAME
-	#define WC_MAX_WEAPON_NAME 21
-#endif
-
-// For modes that always have negative cash
-#if !defined WC_CUSTOM_VENDING_MACHINES
-	#define WC_CUSTOM_VENDING_MACHINES true
-#endif
-
-#if WC_USE_STREAMER && !defined Streamer_IncludeFileVersion
-	#error streamer.inc is required when WC_USE_STREAMER=true
-#endif
-
-// https://github.com/oscar-broman/SKY/blob/master/SKY.inc
-#if !defined _INC_SKY
-	#tryinclude <SKY>
-
-	#if !defined _INC_SKY
-		#error The SKY plugin is required, get it here: github.com/oscar-broman/sky
-	#endif
-#endif
-
-// Given in OnInvalidWeaponDamage
-enum {
-	WC_NO_ERROR,
-	WC_NO_ISSUER,
-	WC_NO_DAMAGED,
-	WC_INVALID_DAMAGE,
-	WC_INVALID_DISTANCE
-}
-
-// Used in SetWeaponDamage
-enum {
-	DAMAGE_TYPE_MULTIPLIER,
-	DAMAGE_TYPE_STATIC,
-	DAMAGE_TYPE_RANGE_MULTIPLIER,
-	DAMAGE_TYPE_RANGE
-}
-
-// Hits displayed in the damage feeds
-enum E_DAMAGE_FEED_HIT {
-	      e_Issuer,
-	      e_Name[MAX_PLAYER_NAME],
-	Float:e_Amount,
-	      e_Weapon,
-	      e_Tick
-}
-
-// Given in OnRejectedHit
-enum E_REJECTED_HIT {
-	e_Time,
-	e_Hour,
-	e_Minute,
-	e_Second,
-	e_Weapon,
-	e_Reason,
-	e_Info1,
-	e_Info2,
-	e_Info3,
-	e_Name[MAX_PLAYER_NAME]
-}
-
-// e_Reason in E_REJECTED_HIT
-enum {
-	HIT_NO_DAMAGEDID,
-	HIT_INVALID_WEAPON,
-	HIT_LAST_SHOT_INVALID,
-	HIT_MULTIPLE_PLAYERS,
-	HIT_MULTIPLE_PLAYERS_SHOTGUN,
-	HIT_DYING_PLAYER,
-	HIT_SAME_TEAM,
-	HIT_UNSTREAMED,
-	HIT_INVALID_HITTYPE,
-	HIT_BEING_RESYNCED,
-	HIT_NOT_SPAWNED,
-	HIT_OUT_OF_RANGE,
-	HIT_TOO_FAR_FROM_SHOT,
-	SHOOTING_RATE_TOO_FAST,
-	SHOOTING_RATE_TOO_FAST_MULTIPLE,
-	HIT_RATE_TOO_FAST,
-	HIT_RATE_TOO_FAST_MULTIPLE,
-	HIT_KNIFE_FAILED,
-	HIT_TOO_FAR_FROM_ORIGIN,
-	HIT_INVALID_DAMAGE,
-	HIT_SAME_VEHICLE,
-	HIT_OWN_VEHICLE,
-	HIT_INVALID_VEHICLE,
-	HIT_DISCONNECTED
-}
-
-// Must be in sync with the enum above
-// Used in debug messages and GetRejectedHit
-stock const g_HitRejectReasons[][] = {
-	"None or invalid player shot",
-	"Invalid weapon",
-	"Last shot invalid",
-	"One bullet hit %d players",
-	"Hit too many players with shotgun: %d",
-	"Hit a dying player",
-	"Hit a teammate",
-	"Hit someone that can't see you (not streamed in)",
-	"Invalid hit type: %d",
-	"Hit while being resynced",
-	"Hit when not spawned or dying",
-	"Hit out of range (%f > %f)",
-	"Hit player too far from hit position (dist %f)",
-	"Shooting rate too fast: %d (%d samples, max %d)",
-	"Shooting rate too fast: %d (%d samples, multiple weapons)",
-	"Hit rate too fast: %d (%d samples, max %d)",
-	"Hit rate too fast: %d (%d samples, multiple weapons)",
-	"The knife kill did not sync",
-	"Damage inflicted too far from current position (dist %f)",
-	"Invalid weapon damage (%.4f)",
-	"Hit a player in the same vehicle",
-	"Hit the vehicle you're in",
-	"Hit invalid vehicle: %d",
-	"Hit a disconnected player ID: %d"
-};
-
-// Used for SetCustomVendingMachines
-#if WC_CUSTOM_VENDING_MACHINES
-	enum E_VENDING_MACHINE {
-		      e_Model,
-		      e_Interior,
-		Float:e_PosX,
-		Float:e_PosY,
-		Float:e_PosZ,
-		Float:e_RotX,
-		Float:e_RotY,
-		Float:e_RotZ,
-		Float:e_FrontX,
-		Float:e_FrontY
-	}
-#endif
-
-// Used to resync players that got team-knifed in lagshot mode
-enum E_RESYNC_DATA {
-	Float:e_Health,
-	Float:e_Armour,
-	      e_Skin,
-	      e_Team,
-	Float:e_PosX,
-	Float:e_PosY,
-	Float:e_PosZ,
-	Float:e_PosA,
-	      e_Weapon,
-	      e_WeaponId[13],
-	      e_WeaponAmmo[13]
-}
-
-// From OnPlayerWeaponShot
-enum E_SHOT_INFO {
-	      e_Tick,
-	      e_Weapon,
-	      e_HitType,
-	      e_HitId,
-	      e_Hits,
-	Float:e_X,
-	Float:e_Y,
-	Float:e_Z,
-	Float:e_OX,
-	Float:e_OY,
-	Float:e_OZ,
-	Float:e_HX,
-	Float:e_HY,
-	Float:e_HZ,
-	Float:e_Length,
-	 bool:e_Valid
-}
-
-enum E_HIT_INFO {
-	      e_Tick,
-	      e_Issuer,
-	      e_Weapon,
-	Float:e_Amount,
-	Float:e_Health,
-	Float:e_Armour,
-	      e_Bodypart
-}
-
-enum E_SPAWN_INFO {
-	      e_Skin,
-	      e_Team,
-	Float:e_PosX,
-	Float:e_PosY,
-	Float:e_PosZ,
-	Float:e_Rot,
-	      e_Weapon1,
-	      e_Ammo1,
-	      e_Weapon2,
-	      e_Ammo2,
-	      e_Weapon3,
-	      e_Ammo3
-}
-
-// When a player takes or gives invalid damage (WC_* errors above)
-forward OnInvalidWeaponDamage(playerid, damagedid, Float:amount, weaponid, bodypart, error, bool:given);
-// Before damage is inflicted
-forward OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart);
-// After OnPlayerDamage
-forward OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart);
-// Before the death animation is applied
-forward OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time);
-// When the death animation is finished and the player has been sent to respawn
-forward OnPlayerDeathFinished(playerid, bool:cancelable);
-// When a shot or damage given is rejected
-forward OnRejectedHit(playerid, hit[E_REJECTED_HIT]);
-
-#if WC_CUSTOM_VENDING_MACHINES
-	// When a player is about to use a vending machine
-	forward OnPlayerUseVendingMachine(playerid, &Float:health_given);
-#endif
-
-// If you have your own definitions, remove them and use these instead
-#define BODY_PART_UNKNOWN 0
-#define WEAPON_UNARMED 0
-#define WEAPON_VEHICLE_M4 19
-#define WEAPON_VEHICLE_MINIGUN 20
-#define WEAPON_PISTOLWHIP 48
-#define WEAPON_HELIBLADES 50
-#define WEAPON_EXPLOSION 51
-#define WEAPON_CARPARK 52
-#define WEAPON_UNKNOWN 55
-
-#if WC_DEBUG_SILENT
-	static s_DebugMsgBuf[512];
-
-	#define DebugMessage(%1,%2) \
-		format(s_DebugMsgBuf,512,%2),printf("(wc:%d) %s",%1,s_DebugMsgBuf)
-
-	#define DebugMessageRed(%1,%2) \
-		format(s_DebugMsgBuf,512,%2),printf("(wc:%d) WARN: %s",%1,s_DebugMsgBuf)
-
-	#define DebugMessageAll(%1) \
-		printf(s_DebugMsgBuf,"(wc) " %1)
-
-	#define DebugMessageRedAll(%1) \
-		printf(s_DebugMsgBuf,"(wc) WARN: " %1)
-#elseif WC_DEBUG
-	static s_DebugMsgBuf[512];
-
-	#define DebugMessage(%1,%2) \
-		format(s_DebugMsgBuf,512,"(wc) " %2),SendClientMessage(%1,-1,s_DebugMsgBuf), \
-		format(s_DebugMsgBuf,512,%2),printf("(wc:%d) %s",%1,s_DebugMsgBuf)
-
-	#define DebugMessageRed(%1,%2) \
-		format(s_DebugMsgBuf,512,"(wc) " %2),SendClientMessage(%1,0xcc0000ff,s_DebugMsgBuf), \
-		format(s_DebugMsgBuf,512,%2),printf("(wc:%d) WARN: %s",%1,s_DebugMsgBuf)
-
-	#define DebugMessageAll(%1) \
-		format(s_DebugMsgBuf,512,"(wc) " %1),SendClientMessageToAll(-1,s_DebugMsgBuf), \
-		printf(s_DebugMsgBuf,"(wc) " %1)
-
-	#define DebugMessageRedAll(%1) \
-		format(s_DebugMsgBuf,512,"(wc) " %1),SendClientMessageToAll(0xcc0000ff,s_DebugMsgBuf), \
-		printf(s_DebugMsgBuf,"(wc) WARN: " %1)
-#else
-	#define DebugMessage(%1);
-	#define DebugMessageRed(%1);
-	#define DebugMessageAll(%1);
-	#define DebugMessageRedAll(%1);
-#endif
-
-// Weapons allowed in OnPlayerGiveDamage
-static const s_ValidDamageGiven[] = {
-	1, // 0 - Fist
-	1, // 1 - Brass knuckles
-	1, // 2 - Golf club
-	1, // 3 - Nitestick
-	1, // 4 - Knife
-	1, // 5 - Bat
-	1, // 6 - Shovel
-	1, // 7 - Pool cue
-	1, // 8 - Katana
-	1, // 9 - Chainsaw
-	1, // 10 - Dildo
-	1, // 11 - Dildo 2
-	1, // 12 - Vibrator
-	1, // 13 - Vibrator 2
-	1, // 14 - Flowers
-	1, // 15 - Cane
-	0, // 16 - Grenade
-	0, // 17 - Teargas
-	0, // 18 - Molotov
-	0, // 19 - Vehicle M4 (custom)
-	0, // 20 - Vehicle minigun
-	0, // 21
-	1, // 22 - Colt 45
-	1, // 23 - Silenced
-	1, // 24 - Deagle
-	1, // 25 - Shotgun
-	1, // 26 - Sawed-off
-	1, // 27 - Spas
-	1, // 28 - UZI
-	1, // 29 - MP5
-	1, // 30 - AK47
-	1, // 31 - M4
-	1, // 32 - Tec9
-	1, // 33 - Cuntgun
-	1, // 34 - Sniper
-	0, // 35 - Rocket launcher
-	0, // 36 - Heatseeker
-	0, // 37 - Flamethrower
-	1, // 38 - Minigun
-	0, // 39 - Satchel
-	0, // 40 - Detonator
-	1, // 41 - Spraycan
-	1, // 42 - Fire extinguisher
-	0, // 43 - Camera
-	0, // 44 - Night vision
-	0, // 45 - Infrared
-	1  // 46 - Parachute
-};
-
-// Weapons allowed in OnPlayerTakeDamage
-// 2 = valid in both OnPlayerGiveDamage and OnPlayerTakeDamage
-static const s_ValidDamageTaken[] = {
-	1, // 0 - Fist
-	1, // 1 - Brass knuckles
-	1, // 2 - Golf club
-	1, // 3 - Nitestick
-	1, // 4 - Knife
-	1, // 5 - Bat
-	1, // 6 - Shovel
-	1, // 7 - Pool cue
-	1, // 8 - Katana
-	1, // 9 - Chainsaw
-	1, // 10 - Dildo
-	1, // 11 - Dildo 2
-	1, // 12 - Vibrator
-	1, // 13 - Vibrator 2
-	1, // 14 - Flowers
-	1, // 15 - Cane
-	0, // 16 - Grenade
-	0, // 17 - Teargas
-	0, // 18 - Molotov
-	0, // 19 - Vehicle M4 (custom)
-	0, // 20 - Vehicle minigun (custom)
-	0, // 21
-	1, // 22 - Colt 45
-	1, // 23 - Silenced
-	1, // 24 - Deagle
-	1, // 25 - Shotgun
-	1, // 26 - Sawed-off
-	1, // 27 - Spas
-	1, // 28 - UZI
-	1, // 29 - MP5
-	1, // 30 - AK47
-	1, // 31 - M4
-	1, // 32 - Tec9
-	1, // 33 - Cuntgun
-	1, // 34 - Sniper
-	0, // 35 - Rocket launcher
-	0, // 36 - Heatseeker
-	2, // 37 - Flamethrower
-	1, // 38 - Minigun
-	0, // 39 - Satchel
-	0, // 40 - Detonator
-	1, // 41 - Spraycan
-	1, // 42 - Fire extinguisher
-	0, // 43 - Camera
-	0, // 44 - Night vision
-	0, // 45 - Infrared
-	1, // 46 - Parachute
-	0, // 47 - Fake pistol
-	0, // 48 - Pistol whip (custom)
-	2, // 49 - Vehicle
-	2, // 50 - Helicopter blades
-	2, // 51 - Explosion
-	0, // 52 - Car park (custom)
-	2, // 53 - Drowning
-	2  // 54 - Splat
-};
-
-// Default weapon damage. Connected to s_DamageType.
-// Melee weapons are multipliers because the damage differs
-// depending on type of punch/kick and fight style.
-static Float:s_WeaponDamage[] = {
-	1.0, // 0 - Fist
-	1.0, // 1 - Brass knuckles
-	1.0, // 2 - Golf club
-	1.0, // 3 - Nitestick
-	1.0, // 4 - Knife
-	1.0, // 5 - Bat
-	1.0, // 6 - Shovel
-	1.0, // 7 - Pool cue
-	1.0, // 8 - Katana
-	1.0, // 9 - Chainsaw
-	1.0, // 10 - Dildo
-	1.0, // 11 - Dildo 2
-	1.0, // 12 - Vibrator
-	1.0, // 13 - Vibrator 2
-	1.0, // 14 - Flowers
-	1.0, // 15 - Cane
-	82.5, // 16 - Grenade
-	0.0, // 17 - Teargas
-	1.0, // 18 - Molotov
-	9.9, // 19 - Vehicle M4 (custom)
-	46.2, // 20 - Vehicle minigun (custom)
-	0.0, // 21
-	8.25, // 22 - Colt 45
-	13.2, // 23 - Silenced
-	46.2, // 24 - Deagle
-	3.3, // 25 - Shotgun
-	3.3, // 26 - Sawed-off
-	4.95, // 27 - Spas
-	6.6, // 28 - UZI
-	8.25, // 29 - MP5
-	9.9, // 30 - AK47
-	9.9, // 31 - M4
-	6.6, // 32 - Tec9
-	24.75, // 33 - Cuntgun
-	41.25, // 34 - Sniper
-	82.5, // 35 - Rocket launcher
-	82.5, // 36 - Heatseeker
-	1.0, // 37 - Flamethrower
-	46.2, // 38 - Minigun
-	82.5, // 39 - Satchel
-	0.0, // 40 - Detonator
-	0.33, // 41 - Spraycan
-	0.33, // 42 - Fire extinguisher
-	0.0, // 43 - Camera
-	0.0, // 44 - Night vision
-	0.0, // 45 - Infrared
-	0.0, // 46 - Parachute
-	0.0, // 47 - Fake pistol
-	2.64, // 48 - Pistol whip (custom)
-	9.9, // 49 - Vehicle
-	330.0, // 50 - Helicopter blades
-	82.5, // 51 - Explosion
-	1.0, // 52 - Car park (custom)
-	1.0, // 53 - Drowning
-	165.0  // 54 - Splat
-};
-
-#assert DAMAGE_TYPE_MULTIPLIER == 0
-#assert DAMAGE_TYPE_STATIC == 1
-
-// Whether the damage is multiplied by the given/taken value (0) or always the same value (1)
-static s_DamageType[] = {
-	0, // 0 - Fist
-	0, // 1 - Brass knuckles
-	0, // 2 - Golf club
-	0, // 3 - Nitestick
-	0, // 4 - Knife
-	0, // 5 - Bat
-	0, // 6 - Shovel
-	0, // 7 - Pool cue
-	0, // 8 - Katana
-	0, // 9 - Chainsaw
-	0, // 10 - Dildo
-	0, // 11 - Dildo 2
-	0, // 12 - Vibrator
-	0, // 13 - Vibrator 2
-	0, // 14 - Flowers
-	0, // 15 - Cane
-	0, // 16 - Grenade
-	1, // 17 - Teargas
-	0, // 18 - Molotov
-	1, // 19 - Vehicle M4 (custom)
-	1, // 20 - Vehicle minigun (custom)
-	0, // 21
-	1, // 22 - Colt 45
-	1, // 23 - Silenced
-	1, // 24 - Deagle
-	1, // 25 - Shotgun
-	1, // 26 - Sawed-off
-	1, // 27 - Spas
-	1, // 28 - UZI
-	1, // 29 - MP5
-	1, // 30 - AK47
-	1, // 31 - M4
-	1, // 32 - Tec9
-	1, // 33 - Cuntgun
-	1, // 34 - Sniper
-	0, // 35 - Rocket launcher
-	0, // 36 - Heatseeker
-	0, // 37 - Flamethrower
-	1, // 38 - Minigun
-	0, // 39 - Satchel
-	0, // 40 - Detonator
-	1, // 41 - Spraycan
-	1, // 42 - Fire extinguisher
-	0, // 43 - Camera
-	0, // 44 - Night vision
-	0, // 45 - Infrared
-	0, // 46 - Parachute
-	0, // 47 - Fake pistol
-	1, // 48 - Pistol whip (custom)
-	1, // 49 - Vehicle
-	1, // 50 - Helicopter blades
-	0, // 51 - Explosion
-	0, // 52 - Car park
-	0, // 53 - Drowning
-	0  // 54 - Splat
-};
-
-// The default weapon range (from weapon.dat)
-// Note that due to various bugs, these can be exceeded, but
-// this include blocks out-of-range values.
-static Float:s_WeaponRange[] = {
-	0.0, // 0 - Fist
-	0.0, // 1 - Brass knuckles
-	0.0, // 2 - Golf club
-	0.0, // 3 - Nitestick
-	0.0, // 4 - Knife
-	0.0, // 5 - Bat
-	0.0, // 6 - Shovel
-	0.0, // 7 - Pool cue
-	0.0, // 8 - Katana
-	0.0, // 9 - Chainsaw
-	0.0, // 10 - Dildo
-	0.0, // 11 - Dildo 2
-	0.0, // 12 - Vibrator
-	0.0, // 13 - Vibrator 2
-	0.0, // 14 - Flowers
-	0.0, // 15 - Cane
-	0.0, // 16 - Grenade
-	0.0, // 17 - Teargas
-	0.0, // 18 - Molotov
-	90.0, // 19 - Vehicle M4 (custom)
-	75.0, // 20 - Vehicle minigun (custom)
-	0.0, // 21
-	35.0, // 22 - Colt 45
-	35.0, // 23 - Silenced
-	35.0, // 24 - Deagle
-	40.0, // 25 - Shotgun
-	35.0, // 26 - Sawed-off
-	40.0, // 27 - Spas
-	35.0, // 28 - UZI
-	45.0, // 29 - MP5
-	70.0, // 30 - AK47
-	90.0, // 31 - M4
-	35.0, // 32 - Tec9
-	100.0, // 33 - Cuntgun
-	320.0, // 34 - Sniper
-	0.0, // 35 - Rocket launcher
-	0.0, // 36 - Heatseeker
-	0.0, // 37 - Flamethrower
-	75.0  // 38 - Minigun
-};
-
-// The fastest possible gap between weapon shots in milliseconds
-static s_MaxWeaponShootRate[] = {
-	250, // 0 - Fist
-	250, // 1 - Brass knuckles
-	250, // 2 - Golf club
-	250, // 3 - Nitestick
-	250, // 4 - Knife
-	250, // 5 - Bat
-	250, // 6 - Shovel
-	250, // 7 - Pool cue
-	250, // 8 - Katana
-	30, // 9 - Chainsaw
-	250, // 10 - Dildo
-	250, // 11 - Dildo 2
-	250, // 12 - Vibrator
-	250, // 13 - Vibrator 2
-	250, // 14 - Flowers
-	250, // 15 - Cane
-	0, // 16 - Grenade
-	0, // 17 - Teargas
-	0, // 18 - Molotov
-	20, // 19 - Vehicle M4 (custom)
-	20, // 20 - Vehicle minigun (custom)
-	0, // 21
-	160, // 22 - Colt 45
-	120, // 23 - Silenced
-	120, // 24 - Deagle
-	800, // 25 - Shotgun
-	120, // 26 - Sawed-off
-	120, // 27 - Spas
-	50, // 28 - UZI
-	90, // 29 - MP5
-	90, // 30 - AK47
-	90, // 31 - M4
-	70, // 32 - Tec9
-	800, // 33 - Cuntgun
-	900, // 34 - Sniper
-	0, // 35 - Rocket launcher
-	0, // 36 - Heatseeker
-	0, // 37 - Flamethrower
-	20, // 38 - Minigun
-	0, // 39 - Satchel
-	0, // 40 - Detonator
-	10, // 41 - Spraycan
-	10, // 42 - Fire extinguisher
-	0, // 43 - Camera
-	0, // 44 - Night vision
-	0, // 45 - Infrared
-	0, // 46 - Parachute
-	0, // 47 - Fake pistol
-	400 // 48 - Pistol whip (custom)
-};
-
-// Whether the damage is applied directly to health (1) or is distributed between health and armour (0), and whether this rule applies only to the torso (1) or not (0)
-static s_DamageArmour[][2] = {
-	{0, 0}, // 0 - Fist
-	{0, 0}, // 1 - Brass knuckles
-	{0, 0}, // 2 - Golf club
-	{0, 0}, // 3 - Nitestick
-	{0, 0}, // 4 - Knife
-	{0, 0}, // 5 - Bat
-	{0, 0}, // 6 - Shovel
-	{0, 0}, // 7 - Pool cue
-	{0, 0}, // 8 - Katana
-	{0, 0}, // 9 - Chainsaw
-	{0, 0}, // 10 - Dildo
-	{0, 0}, // 11 - Dildo 2
-	{0, 0}, // 12 - Vibrator
-	{0, 0}, // 13 - Vibrator 2
-	{0, 0}, // 14 - Flowers
-	{0, 0}, // 15 - Cane
-	{0, 0}, // 16 - Grenade
-	{0, 0}, // 17 - Teargas
-	{0, 0}, // 18 - Molotov
-	{1, 1}, // 19 - Vehicle M4 (custom)
-	{1, 1}, // 20 - Vehicle minigun (custom)
-	{1, 0}, // 21
-	{1, 1}, // 22 - Colt 45
-	{1, 1}, // 23 - Silenced
-	{1, 1}, // 24 - Deagle
-	{1, 1}, // 25 - Shotgun
-	{1, 1}, // 26 - Sawed-off
-	{1, 1}, // 27 - Spas
-	{1, 1}, // 28 - UZI
-	{1, 1}, // 29 - MP5
-	{1, 1}, // 30 - AK47
-	{1, 1}, // 31 - M4
-	{1, 1}, // 32 - Tec9
-	{1, 1}, // 33 - Cuntgun
-	{1, 1}, // 34 - Sniper
-	{0, 0}, // 35 - Rocket launcher
-	{0, 0}, // 36 - Heatseeker
-	{0, 0}, // 37 - Flamethrower
-	{1, 1}, // 38 - Minigun
-	{0, 0}, // 39 - Satchel
-	{0, 0}, // 40 - Detonator
-	{0, 0}, // 41 - Spraycan
-	{0, 0}, // 42 - Fire extinguisher
-	{1, 0}, // 43 - Camera
-	{1, 0}, // 44 - Night vision
-	{1, 0}, // 45 - Infrared
-	{1, 0}, // 46 - Parachute
-	{1, 0}, // 47 - Fake pistol
-	{0, 0}, // 48 - Pistol whip (custom)
-	{0, 0}, // 49 - Vehicle
-	{0, 1}, // 50 - Helicopter blades
-	{0, 0}, // 51 - Explosion
-	{0, 0}, // 52 - Car park
-	{0, 0}, // 53 - Drowning
-	{0, 0}  // 54 - Splat
-};
-
-// That's right, it's called cuntgun
-stock const g_WeaponName[57][WC_MAX_WEAPON_NAME] = {
-	{"Fist"             }, {"Brass knuckles"}, {"Golf club"           },
-	{"Nightstick"       }, {"Knife"         }, {"Bat"                 },
-	{"Shovel"           }, {"Pool cue"      }, {"Katana"              },
-	{"Chainsaw"         }, {"Purple dildo"  }, {"Dildo"               },
-	{"Vibrator"         }, {"Vibrator"      }, {"Flowers"             },
-	{"Cane"             }, {"Grenade"       }, {"Tear gas"            },
-	{"Molotov"          }, {"Vehicle gun"   }, {"Vehicle gun"         },
-	{""                 }, {"Colt 45"       }, {"Silenced pistol"     },
-	{"Deagle"           }, {"Shotgun"       }, {"Sawn-off shotgun"    },
-	{"Combat shotgun"   }, {"Mac-10"        }, {"MP5"                 },
-	{"AK-47"            }, {"M4"            }, {"Tec-9"               },
-	{"Cuntgun"          }, {"Sniper"        }, {"Rocket launcher"     },
-	{"Heat seeking RPG" }, {"Flamethrower"  }, {"Minigun"             },
-	{"Satchel"          }, {"Detonator"     }, {"Spraycan"            },
-	{"Fire extinguisher"}, {"Camera"        }, {"Night vision goggles"},
-	{"Infrared goggles" }, {"Parachute"     }, {"Fake pistol"         },
-	{"Pistol whip"      }, {"Vehicle"       }, {"Helicopter blades"   },
-	{"Explosion"        }, {"Car parking"   }, {"Drowning"            },
-	{"Collision"        }, {"Splat"         }, {"Unknown"             }
-};
-
-// Yes - this is every single one of them
-#if WC_CUSTOM_VENDING_MACHINES
-	static const Float:sc_VendingMachines[][E_VENDING_MACHINE] = {
-		{955, 0, -862.82, 1536.60, 21.98, 0.00, 0.00, 180.00, -862.84, 1537.60},
-		{956, 0, 2271.72, -76.46, 25.96, 0.00, 0.00, 0.00, 2271.72, -77.46},
-		{955, 0, 1277.83, 372.51, 18.95, 0.00, 0.00, 64.00, 1278.73, 372.07},
-		{956, 0, 662.42, -552.16, 15.71, 0.00, 0.00, 180.00, 662.41, -551.16},
-		{955, 0, 201.01, -107.61, 0.89, 0.00, 0.00, 270.00, 200.01, -107.63},
-		{955, 0, -253.74, 2597.95, 62.24, 0.00, 0.00, 90.00, -252.74, 2597.95},
-		{956, 0, -253.74, 2599.75, 62.24, 0.00, 0.00, 90.00, -252.74, 2599.75},
-		{956, 0, -76.03, 1227.99, 19.12, 0.00, 0.00, 90.00, -75.03, 1227.99},
-		{955, 0, -14.70, 1175.35, 18.95, 0.00, 0.00, 180.00, -14.72, 1176.35},
-		{1977, 7, 316.87, -140.35, 998.58, 0.00, 0.00, 270.00, 315.87, -140.36},
-		{1775, 17, 373.82, -178.14, 1000.73, 0.00, 0.00, 0.00, 373.82, -179.14},
-		{1776, 17, 379.03, -178.88, 1000.73, 0.00, 0.00, 270.00, 378.03, -178.90},
-		{1775, 17, 495.96, -24.32, 1000.73, 0.00, 0.00, 180.00, 495.95, -23.32},
-		{1776, 17, 500.56, -1.36, 1000.73, 0.00, 0.00, 0.00, 500.56, -2.36},
-		{1775, 17, 501.82, -1.42, 1000.73, 0.00, 0.00, 0.00, 501.82, -2.42},
-		{956, 0, -1455.11, 2591.66, 55.23, 0.00, 0.00, 180.00, -1455.13, 2592.66},
-		{955, 0, 2352.17, -1357.15, 23.77, 0.00, 0.00, 90.00, 2353.17, -1357.15},
-		{955, 0, 2325.97, -1645.13, 14.21, 0.00, 0.00, 0.00, 2325.97, -1646.13},
-		{956, 0, 2139.51, -1161.48, 23.35, 0.00, 0.00, 87.00, 2140.51, -1161.53},
-		{956, 0, 2153.23, -1016.14, 62.23, 0.00, 0.00, 127.00, 2154.03, -1015.54},
-		{955, 0, 1928.73, -1772.44, 12.94, 0.00, 0.00, 90.00, 1929.73, -1772.44},
-		{1776, 1, 2222.36, 1602.64, 1000.06, 0.00, 0.00, 90.00, 2223.36, 1602.64},
-		{1775, 1, 2222.20, 1606.77, 1000.05, 0.00, 0.00, 90.00, 2223.20, 1606.77},
-		{1775, 1, 2155.90, 1606.77, 1000.05, 0.00, 0.00, 90.00, 2156.90, 1606.77},
-		{1775, 1, 2209.90, 1607.19, 1000.05, 0.00, 0.00, 270.00, 2208.90, 1607.17},
-		{1776, 1, 2155.84, 1607.87, 1000.06, 0.00, 0.00, 90.00, 2156.84, 1607.87},
-		{1776, 1, 2202.45, 1617.00, 1000.06, 0.00, 0.00, 180.00, 2202.43, 1618.00},
-		{1776, 1, 2209.24, 1621.21, 1000.06, 0.00, 0.00, 0.00, 2209.24, 1620.21},
-		{1776, 3, 330.67, 178.50, 1020.07, 0.00, 0.00, 0.00, 330.67, 177.50},
-		{1776, 3, 331.92, 178.50, 1020.07, 0.00, 0.00, 0.00, 331.92, 177.50},
-		{1776, 3, 350.90, 206.08, 1008.47, 0.00, 0.00, 90.00, 351.90, 206.08},
-		{1776, 3, 361.56, 158.61, 1008.47, 0.00, 0.00, 180.00, 361.54, 159.61},
-		{1776, 3, 371.59, 178.45, 1020.07, 0.00, 0.00, 0.00, 371.59, 177.45},
-		{1776, 3, 374.89, 188.97, 1008.47, 0.00, 0.00, 0.00, 374.89, 187.97},
-		{1775, 2, 2576.70, -1284.43, 1061.09, 0.00, 0.00, 270.00, 2575.70, -1284.44},
-		{1775, 15, 2225.20, -1153.42, 1025.90, 0.00, 0.00, 270.00, 2224.20, -1153.43},
-		{955, 0, 1154.72, -1460.89, 15.15, 0.00, 0.00, 270.00, 1153.72, -1460.90},
-		{956, 0, 2480.85, -1959.27, 12.96, 0.00, 0.00, 180.00, 2480.84, -1958.27},
-		{955, 0, 2060.11, -1897.64, 12.92, 0.00, 0.00, 0.00, 2060.11, -1898.64},
-		{955, 0, 1729.78, -1943.04, 12.94, 0.00, 0.00, 0.00, 1729.78, -1944.04},
-		{956, 0, 1634.10, -2237.53, 12.89, 0.00, 0.00, 0.00, 1634.10, -2238.53},
-		{955, 0, 1789.21, -1369.26, 15.16, 0.00, 0.00, 270.00, 1788.21, -1369.28},
-		{956, 0, -2229.18, 286.41, 34.70, 0.00, 0.00, 180.00, -2229.20, 287.41},
-		{955, 256, -1980.78, 142.66, 27.07, 0.00, 0.00, 270.00, -1981.78, 142.64},
-		{955, 256, -2118.96, -423.64, 34.72, 0.00, 0.00, 255.00, -2119.93, -423.40},
-		{955, 256, -2118.61, -422.41, 34.72, 0.00, 0.00, 255.00, -2119.58, -422.17},
-		{955, 256, -2097.27, -398.33, 34.72, 0.00, 0.00, 180.00, -2097.29, -397.33},
-		{955, 256, -2092.08, -490.05, 34.72, 0.00, 0.00, 0.00, -2092.08, -491.05},
-		{955, 256, -2063.27, -490.05, 34.72, 0.00, 0.00, 0.00, -2063.27, -491.05},
-		{955, 256, -2005.64, -490.05, 34.72, 0.00, 0.00, 0.00, -2005.64, -491.05},
-		{955, 256, -2034.46, -490.05, 34.72, 0.00, 0.00, 0.00, -2034.46, -491.05},
-		{955, 256, -2068.56, -398.33, 34.72, 0.00, 0.00, 180.00, -2068.58, -397.33},
-		{955, 256, -2039.85, -398.33, 34.72, 0.00, 0.00, 180.00, -2039.86, -397.33},
-		{955, 256, -2011.14, -398.33, 34.72, 0.00, 0.00, 180.00, -2011.15, -397.33},
-		{955, 2048, -1350.11, 492.28, 10.58, 0.00, 0.00, 90.00, -1349.11, 492.28},
-		{956, 2048, -1350.11, 493.85, 10.58, 0.00, 0.00, 90.00, -1349.11, 493.85},
-		{955, 0, 2319.99, 2532.85, 10.21, 0.00, 0.00, 0.00, 2319.99, 2531.85},
-		{956, 0, 2845.72, 1295.04, 10.78, 0.00, 0.00, 0.00, 2845.72, 1294.04},
-		{955, 0, 2503.14, 1243.69, 10.21, 0.00, 0.00, 180.00, 2503.12, 1244.69},
-		{956, 0, 2647.69, 1129.66, 10.21, 0.00, 0.00, 0.00, 2647.69, 1128.66},
-		{1209, 0, -2420.21, 984.57, 44.29, 0.00, 0.00, 90.00, -2419.21, 984.57},
-		{1302, 0, -2420.17, 985.94, 44.29, 0.00, 0.00, 90.00, -2419.17, 985.94},
-		{955, 0, 2085.77, 2071.35, 10.45, 0.00, 0.00, 90.00, 2086.77, 2071.35},
-		{956, 0, 1398.84, 2222.60, 10.42, 0.00, 0.00, 180.00, 1398.82, 2223.60},
-		{956, 0, 1659.46, 1722.85, 10.21, 0.00, 0.00, 0.00, 1659.46, 1721.85},
-		{955, 0, 1520.14, 1055.26, 10.00, 0.00, 0.00, 270.00, 1519.14, 1055.24},
-		{1775, 6, -19.03, -57.83, 1003.63, 0.00, 0.00, 180.00, -19.05, -56.83},
-		{1775, 18, -16.11, -91.64, 1003.63, 0.00, 0.00, 180.00, -16.13, -90.64},
-		{1775, 16, -15.10, -140.22, 1003.63, 0.00, 0.00, 180.00, -15.11, -139.22},
-		{1775, 17, -32.44, -186.69, 1003.63, 0.00, 0.00, 180.00, -32.46, -185.69},
-		{1775, 16, -35.72, -140.22, 1003.63, 0.00, 0.00, 180.00, -35.74, -139.22},
-		{1776, 6, -36.14, -57.87, 1003.63, 0.00, 0.00, 180.00, -36.16, -56.87},
-		{1776, 18, -17.54, -91.71, 1003.63, 0.00, 0.00, 180.00, -17.56, -90.71},
-		{1776, 16, -16.53, -140.29, 1003.63, 0.00, 0.00, 180.00, -16.54, -139.29},
-		{1776, 17, -33.87, -186.76, 1003.63, 0.00, 0.00, 180.00, -33.89, -185.76},
-		{1775, 6, -19.03, -57.83, 1003.63, 0.00, 0.00, 180.00, -19.05, -56.83},
-		{1776, 6, -36.14, -57.87, 1003.63, 0.00, 0.00, 180.00, -36.16, -56.87},
-		{1775, 18, -16.11, -91.64, 1003.63, 0.00, 0.00, 180.00, -16.13, -90.64},
-		{1776, 18, -17.54, -91.71, 1003.63, 0.00, 0.00, 180.00, -17.56, -90.71},
-		{1776, 16, -16.53, -140.29, 1003.63, 0.00, 0.00, 180.00, -16.54, -139.29},
-		{1775, 16, -15.10, -140.22, 1003.63, 0.00, 0.00, 180.00, -15.11, -139.22},
-		{1776, 17, -33.87, -186.76, 1003.63, 0.00, 0.00, 180.00, -33.89, -185.76},
-		{1775, 17, -32.44, -186.69, 1003.63, 0.00, 0.00, 180.00, -32.46, -185.69},
-		{1775, 16, -35.72, -140.22, 1003.63, 0.00, 0.00, 180.00, -35.74, -139.22}
-	};
-#endif
-
-// Sorry about the mess..
-static s_LagCompMode;
-static s_LastExplosive[MAX_PLAYERS];
-static s_LastShot[MAX_PLAYERS][E_SHOT_INFO];
-static s_LastShotTicks[MAX_PLAYERS][10];
-static s_LastShotWeapons[MAX_PLAYERS][10];
-static s_LastShotIdx[MAX_PLAYERS];
-static s_LastHitTicks[MAX_PLAYERS][10];
-static s_LastHitWeapons[MAX_PLAYERS][10];
-static s_LastHitIdx[MAX_PLAYERS];
-static s_ShotsFired[MAX_PLAYERS];
-static s_HitsIssued[MAX_PLAYERS];
-static s_MaxShootRateSamples = 5;
-static s_MaxHitRateSamples = 5;
-static Float:s_PlayerMaxHealth[MAX_PLAYERS] = {100.0, ...};
-static Float:s_PlayerHealth[MAX_PLAYERS] = {100.0, ...};
-static Float:s_PlayerMaxArmour[MAX_PLAYERS] = {100.0, ...};
-static Float:s_PlayerArmour[MAX_PLAYERS] = {0.0, ...};
-static s_LastSentHealth[MAX_PLAYERS];
-static s_LastSentArmour[MAX_PLAYERS];
-static bool:s_DamageArmourToggle[2] = {false, ...};
-static s_PlayerTeam[MAX_PLAYERS] = {NO_TEAM, ...};
-static s_IsDying[MAX_PLAYERS];
-static s_DeathTimer[MAX_PLAYERS] = {-1, ...};
-static bool:s_HealthBarVisible[MAX_PLAYERS];
-static bool:s_SpawnForStreamedIn[MAX_PLAYERS];
-static s_RespawnTime = 3000;
-static s_CustomFallDamage = false;
-static bool:s_CbugAllowed = true;
-static s_CbugFroze[MAX_PLAYERS];
-static s_DamageFeed = true;
-static s_DamageFeedPlayer[MAX_PLAYERS] = {-1, ...};
-static s_DamageFeedHideDelay = 3000;
-static s_DamageFeedMaxUpdateRate = 250;
-static s_VehiclePassengerDamage = false;
-static s_VehicleUnoccupiedDamage = false;
-static Float:s_FallDeathVelocity = -0.6;
-static s_DamageTakenSound = 1190;
-static s_DamageGivenSound = 17802;
-static s_RejectedHits[MAX_PLAYERS][WC_MAX_REJECTED_HITS][E_REJECTED_HIT];
-static s_RejectedHitsIdx[MAX_PLAYERS];
-static s_World[MAX_PLAYERS];
-static s_LastAnim[MAX_PLAYERS] = {-1, ...};
-static Float:s_LastZVelo[MAX_PLAYERS] = {0.0, ...};
-static Float:s_LastZ[MAX_PLAYERS] = {0.0, ...};
-static s_LastUpdate[MAX_PLAYERS] = {-1, ...};
-static PlayerText:s_DamageFeedTaken[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
-static PlayerText:s_DamageFeedGiven[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
-static s_DamageFeedHitsGiven[MAX_PLAYERS][WC_FEED_HEIGHT][E_DAMAGE_FEED_HIT];
-static s_DamageFeedHitsTaken[MAX_PLAYERS][WC_FEED_HEIGHT][E_DAMAGE_FEED_HIT];
-static s_DamageFeedTimer[MAX_PLAYERS] = {-1, ...};
-static s_DamageFeedLastUpdate[MAX_PLAYERS];
-static s_Spectating[MAX_PLAYERS] = {INVALID_PLAYER_ID, ...};
-static s_LastStop[MAX_PLAYERS];
-static bool:s_FirstSpawn[MAX_PLAYERS] = {true, ...};
-#if WC_CUSTOM_VENDING_MACHINES
-	static bool:s_CustomVendingMachines = true;
-	static s_VendingMachineObject[sizeof(sc_VendingMachines)] = {-1, ...};
-	static s_VendingUseTimer[MAX_PLAYERS] = {-1, ...};
-#endif
-static s_BeingResynced[MAX_PLAYERS];
-static s_KnifeTimeout[MAX_PLAYERS] = {-1, ...};
-static s_SyncData[MAX_PLAYERS][E_RESYNC_DATA];
-static Text:s_HealthBarBorder = Text:INVALID_TEXT_DRAW;
-static Text:s_HealthBarBackground = Text:INVALID_TEXT_DRAW;
-static PlayerText:s_HealthBarForeground[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
-static s_DamageRangeSteps[55];
-static Float:s_DamageRangeRanges[55][WC_MAX_DAMAGE_RANGES];
-static Float:s_DamageRangeValues[55][WC_MAX_DAMAGE_RANGES];
-static s_LastVehicleShooter[MAX_VEHICLES + 1] = {INVALID_PLAYER_ID, ...};
-static bool:s_InternalTextDraw[Text:MAX_TEXT_DRAWS];
-static bool:s_InternalPlayerTextDraw[MAX_PLAYERS][PlayerText:MAX_PLAYER_TEXT_DRAWS];
-static s_LastVehicleEnterTime[MAX_PLAYERS];
-static s_TrueDeath[MAX_PLAYERS];
-static s_InClassSelection[MAX_PLAYERS];
-static s_ForceClassSelection[MAX_PLAYERS];
-static s_ClassSpawnInfo[320][E_SPAWN_INFO];
-static s_PlayerSpawnInfo[MAX_PLAYERS][E_SPAWN_INFO];
-static s_PlayerFallbackSpawnInfo[MAX_PLAYERS][E_SPAWN_INFO];
-static s_PlayerClass[MAX_PLAYERS] = {-2, ...};
-static bool:s_SpawnInfoModified[MAX_PLAYERS];
-static bool:s_AlreadyConnected[MAX_PLAYERS];
-static s_DeathSkip[MAX_PLAYERS];
-static s_DeathSkipTick[MAX_PLAYERS];
-static s_LastVehicleTick[MAX_PLAYERS];
-static s_PreviousHits[MAX_PLAYERS][10][E_HIT_INFO];
-static s_PreviousHitI[MAX_PLAYERS];
-static Float:s_DamageDoneHealth[MAX_PLAYERS];
-static Float:s_DamageDoneArmour[MAX_PLAYERS];
-static s_DelayedDeathTimer[MAX_PLAYERS] = {-1, ...};
-static bool:s_VehicleAlive[MAX_VEHICLES] = {false, ...};
-static s_VehicleRespawnTimer[MAX_VEHICLES] = {-1, ...};
-
-native WC_IsValidVehicle(vehicleid) = IsValidVehicle;
-
-/*
- * Public API
- */
-stock IsBulletWeapon(weaponid)
-{
-	return (WEAPON_COLT45 <= weaponid <= WEAPON_SNIPER) || weaponid == WEAPON_MINIGUN;
-}
-
-stock IsHighRateWeapon(weaponid)
-{
-	switch (weaponid) {
-		case WEAPON_FLAMETHROWER, WEAPON_DROWN, WEAPON_CARPARK,
-		     WEAPON_SPRAYCAN, WEAPON_FIREEXTINGUISHER: {
-			return true;
-		}
-	}
-
-	return false;
-}
-
-stock IsMeleeWeapon(weaponid)
-{
-	return (WEAPON_UNARMED <= weaponid <= WEAPON_KATANA) || (WEAPON_DILDO <= weaponid <= WEAPON_CANE) || weaponid == WEAPON_PISTOLWHIP;
-}
-
-stock IsPlayerSpawned(playerid)
-{
-	if (s_IsDying[playerid] || s_BeingResynced[playerid]) {
-		return false;
-	}
-
-	switch (GetPlayerState(playerid)) {
-		case PLAYER_STATE_ONFOOT .. PLAYER_STATE_PASSENGER,
-		     PLAYER_STATE_SPAWNED: {
-			return true;
-		}
-	}
-
-	return false;
-}
-
-stock AverageShootRate(playerid, shots, &multiple_weapons = 0)
-{
-	if (playerid == INVALID_PLAYER_ID || s_ShotsFired[playerid] < shots) {
-		return -1;
-	}
-
-	new total = 0, idx = s_LastShotIdx[playerid];
-
-	multiple_weapons = false;
-
-	for (new i = shots - 2; i >= 0; i--) {
-		new prev_idx = (idx - i - 1) % sizeof(s_LastShotTicks[]);
-
-		// JIT plugin fix
-		if (prev_idx < 0) {
-			prev_idx += sizeof(s_LastShotTicks[]);
-		}
-
-		new prev = s_LastShotTicks[playerid][prev_idx];
-		new prev_weap = s_LastShotWeapons[playerid][prev_idx];
-		new this_idx = (idx - i) % sizeof(s_LastShotTicks[]);
-
-		// JIT plugin fix
-		if (this_idx < 0) {
-			this_idx += sizeof(s_LastShotTicks[]);
-		}
-
-		if (prev_weap != s_LastShotWeapons[playerid][this_idx]) {
-			multiple_weapons = true;
-		}
-
-		total += s_LastShotTicks[playerid][this_idx] - prev;
-	}
-
-	return total / (shots - 1);
-}
-
-stock AverageHitRate(playerid, hits, &multiple_weapons = 0)
-{
-	if (playerid == INVALID_PLAYER_ID || s_HitsIssued[playerid] < hits) {
-		return -1;
-	}
-
-	new total = 0, idx = s_LastHitIdx[playerid];
-
-	multiple_weapons = false;
-
-	for (new i = hits - 2; i >= 0; i--) {
-		new prev_idx = (idx - i - 1) % sizeof(s_LastHitTicks[]);
-
-		// JIT plugin fix
-		if (prev_idx < 0) {
-			prev_idx += sizeof(s_LastHitTicks[]);
-		}
-
-		new prev = s_LastHitTicks[playerid][prev_idx];
-		new prev_weap = s_LastHitWeapons[playerid][prev_idx];
-		new this_idx = (idx - i) % sizeof(s_LastHitTicks[]);
-
-		// JIT plugin fix
-		if (this_idx < 0) {
-			this_idx += sizeof(s_LastHitTicks[]);
-		}
-
-		if (prev_weap != s_LastHitWeapons[playerid][this_idx]) {
-			multiple_weapons = true;
-		}
-
-		total += s_LastHitTicks[playerid][this_idx] - prev;
-	}
-
-	return total / (hits - 1);
-}
-
-stock SetRespawnTime(ms)
-{
-	s_RespawnTime = max(0, ms);
-}
-
-stock GetRespawnTime()
-{
-	return s_RespawnTime;
-}
-
-stock ReturnWeaponName(weaponid)
-{
-	new name[sizeof(g_WeaponName[])];
-
-	WC_GetWeaponName(weaponid, name);
-
-	return name;
-}
-
-stock SetWeaponDamage(weaponid, damage_type, Float:amount, Float:...)
-{
-	if (weaponid < 0 || weaponid >= sizeof(s_WeaponDamage)) {
-		return 0;
-	}
-
-	if (damage_type == DAMAGE_TYPE_RANGE || damage_type == DAMAGE_TYPE_RANGE_MULTIPLIER) {
-		if (!IsBulletWeapon(weaponid)) {
-			return 0;
-		}
-
-		new args = numargs();
-
-		if (!(args & 0b1)) {
-			return 0;
-		}
-
-		new steps = (args - 1) / 2;
-
-		s_DamageType[weaponid] = damage_type;
-		s_DamageRangeSteps[weaponid] = steps;
-
-		for (new i = 0; i < steps; i++) {
-			if (i) {
-				s_DamageRangeRanges[weaponid][i] = Float:getarg(1 + i*2);
-				s_DamageRangeValues[weaponid][i] = Float:getarg(2 + i*2);
-			} else {
-				s_DamageRangeValues[weaponid][i] = amount;
-			}
-		}
-
-		return 1;
-	} else if (damage_type == DAMAGE_TYPE_MULTIPLIER || damage_type == DAMAGE_TYPE_STATIC) {
-		s_DamageType[weaponid] = damage_type;
-		s_DamageRangeSteps[weaponid] = 0;
-		s_WeaponDamage[weaponid] = amount;
-
-		return 1;
-	}
-
-	return 0;
-}
-
-stock SetCustomArmourRules(bool:armour_rules, bool:torso_rules = false)
-{
-	s_DamageArmourToggle[0] = armour_rules;
-	s_DamageArmourToggle[1] = torso_rules;
-}
-
-stock SetWeaponArmourRule(weaponid, bool:affects_armour, bool:torso_only = false)
-{
-	if (weaponid < 0 || weaponid >= sizeof(s_WeaponDamage)) {
-		return 0;
-	}
-
-	s_DamageArmour[weaponid][0] = affects_armour;
-	s_DamageArmour[weaponid][1] = torso_only;
-
-	return 1;
-}
-
-stock SetDamageSounds(taken, given)
-{
-	s_DamageTakenSound = taken;
-	s_DamageGivenSound = given;
-}
-
-stock SetCbugAllowed(bool:enabled)
-{
-	s_CbugAllowed = enabled;
-}
-
-stock bool:GetCbugAllowed()
-{
-	return s_CbugAllowed;
-}
-
-stock SetCustomFallDamage(bool:toggle, Float:damage_multiplier = 25.0, Float:death_velocity = -0.6)
-{
-	s_CustomFallDamage = toggle;
-
-	if (toggle) {
-		s_WeaponDamage[WEAPON_COLLISION] = damage_multiplier;
-		s_FallDeathVelocity = -floatabs(death_velocity);
-	}
-}
-
-#if WC_CUSTOM_VENDING_MACHINES
-	stock SetCustomVendingMachines(bool:toggle)
-	{
-		s_CustomVendingMachines = toggle;
-
-		if (toggle) {
-			CreateVendingMachines();
-		} else {
-			DestroyVendingMachines();
-		}
-	}
-#endif
-
-stock SetVehiclePassengerDamage(bool:toggle)
-{
-	s_VehiclePassengerDamage = toggle;
-}
-
-stock SetVehicleUnoccupiedDamage(bool:toggle)
-{
-	s_VehicleUnoccupiedDamage = toggle;
-}
-
-stock SetDamageFeedForPlayer(playerid, toggle = -1)
-{
-	if (IsPlayerConnected(playerid))
-	{
-		s_DamageFeedPlayer[playerid] = toggle;
-		DamageFeedUpdate(playerid);
-		return 1;
-	}
-
-	return 0;
-}
-
-stock IsDamageFeedActive(playerid = -1)
-{
-	if (playerid != -1) {
-		return s_DamageFeedPlayer[playerid] == 1 || s_DamageFeed && s_DamageFeedPlayer[playerid] != 0;
-	}
-
-	return s_DamageFeed;
-}
-
-stock SetDamageFeed(bool:toggle)
-{
-	s_DamageFeed = toggle;
-
-	for (new i = 0; i < MAX_PLAYERS; i++) {
-		if (IsPlayerConnected(i)) {
-			DamageFeedUpdate(i);
-		}
-	}
-}
-
-stock SetWeaponShootRate(weaponid, max_rate)
-{
-	if (0 <= weaponid < sizeof(s_MaxWeaponShootRate)) {
-		s_MaxWeaponShootRate[weaponid] = max_rate;
-
-		return 1;
-	}
-
-	return 0;
-}
-
-stock IsPlayerDying(playerid)
-{
-	if (0 <= playerid < MAX_PLAYERS) {
-		return s_IsDying[playerid];
-	}
-
-	return false;
-}
-
-stock SetWeaponMaxRange(weaponid, Float:range)
-{
-	if (!IsBulletWeapon(weaponid)) {
-		return 0;
-	}
-
-	s_WeaponRange[weaponid] = range;
-
-	return 1;
-}
-
-stock SetPlayerMaxHealth(playerid, Float:value)
-{
-	if (0 <= playerid < MAX_PLAYERS) {
-		s_PlayerMaxHealth[playerid] = value;
-	}
-}
-
-stock SetPlayerMaxArmour(playerid, Float:value)
-{
-	if (0 <= playerid < MAX_PLAYERS) {
-		s_PlayerMaxArmour[playerid] = value;
-	}
-}
-
-stock Float:GetPlayerMaxHealth(playerid)
-{
-	if (0 <= playerid < MAX_PLAYERS) {
-		return s_PlayerMaxHealth[playerid];
-	}
-
-	return 0.0;
-}
-
-stock Float:GetPlayerMaxArmour(playerid)
-{
-	if (0 <= playerid < MAX_PLAYERS) {
-		return s_PlayerMaxArmour[playerid];
-	}
-
-	return 0.0;
-}
-
-stock Float:GetLastDamageHealth(playerid)
-{
-	if (0 <= playerid < MAX_PLAYERS) {
-		return s_DamageDoneHealth[playerid];
-	}
-
-	return 0.0;
-}
-
-stock Float:GetLastDamageArmour(playerid)
-{
-	if (0 <= playerid < MAX_PLAYERS) {
-		return s_DamageDoneArmour[playerid];
-	}
-
-	return 0.0;
-}
-
-stock DamagePlayer(playerid, Float:amount, issuerid = INVALID_PLAYER_ID, weaponid = WEAPON_UNKNOWN, bodypart = BODY_PART_UNKNOWN, bool:ignore_armour = false)
-{
-	if (playerid < 0 || playerid > MAX_PLAYERS || !IsPlayerConnected(playerid)) {
-		return 0;
-	}
-
-	if (amount < 0.0) {
-		return 0;
-	}
-
-	if (weaponid < 0 || weaponid > 55) {
-		weaponid = WEAPON_UNKNOWN;
-	}
-
-	if (issuerid < 0 || issuerid > MAX_PLAYERS || !IsPlayerConnected(issuerid)) {
-		issuerid = INVALID_PLAYER_ID;
-	}
-
-	InflictDamage(playerid, amount, issuerid, weaponid, bodypart, ignore_armour);
-
-	return 1;
-}
-
-stock GetRejectedHit(playerid, idx, output[], maxlength = sizeof(output))
-{
-	if (idx >= WC_MAX_REJECTED_HITS) {
-		return 0;
-	}
-
-	new real_idx = (s_RejectedHitsIdx[playerid] - idx) % WC_MAX_REJECTED_HITS;
-
-	// JIT plugin fix
-	if (real_idx < 0) {
-		real_idx += WC_MAX_REJECTED_HITS;
-	}
-
-	if (!s_RejectedHits[playerid][real_idx][e_Time]) {
-		return 0;
-	}
-
-	new reason = s_RejectedHits[playerid][real_idx][e_Reason];
-	new hour = s_RejectedHits[playerid][real_idx][e_Hour];
-	new minute = s_RejectedHits[playerid][real_idx][e_Minute];
-	new second = s_RejectedHits[playerid][real_idx][e_Second];
-	new i1 = s_RejectedHits[playerid][real_idx][e_Info1];
-	new i2 = s_RejectedHits[playerid][real_idx][e_Info2];
-	new i3 = s_RejectedHits[playerid][real_idx][e_Info3];
-	new weapon = s_RejectedHits[playerid][real_idx][e_Weapon];
-
-	new weapon_name[32];
-
-	WC_GetWeaponName(weapon, weapon_name);
-
-	format(output, maxlength, "[%02d:%02d:%02d] (%s -> %s) %s", hour, minute, second, weapon_name, s_RejectedHits[playerid][real_idx][e_Name], g_HitRejectReasons[reason]);
-
-	format(output, maxlength, output, i1, i2, i3);
-
-	return 1;
-}
-
-stock ResyncPlayer(playerid)
-{
-	SaveSyncData(playerid);
-
-	s_BeingResynced[playerid] = true;
-
-	SpawnPlayerInPlace(playerid);
-}
-
-/*
- * Hooked natives
- */
-
-stock WC_SpawnPlayer(playerid)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
-		return 0;
-	}
-
-	if (s_PlayerHealth[playerid] == 0.0) {
-		s_PlayerHealth[playerid] = s_PlayerMaxHealth[playerid];
-	}
-
-	SpawnPlayer(playerid);
-
-	return 1;
-}
-
-stock WC_GetPlayerState(playerid)
-{
-	if (s_IsDying[playerid]) {
-		return PLAYER_STATE_WASTED;
-	}
-
-	return GetPlayerState(playerid);
-}
-
-stock Float:WC_GetPlayerHealth(playerid, &Float:health = 0.0)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) {
-		health = 0.0;
-
-		return 0.0;
-	}
-
-	health = s_PlayerHealth[playerid];
-
-	return health;
-}
-
-stock WC_SetPlayerHealth(playerid, Float:health, Float:armour = -1.0)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) {
-		return 0;
-	}
-
-	if (health <= 0.0) {
-		s_PlayerArmour[playerid] = 0.0;
-		s_PlayerHealth[playerid] = 0.0;
-
-		InflictDamage(playerid, 0.0);
-	} else {
-		if (armour != -1.0) {
-			if (armour > s_PlayerMaxArmour[playerid]) {
-				armour = s_PlayerMaxArmour[playerid];
-			}
-			s_PlayerArmour[playerid] = armour;
-		}
-
-		if (health > s_PlayerMaxHealth[playerid]) {
-			health = s_PlayerMaxHealth[playerid];
-		}
-		s_PlayerHealth[playerid] = health;
-		UpdateHealthBar(playerid, true);
-	}
-
-	return 1;
-}
-
-stock Float:WC_GetPlayerArmour(playerid, &Float:armour = 0.0)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) {
-		armour = 0.0;
-
-		return 0.0;
-	}
-
-	armour = s_PlayerArmour[playerid];
-
-	return armour;
-}
-
-stock WC_SetPlayerArmour(playerid, Float:armour)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) {
-		return 0;
-	}
-
-	if (armour > s_PlayerMaxArmour[playerid]) {
-		armour = s_PlayerMaxArmour[playerid];
-	}
-	s_PlayerArmour[playerid] = armour;
-	UpdateHealthBar(playerid, true);
-
-	return 1;
-}
-
-stock WC_GetPlayerTeam(playerid)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) {
-		return NO_TEAM;
-	}
-
-	if (!IsPlayerConnected(playerid)) {
-		return NO_TEAM;
-	}
-
-	return s_PlayerTeam[playerid];
-}
-
-stock WC_SetPlayerTeam(playerid, team)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) {
-		return 0;
-	}
-
-	s_PlayerTeam[playerid] = team;
-
-	return 1;
-}
-
-stock WC_SendDeathMessage(killer, killee, weapon)
-{
-	if (weapon == WEAPON_CARPARK) {
-		weapon = WEAPON_VEHICLE;
-	} else if (weapon == WEAPON_PISTOLWHIP) {
-		weapon = WEAPON_UNARMED;
-	} else if (weapon == WEAPON_UNKNOWN) {
-		weapon = WEAPON_DROWN;
-	} else if (weapon == WEAPON_VEHICLE_M4) {
-		weapon = WEAPON_M4;
-	} if (weapon == WEAPON_VEHICLE_MINIGUN) {
-		weapon = WEAPON_MINIGUN;
-	}
-
-	SendDeathMessage(killer, killee, weapon);
-
-	return 1;
-}
-
-stock SetWeaponName(weaponid, const name[])
-{
-	if (weaponid < 0 || weaponid >= sizeof(g_WeaponName)) {
-		return 0;
-	}
-
-	strunpack(g_WeaponName[weaponid], name, sizeof(g_WeaponName[]));
-
-	return 1;
-}
-
-stock WC_GetWeaponName(weaponid, weapon[], len = sizeof(weapon))
-{
-	if (weaponid < 0 || weaponid >= sizeof(g_WeaponName)) {
-		format(weapon, len, "Weapon %d", weaponid);
-	} else {
-		strunpack(weapon, g_WeaponName[weaponid], len);
-	}
-
-	return 1;
-}
-
-stock WC_ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
-		return 0;
-	}
-
-	return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
-}
-
-stock WC_ClearAnimations(playerid, forcesync = 1)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
-		return 0;
-	}
-
-	s_LastStop[playerid] = GetTickCount();
-
-	return ClearAnimations(playerid, forcesync);
-}
-
-stock WC_AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
-{
-	new classid = AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
-
-	s_ClassSpawnInfo[classid][e_Skin] = modelid;
-	s_ClassSpawnInfo[classid][e_Team] = 0x7FFFFFFF;
-	s_ClassSpawnInfo[classid][e_PosX] = spawn_x;
-	s_ClassSpawnInfo[classid][e_PosY] = spawn_y;
-	s_ClassSpawnInfo[classid][e_PosZ] = spawn_z;
-	s_ClassSpawnInfo[classid][e_Rot] = z_angle;
-	s_ClassSpawnInfo[classid][e_Weapon1] = weapon1;
-	s_ClassSpawnInfo[classid][e_Ammo1] = weapon1_ammo;
-	s_ClassSpawnInfo[classid][e_Weapon2] = weapon2;
-	s_ClassSpawnInfo[classid][e_Ammo2] = weapon2_ammo;
-	s_ClassSpawnInfo[classid][e_Weapon3] = weapon3;
-	s_ClassSpawnInfo[classid][e_Ammo3] = weapon3_ammo;
-
-	return classid;
-}
-
-stock WC_AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
-{
-	new classid = AddPlayerClassEx(teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
-
-	s_ClassSpawnInfo[classid][e_Skin] = modelid;
-	s_ClassSpawnInfo[classid][e_Team] = teamid;
-	s_ClassSpawnInfo[classid][e_PosX] = spawn_x;
-	s_ClassSpawnInfo[classid][e_PosY] = spawn_y;
-	s_ClassSpawnInfo[classid][e_PosZ] = spawn_z;
-	s_ClassSpawnInfo[classid][e_Rot] = z_angle;
-	s_ClassSpawnInfo[classid][e_Weapon1] = weapon1;
-	s_ClassSpawnInfo[classid][e_Ammo1] = weapon1_ammo;
-	s_ClassSpawnInfo[classid][e_Weapon2] = weapon2;
-	s_ClassSpawnInfo[classid][e_Ammo2] = weapon2_ammo;
-	s_ClassSpawnInfo[classid][e_Weapon3] = weapon3;
-	s_ClassSpawnInfo[classid][e_Ammo3] = weapon3_ammo;
-
-	return classid;
-}
-
-stock WC_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
-{
-	s_PlayerClass[playerid] = -1;
-	s_SpawnInfoModified[playerid] = false;
-
-	s_PlayerSpawnInfo[playerid][e_Skin] = skin;
-	s_PlayerSpawnInfo[playerid][e_Team] = team;
-	s_PlayerSpawnInfo[playerid][e_PosX] = x;
-	s_PlayerSpawnInfo[playerid][e_PosY] = y;
-	s_PlayerSpawnInfo[playerid][e_PosZ] = z;
-	s_PlayerSpawnInfo[playerid][e_Rot] = rotation;
-	s_PlayerSpawnInfo[playerid][e_Weapon1] = weapon1;
-	s_PlayerSpawnInfo[playerid][e_Ammo1] = weapon1_ammo;
-	s_PlayerSpawnInfo[playerid][e_Weapon2] = weapon2;
-	s_PlayerSpawnInfo[playerid][e_Ammo2] = weapon2_ammo;
-	s_PlayerSpawnInfo[playerid][e_Weapon3] = weapon3;
-	s_PlayerSpawnInfo[playerid][e_Ammo3] = weapon3_ammo;
-
-	return SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
-}
-
-stock WC_TogglePlayerSpectating(playerid, toggle)
-{
-	if (toggle) {
-		if (s_DeathTimer[playerid] != -1) {
-			KillTimer(s_DeathTimer[playerid]);
-			s_DeathTimer[playerid] = -1;
-		}
-
-		#if WC_CUSTOM_VENDING_MACHINES
-			if (s_VendingUseTimer[playerid] != -1) {
-				KillTimer(s_VendingUseTimer[playerid]);
-				s_VendingUseTimer[playerid] = -1;
-			}
-		#endif
-
-		s_IsDying[playerid] = false;
-	}
-
-	return TogglePlayerSpectating(playerid, toggle);
-}
-
-stock WC_TogglePlayerControllable(playerid, toggle)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
-		return 0;
-	}
-
-	s_LastStop[playerid] = GetTickCount();
-
-	return TogglePlayerControllable(playerid, toggle);
-}
-
-stock WC_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
-		return 0;
-	}
-
-	s_LastStop[playerid] = GetTickCount();
-
-	return SetPlayerPos(playerid, x, y, z);
-}
-
-stock WC_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
-		return 0;
-	}
-
-	s_LastStop[playerid] = GetTickCount();
-
-	return SetPlayerPosFindZ(playerid, x, y, z);
-}
-
-stock WC_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
-		return 0;
-	}
-
-	if (X == 0.0 && Y == 0.0 && Z == 0.0) {
-		s_LastStop[playerid] = GetTickCount();
-	}
-
-	return SetPlayerVelocity(playerid, X, Y, Z);
-}
-
-stock wc_SetPlayerVirtualWorld(playerid, worldid)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) {
-		return 0;
-	}
-
-	s_World[playerid] = worldid;
-
-	if (s_IsDying[playerid]) {
-		return 1;
-	}
-
-	return SetPlayerVirtualWorld(playerid, worldid);
-}
-
-stock WC_GetPlayerVirtualWorld(playerid)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) {
-		return 0;
-	}
-
-	new worldid = GetPlayerVirtualWorld(playerid);
-
-	if (worldid == WC_DEATH_WORLD) {
-		return s_World[playerid];
-	}
-
-	return worldid;
-}
-
-stock WC_PlayerSpectatePlayer(playerid, targetplayerid, mode = SPECTATE_MODE_NORMAL)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS || targetplayerid < 0 || targetplayerid >= MAX_PLAYERS) {
-		return 0;
-	}
-
-	s_Spectating[playerid] = targetplayerid;
-
-	return PlayerSpectatePlayer(playerid, targetplayerid, mode);
-}
-
-stock WC_DestroyVehicle(vehicleid)
-{
-	if (0 < vehicleid < MAX_VEHICLES) {
-		s_LastVehicleShooter[vehicleid] = INVALID_PLAYER_ID;
-		s_VehicleAlive[vehicleid] = false;
-		if (s_VehicleRespawnTimer[vehicleid] != -1) {
-			KillTimer(s_VehicleRespawnTimer[vehicleid]);
-			s_VehicleRespawnTimer[vehicleid] = -1;
-		}
-	}
-
-	return DestroyVehicle(vehicleid);
-}
-
-stock WC_CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren = 0)
-{
-	new id = CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay, addsiren);
-	if (id != INVALID_VEHICLE_ID) {
-		s_VehicleAlive[id] = true;
-		return id;
-	}
-	return INVALID_VEHICLE_ID;
-}
-
-
-stock WC_AddStaticVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2)
-{
-	new id = AddStaticVehicle(modelid, x, y, z, angle, color1, color2);
-	if (id != INVALID_VEHICLE_ID) {
-		s_VehicleAlive[id] = true;
-		return id;
-	}
-	return INVALID_VEHICLE_ID;
-}
-
-
-stock WC_AddStaticVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren = 0)
-{
-	new id = AddStaticVehicleEx(modelid, x, y, z, angle, color1, color2, respawn_delay, addsiren);
-	if (id != INVALID_VEHICLE_ID) {
-		s_VehicleAlive[id] = true;
-		return id;
-	}
-	return INVALID_VEHICLE_ID;
-}
-
-stock WC_IsPlayerInCheckpoint(playerid)
-{
-	if (!IsPlayerSpawned(playerid)) {
-		return 0;
-	}
-
-	return IsPlayerInCheckpoint(playerid);
-}
-
-stock WC_SetPlayerSpecialAction(playerid, actionid)
-{
-	if (!IsPlayerSpawned(playerid)) {
-		return 0;
-	}
-
-	return SetPlayerSpecialAction(playerid, actionid);
-}
-
-stock Text:WC_TextDrawCreate(Float:x, Float:y, text[])
-{
-	new Text:td = TextDrawCreate(x, y, text);
-
-	if (td != Text:INVALID_TEXT_DRAW) {
-		s_InternalTextDraw[td] = false;
-	}
-
-	return td;
-}
-
-stock WC_TextDrawDestroy(Text:text)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawDestroy(text);
-}
-
-stock WC_TextDrawLetterSize(Text:text, Float:x, Float:y)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawLetterSize(text, x, y);
-}
-
-stock WC_TextDrawTextSize(Text:text, Float:x, Float:y)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawTextSize(text, x, y);
-}
-
-stock WC_TextDrawAlignment(Text:text, alignment)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawAlignment(text, alignment);
-}
-
-stock WC_TextDrawColor(Text:text, color)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawColor(text, color);
-}
-
-stock WC_TextDrawUseBox(Text:text, use)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawUseBox(text, use);
-}
-
-stock WC_TextDrawBoxColor(Text:text, color)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawBoxColor(text, color);
-}
-
-stock WC_TextDrawSetShadow(Text:text, size)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawSetShadow(text, size);
-}
-
-stock WC_TextDrawSetOutline(Text:text, size)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawSetOutline(text, size);
-}
-
-stock WC_TextDrawBackgroundColor(Text:text, color)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawBackgroundColor(text, color);
-}
-
-stock WC_TextDrawFont(Text:text, font)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawFont(text, font);
-}
-
-stock WC_TextDrawSetProportional(Text:text, set)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawSetProportional(text, set);
-}
-
-stock WC_TextDrawSetSelectable(Text:text, set)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawSetSelectable(text, set);
-}
-
-stock WC_TextDrawShowForPlayer(playerid, Text:text)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawShowForPlayer(playerid, text);
-}
-
-stock WC_TextDrawHideForPlayer(playerid, Text:text)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawHideForPlayer(playerid, text);
-}
-
-stock WC_TextDrawShowForAll(Text:text)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawShowForAll(text);
-}
-
-stock WC_TextDrawHideForAll(Text:text)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawHideForAll(text);
-}
-
-stock WC_TextDrawSetString(Text:text, string[])
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawSetString(text, string);
-}
-
-stock WC_TextDrawSetPreviewModel(Text:text, modelindex)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawSetPreviewModel(text, modelindex);
-}
-
-stock WC_TextDrawSetPreviewRot(Text:text, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fZoom = 1.0)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawSetPreviewRot(text, fRotX, fRotY, fRotZ, fZoom);
-}
-
-stock WC_TextDrawSetPreviewVehCol(Text:text, color1, color2)
-{
-	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
-	return TextDrawSetPreviewVehCol(text, color1, color2);
-}
-
-stock PlayerText:WC_CreatePlayerTextDraw(playerid, Float:x, Float:y, text[])
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return PlayerText:INVALID_TEXT_DRAW;
-	new PlayerText:td = CreatePlayerTextDraw(playerid, x, y, text);
-
-	if (td != PlayerText:INVALID_TEXT_DRAW) {
-		s_InternalPlayerTextDraw[playerid][td] = false;
-	}
-
-	return td;
-}
-
-stock WC_PlayerTextDrawDestroy(playerid, PlayerText:text)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawDestroy(playerid, text);
-}
-
-stock WC_PlayerTextDrawLetterSize(playerid, PlayerText:text, Float:x, Float:y)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawLetterSize(playerid, text, x, y);
-}
-
-stock WC_PlayerTextDrawTextSize(playerid, PlayerText:text, Float:x, Float:y)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawTextSize(playerid, text, x, y);
-}
-
-stock WC_PlayerTextDrawAlignment(playerid, PlayerText:text, alignment)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawAlignment(playerid, text, alignment);
-}
-
-stock WC_PlayerTextDrawColor(playerid, PlayerText:text, color)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawColor(playerid, text, color);
-}
-
-stock WC_PlayerTextDrawUseBox(playerid, PlayerText:text, use)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawUseBox(playerid, text, use);
-}
-
-stock WC_PlayerTextDrawBoxColor(playerid, PlayerText:text, color)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawBoxColor(playerid, text, color);
-}
-
-stock WC_PlayerTextDrawSetShadow(playerid, PlayerText:text, size)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawSetShadow(playerid, text, size);
-}
-
-stock WC_PlayerTextDrawSetOutline(playerid, PlayerText:text, size)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawSetOutline(playerid, text, size);
-}
-
-stock WC_PlayerTextDrawBackgroundColo(playerid, PlayerText:text, color)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawBackgroundColor(playerid, text, color);
-}
-
-stock WC_PlayerTextDrawFont(playerid, PlayerText:text, font)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawFont(playerid, text, font);
-}
-
-stock WC_PlayerTextDrawSetProportiona(playerid, PlayerText:text, set)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawSetProportional(playerid, text, set);
-}
-
-stock WC_PlayerTextDrawSetSelectable(playerid, PlayerText:text, set)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawSetSelectable(playerid, text, set);
-}
-
-stock WC_PlayerTextDrawShow(playerid, PlayerText:text)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawShow(playerid, text);
-}
-
-stock WC_PlayerTextDrawHide(playerid, PlayerText:text)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawHide(playerid, text);
-}
-
-stock WC_PlayerTextDrawSetString(playerid, PlayerText:text, string[])
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawSetString(playerid, text, string);
-}
-
-stock WC_PlayerTextDrawSetPreviewMode(playerid, PlayerText:text, modelindex)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawSetPreviewModel(playerid, text, modelindex);
-}
-
-stock WC_PlayerTextDrawSetPreviewRot(playerid, PlayerText:text, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fZoom = 1.0)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawSetPreviewRot(playerid, text, fRotX, fRotY, fRotZ, fZoom);
-}
-
-stock WC_PlayerTextDrawSetPreviewVehC(playerid, PlayerText:text, color1, color2)
-{
-	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
-	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
-	return PlayerTextDrawSetPreviewVehCol(playerid, text, color1, color2);
-}
-
-/*
- * Hooked callbacks
- */
-public OnGameModeInit()
-{
-	ScriptInit();
-
-	#if defined WC_OnGameModeInit
-		return WC_OnGameModeInit();
-	#else
-		return 1;
-	#endif
-}
-
-public OnGameModeExit()
-{
-	ScriptExit();
-
-	#if defined WC_OnGameModeExit
-		return WC_OnGameModeExit();
-	#else
-		return 1;
-	#endif
-}
-
-public OnFilterScriptInit()
-{
-	ScriptInit();
-
-	#if defined WC_OnFilterScriptInit
-		return WC_OnFilterScriptInit();
-	#else
-		return 1;
-	#endif
-}
-
-public OnFilterScriptExit()
-{
-	ScriptExit();
-
-	#if defined WC_OnFilterScriptExit
-		return WC_OnFilterScriptExit();
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerConnect(playerid)
-{
-	new tick = GetTickCount();
-
-	s_PlayerMaxHealth[playerid] = 100.0;
-	s_PlayerHealth[playerid] = 100.0;
-	s_PlayerMaxArmour[playerid] = 100.0;
-	s_PlayerArmour[playerid] = 0.0;
-	s_LastExplosive[playerid] = 0;
-	s_LastShotIdx[playerid] = 0;
-	s_LastShot[playerid][e_Tick] = 0;
-	s_LastHitIdx[playerid] = 0;
-	s_RejectedHitsIdx[playerid] = 0;
-	s_ShotsFired[playerid] = 0;
-	s_HitsIssued[playerid] = 0;
-	s_PlayerTeam[playerid] = NO_TEAM;
-	s_IsDying[playerid] = false;
-	s_BeingResynced[playerid] = false;
-	s_SpawnForStreamedIn[playerid] = false;
-	s_World[playerid] = 0;
-	s_LastAnim[playerid] = -1;
-	s_LastZVelo[playerid] = 0.0;
-	s_LastZ[playerid] = 0.0;
-	s_LastUpdate[playerid] = tick;
-	s_DamageFeedTimer[playerid] = -1;
-	s_DamageFeedLastUpdate[playerid] = tick;
-	s_Spectating[playerid] = INVALID_PLAYER_ID;
-	s_HealthBarVisible[playerid] = false;
-	s_LastSentHealth[playerid] = 0;
-	s_LastSentArmour[playerid] = 0;
-	s_LastStop[playerid] = tick;
-	s_FirstSpawn[playerid] = true;
-	s_LastVehicleEnterTime[playerid] = 0;
-	s_TrueDeath[playerid] = true;
-	s_InClassSelection[playerid] = false;
-	s_ForceClassSelection[playerid] = false;
-	s_PlayerClass[playerid] = -2;
-	s_SpawnInfoModified[playerid] = false;
-	s_PlayerFallbackSpawnInfo[playerid][e_Skin] = -1;
-	s_DeathSkip[playerid] = 0;
-	s_LastVehicleTick[playerid] = 0;
-	s_PreviousHitI[playerid] = 0;
-	s_CbugFroze[playerid] = 0;
-	s_DeathTimer[playerid] = -1;
-	s_DelayedDeathTimer[playerid] = -1;
-	s_DamageFeedPlayer[playerid] = -1;
-
-	for (new i = 0; i < sizeof(s_PreviousHits[]); i++) {
-		s_PreviousHits[playerid][i][e_Tick] = 0;
-	}
-
-	for (new i = 0; i < sizeof(s_RejectedHits[]); i++) {
-		s_RejectedHits[playerid][i][e_Time] = 0;
-	}
-
-	for (new i = 0; i < sizeof(s_DamageFeedHitsGiven[]); i++) {
-		s_DamageFeedHitsGiven[playerid][i][e_Tick] = 0;
-		s_DamageFeedHitsTaken[playerid][i][e_Tick] = 0;
-	}
-
-	SetPlayerTeam(playerid, 0xFE);
-	FreezeSyncData(playerid, false);
-	SetFakeFacingAngle(playerid, _);
-	DamageFeedUpdate(playerid);
-
-	#if WC_CUSTOM_VENDING_MACHINES
-		if (!s_AlreadyConnected[playerid]) {
-			RemoveDefaultVendingMachines(playerid);
-		}
-	#endif
-
-	s_AlreadyConnected[playerid] = false;
-
-	#if defined WC_OnPlayerConnect
-		return WC_OnPlayerConnect(playerid);
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerDisconnect(playerid, reason)
-{
-	#if defined WC_OnPlayerDisconnect
-		WC_OnPlayerDisconnect(playerid, reason);
-	#endif
-	
-	#if WC_CUSTOM_VENDING_MACHINES
-		if (s_VendingUseTimer[playerid] != -1) {
-			KillTimer(s_VendingUseTimer[playerid]);
-			s_VendingUseTimer[playerid] = -1;
-		}
-	#endif
-
-	if (s_DelayedDeathTimer[playerid] != -1) {
-		KillTimer(s_DelayedDeathTimer[playerid]);
-		s_DelayedDeathTimer[playerid] = -1;
-	}
-
-	if (s_DeathTimer[playerid] != -1) {
-		KillTimer(s_DeathTimer[playerid]);
-		s_DeathTimer[playerid] = -1;
-	}
-
-	if (s_KnifeTimeout[playerid] != -1) {
-		KillTimer(s_KnifeTimeout[playerid]);
-		s_KnifeTimeout[playerid] = -1;
-	}
-
-	if (s_HealthBarForeground[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-		PlayerTextDrawDestroy(playerid, s_HealthBarForeground[playerid]);
-		s_InternalPlayerTextDraw[playerid][s_HealthBarForeground[playerid]] = false;
-		s_HealthBarForeground[playerid] = PlayerText:INVALID_TEXT_DRAW;
-	}
-
-	if (s_DamageFeedGiven[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-		PlayerTextDrawDestroy(playerid, s_DamageFeedGiven[playerid]);
-		s_InternalPlayerTextDraw[playerid][s_DamageFeedGiven[playerid]] = false;
-		s_DamageFeedGiven[playerid] = PlayerText:INVALID_TEXT_DRAW;
-	}
-
-	if (s_DamageFeedTaken[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-		PlayerTextDrawDestroy(playerid, s_DamageFeedTaken[playerid]);
-		s_InternalPlayerTextDraw[playerid][s_DamageFeedTaken[playerid]] = false;
-		s_DamageFeedTaken[playerid] = PlayerText:INVALID_TEXT_DRAW;
-	}
-
-	if (s_DamageFeedTimer[playerid] != -1) {
-		KillTimer(s_DamageFeedTimer[playerid]);
-		s_DamageFeedTimer[playerid] = -1;
-	}
-
-	SetHealthBarVisible(playerid, false);
-
-	s_Spectating[playerid] = INVALID_PLAYER_ID;
-
-	for (new i = 0; i < sizeof(s_LastVehicleShooter); i++) {
-		if (s_LastVehicleShooter[i] == playerid) {
-			s_LastVehicleShooter[i] = INVALID_PLAYER_ID;
-		}
-	}
-
-	for (new i = 0; i < sizeof(s_InternalPlayerTextDraw[]); i++) {
-		s_InternalPlayerTextDraw[playerid][PlayerText:i] = false;
-	}
-
-	for (new i = 0; i < MAX_PLAYERS; i++) {
-		if (!IsPlayerConnected(i)) {
-			continue;
-		}
-
-		for (new j = 0; j < sizeof(s_PreviousHits[]); j++) {
-			if (s_PreviousHits[i][j][e_Issuer] == playerid) {
-				s_PreviousHits[i][j][e_Issuer] = INVALID_PLAYER_ID;
-			}
-		}
-	}
-
-	return 1;
-}
-
-public OnPlayerSpawn(playerid)
-{
-	s_TrueDeath[playerid] = false;
-	s_InClassSelection[playerid] = false;
-
-	if (s_ForceClassSelection[playerid]) {
-		DebugMessage(playerid, "Being forced into class selection");
-		ForceClassSelection(playerid);
-		SetPlayerHealth(playerid, 0.0);
-		SetPlayerVirtualWorld(playerid, WC_DEATH_WORLD);
-
-		return 1;
-	}
-
-	s_LastUpdate[playerid] = GetTickCount();
-	s_LastStop[playerid] = GetTickCount();
-
-	if (s_BeingResynced[playerid]) {
-		s_BeingResynced[playerid] = false;
-
-		UpdateHealthBar(playerid);
-
-		SetPlayerPos(playerid, s_SyncData[playerid][e_PosX], s_SyncData[playerid][e_PosY], s_SyncData[playerid][e_PosZ]);
-		SetPlayerFacingAngle(playerid, s_SyncData[playerid][e_PosA]);
-
-		SetPlayerSkin(playerid, s_SyncData[playerid][e_Skin]);
-		SetPlayerTeam(playerid, s_SyncData[playerid][e_Team]);
-
-		for (new i = 0; i < 13; i++) {
-			if (s_SyncData[playerid][e_WeaponId][i]) {
-				GivePlayerWeapon(playerid, s_SyncData[playerid][e_WeaponId][i], s_SyncData[playerid][e_WeaponAmmo][i]);
-			}
-		}
-
-		GivePlayerWeapon(playerid, s_SyncData[playerid][e_Weapon], 0);
-
-		return 1;
-	}
-
-	if (s_SpawnInfoModified[playerid]) {
-		new spawn_info[E_SPAWN_INFO], classid = s_PlayerClass[playerid];
-
-		s_SpawnInfoModified[playerid] = false;
-
-		if (classid == -1) {
-			spawn_info = s_PlayerSpawnInfo[playerid];
-		} else if (classid == -2) {
-			spawn_info = s_PlayerFallbackSpawnInfo[playerid];
-		} else {
-			if (s_ClassSpawnInfo[classid][e_Skin] == -1 && s_PlayerFallbackSpawnInfo[playerid][e_Skin] != -1) {
-				spawn_info = s_PlayerFallbackSpawnInfo[playerid];
-			} else {
-				spawn_info = s_ClassSpawnInfo[classid];
-			}
-		}
-
-		if (spawn_info[e_Skin] != -1) {
-			SetSpawnInfo(
-				playerid,
-				spawn_info[e_Team],
-				spawn_info[e_Skin],
-				spawn_info[e_PosX],
-				spawn_info[e_PosY],
-				spawn_info[e_PosZ],
-				spawn_info[e_Rot],
-				spawn_info[e_Weapon1],
-				spawn_info[e_Ammo1],
-				spawn_info[e_Weapon2],
-				spawn_info[e_Ammo2],
-				spawn_info[e_Weapon3],
-				spawn_info[e_Ammo3]
-			);
-		}
-	} else {
-		s_PlayerFallbackSpawnInfo[playerid][e_Team] = s_PlayerTeam[playerid];
-		s_PlayerFallbackSpawnInfo[playerid][e_Skin] = GetPlayerSkin(playerid);
-		GetPlayerPos(
-			playerid,
-			s_PlayerFallbackSpawnInfo[playerid][e_PosX],
-			s_PlayerFallbackSpawnInfo[playerid][e_PosY],
-			s_PlayerFallbackSpawnInfo[playerid][e_PosZ]
-		);
-		GetPlayerFacingAngle(playerid, s_PlayerFallbackSpawnInfo[playerid][e_Rot]);
-	}
-
-	if (s_DeathTimer[playerid] != -1) {
-		KillTimer(s_DeathTimer[playerid]);
-		s_DeathTimer[playerid] = -1;
-	}
-
-	if (s_IsDying[playerid]) {
-		s_IsDying[playerid] = false;
-	}
-
-	if (s_PlayerHealth[playerid] == 0.0) {
-		s_PlayerHealth[playerid] = s_PlayerMaxHealth[playerid];
-	}
-
-	UpdatePlayerVirtualWorld(playerid);
-	UpdateHealthBar(playerid, true);
-	FreezeSyncData(playerid, false);
-	SetFakeFacingAngle(playerid, _);
-	DamageFeedUpdate(playerid);
-
-	if (GetPlayerTeam(playerid) != 0xFE) {
-		SetPlayerTeam(playerid, 0xFE);
-	}
-
-	if (s_DeathSkip[playerid] == 2) {
-		DebugMessage(playerid, "Death skipped");
-		SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
-		GivePlayerWeapon(playerid, 0, 1);
-		SetPlayerArmedWeapon(playerid, 0);
-		ClearAnimations(playerid);
-		ApplyAnimation(playerid, "PED", "IDLE_stance", 4.1, 1, 0, 0, 0, 1, 1);
-
-		s_DeathSkip[playerid] = 1;
-		s_DeathSkipTick[playerid] = GetTickCount();
-
-		return 1;
-	}
-
-	if (s_FirstSpawn[playerid]) {
-		s_FirstSpawn[playerid] = false;
-
-		#if WC_CUSTOM_VENDING_MACHINES
-			if (s_CustomVendingMachines) {
-				ApplyAnimation(playerid, "VENDING", "null", 0, 0, 0, 0, 0, 0);
-			}
-		#endif
-	}
-
-	#if defined WC_OnPlayerSpawn
-		return WC_OnPlayerSpawn(playerid);
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerRequestClass(playerid, classid)
-{
-	DebugMessage(playerid, "Requested class: %d", classid);
-
-	if (s_DeathSkip[playerid]) {
-		DebugMessage(playerid, "Skipping death - class selection skipped");
-		SpawnPlayer(playerid);
-
-		return 0;
-	}
-
-	if (s_ForceClassSelection[playerid]) {
-		s_ForceClassSelection[playerid] = false;
-	}
-
-	if (s_BeingResynced[playerid]) {
-		s_TrueDeath[playerid] = false;
-
-		SpawnPlayerInPlace(playerid);
-
-		return 0;
-	}
-
-	if (s_DeathTimer[playerid] != -1) {
-		KillTimer(s_DeathTimer[playerid]);
-		s_DeathTimer[playerid] = -1;
-	}
-
-	if (s_IsDying[playerid]) {
-		OnPlayerDeathFinished(playerid, false);
-		s_IsDying[playerid] = false;
-	}
-
-	FreezeSyncData(playerid, false);
-	UpdatePlayerVirtualWorld(playerid);
-
-	if (s_TrueDeath[playerid]) {
-		if (!s_InClassSelection[playerid]) {
-			DebugMessage(playerid, "True death class selection");
-
-			new Float:x, Float:y, Float:z;
-			GetPlayerPos(playerid, x, y, z);
-			RemoveBuildingForPlayer(playerid, 1484, x, y, z, 350.0),
-			RemoveBuildingForPlayer(playerid, 1485, x, y, z, 350.0),
-			RemoveBuildingForPlayer(playerid, 1486, x, y, z, 350.0);
-
-			s_InClassSelection[playerid] = true;
-		}
-
-		#if defined WC_OnPlayerRequestClass
-			if (WC_OnPlayerRequestClass(playerid, classid)) {
-				s_PlayerClass[playerid] = classid;
-
-				return 1;
-			} else {
-				return 0;
-			}
-		#else
-			s_PlayerClass[playerid] = classid;
-
-			return 1;
-		#endif
-	} else {
-		DebugMessage(playerid, "Not true death - being respawned");
-
-		s_ForceClassSelection[playerid] = true;
-
-		SpawnPlayerInPlace(playerid);
-
-		return 0;
-	}
-}
-
-public OnPlayerDeath(playerid, killerid, reason)
-{
-	s_TrueDeath[playerid] = true;
-	s_InClassSelection[playerid] = false;
-
-	#if WC_CUSTOM_VENDING_MACHINES
-		if (s_VendingUseTimer[playerid] != -1) {
-			KillTimer(s_VendingUseTimer[playerid]);
-			s_VendingUseTimer[playerid] = -1;
-		}
-	#endif
-
-	if (s_BeingResynced[playerid] || s_ForceClassSelection[playerid]) {
-		return 1;
-	}
-
-	// Probably fake death
-	if (killerid != INVALID_PLAYER_ID && !IsPlayerStreamedIn(killerid, playerid)) {
-		killerid = INVALID_PLAYER_ID;
-	}
-
-	DebugMessageRedAll("OnPlayerDeath(%d died by %d from %d)", playerid, reason, killerid);
-
-	if (s_DeathTimer[playerid] != -1) {
-		KillTimer(s_DeathTimer[playerid]);
-	}
-
-	if (s_IsDying[playerid]) {
-		DebugMessageRedAll("death while dying %d", playerid);
-
-		return 1;
-	}
-
-	// WEAPON_UNKNOWN
-	if (reason < 0 || reason > 55) {
-		reason = 55;
-	}
-
-	new vehicleid = GetPlayerVehicleID(playerid);
-
-	// Let's assume they died from an exploading vehicle
-	if (vehicleid) {
-		reason = WEAPON_EXPLOSION;
-		killerid = INVALID_PLAYER_ID;
-
-		if (!HasSameTeam(playerid, s_LastVehicleShooter[vehicleid])) {
-			killerid = s_LastVehicleShooter[vehicleid];
-		}
-	}
-
-	new Float:amount = 0.0;
-	new bodypart = BODY_PART_UNKNOWN;
-
-	if (reason == WEAPON_PARACHUTE) {
-		reason = WEAPON_COLLISION;
-	}
-
-	if (OnPlayerDamage(playerid, amount, killerid, reason, bodypart)) {
-		if (reason < 0 || reason > WEAPON_UNKNOWN) {
-			reason = WEAPON_UNKNOWN;
-		}
-
-		if (amount == 0.0) {
-			amount = s_PlayerHealth[playerid] + s_PlayerArmour[playerid];
-		}
-
-		if (reason == WEAPON_COLLISION || reason == WEAPON_DROWN || reason == WEAPON_CARPARK) {
-			if (amount <= 0.0) {
-				amount = s_PlayerHealth[playerid];
-			}
-
-			s_PlayerHealth[playerid] -= amount;
-		} else {
-			if (amount <= 0.0) {
-				amount = s_PlayerHealth[playerid] + s_PlayerArmour[playerid];
-			}
-
-			s_PlayerArmour[playerid] -= amount;
-		}
-
-		if (s_PlayerArmour[playerid] < 0.0) {
-			s_DamageDoneArmour[playerid] = amount + s_PlayerArmour[playerid];
-			s_DamageDoneHealth[playerid] = -s_PlayerArmour[playerid];
-			s_PlayerHealth[playerid] += s_PlayerArmour[playerid];
-			s_PlayerArmour[playerid] = 0.0;
-		} else {
-			s_DamageDoneArmour[playerid] = amount;
-			s_DamageDoneHealth[playerid] = 0.0;
-		}
-
-		if (s_PlayerHealth[playerid] <= 0.0) {
-			amount += s_PlayerHealth[playerid];
-			s_DamageDoneHealth[playerid] += s_PlayerHealth[playerid];
-			s_PlayerHealth[playerid] = 0.0;
-		}
-
-		OnPlayerDamageDone(playerid, amount, killerid, reason, bodypart);
-	}
-
-	if (s_PlayerHealth[playerid] <= 0.0005) {
-		s_PlayerHealth[playerid] = 0.0;
-		s_IsDying[playerid] = true;
-
-		new animlib[32], animname[32], anim_lock, respawn_time;
-
-		OnPlayerPrepareDeath(playerid, animlib, animname, anim_lock, respawn_time);
-
-		#if defined WC_OnPlayerDeath
-			WC_OnPlayerDeath(playerid, killerid, reason);
-		#endif
-
-		OnPlayerDeathFinished(playerid, false);
-	} else {
-		if (vehicleid || WasPlayerInVehicle(playerid, 10000)) {
-			new Float:x, Float:y, Float:z, Float:r;
-
-			GetPlayerPos(playerid, x, y, z);
-			SetPlayerPos(playerid, x, y, z);
-			SaveSyncData(playerid);
-
-			if (vehicleid) {
-				GetVehicleZAngle(vehicleid, r);
-			} else {
-				GetPlayerFacingAngle(playerid, r);
-			}
-
-			s_DeathSkip[playerid] = 2;
-
-			ForceClassSelection(playerid);
-			SetSpawnInfo(playerid, 0xFE, GetPlayerSkin(playerid), x, y, z, r, 0, 0, 0, 0, 0, 0);
-			TogglePlayerSpectating(playerid, true);
-			TogglePlayerSpectating(playerid, false);
-			SetSpawnInfo(playerid, 0xFE, GetPlayerSkin(playerid), x, y, z, r, 0, 0, 0, 0, 0, 0);
-			TogglePlayerControllable(playerid, true);
-			GivePlayerWeapon(playerid, 1, 1);
-		} else {
-			SpawnPlayerInPlace(playerid);
-		}
-	}
-
-	UpdateHealthBar(playerid);
-
-	return 1;
-}
-
-static Float:AngleBetweenPoints(Float:x1, Float:y1, Float:x2, Float:y2);
-
-forward WC_CbugPunishment(playerid, weapon);
-public WC_CbugPunishment(playerid, weapon) {
-	//GameTextForPlayer(playerid, "~r~C-bug is not allowed", 3000, 3);
-	//ApplyAnimation(playerid, "SWORD", "sword_block", 4.0, 0, 0, 0, 0, 0, 1);
-	//FreezeSyncData(playerid, false);
-	ClearAnimations(playerid, 1);
-	//GivePlayerWeapon(playerid, weapon, 0);
-}
-
-public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
-{
-	if ((!s_CbugAllowed && !CanPlayerCbug(playerid))&& !IsPlayerDying(playerid) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
-		if (newkeys & KEY_CROUCH) {
-			new tick = GetTickCount();
-			new diff = tick - s_LastShot[playerid][e_Tick];
-
-			if (s_LastShot[playerid][e_Tick] && diff < 1200 && !s_CbugFroze[playerid]) {
-				PlayerPlaySound(playerid, 1055, 0.0, 0.0, 0.0);
-
-				if (s_LastShot[playerid][e_Valid] && floatabs(s_LastShot[playerid][e_HX]) > 1.0 && floatabs(s_LastShot[playerid][e_HY]) > 1.0) {
-					SetPlayerFacingAngle(playerid, AngleBetweenPoints(
-						s_LastShot[playerid][e_HX],
-						s_LastShot[playerid][e_HY],
-						s_LastShot[playerid][e_OX],
-						s_LastShot[playerid][e_OY]
-					));
-				}
-
-				new w, a;
-				GetPlayerWeaponData(playerid, 0, w, a);
-
-				ClearAnimations(playerid, 1);
-				//ApplyAnimation(playerid, "PED", "IDLE_stance", 4.1, 1, 0, 0, 0, 0, 1);
-				//FreezeSyncData(playerid, true);
-				//GivePlayerWeapon(playerid, w, 0);
-				//SetTimerEx("WC_CbugPunishment", 600, false, "ii", playerid, GetPlayerWeapon(playerid));
-
-				s_CbugFroze[playerid] = tick;
-
-				for (new i = 0; i < MAX_PLAYERS; i++) {
-					if (!IsPlayerConnected(i) && !IsPlayerDying(i)) {
-						continue;
-					}
-
-					for (new j = 0; j < sizeof(s_PreviousHits[]); j++) {
-						if (s_PreviousHits[i][j][e_Issuer] == playerid && tick - s_PreviousHits[i][j][e_Tick] <= 1200) {
-							s_PreviousHits[i][j][e_Issuer] = INVALID_PLAYER_ID;
-
-							new Float:health = WC_GetPlayerHealth(i);
-							new Float:armour = WC_GetPlayerArmour(i);
-
-							if (s_IsDying[i]) {
-								if (s_DelayedDeathTimer[i] == -1) {
-									continue;
-								}
-
-								KillTimer(s_DelayedDeathTimer[i]);
-								s_DelayedDeathTimer[i] = -1;
-								ClearAnimations(i, 1);
-								SetFakeFacingAngle(i, _);
-								FreezeSyncData(i, false);
-
-								s_IsDying[i] = false;
-
-								if (s_DeathTimer[i] != -1) {
-									KillTimer(s_DeathTimer[i]);
-									s_DeathTimer[i] = -1;
-								}
-							}
-
-							health += s_PreviousHits[i][j][e_Health];
-							armour += s_PreviousHits[i][j][e_Armour];
-
-							WC_SetPlayerHealth(i, health, armour);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
-		#if WC_CUSTOM_VENDING_MACHINES
-			if (s_CustomVendingMachines
-			 && newkeys == KEY_SECONDARY_ATTACK
-			 && !oldkeys
-			 && s_VendingUseTimer[playerid] == -1
-			 && GetPlayerAnimationIndex(playerid) != 1660) {
-				new bool:failed = false;
-
-				if (GetPlayerMoney(playerid) <= 0 || s_PlayerHealth[playerid] >= s_PlayerMaxHealth[playerid]) {
-					failed = true;
-				}
-
-				new Float:z;
-
-				GetPlayerPos(playerid, z, z, z);
-
-				for (new i = 0; i < sizeof(sc_VendingMachines); i++) {
-					if (floatabs(z - sc_VendingMachines[i][e_PosZ]) > 1.5) {
-						continue;
-					}
-
-					if (IsPlayerInRangeOfPoint(playerid, 0.5, sc_VendingMachines[i][e_FrontX], sc_VendingMachines[i][e_FrontY], z)) {
-						if (failed) {
-							PlayerPlaySound(playerid, 1055, 0.0, 0.0, 0.0);
-							break;
-						}
-
-						new Float:health_given = 35.0;
-
-						if (OnPlayerUseVendingMachine(playerid, health_given)) {
-							s_VendingUseTimer[playerid] = SetTimerEx("WC_VendingMachineUsed", 2500, false, "if", playerid, health_given);
-
-							SetPlayerFacingAngle(playerid, sc_VendingMachines[i][e_RotZ]);
-							SetPlayerPos(playerid, sc_VendingMachines[i][e_FrontX], sc_VendingMachines[i][e_FrontY], z);
-							ApplyAnimation(playerid, "VENDING", "VEND_USE", 4.1, 0, 0, 1, 0, 0, 1);
-
-							PlayerPlaySound(playerid, 42600, 0.0, 0.0, 0.0);
-						} else {
-							PlayerPlaySound(playerid, 1055, 0.0, 0.0, 0.0);
-						}
-
-						break;
-					}
-				}
-			}
-		#endif
-
-		if (newkeys & KEY_FIRE) {
-			new weap = GetPlayerWeapon(playerid);
-
-			switch (weap) {
-				case WEAPON_BOMB, WEAPON_SATCHEL: {
-					s_LastExplosive[playerid] = WEAPON_SATCHEL;
-				}
-
-				case WEAPON_ROCKETLAUNCHER, WEAPON_HEATSEEKER, WEAPON_GRENADE: {
-					s_LastExplosive[playerid] = weap;
-				}
-			}
-		}
-	}
-
-	#if defined WC_OnPlayerKeyStateChange
-		return WC_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerStreamIn(playerid, forplayerid)
-{
-	// Send ped floor_hit_f
-	if (s_IsDying[playerid]) {
-		SendLastSyncData(playerid, forplayerid, 0x2e040000 + 1150);
-	}
-
-	#if defined WC_OnPlayerStreamIn
-		return WC_OnPlayerStreamIn(playerid, forplayerid);
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
-{
-	#if WC_CUSTOM_VENDING_MACHINES
-		if (s_VendingUseTimer[playerid] != -1) {
-			KillTimer(s_VendingUseTimer[playerid]);
-			s_VendingUseTimer[playerid] = -1;
-		}
-	#endif
-
-	s_LastVehicleEnterTime[playerid] = gettime();
-	s_LastVehicleTick[playerid] = GetTickCount();
-
-	#if defined WC_OnPlayerEnterVehicle
-		return WC_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerExitVehicle(playerid, vehicleid)
-{
-	s_LastVehicleTick[playerid] = GetTickCount();
-
-	#if defined WC_OnPlayerExitVehicle
-		return WC_OnPlayerExitVehicle(playerid, vehicleid);
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerStateChange(playerid, newstate, oldstate)
-{
-	if (s_Spectating[playerid] != INVALID_PLAYER_ID && newstate != PLAYER_STATE_SPECTATING) {
-		s_Spectating[playerid] = INVALID_PLAYER_ID;
-	}
-
-	#if WC_CUSTOM_VENDING_MACHINES
-		if (s_VendingUseTimer[playerid] != -1) {
-			KillTimer(s_VendingUseTimer[playerid]);
-			s_VendingUseTimer[playerid] = -1;
-		}
-	#endif
-
-	if (s_IsDying[playerid] && (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)) {
-		TogglePlayerControllable(playerid, false);
-	}
-
-	if (oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) {
-		s_LastVehicleTick[playerid] = GetTickCount();
-
-		if (newstate == PLAYER_STATE_ONFOOT) {
-			new Float:vx, Float:vy, Float:vz;
-			GetPlayerVelocity(playerid, vx, vy, vz);
-
-			if (vx*vx + vy*vy + vz*vz <= 0.05) {
-				for (new i = 0; i < MAX_PLAYERS; i++) {
-					if (i != playerid && IsPlayerConnected(i) && IsPlayerStreamedIn(playerid, i)) {
-						SendLastSyncData(playerid, i);
-						ClearAnimationsForPlayer(playerid, i);
-					}
-				}
-			}
-		}
-	}
-
-	switch (newstate) {
-		case PLAYER_STATE_ONFOOT,
-		     PLAYER_STATE_DRIVER,
-		     PLAYER_STATE_PASSENGER: {
-			SetHealthBarVisible(playerid, true);
-		}
-
-		default: {
-			SetHealthBarVisible(playerid, false);
-		}
-	}
-
-	#if defined WC_OnPlayerStateChange
-		return WC_OnPlayerStateChange(playerid, newstate, oldstate);
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerPickUpPickup(playerid, pickupid)
-{
-	if (!IsPlayerSpawned(playerid)) {
-		return 0;
-	}
-
-	#if defined WC_OnPlayerPickUpPickup
-		return WC_OnPlayerPickUpPickup(playerid, pickupid);
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerUpdate(playerid)
-{
-	if (s_IsDying[playerid]) {
-		return 1;
-	}
-
-	if (s_DeathSkip[playerid] == 1) {
-		if (s_DeathSkipTick[playerid]) {
-			if (GetTickCount() - s_DeathSkipTick[playerid] > 1000) {
-				new Float:x, Float:y, Float:z, Float:r;
-
-				GetPlayerPos(playerid, x, y, z);
-				GetPlayerFacingAngle(playerid, r);
-
-				SetSpawnInfo(playerid, 0xFE, GetPlayerSkin(playerid), x, y, z, r, 0, 0, 0, 0, 0, 0);
-
-				s_DeathSkipTick[playerid] = 0;
-
-				ApplyAnimation(playerid, "PED", "IDLE_stance", 4.1, 1, 0, 0, 0, 1, 1);
-			}
-		} else {
-			if (GetPlayerAnimationIndex(playerid) != 1189) {
-				s_DeathSkip[playerid] = 0;
-
-				WC_DeathSkipEnd(playerid);
-
-				DebugMessage(playerid, "Death skip end");
-			}
-		}
-	}
-
-	if (s_SpawnForStreamedIn[playerid]) {
-		WC_SpawnForStreamedIn(playerid);
-
-		s_SpawnForStreamedIn[playerid] = false;
-	}
-
-	new tick = GetTickCount();
-
-	s_LastUpdate[playerid] = tick;
-
-	// Detect fall damage based on velocity and animation
-	if (s_CustomFallDamage) {
-		new Float:vz, Float:z;
-
-		GetPlayerVelocity(playerid, vz, vz, vz);
-		GetPlayerPos(playerid, z, z, z);
-
-		new surfing = GetPlayerSurfingVehicleID(playerid);
-
-		if (surfing && surfing == INVALID_VEHICLE_ID) {
-			surfing = GetPlayerSurfingObjectID(playerid) != INVALID_OBJECT_ID;
-		} else {
-			surfing = 1;
-		}
-
-		if (surfing || tick - s_LastStop[playerid] < 2000) {
-			vz = 0.0;
-			s_LastZVelo[playerid] = 0.0;
-		} else {
-			if (vz != 0.0) {
-				s_LastZVelo[playerid] = vz;
-			}
-
-			if (z - s_LastZ[playerid] > 1.0) {
-				s_LastZVelo[playerid] = 0.1;
-				vz = 0.1;
-			}
-		}
-
-		s_LastZ[playerid] = z;
-
-		new anim = GetPlayerAnimationIndex(playerid);
-
-		if (anim != s_LastAnim[playerid]) {
-			new prev = s_LastAnim[playerid];
-			s_LastAnim[playerid] = anim;
-
-			if (((prev == 1130 && vz == 0.0) || 1128 <= anim <= 1134 || anim == 1208)) {
-				new Float:amount = -1.0;
-				DebugMessage(playerid, "vz: %f anim: %d prev: %d", vz, anim, prev);
-
-				vz = s_LastZVelo[playerid];
-
-				if (vz <= s_FallDeathVelocity) {
-					amount = 0.0;
-				} else if (vz <= -0.2) {
-					if (vz == -0.2) {
-						amount = s_WeaponDamage[WEAPON_COLLISION] * 0.2;
-					} else {
-						amount = (vz + 0.2) / (s_FallDeathVelocity + 0.2);
-						amount *= s_WeaponDamage[WEAPON_COLLISION];
-					}
-				}
-
-				if (GetPlayerWeapon(playerid) == WEAPON_PARACHUTE && anim == 1134) {
-					amount = -1.0;
-				}
-
-				if (amount >= 0.0) {
-					DebugMessage(playerid, "fall dmg: %.5f (vz: %f, anim: %d, prev: %d)", amount, vz, anim, prev);
-
-					InflictDamage(playerid, amount, INVALID_PLAYER_ID, WEAPON_COLLISION, 3);
-
-					if (amount == 0.0) {
-						amount = s_PlayerHealth[playerid];
-					}
-				}
-			}
-		}
-	}
-
-	#if defined WC_OnPlayerUpdate
-		return WC_OnPlayerUpdate(playerid);
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
-{
-	if (!IsHighRateWeapon(weaponid)) {
-		DebugMessage(playerid, "OnPlayerGiveDamage(%d gave %f to %d using %d on bodypart %d)", playerid, amount, damagedid, weaponid, bodypart);
-	}
-
-	// Nobody got damaged
-	if (damagedid == INVALID_PLAYER_ID) {
-		#if defined OnInvalidWeaponDamage
-			OnInvalidWeaponDamage(playerid, damagedid, amount, weaponid, bodypart, WC_NO_DAMAGED, true);
-		#endif
-
-		AddRejectedHit(playerid, damagedid, HIT_NO_DAMAGEDID, weaponid);
-
-		return 0;
-	}
-
-	if (s_IsDying[damagedid]) {
-		AddRejectedHit(playerid, damagedid, HIT_DYING_PLAYER, weaponid);
-		return 0;
-	}
-
-	if (!s_LagCompMode) {
-		new npc = IsPlayerNPC(damagedid);
-
-		if (weaponid == WEAPON_KNIFE && _:amount == _:0.0) {
-			if (s_KnifeTimeout[damagedid] != -1) {
-				KillTimer(s_KnifeTimeout[damagedid]);
-			}
-
-			s_KnifeTimeout[damagedid] = SetTimerEx("WC_SetSpawnForStreamedIn", 2500, false, "i", damagedid);
-		}
-
-		if (!npc) {
-			return 0;
-		}
-	}
-
-	// Ignore unreliable and invalid damage
-	if (weaponid < 0 || weaponid >= sizeof(s_ValidDamageGiven) || !s_ValidDamageGiven[weaponid]) {
-		// Fire is synced as taken damage (because it's not reliable as given), so no need to show a rejected hit.
-		// Vehicle damage is also synced as taken, so no need to show that either.
-		if (weaponid != WEAPON_FLAMETHROWER && weaponid != WEAPON_VEHICLE) {
-			AddRejectedHit(playerid, damagedid, HIT_INVALID_WEAPON, weaponid);
-		}
-
-		return 0;
-	}
-
-	if (!IsPlayerSpawned(playerid)) {
-		// Make sure the rejected hit wasn't added in OnPlayerWeaponShot
-		if (!IsBulletWeapon(weaponid) || s_LastShot[playerid][e_Valid]) {
-			AddRejectedHit(playerid, damagedid, HIT_NOT_SPAWNED, weaponid);
-		}
-
-		return 0;
-	}
-
-	new npc = IsPlayerNPC(damagedid);
-
-	// From stealth knife, can be any weapon
-	if (_:amount == _:1833.33154296875) {
-		return 0;
-	}
-
-	if (weaponid == WEAPON_KNIFE) {
-		if (_:amount == _:0.0) {
-			// Resync without bothering the player being knifed
-			if (npc || HasSameTeam(playerid, damagedid)) {
-				if (s_KnifeTimeout[damagedid] != -1) {
-					KillTimer(s_KnifeTimeout[damagedid]);
-				}
-
-				s_KnifeTimeout[damagedid] = SetTimerEx("WC_SpawnForStreamedIn", 150, false, "i", damagedid);
-				ClearAnimations(playerid, 1);
-				SetPlayerArmedWeapon(playerid, 0);
-
-				return 0;
-			}
-
-			if (!OnPlayerDamage(damagedid, amount, playerid, weaponid, bodypart)) {
-				if (s_KnifeTimeout[damagedid] != -1) {
-					KillTimer(s_KnifeTimeout[damagedid]);
-				}
-
-				s_KnifeTimeout[damagedid] = SetTimerEx("WC_SpawnForStreamedIn", 150, false, "i", damagedid);
-				ClearAnimations(playerid, 1);
-				SetPlayerArmedWeapon(playerid, 0);
-
-				return 0;
-			}
-
-			s_DamageDoneHealth[playerid] = s_PlayerHealth[playerid];
-			s_DamageDoneArmour[playerid] = s_PlayerArmour[playerid];
-
-			OnPlayerDamageDone(damagedid, s_PlayerHealth[damagedid] + s_PlayerArmour[damagedid], playerid, weaponid, bodypart);
-
-			ClearAnimations(damagedid, 1);
-
-			PlayerDeath(damagedid, "KNIFE", "KILL_Knife_Ped_Damage", _, 5200);
-
-			SetTimerEx("WC_SecondKnifeAnim", 2200, false, "i", damagedid);
-
-			#if defined WC_OnPlayerDeath
-				WC_OnPlayerDeath(damagedid, playerid, weaponid);
-			#endif
-
-			DebugMessage(damagedid, "being knifed by %d", playerid);
-			DebugMessage(playerid, "knifing %d", damagedid);
-
-			new Float:x, Float:y, Float:z, Float:a;
-
-			GetPlayerFacingAngle(damagedid, a);
-			SetPlayerFacingAngle(playerid, a);
-			PosInFront(damagedid, -1.0, x, y, z);
-
-			SetPlayerVelocity(damagedid, 0.0, 0.0, 0.0);
-			SetPlayerVelocity(playerid, 0.0, 0.0, 0.0);
-
-			new forcesync = 2;
-
-			if (747 < GetPlayerAnimationIndex(playerid) > 748) {
-				DebugMessageRed(playerid, "applying knife anim for you too (current: %d)", GetPlayerAnimationIndex(playerid));
-
-				forcesync = 1;
-			}
-
-			ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Player", 4.1, 0, 1, 1, 0, 1800, forcesync);
-
-			return 0;
-		}
-	}
-
-	if (HasSameTeam(playerid, damagedid)) {
-		AddRejectedHit(playerid, damagedid, HIT_SAME_TEAM, weaponid);
-		return 0;
-	}
-
-	// Both players should see eachother
-	if ((!IsPlayerStreamedIn(playerid, damagedid) && !IsPlayerPaused(damagedid)) || !IsPlayerStreamedIn(damagedid, playerid)) {
-		AddRejectedHit(playerid, damagedid, HIT_UNSTREAMED, weaponid, damagedid);
-		return 0;
-	}
-
-	new Float:bullets, err;
-
-	if ((err = ProcessDamage(damagedid, playerid, amount, weaponid, bodypart, bullets))) {
-		if (err == WC_INVALID_DAMAGE) {
-			AddRejectedHit(playerid, damagedid, HIT_INVALID_DAMAGE, weaponid, _:amount);
-		}
-
-		if (err != WC_INVALID_DISTANCE) {
-			#if defined OnInvalidWeaponDamage
-				OnInvalidWeaponDamage(playerid, damagedid, amount, weaponid, bodypart, err, true);
-			#endif
-		}
-
-		return 0;
-	}
-
-	new tick = GetTickCount();
-	if (tick == 0) tick = 1;
-
-	new idx = (s_LastHitIdx[playerid] + 1) % sizeof(s_LastHitTicks[]);
-
-	// JIT plugin fix
-	if (idx < 0) {
-		idx += sizeof(s_LastHitTicks[]);
-	}
-
-	s_LastHitIdx[playerid] = idx;
-	s_LastHitTicks[playerid][idx] = tick;
-	s_LastHitWeapons[playerid][idx] = weaponid;
-	s_HitsIssued[playerid] += 1;
-
-	#if WC_DEBUG
-		if (s_HitsIssued[playerid] > 1) {
-			new prev_tick_idx = (idx - 1) % sizeof(s_LastHitTicks[]);
-
-			// JIT plugin fix
-			if (prev_tick_idx < 0) {
-				prev_tick_idx += sizeof(s_LastHitTicks[]);
-			}
-
-			new prev_tick = s_LastHitTicks[playerid][prev_tick_idx];
-
-			DebugMessage(playerid, "(hit) last: %d last 3: %d", tick - prev_tick, AverageHitRate(playerid, 3));
-		}
-	#endif
-
-	new multiple_weapons;
-	new avg_rate = AverageHitRate(playerid, s_MaxHitRateSamples, multiple_weapons);
-
-	// Hit issue flood?
-	// Could be either a cheat or just lag
-	if (avg_rate != -1) {
-		if (multiple_weapons) {
-			if (avg_rate < 100) {
-				AddRejectedHit(playerid, damagedid, HIT_RATE_TOO_FAST_MULTIPLE, weaponid, avg_rate, s_MaxHitRateSamples);
-				return 0;
-			}
-		} else if (s_MaxWeaponShootRate[weaponid] - avg_rate > 20) {
-			AddRejectedHit(playerid, damagedid, HIT_RATE_TOO_FAST, weaponid, avg_rate, s_MaxHitRateSamples, s_MaxWeaponShootRate[weaponid]);
-			return 0;
-		}
-	}
-
-	if (IsBulletWeapon(weaponid) && _:amount != _:2.6400001049041748046875 && !(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0)) {
-		new valid = true;
-
-		if (!s_LastShot[playerid][e_Valid]) {
-			//AddRejectedHit(playerid, damagedid, HIT_LAST_SHOT_INVALID, weaponid);
-			valid = false;
-			DebugMessageRed(playerid, "last shot not valid");
-		} else if (WEAPON_SHOTGUN <= weaponid <= WEAPON_SHOTGSPA) {
-			// Let's assume someone won't hit 3 players with 1 shotgun shot, and that one OnPlayerWeaponShot can be out of sync
-			if (s_LastShot[playerid][e_Hits] >= 3) {
-				valid = false;
-				AddRejectedHit(playerid, damagedid, HIT_MULTIPLE_PLAYERS_SHOTGUN, weaponid, s_LastShot[playerid][e_Hits] + 1);
-			}
-		} else if (s_LastShot[playerid][e_Hits] > 0) {
-			// Sniper doesn't always send OnPlayerWeaponShot
-			if (s_LastShot[playerid][e_Hits] > 4 && weaponid != WEAPON_SNIPER) {
-				valid = false;
-				AddRejectedHit(playerid, damagedid, HIT_MULTIPLE_PLAYERS, weaponid, s_LastShot[playerid][e_Hits] + 1);
-			} else {
-				DebugMessageRed(playerid, "hit %d players with 1 shot", s_LastShot[playerid][e_Hits] + 1);
-			}
-		}
-
-		s_LastShot[playerid][e_Hits] += 1;
-
-		if (!valid) {
-			return 0;
-		}
-	}
-
-	if (npc) {
-		OnPlayerDamageDone(damagedid, amount, playerid, weaponid, bodypart);
-	} else {
-		InflictDamage(damagedid, amount, playerid, weaponid, bodypart);
-	}
-
-	// Don't send OnPlayerGiveDamage to the rest of the script, since it should not be used
-	return 0;
-}
-
-public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
-{
-	UpdateHealthBar(playerid, true);
-
-	if (s_IsDying[playerid]) {
-		return 0;
-	}
-
-	if (s_BeingResynced[playerid]) {
-		return 0;
-	}
-
-	if (!IsHighRateWeapon(weaponid)) {
-		DebugMessage(playerid, "OnPlayerTakeDamage(%d took %f from %d by %d on bodypart %d)", playerid, amount, issuerid, weaponid, bodypart);
-	}
-
-	// Ignore unreliable and invalid damage
-	if (weaponid < 0 || weaponid >= sizeof(s_ValidDamageTaken) || !s_ValidDamageTaken[weaponid]) {
-		return 0;
-	}
-
-	if (playerid == INVALID_PLAYER_ID || IsPlayerNPC(playerid)) {
-		return 0;
-	}
-
-	// Carjack damage
-	if (weaponid == 54 && _:amount == _:0.0) {
-		return 0;
-	}
-
-	// From stealth knife, can be any weaponid
-	if (_:amount == _:1833.33154296875) {
-		return 0;
-	}
-
-	// Climb bug
-	if (weaponid == WEAPON_COLLISION) {
-		if (s_CustomFallDamage) {
-			return 0;
-		}
-
-		new anim = GetPlayerAnimationIndex(playerid);
-
-		if (1061 <= anim <= 1067) {
-			DebugMessage(playerid, "climb bug prevented");
-			return 0;
-		}
-	}
-
-	// Being knifed client-side
-	if (weaponid == WEAPON_KNIFE) {
-		if (s_IsDying[playerid]) {
-			return 0;
-		}
-
-		// With the plugin, this part is never actually used (it can't happen)
-		if (_:amount == _:0.0) {
-			if (s_KnifeTimeout[playerid] != -1) {
-				KillTimer(s_KnifeTimeout[playerid]);
-
-				s_KnifeTimeout[playerid] = -1;
-			}
-
-			if (issuerid == INVALID_PLAYER_ID || HasSameTeam(playerid, issuerid)) {
-				ResyncPlayer(playerid);
-
-				return 0;
-			}
-
-			if (!OnPlayerDamage(playerid, amount, issuerid, weaponid, bodypart)) {
-				ResyncPlayer(playerid);
-
-				return 0;
-			}
-
-			// Make sure the values were not modified
-			weaponid = WEAPON_KNIFE;
-			amount = 0.0;
-
-			s_DamageDoneHealth[playerid] = s_PlayerHealth[playerid];
-			s_DamageDoneArmour[playerid] = s_PlayerArmour[playerid];
-
-			OnPlayerDamageDone(playerid, s_PlayerHealth[playerid] + s_PlayerArmour[playerid], issuerid, weaponid, bodypart);
-
-			PlayerDeath(playerid, "KNIFE", "KILL_Knife_Ped_Die", _, 4000 - GetPlayerPing(playerid));
-
-			#if defined WC_OnPlayerDeath
-				WC_OnPlayerDeath(playerid, issuerid, weaponid);
-			#endif
-
-			SetPlayerHealth(playerid, Float:0x7f7fffff);
-
-			DebugMessage(playerid, "being knifed by %d", issuerid);
-			DebugMessage(issuerid, "knifing %d", playerid);
-
-			new Float:x, Float:y, Float:z, Float:a;
-
-			GetPlayerFacingAngle(playerid, a);
-			SetPlayerFacingAngle(issuerid, a);
-			PosInFront(playerid, -1.0, x, y, z);
-
-			SetPlayerVelocity(playerid, 0.0, 0.0, 0.0);
-			SetPlayerVelocity(issuerid, 0.0, 0.0, 0.0);
-
-			new forcesync = 2;
-
-			if (GetPlayerAnimationIndex(issuerid) != 747) {
-				DebugMessageRed(issuerid, "applying knife anim for you too (current: %d)", GetPlayerAnimationIndex(issuerid));
-
-				forcesync = 1;
-			}
-
-			ApplyAnimation(issuerid, "KNIFE", "KILL_Knife_Player", 4.1, 0, 1, 1, 0, 1800, forcesync);
-
-			return 0;
-		}
-	}
-
-	// If it's lagcomp, only allow damage that's valid for both modes
-	if (s_LagCompMode && s_ValidDamageTaken[weaponid] != 2) {
-		if (issuerid != INVALID_PLAYER_ID && IsPlayerInAnyVehicle(issuerid) && GetPlayerVehicleSeat(issuerid) == 0 && (weaponid == WEAPON_M4 || weaponid == WEAPON_MINIGUN)) {
-			weaponid = weaponid == WEAPON_M4 ? WEAPON_VEHICLE_M4 : WEAPON_VEHICLE_MINIGUN;
-		} else {
-			return 0;
-		}
-	}
-
-	// Should still be damaged by grenades or fire after someone has died
-	if (issuerid != INVALID_PLAYER_ID) {
-		if (HasSameTeam(playerid, issuerid)) {
-			return 0;
-		}
-
-		if (s_IsDying[issuerid] && (IsBulletWeapon(weaponid) || IsMeleeWeapon(weaponid))) {
-			DebugMessageRed(playerid, "shot/punched by dead player (%d)", issuerid);
-
-			return 0;
-		}
-
-		if (s_BeingResynced[issuerid]) {
-			return 0;
-		}
-	}
-
-	new Float:bullets = 0.0, err;
-
-	if ((err = ProcessDamage(playerid, issuerid, amount, weaponid, bodypart, bullets))) {
-		if (err == WC_INVALID_DAMAGE) {
-			AddRejectedHit(issuerid, playerid, HIT_INVALID_DAMAGE, weaponid, _:amount);
-		}
-
-		if (err != WC_INVALID_DISTANCE) {
-			#if defined OnInvalidWeaponDamage
-				OnInvalidWeaponDamage(issuerid, playerid, amount, weaponid, bodypart, err, false);
-			#endif
-		}
-
-		return 0;
-	}
-
-	if (IsBulletWeapon(weaponid)) {
-		new Float:x, Float:y, Float:z;
-		GetPlayerPos(issuerid, x, y, z);
-		new Float:dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
-
-		if (dist > s_WeaponRange[weaponid] + 2.0) {
-			AddRejectedHit(issuerid, playerid, HIT_OUT_OF_RANGE, weaponid, _:dist, _:s_WeaponRange[weaponid]);
-			return 0;
-		}
-	}
-
-	InflictDamage(playerid, amount, issuerid, weaponid, bodypart);
-
-	return 0;
-}
-
-public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
-{
-	#if WC_CUSTOM_VENDING_MACHINES
-		if (s_VendingUseTimer[playerid] != -1) {
-			KillTimer(s_VendingUseTimer[playerid]);
-			s_VendingUseTimer[playerid] = -1;
-		}
-	#endif
-
-	s_LastShot[playerid][e_Valid] = false;
-	s_LastShot[playerid][e_Hits] = false;
-
-	if (s_CbugFroze[playerid] && GetTickCount() - s_CbugFroze[playerid] < 900) {
-		return 0;
-	}
-
-	s_CbugFroze[playerid] = 0;
-
-	new damagedid = INVALID_PLAYER_ID;
-
-	if (hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID) {
-		if (!IsPlayerConnected(hitid)) {
-			AddRejectedHit(playerid, hitid, HIT_DISCONNECTED, weaponid, hitid);
-
-			return 0;
-		}
-
-		damagedid = hitid;
-	}
-
-	if (hittype < 0 || hittype > 5) {
-		AddRejectedHit(playerid, damagedid, HIT_INVALID_HITTYPE, weaponid, hittype);
-
-		return 0;
-	}
-
-	#if WC_DEBUG
-		if (hittype == BULLET_HIT_TYPE_PLAYER) {
-			DebugMessage(playerid, "OnPlayerWeaponShot(%d shot %d with %d at %f, %f, %f)", playerid, hitid, weaponid, fX, fY, fZ);
-		} else if (hittype) {
-			DebugMessage(playerid, "OnPlayerWeaponShot(%d shot %d %d with %d at %f, %f, %f)", playerid, hittype, hitid, weaponid, fX, fY, fZ);
-		} else {
-			DebugMessage(playerid, "OnPlayerWeaponShot(%d shot with %d at %f, %f, %f)", playerid, weaponid, fX, fY, fZ);
-		}
-	#endif
-
-	if (s_BeingResynced[playerid]) {
-		AddRejectedHit(playerid, damagedid, HIT_BEING_RESYNCED, weaponid);
-
-		return 0;
-	}
-
-	if (!IsPlayerSpawned(playerid)) {
-		AddRejectedHit(playerid, damagedid, HIT_NOT_SPAWNED, weaponid);
-
-		return 0;
-	}
-
-	if (!IsBulletWeapon(weaponid)) {
-		AddRejectedHit(playerid, damagedid, HIT_INVALID_WEAPON, weaponid);
-
-		return 0;
-	}
-
-	new Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ;
-	new Float:x, Float:y, Float:z;
-
-	GetPlayerPos(playerid, x, y, z);
-	GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
-
-	new Float:length = VectorSize(fOriginX - fHitPosX, fOriginY - fHitPosY, fOriginZ - fHitPosZ);
-	new Float:origin_dist = VectorSize(fOriginX - x, fOriginY - y, fOriginZ - z);
-
-	if (origin_dist > 15.0) {
-		new in_veh = IsPlayerInAnyVehicle(hitid) || GetPlayerSurfingVehicleID(playerid);
-
-		if ((!in_veh && GetPlayerSurfingVehicleID(playerid) == INVALID_VEHICLE_ID) || origin_dist > 50.0) {
-			AddRejectedHit(playerid, damagedid, HIT_TOO_FAR_FROM_ORIGIN, weaponid, _:origin_dist);
-
-			return 0;
-		}
-	}
-
-	// Shot exceeding the max range?
-	if (hittype != BULLET_HIT_TYPE_NONE) {
-		if (length > s_WeaponRange[weaponid]) {
-			if (hittype == BULLET_HIT_TYPE_PLAYER) {
-				AddRejectedHit(playerid, damagedid, HIT_OUT_OF_RANGE, weaponid, _:length, _:s_WeaponRange[weaponid]);
-			}
-
-			return 0;
-		}
-
-		if (hittype == BULLET_HIT_TYPE_PLAYER) {
-			if (IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleID(playerid) == GetPlayerVehicleID(hitid)) {
-				AddRejectedHit(playerid, damagedid, HIT_SAME_VEHICLE, weaponid);
-				return 0;
-			}
-
-			new Float:dist = GetPlayerDistanceFromPoint(hitid, fHitPosX, fHitPosY, fHitPosZ);
-			new in_veh = IsPlayerInAnyVehicle(hitid);
-
-			if ((!in_veh && dist > 20.0) || dist > 50.0) {
-				AddRejectedHit(playerid, damagedid, HIT_TOO_FAR_FROM_SHOT, weaponid, _:dist);
-
-				return 0;
-			}
-		}
-	}
-
-	new tick = GetTickCount();
-	if (tick == 0) tick = 1;
-
-	new idx = (s_LastShotIdx[playerid] + 1) % sizeof(s_LastShotTicks[]);
-
-	// JIT plugin fix
-	if (idx < 0) {
-		idx += sizeof(s_LastShotTicks[]);
-	}
-
-	s_LastShotIdx[playerid] = idx;
-	s_LastShotTicks[playerid][idx] = tick;
-	s_LastShotWeapons[playerid][idx] = weaponid;
-	s_ShotsFired[playerid] += 1;
-
-	#if WC_DEBUG
-		if (s_ShotsFired[playerid] > 1) {
-			new prev_tick_idx = (idx - 1) % sizeof(s_LastShotTicks[]);
-
-			// JIT plugin fix
-			if (prev_tick_idx < 0) {
-				prev_tick_idx += sizeof(s_LastShotTicks[]);
-			}
-
-			new prev_tick = s_LastShotTicks[playerid][prev_tick_idx];
-
-			DebugMessage(playerid, "(shot) last: %d last 3: %d", tick - prev_tick, AverageShootRate(playerid, 3));
-		}
-	#endif
-
-	s_LastShot[playerid][e_Tick] = tick;
-	s_LastShot[playerid][e_Weapon] = weaponid;
-	s_LastShot[playerid][e_HitType] = hittype;
-	s_LastShot[playerid][e_HitId] = hitid;
-	s_LastShot[playerid][e_X] = fX;
-	s_LastShot[playerid][e_Y] = fY;
-	s_LastShot[playerid][e_Z] = fZ;
-	s_LastShot[playerid][e_OX] = fOriginX;
-	s_LastShot[playerid][e_OY] = fOriginY;
-	s_LastShot[playerid][e_OZ] = fOriginZ;
-	s_LastShot[playerid][e_HX] = fHitPosX;
-	s_LastShot[playerid][e_HY] = fHitPosY;
-	s_LastShot[playerid][e_HZ] = fHitPosZ;
-	s_LastShot[playerid][e_Length] = length;
-	s_LastShot[playerid][e_Hits] = 0;
-
-	new multiple_weapons;
-	new avg_rate = AverageShootRate(playerid, s_MaxShootRateSamples, multiple_weapons);
-
-	// Bullet flood?
-	// Could be either a cheat or just lag
-	if (avg_rate != -1) {
-		if (multiple_weapons) {
-			if (avg_rate < 100) {
-				AddRejectedHit(playerid, damagedid, SHOOTING_RATE_TOO_FAST_MULTIPLE, weaponid, avg_rate, s_MaxShootRateSamples);
-				return 0;
-			}
-		} else if (s_MaxWeaponShootRate[weaponid] - avg_rate > 20) {
-			AddRejectedHit(playerid, damagedid, SHOOTING_RATE_TOO_FAST, weaponid, avg_rate, s_MaxShootRateSamples, s_MaxWeaponShootRate[weaponid]);
-			return 0;
-		}
-	}
-
-	// Destroy vehicles with passengers in them
-	if (hittype == BULLET_HIT_TYPE_VEHICLE) {
-		if (hitid < 0 || hitid > MAX_VEHICLES || !WC_IsValidVehicle(hitid)) {
-			AddRejectedHit(playerid, damagedid, HIT_INVALID_VEHICLE, weaponid, hitid);
-			return 0;
-		}
-
-		new vehicleid = GetPlayerVehicleID(playerid);
-
-		// Shouldn't be possible to damage the vehicle you're in
-		if (hitid == vehicleid) {
-			AddRejectedHit(playerid, damagedid, HIT_OWN_VEHICLE, weaponid);
-			return 0;
-		}
-
-		if (s_VehiclePassengerDamage) {
-			new has_driver = false;
-			new has_passenger = false;
-
-			for (new otherid = 0; otherid < MAX_PLAYERS; otherid++) {
-				if (otherid == playerid || !IsPlayerConnected(otherid)) {
-					continue;
-				}
-
-				if (GetPlayerVehicleID(otherid) != hitid) {
-					continue;
-				}
-
-				new seat = GetPlayerVehicleSeat(otherid);
-
-				if (seat == 0) {
-					has_driver = true;
-				} else {
-					has_passenger = true;
-				}
-			}
-
-			if (!has_driver && has_passenger) {
-				new Float:health;
-
-				GetVehicleHealth(hitid, health);
-
-				if (WEAPON_SHOTGUN <= weaponid <= WEAPON_SHOTGSPA) {
-					health -= 120.0;
-				} else {
-					health -= s_WeaponDamage[weaponid] * 3.0;
-				}
-
-				if (health <= 0.0) {
-					health = 0.0;
-				}
-
-				SetVehicleHealth(hitid, health);
-			}
-		}
-
-		if (s_VehicleUnoccupiedDamage) {
-			new has_occupent = false;
-
-			for (new otherid = 0; otherid < MAX_PLAYERS; otherid++) {
-				if (otherid == playerid || !IsPlayerConnected(otherid)) {
-					continue;
-				}
-
-				if (GetPlayerVehicleID(otherid) != hitid) {
-					continue;
-				}
-
-				has_occupent = true;
-			}
-
-			if (!has_occupent) {
-				new Float:health;
-
-				GetVehicleHealth(hitid, health);
-				if (health >= 249.0) { //vehicles start on fire at 249 or under so theres no need to check once the vehicle is at or below 250
-					if (WEAPON_SHOTGUN <= weaponid <= WEAPON_SHOTGSPA) {
-						health -= 120.0;
-					} else {
-						health -= s_WeaponDamage[weaponid] * 3.0;
-					}
-
-					if (health <= 249.0) {
-						if (s_VehicleRespawnTimer[hitid] == -1) {
-							health = 249.0;
-							s_VehicleRespawnTimer[hitid] = SetTimerEx("WC_KillVehicle", 6000, false, "ii", hitid, playerid);
-						}
-					}
-
-					SetVehicleHealth(hitid, health);
-				}
-			}
-		}
-	}
-
-	new retval = 1;
-
-	#if defined WC_OnPlayerWeaponShot
-		retval = WC_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
-	#else
-		retval = 1;
-	#endif
-
-	s_LastShot[playerid][e_Valid] = !!retval;
-
-	// Valid shot?
-	if (retval) {
-		if (hittype == BULLET_HIT_TYPE_VEHICLE) {
-			s_LastVehicleShooter[hitid] = playerid;
-		}
-	}
-
-	return retval;
-}
-
-forward WC_KillVehicle(vehicleid, killerid);
-public WC_KillVehicle(vehicleid, killerid)
-{
-	OnVehicleDeath(vehicleid, killerid);
-	s_VehicleRespawnTimer[vehicleid] = SetTimerEx("WC_OnDeadVehicleSpawn", 10000, false, "i", vehicleid);
-	return 1;
-}
-
-
-forward WC_OnDeadVehicleSpawn(vehicleid);
-public WC_OnDeadVehicleSpawn(vehicleid)
-{
-	s_VehicleRespawnTimer[vehicleid] = -1;
-	return SetVehicleToRespawn(vehicleid);
-}
-
-
-
-public OnVehicleSpawn(vehicleid)
-{
-	if (s_VehicleRespawnTimer[vehicleid] != -1) {
-		KillTimer(s_VehicleRespawnTimer[vehicleid]);
-		s_VehicleRespawnTimer[vehicleid] = -1;
-	}
-
-	s_VehicleAlive[vehicleid] = true;
-
-
-	#if defined WC_OnVehicleSpawn
-		return WC_OnVehicleSpawn(vehicleid);
-	#else
-		return 1;
-	#endif
-}
-
-
-public OnVehicleDeath(vehicleid, killerid)
-{
-	if (s_VehicleRespawnTimer[vehicleid] != -1) {
-		KillTimer(s_VehicleRespawnTimer[vehicleid]);
-		s_VehicleRespawnTimer[vehicleid] = -1;
-	}
-	if (s_VehicleAlive[vehicleid]) {
-		s_VehicleAlive[vehicleid] = false;
-
-		#if defined WC_OnVehicleDeath
-			return WC_OnVehicleDeath(vehicleid, killerid);
-		#else
-			return 1;
-		#endif
-	}
-	return 1;
-}
-
-
-public OnPlayerEnterCheckpoint(playerid)
-{
-	if (!IsPlayerSpawned(playerid)) {
-		return 1;
-	}
-
-	#if defined WC_OnPlayerEnterCheckpoint
-		return WC_OnPlayerEnterCheckpoint(playerid);
-	#else
-		return 1;
-	#endif
-}
-
-public OnPlayerLeaveCheckpoint(playerid)
-{
-	// If they're dying, it will be called in PlayerDeath (when the death anim begins)
-	if (s_IsDying[playerid]) {
-		return 1;
-	}
-
-	#if defined WC_OnPlayerLeaveCheckpoint
-		return WC_OnPlayerLeaveCheckpoint(playerid);
-	#else
-		return 1;
-	#endif
-}
-
-/*
- * Internal functions
- */
-
-static ScriptInit()
-{
-	s_LagCompMode = GetServerVarAsInt("lagcompmode");
-
-	if (s_LagCompMode) {
-		SetKnifeSync(false);
-	} else {
-		s_DamageTakenSound = 0;
-		SetKnifeSync(true);
-	}
-
-	for (new i = 0; i < sizeof(s_ClassSpawnInfo); i++) {
-		s_ClassSpawnInfo[i][e_Skin] = -1;
-	}
-
-	s_HealthBarBorder = TextDrawCreate(610.01, 68.25, "\1");
-
-	if (s_HealthBarBorder == Text:INVALID_TEXT_DRAW) {
-		printf("(wc) WARN: Unable to create healthbar border textdraw");
-	} else {
-		s_InternalTextDraw[s_HealthBarBorder] = true;
-
-		TextDrawUseBox    (s_HealthBarBorder, 1);
-		TextDrawLetterSize(s_HealthBarBorder, 0.0, 0.64);
-		TextDrawTextSize  (s_HealthBarBorder, 543.75, 0.0);
-		TextDrawBoxColor  (s_HealthBarBorder, 0x000000FF);
-	}
-
-	s_HealthBarBackground = TextDrawCreate(608.01, 70.25, "\1");
-
-	if (s_HealthBarBackground == Text:INVALID_TEXT_DRAW) {
-		printf("(wc) WARN: Unable to create healthbar background textdraw");
-	} else {
-		s_InternalTextDraw[s_HealthBarBackground] = true;
-
-		TextDrawUseBox    (s_HealthBarBackground, 1);
-		TextDrawLetterSize(s_HealthBarBackground, 0.0, 0.2);
-		TextDrawTextSize  (s_HealthBarBackground, 545.75, 0.0);
-		TextDrawBoxColor  (s_HealthBarBackground, 0x5A0C10FF);
-	}
-
-	#if WC_CUSTOM_VENDING_MACHINES
-		if (s_CustomVendingMachines) {
-			CreateVendingMachines();
-		}
-	#endif
-
-	new tick = GetTickCount();
-
-	for (new playerid = 0; playerid < MAX_PLAYERS; playerid++) {
-		if (!IsPlayerConnected(playerid)) {
-			continue;
-		}
-
-		new team = GetPlayerTeam(playerid);
-
-		if (team == 0xFE) {
-			s_PlayerTeam[playerid] = NO_TEAM;
-		} else {
-			s_PlayerTeam[playerid] = team;
-		}
-
-		SetPlayerTeam(playerid, 0xFE);
-		DamageFeedUpdate(playerid);
-
-		new worldid = GetPlayerVirtualWorld(playerid);
-
-		if (worldid == WC_DEATH_WORLD) {
-			worldid = 0;
-
-			SetPlayerVirtualWorld(playerid, worldid);
-		}
-
-		s_World[playerid] = worldid;
-		s_LastUpdate[playerid] = tick;
-		s_DamageFeedLastUpdate[playerid] = tick;
-		s_LastStop[playerid] = tick;
-		s_LastVehicleEnterTime[playerid] = 0;
-		s_TrueDeath[playerid] = true;
-		s_InClassSelection[playerid] = true;
-		s_PlayerFallbackSpawnInfo[playerid][e_Skin] = -1;
-		s_AlreadyConnected[playerid] = true;
-
-		#if WC_CUSTOM_VENDING_MACHINES
-			RemoveDefaultVendingMachines(playerid);
-		#endif
-
-		if (PLAYER_STATE_ONFOOT <= GetPlayerState(playerid) <= PLAYER_STATE_PASSENGER) {
-			GetPlayerHealth(playerid, s_PlayerHealth[playerid]);
-			GetPlayerArmour(playerid, s_PlayerArmour[playerid]);
-
-			if (s_PlayerHealth[playerid] == 0.0) {
-				s_PlayerHealth[playerid] = s_PlayerMaxHealth[playerid];
-			}
-
-			UpdateHealthBar(playerid);
-		}
-
-		switch (GetPlayerState(playerid)) {
-			case PLAYER_STATE_ONFOOT,
-			     PLAYER_STATE_DRIVER,
-			     PLAYER_STATE_PASSENGER,
-			     PLAYER_STATE_SPAWNED: {
-				SetHealthBarVisible(playerid, true);
-			}
-
-			default: {
-				SetHealthBarVisible(playerid, false);
-			}
-		}
-	}
-}
-
-static ScriptExit()
-{
-	SetKnifeSync(true);
-
-	#if WC_CUSTOM_VENDING_MACHINES
-		DestroyVendingMachines();
-	#endif
-
-	for (new playerid = 0; playerid < MAX_PLAYERS; playerid++) {
-		#if WC_CUSTOM_VENDING_MACHINES
-			if (s_VendingUseTimer[playerid] != -1) {
-				KillTimer(s_VendingUseTimer[playerid]);
-				s_VendingUseTimer[playerid] = -1;
-			}
-		#endif
-
-		if (!IsPlayerConnected(playerid)) {
-			continue;
-		}
-
-		// Put things back the way they were
-		SetPlayerTeam(playerid, s_PlayerTeam[playerid]);
-
-		if (PLAYER_STATE_ONFOOT <= GetPlayerState(playerid) <= PLAYER_STATE_PASSENGER) {
-			new Float:health = s_PlayerHealth[playerid];
-
-			if (health == 0.0) {
-				health = s_PlayerMaxHealth[playerid];
-			}
-
-			SetPlayerHealth(playerid, health);
-			SetPlayerArmour(playerid, s_PlayerArmour[playerid]);
-		}
-
-		SetFakeHealth(playerid, 255);
-		SetFakeArmour(playerid, 255);
-		FreezeSyncData(playerid, false);
-		SetFakeFacingAngle(playerid, _);
-		SetHealthBarVisible(playerid, false);
-
-		if (s_HealthBarForeground[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-			PlayerTextDrawDestroy(playerid, s_HealthBarForeground[playerid]);
-			s_InternalPlayerTextDraw[playerid][s_HealthBarForeground[playerid]] = false;
-			s_HealthBarForeground[playerid] = PlayerText:INVALID_TEXT_DRAW;
-		}
-
-		if (s_DamageFeedGiven[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-			PlayerTextDrawDestroy(playerid, s_DamageFeedGiven[playerid]);
-			s_InternalPlayerTextDraw[playerid][s_DamageFeedGiven[playerid]] = false;
-			s_DamageFeedGiven[playerid] = PlayerText:INVALID_TEXT_DRAW;
-		}
-
-		if (s_DamageFeedTaken[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-			PlayerTextDrawDestroy(playerid, s_DamageFeedTaken[playerid]);
-			s_InternalPlayerTextDraw[playerid][s_DamageFeedTaken[playerid]] = false;
-			s_DamageFeedTaken[playerid] = PlayerText:INVALID_TEXT_DRAW;
-		}
-	}
-
-	if (s_HealthBarBorder != Text:INVALID_TEXT_DRAW) {
-		TextDrawDestroy(s_HealthBarBorder);
-		s_InternalTextDraw[s_HealthBarBorder] = false;
-	}
-
-	if (s_HealthBarBackground != Text:INVALID_TEXT_DRAW) {
-		TextDrawDestroy(s_HealthBarBackground);
-		s_InternalTextDraw[s_HealthBarBackground] = false;
-	}
-}
-
-static UpdatePlayerVirtualWorld(playerid)
-{
-	new worldid = GetPlayerVirtualWorld(playerid);
-
-	if (worldid == WC_DEATH_WORLD) {
-		worldid = s_World[playerid];
-	} else if (worldid != s_World[playerid]) {
-		s_World[playerid] = worldid;
-	}
-
-	SetPlayerVirtualWorld(playerid, worldid);
-}
-
-static HasSameTeam(playerid, otherid)
-{
-	if (otherid < 0 || otherid >= MAX_PLAYERS || playerid < 0 || playerid >= MAX_PLAYERS) {
-		return 0;
-	}
-
-	if (s_PlayerTeam[playerid] == NO_TEAM || s_PlayerTeam[otherid] == NO_TEAM) {
-		return 0;
-	}
-
-	return (s_PlayerTeam[playerid] == s_PlayerTeam[otherid]);
-}
-
-static IsPlayerPaused(playerid)
-{
-	return (GetTickCount() - s_LastUpdate[playerid] > 2000);
-}
-
-static UpdateHealthBar(playerid, bool:force = false)
-{
-	if (s_BeingResynced[playerid] || s_ForceClassSelection[playerid]) {
-		return;
-	}
-
-	new health = floatround(s_PlayerHealth[playerid] / s_PlayerMaxHealth[playerid] * 100.0, floatround_ceil);
-	new armour = floatround(s_PlayerArmour[playerid] / s_PlayerMaxArmour[playerid] * 100.0, floatround_ceil);
-
-	// Make the values reflect what the client should see
-	if (s_IsDying[playerid]) {
-		health = 0;
-		armour = 0;
-	} else {
-		if (health > 100) {
-			health = 100;
-		}
-
-		if (armour > 100) {
-			armour = 100;
-		}
-	}
-
-	if (force) {
-		s_LastSentHealth[playerid] = -1;
-		s_LastSentArmour[playerid] = -1;
-	} else if (s_HealthBarVisible[playerid] && s_HealthBarForeground[playerid] == PlayerText:INVALID_TEXT_DRAW && !s_IsDying[playerid]) {
-		s_LastSentHealth[playerid] = -1;
-	} else if (health == s_LastSentHealth[playerid] && armour == s_LastSentArmour[playerid]) {
-		return;
-	}
-
-	SetFakeHealth(playerid, health);
-	SetFakeArmour(playerid, armour);
-
-	UpdateSyncData(playerid);
-
-	if (health != s_LastSentHealth[playerid]) {
-		s_LastSentHealth[playerid] = health;
-
-		SetPlayerHealth(playerid, 8000000.0 + float(health));
-
-		if (s_HealthBarVisible[playerid] && !s_IsDying[playerid]) {
-			if (s_HealthBarForeground[playerid] == PlayerText:INVALID_TEXT_DRAW) {
-				s_HealthBarForeground[playerid] = CreatePlayerTextDraw(
-					playerid,
-					551.5 + float(health) * 0.5651,
-					70.25,
-					"\1"
-				);
-
-				if (s_HealthBarForeground[playerid] == PlayerText:INVALID_TEXT_DRAW) {
-					printf("(wc) WARN: Unable to create player healthbar foreground");
-				} else {
-					s_InternalPlayerTextDraw[playerid][s_HealthBarForeground[playerid]] = true;
-
-					PlayerTextDrawUseBox    (playerid, s_HealthBarForeground[playerid], 1);
-					PlayerTextDrawLetterSize(playerid, s_HealthBarForeground[playerid], 0.0, 0.2);
-					PlayerTextDrawTextSize  (playerid, s_HealthBarForeground[playerid], 545.75, 0.0);
-					PlayerTextDrawBoxColor  (playerid, s_HealthBarForeground[playerid], 0xB51821FF);
-
-					PlayerTextDrawShow(playerid, s_HealthBarForeground[playerid]);
-				}
-			} else {
-				PlayerTextDrawSetPosition(playerid, s_HealthBarForeground[playerid], 551.5 + float(health) * 0.5651, 70.25);
-				PlayerTextDrawShow(playerid, s_HealthBarForeground[playerid]);
-			}
-
-		} else if (s_HealthBarForeground[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-			PlayerTextDrawDestroy(playerid, s_HealthBarForeground[playerid]);
-			s_InternalPlayerTextDraw[playerid][s_HealthBarForeground[playerid]] = false;
-			s_HealthBarForeground[playerid] = PlayerText:INVALID_TEXT_DRAW;
-		}
-	}
-
-	if (armour != s_LastSentArmour[playerid]) {
-		s_LastSentArmour[playerid] = armour;
-
-		SetPlayerArmour(playerid, float(armour));
-	}
-}
-
-static SetHealthBarVisible(playerid, bool:toggle)
-{
-	if (s_HealthBarVisible[playerid] == toggle) {
-		return;
-	}
-
-	s_HealthBarVisible[playerid] = toggle;
-
-	if (toggle) {
-		if (s_HealthBarBorder != Text:INVALID_TEXT_DRAW) {
-			TextDrawShowForPlayer(playerid, s_HealthBarBorder);
-		}
-
-		if (s_HealthBarBackground != Text:INVALID_TEXT_DRAW) {
-			TextDrawShowForPlayer(playerid, s_HealthBarBackground);
-		}
-
-		UpdateHealthBar(playerid, true);
-	} else {
-		if (s_HealthBarForeground[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-			PlayerTextDrawHide(playerid, s_HealthBarForeground[playerid]);
-		}
-
-		if (s_HealthBarBorder != Text:INVALID_TEXT_DRAW) {
-			TextDrawHideForPlayer(playerid, s_HealthBarBorder);
-		}
-
-		if (s_HealthBarBackground != Text:INVALID_TEXT_DRAW) {
-			TextDrawHideForPlayer(playerid, s_HealthBarBackground);
-		}
-	}
-}
-
-static SpawnPlayerInPlace(playerid) {
-	new Float:x, Float:y, Float:z, Float:r;
-
-	GetPlayerPos(playerid, x, y, z);
-	GetPlayerFacingAngle(playerid, r);
-
-	SetSpawnInfo(playerid, 0xFE, GetPlayerSkin(playerid), x, y, z, r, 0, 0, 0, 0, 0, 0);
-
-	s_SpawnInfoModified[playerid] = true;
-
-	SpawnPlayer(playerid);
-}
-
-static PosInFront(playerid, Float:distance, &Float:x, &Float:y, &Float:z)
-{
-	new Float:a;
-
-	GetPlayerPos(playerid, x, y, z);
-	GetPlayerFacingAngle(playerid, a);
-
-	x += (distance * floatsin(-a, degrees));
-	y += (distance * floatcos(-a, degrees));
-}
-
-static Float:AngleBetweenPoints(Float:x1, Float:y1, Float:x2, Float:y2)
-{
-	return -(90.0 - atan2(y1 - y2, x1 - x2));
-}
-
-static UpdateSyncData(playerid)
-{
-	// Currently re-sending onfoot data is only supported
-	if (!IsPlayerConnected(playerid) || GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) {
-		return;
-	}
-
-	for (new i = 0; i < MAX_PLAYERS; i++) {
-		if (i != playerid && IsPlayerConnected(i) && IsPlayerStreamedIn(playerid, i)) {
-			SendLastSyncData(playerid, i);
-		}
-	}
-}
-
-static WasPlayerInVehicle(playerid, time) {
-	if (!s_LastVehicleTick[playerid]) {
-		return 0;
-	}
-
-	if (GetTickCount() - time < s_LastVehicleTick[playerid]) {
-		return 1;
-	}
-
-	return 0;
-}
-
-#if WC_CUSTOM_VENDING_MACHINES
-	static RemoveDefaultVendingMachines(playerid)
-	{
-		RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 20000.0); // CJ_EXT_SPRUNK
-		RemoveBuildingForPlayer(playerid, 956, 0.0, 0.0, 0.0, 20000.0); // CJ_EXT_CANDY
-		RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 20000.0); // vendmach
-		RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 20000.0); // vendmachfd
-		RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 20000.0); // CJ_SPRUNK1
-		RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 20000.0); // CJ_CANDYVENDOR
-		RemoveBuildingForPlayer(playerid, 1977, 0.0, 0.0, 0.0, 20000.0); // vendin3
-
-		// Make sure they're all gone..
-		for (new i = 0; i < sizeof(sc_VendingMachines); i++) {
-			RemoveBuildingForPlayer(
-				playerid,
-				sc_VendingMachines[i][e_Model],
-				sc_VendingMachines[i][e_PosX],
-				sc_VendingMachines[i][e_PosY],
-				sc_VendingMachines[i][e_PosZ],
-				1.0
-			);
-		}
-	}
-
-	static CreateVendingMachines()
-	{
-		DestroyVendingMachines();
-
-		for (new i = 0; i < sizeof(sc_VendingMachines); i++) {
-			#if WC_USE_STREAMER
-				s_VendingMachineObject[i] = CreateDynamicObject(
-					sc_VendingMachines[i][e_Model],
-					sc_VendingMachines[i][e_PosX],
-					sc_VendingMachines[i][e_PosY],
-					sc_VendingMachines[i][e_PosZ],
-					sc_VendingMachines[i][e_RotX],
-					sc_VendingMachines[i][e_RotY],
-					sc_VendingMachines[i][e_RotZ],
-					.interiorid = sc_VendingMachines[i][e_Interior]
-				);
-			#else
-				s_VendingMachineObject[i] = CreateObject(
-					sc_VendingMachines[i][e_Model],
-					sc_VendingMachines[i][e_PosX],
-					sc_VendingMachines[i][e_PosY],
-					sc_VendingMachines[i][e_PosZ],
-					sc_VendingMachines[i][e_RotX],
-					sc_VendingMachines[i][e_RotY],
-					sc_VendingMachines[i][e_RotZ]
-				);
-			#endif
-		}
-	}
-
-	static DestroyVendingMachines()
-	{
-		for (new i = 0; i < sizeof(s_VendingMachineObject); i++) {
-			if (s_VendingMachineObject[i] != -1) {
-				#if WC_USE_STREAMER
-					DestroyDynamicObject(s_VendingMachineObject[i]);
-				#else
-					DestroyObject(s_VendingMachineObject[i]);
-				#endif
-
-				s_VendingMachineObject[i] = -1;
-			}
-		}
-	}
-#endif
-
-forward WC_DeathSkipEnd(playerid);
-public WC_DeathSkipEnd(playerid)
-{
-	TogglePlayerControllable(playerid, true);
-
-	ResetPlayerWeapons(playerid);
-
-	for (new i = 0; i < 13; i++) {
-		if (s_SyncData[playerid][e_WeaponId][i]) {
-			GivePlayerWeapon(playerid, s_SyncData[playerid][e_WeaponId][i], s_SyncData[playerid][e_WeaponAmmo][i]);
-		}
-	}
-
-	GivePlayerWeapon(playerid, s_SyncData[playerid][e_Weapon], 0);
-	SetPlayerSpecialAction(playerid, 0);
-}
-
-forward WC_SpawnForStreamedIn(playerid);
-public WC_SpawnForStreamedIn(playerid)
-{
-	if (!IsPlayerConnected(playerid)) {
-		return;
-	}
-
-	SpawnPlayerForWorld(playerid);
-
-	for (new i = 0; i < MAX_PLAYERS; i++) {
-		if (i != playerid && IsPlayerConnected(i) && IsPlayerStreamedIn(playerid, i)) {
-			SendLastSyncData(playerid, i);
-			ClearAnimationsForPlayer(playerid, i);
-		}
-	}
-}
-
-forward WC_SetSpawnForStreamedIn(playerid);
-public WC_SetSpawnForStreamedIn(playerid)
-{
-	s_SpawnForStreamedIn[playerid] = true;
-}
-
-forward WC_SpawnPlayerInPlace(playerid);
-public WC_SpawnPlayerInPlace(playerid)
-{
-	SpawnPlayerInPlace(playerid);
-}
-
-static ProcessDamage(&playerid, &issuerid, &Float:amount, &weaponid, &bodypart, &Float:bullets)
-{
-	if (amount < 0.0) {
-		return WC_INVALID_DAMAGE;
-	}
-
-	// Adjust invalid amounts caused by an animation bug
-	switch (amount) {
-		case 3.63000011444091796875,
-		     5.940000057220458984375,
-		     5.610000133514404296875: {
-			amount = 2.6400001049041748046875;
-		}
-
-		case 3.30000019073486328125: {
-			if (weaponid != WEAPON_SHOTGUN && weaponid != WEAPON_SAWEDOFF) {
-				amount = 2.6400001049041748046875;
-			}
-		}
-
-		case 4.950000286102294921875: {
-			if (IsMeleeWeapon(weaponid)) {
-				amount = 2.6400001049041748046875;
-			}
-		}
-
-		case 6.270000457763671875,
-		     6.93000030517578125,
-		     7.2600002288818359375,
-		     7.9200000762939453125,
-		     8.5799999237060546875,
-		     9.24000072479248046875,
-		     11.88000011444091796875,
-		     11.22000026702880859375: {
-			amount = 2.6400001049041748046875;
-		}
-
-		case 9.90000057220458984375: {
-			switch (weaponid) {
-				case WEAPON_VEHICLE, WEAPON_VEHICLE_M4, WEAPON_AK47,
-				     WEAPON_M4, WEAPON_SHOTGUN, WEAPON_SAWEDOFF, WEAPON_SHOTGSPA: {}
-
-				default: {
-					amount = 6.6000003814697265625;
-				}
-			}
-		}
-	}
-
-	// Car parking
-	if (weaponid == WEAPON_HELIBLADES && _:amount != _:330.0) {
-		weaponid = WEAPON_CARPARK;
-	}
-
-	// Finish processing drown/fire/carpark quickly, since they are sent at very high rates
-	if (IsHighRateWeapon(weaponid)) {
-		// Apply reasonable bounds
-		if (weaponid == WEAPON_DROWN) {
-			if (amount > 10.0) amount = 10.0;
-		} else if (amount > 1.0) {
-			amount = 1.0;
-		}
-
-		// Adjust the damage if the multiplier is not 1.0
-		if (_:s_WeaponDamage[weaponid] != _:1.0) {
-			amount *= s_WeaponDamage[weaponid];
-		}
-
-		// Make sure the distance and issuer is valid; carpark can be self-inflicted so it doesn't require an issuer
-		if (weaponid == WEAPON_SPRAYCAN || weaponid == WEAPON_FIREEXTINGUISHER || (weaponid == WEAPON_CARPARK && issuerid != INVALID_PLAYER_ID)) {
-			if (issuerid == INVALID_PLAYER_ID) {
-				return WC_NO_ISSUER;
-			}
-
-			new Float:x, Float:y, Float:z, Float:dist;
-			GetPlayerPos(issuerid, x, y, z);
-			dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
-
-			if (dist > 15.0) {
-				AddRejectedHit(issuerid, playerid, HIT_TOO_FAR_FROM_ORIGIN, weaponid, _:dist);
-				return WC_INVALID_DISTANCE;
-			}
-		}
-
-		return WC_NO_ERROR;
-	}
-
-	// Bullet or melee damage must have an issuerid, otherwise something has gone wrong (e.g. sniper bug)
-	if (issuerid == INVALID_PLAYER_ID && (IsBulletWeapon(weaponid) || IsMeleeWeapon(weaponid))) {
-		return WC_NO_ISSUER;
-	}
-
-	// Punching with a parachute
-	if (weaponid == WEAPON_PARACHUTE) {
-		weaponid = WEAPON_UNARMED;
-	}
-
-	// Collision damage should never be above 165
-	if (weaponid == WEAPON_COLLISION) {
-		if (amount > 165.0) {
-			amount = 1.0;
-		} else {
-			amount /= 165.0;
-		}
-	}
-
-	if (weaponid == WEAPON_EXPLOSION) {
-		// Explosions do at most 82.5 damage. This will later be multipled by the damage value
-		amount /= 82.5;
-
-		// Figure out what caused the explosion
-		if (issuerid != INVALID_PLAYER_ID && s_LastExplosive[issuerid]) {
-			weaponid = s_LastExplosive[issuerid];
-		}
-	}
-
-	// Check for pistol whip
-	switch (weaponid) {
-		case WEAPON_COLT45 .. WEAPON_SNIPER,
-		     WEAPON_MINIGUN, WEAPON_SPRAYCAN, WEAPON_FIREEXTINGUISHER: {
-			// A pistol whip inflicts 2.64 damage
-			if (_:amount == _:2.6400001049041748046875) {
-				// Save the weapon in the bodypart argument (it's always BODY_PART_TORSO)
-				bodypart = weaponid;
-				weaponid = WEAPON_PISTOLWHIP;
-			}
-		}
-	}
-
-	new melee = IsMeleeWeapon(weaponid);
-
-	// Can't punch from a vehicle
-	if (melee && IsPlayerInAnyVehicle(issuerid)) {
-		return WC_INVALID_DAMAGE;
-	}
-
-	if (weaponid != WEAPON_PISTOLWHIP) {
-		switch (amount) {
-			case 1.32000005245208740234375,
-			     1.650000095367431640625,
-			     1.980000019073486328125,
-			     2.3100001811981201171875,
-			     2.6400001049041748046875,
-			     2.9700000286102294921875,
-			     3.96000003814697265625,
-			     4.28999996185302734375,
-			     4.62000036239624023437,
-			     5.280000209808349609375: {
-				// Damage is most likely from punching and switching weapon quickly
-				if (!melee) {
-					DebugMessage(issuerid, "weapon changed from %d to melee (punch & swap)", weaponid);
-					weaponid = WEAPON_UNARMED;
-					melee = true;
-				}
-			}
-
-			case 6.6000003814697265625: {
-				if (!melee) {
-					switch (weaponid) {
-						case WEAPON_UZI, WEAPON_TEC9, WEAPON_CHAINSAW,
-						     WEAPON_SHOTGUN, WEAPON_SAWEDOFF: {}
-
-						default: {
-							DebugMessage(issuerid, "weapon changed from %d to melee (punch & swap)", weaponid);
-							weaponid = WEAPON_UNARMED;
-							melee = true;
-						}
-					}
-				}
-			}
-
-			case 54.12000274658203125: {
-				if (!melee) {
-					DebugMessage(issuerid, "weapon changed from %d to melee (punch & swap)", weaponid);
-					melee = true;
-					weaponid = WEAPON_UNARMED;
-					amount = 1.32000005245208740234375;
-				}
-
-				// Be extra sure about this one
-				if (GetPlayerFightingStyle(issuerid) != FIGHT_STYLE_KNEEHEAD) {
-					return WC_INVALID_DAMAGE;
-				}
-			}
-
-			// Melee damage has been tampered with
-			default: {
-				if (melee) {
-					return WC_INVALID_DAMAGE;
-				}
-			}
-		}
-	}
-
-	if (melee) {
-		new Float:x, Float:y, Float:z, Float:dist;
-		GetPlayerPos(issuerid, x, y, z);
-		dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
-
-		if (dist > 15.0) {
-			AddRejectedHit(issuerid, playerid, HIT_TOO_FAR_FROM_ORIGIN, weaponid, _:dist);
-			return WC_INVALID_DISTANCE;
-		}
-	}
-
-	switch (weaponid) {
-		// The spas shotguns shoot 8 bullets, each inflicting 4.95 damage
-		case WEAPON_SHOTGSPA: {
-			bullets = amount / 4.950000286102294921875;
-
-			if (8.0 - bullets < -0.05) {
-				return WC_INVALID_DAMAGE;
-			}
-		}
-
-		// Shotguns and sawed-off shotguns shoot 15 bullets, each inflicting 3.3 damage
-		case WEAPON_SHOTGUN, WEAPON_SAWEDOFF: {
-			bullets = amount / 3.30000019073486328125;
-
-			if (15.0 - bullets < -0.05) {
-				return WC_INVALID_DAMAGE;
-			}
-		}
-	}
-
-	if (_:bullets) {
-		new Float:f = floatfract(bullets);
-
-		// The damage for each bullet has been tampered with
-		if (f > 0.01 && f < 0.99) {
-			return WC_INVALID_DAMAGE;
-		}
-
-		// Divide the damage amount by the number of bullets
-		amount /= bullets;
-	}
-
-	// Check chainsaw damage
-	if (weaponid == WEAPON_CHAINSAW) {
-		switch (amount) {
-			case 6.6000003814697265625,
-			     13.5300006866455078125,
-			     16.1700000762939453125,
-			     26.40000152587890625,
-			     27.060001373291015625: {}
-
-			default: {
-				return WC_INVALID_DAMAGE;
-			}
-		}
-	}
-	
-	// Check deagle damage
-	if (weaponid == WEAPON_DEAGLE) {
-		switch (amount) {
-			case 46.200000762939453125,
-			     23.1000003814697265625: {}
-
-			default: {
-				return WC_INVALID_DAMAGE;
-			}
-		}
-	}
-
-	// Check gun damage
-	new Float:def_amount = 0.0;
-
-	switch (weaponid) {
-		case WEAPON_COLT45,
-		     WEAPON_MP5: def_amount = 8.25;
-		case WEAPON_SILENCED: def_amount = 13.200000762939453125;
-		case WEAPON_UZI,
-		     WEAPON_TEC9: def_amount = 6.6000003814697265625;
-		case WEAPON_AK47,
-		     WEAPON_M4,
-		     WEAPON_VEHICLE_M4: def_amount = 9.90000057220458984375;
-		case WEAPON_RIFLE: def_amount = 24.7500019073486328125;
-		case WEAPON_SNIPER: def_amount = 41.25;
-		case WEAPON_MINIGUN,
-		     WEAPON_VEHICLE_MINIGUN: def_amount = 46.200000762939453125;
-		case WEAPON_VEHICLE: def_amount = 9.90000057220458984375;
-	}
-
-	if (_:def_amount && _:def_amount != _:amount) {
-		return WC_INVALID_DAMAGE;
-	}
-
-	// Adjust the damage
-	switch (s_DamageType[weaponid]) {
-		case DAMAGE_TYPE_MULTIPLIER: {
-			if (_:s_WeaponDamage[weaponid] != _:1.0) {
-				amount *= s_WeaponDamage[weaponid];
-			}
-		}
-
-		case DAMAGE_TYPE_STATIC: {
-			if (_:bullets) {
-				amount = s_WeaponDamage[weaponid] * bullets;
-			} else {
-				amount = s_WeaponDamage[weaponid];
-			}
-		}
-
-		case DAMAGE_TYPE_RANGE,
-		     DAMAGE_TYPE_RANGE_MULTIPLIER: {
-			new Float:length = s_LastShot[issuerid][e_Length];
-
-			for (new i = s_DamageRangeSteps[weaponid] - 1; i >= 0; i--) {
-				if (i == 0 || length >= s_DamageRangeRanges[weaponid][i]) {
-					if (s_DamageType[weaponid] == DAMAGE_TYPE_RANGE_MULTIPLIER) {
-						if (_:s_DamageRangeValues[weaponid][i] != _:1.0) {
-							amount *= s_DamageRangeValues[weaponid][i];
-						}
-					} else {
-						if (_:bullets) {
-							amount = s_DamageRangeValues[weaponid][i] * bullets;
-						} else {
-							amount = s_DamageRangeValues[weaponid][i];
-						}
-					}
-
-					break;
-				}
-			}
-		}
-	}
-
-	return WC_NO_ERROR;
-}
-
-static InflictDamage(playerid, Float:amount, issuerid = INVALID_PLAYER_ID, weaponid = WEAPON_UNKNOWN, bodypart = BODY_PART_UNKNOWN, bool:ignore_armour = false)
-{
-	if (!IsPlayerSpawned(playerid) || amount < 0.0) {
-		return;
-	}
-
-	if (!OnPlayerDamage(playerid, amount, issuerid, weaponid, bodypart)) {
-		UpdateHealthBar(playerid);
-
-		if (weaponid < 0 || weaponid > WEAPON_UNKNOWN) {
-			weaponid = WEAPON_UNKNOWN;
-		}
-
-		#if WC_DEBUG
-			new Float:length = 0.0;
-
-			if (issuerid != INVALID_PLAYER_ID) {
-				if (IsBulletWeapon(weaponid)) {
-					length = s_LastShot[issuerid][e_Length];
-				}
-			}
-
-			if (!IsHighRateWeapon(weaponid)) {
-				DebugMessageAll("!InflictDamage(%d, %.4f, %d, %d, %d) length = %f", playerid, amount, issuerid, weaponid, bodypart, length);
-			}
-		#endif
-
-		return;
-	}
-
-	if (weaponid < 0 || weaponid > WEAPON_UNKNOWN) {
-		weaponid = WEAPON_UNKNOWN;
-	}
-
-	#if WC_DEBUG
-		new Float:length = 0.0;
-
-		if (issuerid != INVALID_PLAYER_ID) {
-			if (IsBulletWeapon(weaponid)) {
-				length = s_LastShot[issuerid][e_Length];
-			}
-		}
-
-		if (!IsHighRateWeapon(weaponid)) {
-			DebugMessageAll("InflictDamage(%d, %.4f, %d, %d, %d) length = %f", playerid, amount, issuerid, weaponid, bodypart, length);
-		}
-	#endif
-
-	if (!ignore_armour && weaponid != WEAPON_COLLISION && weaponid != WEAPON_DROWN && weaponid != WEAPON_CARPARK && (!s_DamageArmourToggle[0] || (s_DamageArmour[weaponid][0] && (!s_DamageArmourToggle[1] || ((s_DamageArmour[weaponid][1] && bodypart == 3) || (!s_DamageArmour[weaponid][1])))))) {
-		if (amount <= 0.0) {
-			amount = s_PlayerHealth[playerid] + s_PlayerArmour[playerid];
-		}
-
-		s_PlayerArmour[playerid] -= amount;
-	} else {
-		if (amount <= 0.0) {
-			amount = s_PlayerHealth[playerid];
-		}
-
-		s_PlayerHealth[playerid] -= amount;
-	}
-
-	if (s_PlayerArmour[playerid] < 0.0) {
-		s_DamageDoneArmour[playerid] = amount + s_PlayerArmour[playerid];
-		s_DamageDoneHealth[playerid] = -s_PlayerArmour[playerid];
-		s_PlayerHealth[playerid] += s_PlayerArmour[playerid];
-		s_PlayerArmour[playerid] = 0.0;
-	} else {
-		s_DamageDoneArmour[playerid] = amount;
-		s_DamageDoneHealth[playerid] = 0.0;
-	}
-
-	if (s_PlayerHealth[playerid] <= 0.0) {
-		amount += s_PlayerHealth[playerid];
-		s_DamageDoneHealth[playerid] += s_PlayerHealth[playerid];
-		s_PlayerHealth[playerid] = 0.0;
-	}
-
-	OnPlayerDamageDone(playerid, amount, issuerid, weaponid, bodypart);
-
-	if (s_PlayerHealth[playerid] <= 0.0005) {
-		new vehicleid = GetPlayerVehicleID(playerid);
-
-		if (vehicleid) {
-			new modelid = GetVehicleModel(vehicleid);
-			new seat = GetPlayerVehicleSeat(playerid);
-
-			TogglePlayerControllable(playerid, false);
-
-			switch (modelid) {
-				case 509, 481, 510, 462, 448, 581, 522,
-				     461, 521, 523, 463, 586, 468, 471: {
-					new Float:vx, Float:vy, Float:vz;
-					GetVehicleVelocity(vehicleid, vx, vy, vz);
-
-					if (vx*vx + vy*vy + vz*vz >= 0.4) {
-						PlayerDeath(playerid, "PED", "BIKE_fallR", 0);
-					} else {
-						PlayerDeath(playerid, "PED", "BIKE_fall_off", 0);
-					}
-				}
-
-				default: {
-					if (seat & 1) {
-						PlayerDeath(playerid, "PED", "CAR_dead_LHS");
-					} else {
-						PlayerDeath(playerid, "PED", "CAR_dead_RHS");
-					}
-				}
-			}
-		} else if (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) {
-			PlayerDeath(playerid, "PED", "KO_skid_back", .freeze_sync = false);
-		} else {
-			if (gettime() - s_LastVehicleEnterTime[playerid] < 10) {
-				TogglePlayerControllable(playerid, false);
-			}
-
-			new anim = GetPlayerAnimationIndex(playerid);
-
-			if (anim == 1250 || (1538 <= anim <= 1544) || weaponid == WEAPON_DROWN) {
-				// In water
-				PlayerDeath(playerid, "PED", "Drown");
-			} else if (1195 <= anim <= 1198) {
-				// Jumping animation
-				PlayerDeath(playerid, "PED", "KO_skid_back");
-			} else if (WEAPON_SHOTGUN <= weaponid <= WEAPON_SHOTGSPA) {
-				if (IsPlayerBehindPlayer(issuerid, playerid)) {
-					MakePlayerFacePlayer(playerid, issuerid, true);
-					PlayerDeath(playerid, "PED", "KO_shot_front");
-				} else {
-					MakePlayerFacePlayer(playerid, issuerid);
-					PlayerDeath(playerid, "PED", "BIKE_fall_off");
-				}
-			} else if (WEAPON_RIFLE <= weaponid <= WEAPON_SNIPER) {
-				if (bodypart == 9) {
-					PlayerDeath(playerid, "PED", "KO_shot_face");
-				} else if (IsPlayerBehindPlayer(issuerid, playerid)) {
-					PlayerDeath(playerid, "PED", "KO_shot_front");
-				} else {
-					PlayerDeath(playerid, "PED", "KO_shot_stom");
-				}
-			} else if (IsBulletWeapon(weaponid)) {
-				if (bodypart == 9) {
-					PlayerDeath(playerid, "PED", "KO_shot_face");
-				} else {
-					PlayerDeath(playerid, "PED", "KO_shot_front");
-				}
-			} else if (weaponid == WEAPON_PISTOLWHIP) {
-				PlayerDeath(playerid, "PED", "KO_spin_R");
-			} else if (IsMeleeWeapon(weaponid) || weaponid == WEAPON_CARPARK) {
-				PlayerDeath(playerid, "PED", "KO_skid_front");
-			} else if (weaponid == WEAPON_SPRAYCAN || weaponid == WEAPON_FIREEXTINGUISHER) {
-				PlayerDeath(playerid, "KNIFE", "KILL_Knife_Ped_Die");
-			} else {
-				PlayerDeath(playerid, "PED", "KO_skid_back");
-			}
-		}
-
-		#if defined WC_OnPlayerDeath
-			if (s_CbugAllowed) {
-				WC_OnPlayerDeath(playerid, issuerid, weaponid);
-			} else {
-				s_DelayedDeathTimer[playerid] = SetTimerEx(#WC_DelayedDeath, 1200, false, "iii", playerid, issuerid, weaponid);
-			}
-		#endif
-	}
-
-	UpdateHealthBar(playerid);
-}
-
-forward WC_DelayedDeath(playerid, issuerid, reason);
-public WC_DelayedDeath(playerid, issuerid, reason) {
-	s_DelayedDeathTimer[playerid] = -1;
-
-	#if defined WC_OnPlayerDeath
-		WC_OnPlayerDeath(playerid, issuerid, reason);
-	#endif
-}
-
-static PlayerDeath(playerid, animlib[32], animname[32], anim_lock = 0, respawn_time = -1, bool:freeze_sync = true, anim_freeze = 1)
-{
-	s_PlayerHealth[playerid] = 0.0;
-	s_PlayerArmour[playerid] = 0.0;
-	s_IsDying[playerid] = true;
-
-	new action = GetPlayerSpecialAction(playerid);
-
-	if (action && action != SPECIAL_ACTION_DUCK) {
-		if (action == SPECIAL_ACTION_USEJETPACK) {
-			ClearAnimations(playerid);
-		}
-
-		SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
-
-		if (action == SPECIAL_ACTION_USEJETPACK) {
-			new Float:vx, Float:vy, Float:vz;
-			GetPlayerVelocity(playerid, vx, vy, vz);
-			SetPlayerVelocity(playerid, vx, vy, vz);
-		}
-	}
-
-	OnPlayerPrepareDeath(playerid, animlib, animname, anim_lock, respawn_time);
-
-	UpdateHealthBar(playerid);
-	FreezeSyncData(playerid, freeze_sync);
-
-	if (respawn_time == -1) {
-		respawn_time = s_RespawnTime;
-	}
-
-	if (animlib[0] && animname[0]) {
-		ApplyAnimation(playerid, animlib, animname, 4.1, 0, anim_lock, anim_lock, anim_freeze, 0, 1);
-	}
-
-	if (s_DeathTimer[playerid] != -1) {
-		KillTimer(s_DeathTimer[playerid]);
-	}
-
-	s_DeathTimer[playerid] = SetTimerEx("WC_PlayerDeathRespawn", respawn_time, false, "i", playerid);
-
-	if (s_HealthBarForeground[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-		PlayerTextDrawHide(playerid, s_HealthBarForeground[playerid]);
-	}
-
-	#if defined WC_OnPlayerLeaveCheckpoint
-		if (IsPlayerInCheckpoint(playerid)) {
-			WC_OnPlayerLeaveCheckpoint(playerid);
-		}
-	#endif
-}
-
-public OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time)
-{
-	#if defined WC_OnPlayerPrepareDeath
-		WC_OnPlayerPrepareDeath(playerid, animlib, animname, anim_lock, respawn_time);
-	#endif
-}
-
-public OnRejectedHit(playerid, hit[E_REJECTED_HIT])
-{
-	#if WC_DEBUG
-		new output[256];
-		new reason = hit[e_Reason];
-		new i1 = hit[e_Info1];
-		new i2 = hit[e_Info2];
-		new i3 = hit[e_Info3];
-		new weapon = hit[e_Weapon];
-
-		new weapon_name[32];
-
-		WC_GetWeaponName(weapon, weapon_name);
-
-		format(output, sizeof(output), "(%s -> %s) %s", weapon_name, hit[e_Name], g_HitRejectReasons[reason]);
-
-		format(output, sizeof(output), output, i1, i2, i3);
-
-		DebugMessageRed(playerid, "Rejected hit: %s", output);
-	#endif
-
-	#if defined WC_OnRejectedHit
-		WC_OnRejectedHit(playerid, hit);
-	#endif
-}
-
-public OnPlayerDeathFinished(playerid, bool:cancelable)
-{
-	if (s_PlayerHealth[playerid] == 0.0) {
-		s_PlayerHealth[playerid] = s_PlayerMaxHealth[playerid];
-	}
-
-	if (s_DeathTimer[playerid] != -1) {
-		KillTimer(s_DeathTimer[playerid]);
-		s_DeathTimer[playerid] = -1;
-	}
-
-	#if defined WC_OnPlayerDeathFinished
-		new retval = WC_OnPlayerDeathFinished(playerid, cancelable);
-
-		if (!retval && cancelable) {
-			return 0;
-		}
-	#endif
-
-	ResetPlayerWeapons(playerid);
-
-	return 1;
-}
-
-#if WC_CUSTOM_VENDING_MACHINES
-	public OnPlayerUseVendingMachine(playerid, &Float:health_given) {
-		#if defined WC_OnPlayerUseVendingMachine
-			return WC_OnPlayerUseVendingMachine(playerid, health_given);
-		#else
-			if (GetPlayerMoney(playerid) > 0) {
-				GivePlayerMoney(playerid, -1);
-
-				return 1;
-			} else {
-				return 0;
-			}
-		#endif
-	}
-
-	forward WC_VendingMachineUsed(playerid, Float:health_given);
-	public WC_VendingMachineUsed(playerid, Float:health_given)
-	{
-		s_VendingUseTimer[playerid] = -1;
-
-		if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && !s_IsDying[playerid]) {
-			new Float:health = s_PlayerHealth[playerid];
-
-			health += health_given;
-
-			if (health > s_PlayerMaxHealth[playerid]) {
-				health = s_PlayerMaxHealth[playerid];
-			}
-
-			WC_SetPlayerHealth(playerid, health);
-		}
-	}
-#endif
-
-forward WC_DamageFeedUpdate(playerid);
-public WC_DamageFeedUpdate(playerid)
-{
-	s_DamageFeedTimer[playerid] = -1;
-
-	if (IsPlayerConnected(playerid) && IsDamageFeedActive(playerid)) {
-		DamageFeedUpdate(playerid, true);
-	}
-}
-
-static DamageFeedUpdate(playerid, bool:modified = false)
-{
-	if (!IsDamageFeedActive(playerid)) {
-		if (s_DamageFeedGiven[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-			PlayerTextDrawDestroy(playerid, s_DamageFeedGiven[playerid]);
-			s_InternalPlayerTextDraw[playerid][s_DamageFeedGiven[playerid]] = false;
-			s_DamageFeedGiven[playerid] = PlayerText:INVALID_TEXT_DRAW;
-		}
-
-		if (s_DamageFeedTaken[playerid] != PlayerText:INVALID_TEXT_DRAW) {
-			PlayerTextDrawDestroy(playerid, s_DamageFeedTaken[playerid]);
-			s_InternalPlayerTextDraw[playerid][s_DamageFeedTaken[playerid]] = false;
-			s_DamageFeedTaken[playerid] = PlayerText:INVALID_TEXT_DRAW;
-		}
-
-		return;
-	}
-
-	if (s_DamageFeedGiven[playerid] == PlayerText:INVALID_TEXT_DRAW) {
-		new PlayerText:td = CreatePlayerTextDraw(playerid, 200.0, 365.0, "_");
-
-		if (td == PlayerText:INVALID_TEXT_DRAW) {
-			printf("(wc) WARN: Unable to create damage feed textdraw");
-		} else {
-			s_InternalPlayerTextDraw[playerid][td] = true;
-
-			PlayerTextDrawLetterSize(playerid, td, 0.2, 0.9);
-			PlayerTextDrawColor(playerid, td, 0x30FF50FF);
-			PlayerTextDrawFont(playerid, td, 1);
-			PlayerTextDrawSetShadow(playerid, td, 0);
-			PlayerTextDrawAlignment(playerid, td, 2);
-			PlayerTextDrawSetOutline(playerid, td, 1);
-			PlayerTextDrawBackgroundColor(playerid, td, 0x0000001A);
-
-			s_DamageFeedGiven[playerid] = td;
-		}
-	}
-
-	if (s_DamageFeedTaken[playerid] == PlayerText:INVALID_TEXT_DRAW) {
-		new PlayerText:td = CreatePlayerTextDraw(playerid, 440.0, 365.0, "_");
-
-		if (td == PlayerText:INVALID_TEXT_DRAW) {
-			printf("(wc) WARN: Unable to create damage feed textdraw");
-		} else {
-			s_InternalPlayerTextDraw[playerid][td] = true;
-
-			PlayerTextDrawLetterSize(playerid, td, 0.2, 0.9);
-			PlayerTextDrawColor(playerid, td, 0x33CCFFFF);
-			PlayerTextDrawFont(playerid, td, 1);
-			PlayerTextDrawSetShadow(playerid, td, 0);
-			PlayerTextDrawAlignment(playerid, td, 2);
-			PlayerTextDrawSetOutline(playerid, td, 1);
-			PlayerTextDrawBackgroundColor(playerid, td, 0x0000001A);
-
-			s_DamageFeedTaken[playerid] = td;
-		}
-	}
-
-	new tick = GetTickCount();
-	if (tick == 0) tick = 1;
-	new lowest_tick = tick + 1;
-
-	for (new i = 0; i < sizeof(s_DamageFeedHitsGiven[]) - 1; i++) {
-		if (!s_DamageFeedHitsGiven[playerid][i][e_Tick]) {
-			break;
-		}
-
-		if (tick - s_DamageFeedHitsGiven[playerid][i][e_Tick] >= s_DamageFeedHideDelay) {
-			modified = true;
-
-			for (new j = i; j < sizeof(s_DamageFeedHitsGiven[]) - 1; j++) {
-				s_DamageFeedHitsGiven[playerid][j][e_Tick] = 0;
-			}
-
-			break;
-		}
-
-		if (s_DamageFeedHitsGiven[playerid][i][e_Tick] < lowest_tick) {
-			lowest_tick = s_DamageFeedHitsGiven[playerid][i][e_Tick];
-		}
-	}
-
-	for (new i = 0; i < sizeof(s_DamageFeedHitsTaken[]) - 1; i++) {
-		if (!s_DamageFeedHitsTaken[playerid][i][e_Tick]) {
-			break;
-		}
-
-		if (tick - s_DamageFeedHitsTaken[playerid][i][e_Tick] >= s_DamageFeedHideDelay) {
-			modified = true;
-
-			for (new j = i; j < sizeof(s_DamageFeedHitsTaken[]) - 1; j++) {
-				s_DamageFeedHitsTaken[playerid][j][e_Tick] = 0;
-			}
-
-			break;
-		}
-
-		if (s_DamageFeedHitsTaken[playerid][i][e_Tick] < lowest_tick) {
-			lowest_tick = s_DamageFeedHitsTaken[playerid][i][e_Tick];
-		}
-	}
-
-	if (s_DamageFeedTimer[playerid] != -1) {
-		KillTimer(s_DamageFeedTimer[playerid]);
-	}
-
-	if (tick - s_DamageFeedLastUpdate[playerid] < s_DamageFeedMaxUpdateRate && modified) {
-		s_DamageFeedTimer[playerid] = SetTimerEx("WC_DamageFeedUpdate", s_DamageFeedMaxUpdateRate - (tick - s_DamageFeedLastUpdate[playerid]), false, "i", playerid);
-	} else {
-		if (lowest_tick == tick + 1) {
-			s_DamageFeedTimer[playerid] = -1;
-			modified = true;
-		} else {
-			s_DamageFeedTimer[playerid] = SetTimerEx("WC_DamageFeedUpdate", s_DamageFeedHideDelay - (tick - lowest_tick) + 10, false, "i", playerid);
-		}
-
-		if (modified) {
-			DamageFeedUpdateText(playerid);
-
-			s_DamageFeedLastUpdate[playerid] = tick;
-		}
-	}
-}
-
-static DamageFeedUpdateText(playerid)
-{
-	new buf[64 * WC_FEED_HEIGHT] = "";
-
-	for (new i = 0; i < sizeof(s_DamageFeedHitsGiven[]) - 1; i++) {
-		if (!s_DamageFeedHitsGiven[playerid][i][e_Tick]) {
-			break;
-		}
-
-		new weapon[32];
-
-		if (s_DamageFeedHitsGiven[playerid][i][e_Weapon] == -1) {
-			weapon = "Multiple";
-		} else {
-			WC_GetWeaponName(s_DamageFeedHitsGiven[playerid][i][e_Weapon], weapon);
-		}
-
-		if (s_DamageFeedHitsGiven[playerid][i][e_Issuer] == INVALID_PLAYER_ID) {
-			format(
-				buf,
-				sizeof(buf),
-				"%s%s +%.2f~n~",
-				buf,
-				weapon,
-				s_DamageFeedHitsGiven[playerid][i][e_Amount] + 0.009
-			);
-		} else {
-			format(
-				buf,
-				sizeof(buf),
-				"%s%s - %s +%.2f~n~",
-				buf,
-				s_DamageFeedHitsGiven[playerid][i][e_Name],
-				weapon,
-				s_DamageFeedHitsGiven[playerid][i][e_Amount] + 0.009
-			);
-		}
-	}
-
-	if (s_DamageFeedGiven[playerid] == PlayerText:INVALID_TEXT_DRAW) {
-		printf("(wc) WARN: Doesn't have feed textdraw when needed");
-	} else {
-		if (buf[0]) {
-			PlayerTextDrawSetString(playerid, s_DamageFeedGiven[playerid], buf);
-			PlayerTextDrawShow(playerid, s_DamageFeedGiven[playerid]);
-		} else {
-			PlayerTextDrawHide(playerid, s_DamageFeedGiven[playerid]);
-		}
-	}
-
-	buf = "";
-
-	for (new i = 0; i < sizeof(s_DamageFeedHitsTaken[]) - 1; i++) {
-		if (!s_DamageFeedHitsTaken[playerid][i][e_Tick]) {
-			break;
-		}
-
-		new weapon[32];
-
-		if (s_DamageFeedHitsTaken[playerid][i][e_Weapon] == -1) {
-			weapon = "Multiple";
-		} else {
-			WC_GetWeaponName(s_DamageFeedHitsTaken[playerid][i][e_Weapon], weapon);
-		}
-
-		if (s_DamageFeedHitsTaken[playerid][i][e_Issuer] == INVALID_PLAYER_ID) {
-			format(
-				buf,
-				sizeof(buf),
-				"%s%s -%.2f~n~",
-				buf,
-				weapon,
-				s_DamageFeedHitsTaken[playerid][i][e_Amount] + 0.009
-			);
-		} else {
-			format(
-				buf,
-				sizeof(buf),
-				"%s%s - %s -%.2f~n~",
-				buf,
-				s_DamageFeedHitsTaken[playerid][i][e_Name],
-				weapon,
-				s_DamageFeedHitsTaken[playerid][i][e_Amount] + 0.009
-			);
-		}
-	}
-
-	if (s_DamageFeedTaken[playerid] == PlayerText:INVALID_TEXT_DRAW) {
-		printf("(wc) WARN: Doesn't have feed textdraw when needed");
-	} else {
-		if (buf[0]) {
-			PlayerTextDrawSetString(playerid, s_DamageFeedTaken[playerid], buf);
-			PlayerTextDrawShow(playerid, s_DamageFeedTaken[playerid]);
-		} else {
-			PlayerTextDrawHide(playerid, s_DamageFeedTaken[playerid]);
-		}
-	}
-}
-
-static DamageFeedAddHitGiven(playerid, issuerid, Float:amount, weapon)
-{
-	for (new i = 0; i < MAX_PLAYERS; i++) {
-		if (s_Spectating[i] == playerid && i != playerid) {
-			DamageFeedAddHit(s_DamageFeedHitsGiven[i], i, issuerid, amount, weapon);
-		}
-	}
-
-	DamageFeedAddHit(s_DamageFeedHitsGiven[playerid], playerid, issuerid, amount, weapon);
-}
-
-static DamageFeedAddHitTaken(playerid, issuerid, Float:amount, weapon)
-{
-	for (new i = 0; i < MAX_PLAYERS; i++) {
-		if (s_Spectating[i] == playerid && i != playerid) {
-			DamageFeedAddHit(s_DamageFeedHitsTaken[i], i, issuerid, amount, weapon);
-		}
-	}
-
-	DamageFeedAddHit(s_DamageFeedHitsTaken[playerid], playerid, issuerid, amount, weapon);
-}
-
-static DamageFeedAddHit(arr[WC_FEED_HEIGHT][E_DAMAGE_FEED_HIT], playerid, issuerid, Float:amount, weapon)
-{
-	if (!IsDamageFeedActive(playerid)) {
-		return;
-	}
-
-	new tick = GetTickCount();
-	if (tick == 0) tick = 1;
-	new idx = -1;
-
-	for (new i = 0; i < sizeof(arr) - 1; i++) {
-		if (!arr[i][e_Tick]) {
-			break;
-		}
-
-		if (tick - arr[i][e_Tick] >= s_DamageFeedHideDelay) {
-			DamageFeedRemoveHit(arr, i);
-			break;
-		}
-
-		// Remove it and add it on top below
-		if (arr[i][e_Issuer] == issuerid) {
-			// Multiple weapons
-			if (arr[i][e_Weapon] != weapon) {
-				//weapon = -1;
-			}
-
-			amount += arr[i][e_Amount];
-			idx = i;
-			break;
-		}
-	}
-
-	if (idx == -1) {
-		idx = 0;
-
-		// Insert it at the top
-		for (new i = sizeof(arr) - 1; i >= 1; i--) {
-			arr[i] = arr[i - 1];
-		}
-	}
-
-	arr[idx][e_Tick] = tick;
-	arr[idx][e_Amount] = amount;
-	arr[idx][e_Issuer] = issuerid;
-	arr[idx][e_Weapon] = weapon;
-
-	GetPlayerName(issuerid, arr[idx][e_Name], MAX_PLAYER_NAME);
-
-	DamageFeedUpdate(playerid, true);
-}
-
-static DamageFeedRemoveHit(arr[WC_FEED_HEIGHT][E_DAMAGE_FEED_HIT], idx)
-{
-	for (new i = 0; i < WC_FEED_HEIGHT; i++) {
-		if (i >= idx) {
-			arr[i][e_Tick] = 0;
-		}
-	}
-}
-
-static SaveSyncData(playerid)
-{
-	GetPlayerHealth(playerid, s_SyncData[playerid][e_Health]);
-	GetPlayerArmour(playerid, s_SyncData[playerid][e_Armour]);
-
-	GetPlayerPos(playerid, s_SyncData[playerid][e_PosX], s_SyncData[playerid][e_PosY], s_SyncData[playerid][e_PosZ]);
-	GetPlayerFacingAngle(playerid, s_SyncData[playerid][e_PosA]);
-
-	s_SyncData[playerid][e_Skin] = GetPlayerSkin(playerid);
-	s_SyncData[playerid][e_Team] = GetPlayerTeam(playerid);
-
-	s_SyncData[playerid][e_Weapon] = GetPlayerWeapon(playerid);
-
-	for (new i = 0; i < 13; i++) {
-		GetPlayerWeaponData(playerid, i, s_SyncData[playerid][e_WeaponId][i], s_SyncData[playerid][e_WeaponAmmo][i]);
-	}
-}
-
-static MakePlayerFacePlayer(playerid, targetid, opposite = false, forcesync = true)
-{
-	new Float:x1, Float:y1, Float:z1;
-	new Float:x2, Float:y2, Float:z2;
-
-	GetPlayerPos(playerid, x1, y1, z1);
-	GetPlayerPos(targetid, x2, y2, z2);
-	new Float:angle = AngleBetweenPoints(x2, y2, x1, y1);
-
-	if (opposite) {
-		angle += 180.0;
-		if (angle > 360.0) angle -= 360.0;
-	}
-
-	if (angle < 0.0) angle += 360.0;
-	if (angle > 360.0) angle -= 360.0;
-
-	SetPlayerFacingAngle(playerid, angle);
-
-	if (forcesync) {
-		SetFakeFacingAngle(playerid, angle);
-		UpdateSyncData(playerid);
-	}
-}
-
-static IsPlayerBehindPlayer(playerid, targetid, Float:diff = 90.0)
-{
-	new Float:x1, Float:y1, Float:z1;
-	new Float:x2, Float:y2, Float:z2;
-	new Float:ang, Float:angdiff;
-
-	GetPlayerPos(playerid, x1, y1, z1);
-	GetPlayerPos(targetid, x2, y2, z2);
-	GetPlayerFacingAngle(targetid, ang);
-
-	angdiff = AngleBetweenPoints(x1, y1, x2, y2);
-
-	if (angdiff < 0.0) angdiff += 360.0;
-	if (angdiff > 360.0) angdiff -= 360.0;
-
-	ang = ang - angdiff;
-
-	if (ang > 180.0) ang -= 360.0;
-	if (ang < -180.0) ang += 360.0;
-
-	return floatabs(ang) > diff;
-}
-
-static AddRejectedHit(playerid, damagedid, reason, weapon, i1 = 0, i2 = 0, i3 = 0)
-{
-	new idx = s_RejectedHitsIdx[playerid];
-
-	if (s_RejectedHits[playerid][idx][e_Time]) {
-		idx += 1;
-
-		if (idx >= sizeof(s_RejectedHits[])) {
-			idx = 0;
-		}
-
-		s_RejectedHitsIdx[playerid] = idx;
-	}
-
-	new time, hour, minute, second;
-
-	time = gettime(hour, minute, second);
-
-	s_RejectedHits[playerid][idx][e_Reason] = reason;
-	s_RejectedHits[playerid][idx][e_Time] = time;
-	s_RejectedHits[playerid][idx][e_Weapon] = weapon;
-	s_RejectedHits[playerid][idx][e_Hour] = hour;
-	s_RejectedHits[playerid][idx][e_Minute] = minute;
-	s_RejectedHits[playerid][idx][e_Second] = second;
-	s_RejectedHits[playerid][idx][e_Info1] = _:i1;
-	s_RejectedHits[playerid][idx][e_Info2] = _:i2;
-	s_RejectedHits[playerid][idx][e_Info3] = _:i3;
-
-	if (damagedid != INVALID_PLAYER_ID) {
-		GetPlayerName(damagedid, s_RejectedHits[playerid][idx][e_Name], MAX_PLAYER_NAME);
-	} else {
-		s_RejectedHits[playerid][idx][e_Name][0] = '#';
-		s_RejectedHits[playerid][idx][e_Name][1] = '\0';
-	}
-
-	OnRejectedHit(playerid, s_RejectedHits[playerid][idx]);
-}
-
-forward WC_SecondKnifeAnim(playerid);
-public WC_SecondKnifeAnim(playerid)
-{
-	ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 1, 1, 1, 3000, 1);
-}
-
-forward WC_PlayerDeathRespawn(playerid);
-public WC_PlayerDeathRespawn(playerid)
-{
-	if (!s_IsDying[playerid]) {
-		return;
-	}
-
-	s_IsDying[playerid] = false;
-
-	if (!OnPlayerDeathFinished(playerid, true)) {
-		UpdateHealthBar(playerid);
-		SetFakeFacingAngle(playerid, _);
-		FreezeSyncData(playerid, false);
-
-		return;
-	}
-
-	s_IsDying[playerid] = true;
-	s_TrueDeath[playerid] = false;
-
-	if (IsPlayerInAnyVehicle(playerid)) {
-		new Float:x, Float:y, Float:z;
-		GetPlayerPos(playerid, x, y, z);
-		SetPlayerPos(playerid, x, y, z);
-	}
-
-	SetPlayerVirtualWorld(playerid, WC_DEATH_WORLD);
-	SetFakeFacingAngle(playerid, _);
-	TogglePlayerSpectating(playerid, true);
-	TogglePlayerSpectating(playerid, false);
-}
-
-public OnInvalidWeaponDamage(playerid, damagedid, Float:amount, weaponid, bodypart, error, bool:given)
-{
-	DebugMessageRedAll("OnInvalidWeaponDamage(%d, %d, %f, %d, %d, %d, %d)", playerid, damagedid, amount, weaponid, bodypart, error, given);
-
-	#if defined WC_OnInvalidWeaponDamage
-		WC_OnInvalidWeaponDamage(playerid, damagedid, Float:amount, weaponid, bodypart, error, bool:given);
-	#endif
-}
-
-public OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart)
-{
-	new idx = s_PreviousHitI[playerid];
-
-	s_PreviousHitI[playerid] = (s_PreviousHitI[playerid] - 1) % sizeof(s_PreviousHits[]);
-
-	// JIT plugin fix
-	if (s_PreviousHitI[playerid] < 0) {
-		s_PreviousHitI[playerid] += sizeof(s_PreviousHits[]);
-	}
-
-	s_PreviousHits[playerid][idx][e_Tick] = GetTickCount();
-	s_PreviousHits[playerid][idx][e_Issuer] = issuerid;
-	s_PreviousHits[playerid][idx][e_Weapon] = weapon;
-	s_PreviousHits[playerid][idx][e_Amount] = amount;
-	s_PreviousHits[playerid][idx][e_Bodypart] = bodypart;
-	s_PreviousHits[playerid][idx][e_Health] = GetLastDamageHealth(playerid);
-	s_PreviousHits[playerid][idx][e_Armour] = GetLastDamageArmour(playerid);
-
-	if (!IsHighRateWeapon(weapon)) {
-		DebugMessageAll("OnPlayerDamageDone(%d did %f to %d with %d on bodypart %d)", issuerid, amount, playerid, weapon, bodypart);
-
-		if (s_DamageTakenSound) {
-			PlayerPlaySound(playerid, s_DamageTakenSound, 0.0, 0.0, 0.0);
-
-			for (new i = 0; i < MAX_PLAYERS; i++) {
-				if (s_Spectating[i] == playerid && i != playerid) {
-					PlayerPlaySound(i, s_DamageTakenSound, 0.0, 0.0, 0.0);
-				}
-			}
-		}
-
-		if (s_DamageGivenSound && issuerid != INVALID_PLAYER_ID) {
-			PlayerPlaySound(issuerid, s_DamageGivenSound, 0.0, 0.0, 0.0);
-
-			for (new i = 0; i < MAX_PLAYERS; i++) {
-				if (s_Spectating[i] == issuerid && i != issuerid) {
-					PlayerPlaySound(i, s_DamageGivenSound, 0.0, 0.0, 0.0);
-				}
-			}
-		}
-	}
-
-	if (issuerid != INVALID_PLAYER_ID) {
-		DamageFeedAddHitGiven(issuerid, playerid, amount, weapon);
-	}
-
-	DamageFeedAddHitTaken(playerid, issuerid, amount, weapon);
-
-	#if defined WC_OnPlayerDamageDone
-		WC_OnPlayerDamageDone(playerid, amount, issuerid, weapon, bodypart);
-	#endif
-}
-
-public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
-{
-	#if defined WC_OnPlayerDamage
-		return WC_OnPlayerDamage(playerid, amount, issuerid, weapon, bodypart);
-	#else
-		return 1;
-	#endif
-}
-
-/*
- * ALS callbacks
- */
-#if defined _ALS_OnGameModeInit
-	#undef OnGameModeInit
-#else
-	#define _ALS_OnGameModeInit
-#endif
-#define OnGameModeInit WC_OnGameModeInit
-#if defined WC_OnGameModeInit
-	forward WC_OnGameModeInit();
-#endif
-
-
-#if defined _ALS_OnGameModeExit
-	#undef OnGameModeExit
-#else
-	#define _ALS_OnGameModeExit
-#endif
-#define OnGameModeExit WC_OnGameModeExit
-#if defined WC_OnGameModeExit
-	forward WC_OnGameModeExit();
-#endif
-
-
-#if defined _ALS_OnFilterScriptInit
-	#undef OnFilterScriptInit
-#else
-	#define _ALS_OnFilterScriptInit
-#endif
-#define OnFilterScriptInit WC_OnFilterScriptInit
-#if defined WC_OnFilterScriptInit
-	forward WC_OnFilterScriptInit();
-#endif
-
-
-#if defined _ALS_OnFilterScriptExit
-	#undef OnFilterScriptExit
-#else
-	#define _ALS_OnFilterScriptExit
-#endif
-#define OnFilterScriptExit WC_OnFilterScriptExit
-#if defined WC_OnFilterScriptExit
-	forward WC_OnFilterScriptExit();
-#endif
-
-
-#if defined _ALS_OnPlayerConnect
-	#undef OnPlayerConnect
-#else
-	#define _ALS_OnPlayerConnect
-#endif
-#define OnPlayerConnect WC_OnPlayerConnect
-#if defined WC_OnPlayerConnect
-	forward WC_OnPlayerConnect(playerid);
-#endif
-
-
-#if defined _ALS_OnPlayerDisconnect
-	#undef OnPlayerDisconnect
-#else
-	#define _ALS_OnPlayerDisconnect
-#endif
-#define OnPlayerDisconnect WC_OnPlayerDisconnect
-#if defined WC_OnPlayerDisconnect
-	forward WC_OnPlayerDisconnect(playerid, reason);
-#endif
-
-
-#if defined _ALS_OnPlayerStreamIn
-	#undef OnPlayerStreamIn
-#else
-	#define _ALS_OnPlayerStreamIn
-#endif
-#define OnPlayerStreamIn WC_OnPlayerStreamIn
-#if defined WC_OnPlayerStreamIn
-	forward WC_OnPlayerStreamIn(playerid, forplayerid);
-#endif
-
-#if defined _ALS_OnVehicleDeath
-	#undef OnVehicleDeath
-#else
-	#define _ALS_OnVehicleDeath
-#endif
-#define OnVehicleDeath WC_OnVehicleDeath
-#if defined WC_OnVehicleDeath
-	forward WC_OnVehicleDeath(vehicleid, killerid);
-#endif
-
-
-#if defined _ALS_OnVehicleSpawn
-	#undef OnVehicleSpawn
-#else
-	#define _ALS_OnVehicleSpawn
-#endif
-#define OnVehicleSpawn WC_OnVehicleSpawn
-#if defined WC_OnVehicleSpawn
-	forward WC_OnVehicleSpawn(vehicleid);
-#endif
-
-#if defined _ALS_OnPlayerEnterVehicle
-	#undef OnPlayerEnterVehicle
-#else
-	#define _ALS_OnPlayerEnterVehicle
-#endif
-#define OnPlayerEnterVehicle WC_OnPlayerEnterVehicle
-#if defined WC_OnPlayerEnterVehicle
-	forward WC_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
-#endif
-
-
-#if defined _ALS_OnPlayerExitVehicle
-	#undef OnPlayerExitVehicle
-#else
-	#define _ALS_OnPlayerExitVehicle
-#endif
-#define OnPlayerExitVehicle WC_OnPlayerExitVehicle
-#if defined WC_OnPlayerExitVehicle
-	forward WC_OnPlayerExitVehicle(playerid, vehicleid);
-#endif
-
-
-#if defined _ALS_OnPlayerStateChange
-	#undef OnPlayerStateChange
-#else
-	#define _ALS_OnPlayerStateChange
-#endif
-#define OnPlayerStateChange WC_OnPlayerStateChange
-#if defined WC_OnPlayerStateChange
-	forward WC_OnPlayerStateChange(playerid, newstate, oldstate);
-#endif
-
-
-#if defined _ALS_OnPlayerPickUpPickup
-	#undef OnPlayerPickUpPickup
-#else
-	#define _ALS_OnPlayerPickUpPickup
-#endif
-#define OnPlayerPickUpPickup WC_OnPlayerPickUpPickup
-#if defined WC_OnPlayerPickUpPickup
-	forward WC_OnPlayerPickUpPickup(playerid, pickupid);
-#endif
-
-
-#if defined _ALS_OnPlayerUpdate
-	#undef OnPlayerUpdate
-#else
-	#define _ALS_OnPlayerUpdate
-#endif
-#define OnPlayerUpdate WC_OnPlayerUpdate
-#if defined WC_OnPlayerUpdate
-	forward WC_OnPlayerUpdate(playerid);
-#endif
-
-
-#if defined _ALS_OnPlayerSpawn
-	#undef OnPlayerSpawn
-#else
-	#define _ALS_OnPlayerSpawn
-#endif
-#define OnPlayerSpawn WC_OnPlayerSpawn
-#if defined WC_OnPlayerSpawn
-	forward WC_OnPlayerSpawn(playerid);
-#endif
-
-
-#if defined _ALS_OnPlayerRequestClass
-	#undef OnPlayerRequestClass
-#else
-	#define _ALS_OnPlayerRequestClass
-#endif
-#define OnPlayerRequestClass WC_OnPlayerRequestClass
-#if defined WC_OnPlayerRequestClass
-	forward WC_OnPlayerRequestClass(playerid, classid);
-#endif
-
-
-#if defined _ALS_OnPlayerDeath
-	#undef OnPlayerDeath
-#else
-	#define _ALS_OnPlayerDeath
-#endif
-#define OnPlayerDeath WC_OnPlayerDeath
-#if defined WC_OnPlayerDeath
-	forward WC_OnPlayerDeath(playerid, killerid, reason);
-#endif
-
-
-#if defined _ALS_OnPlayerKeyStateChange
-	#undef OnPlayerKeyStateChange
-#else
-	#define _ALS_OnPlayerKeyStateChange
-#endif
-#define OnPlayerKeyStateChange WC_OnPlayerKeyStateChange
-#if defined WC_OnPlayerKeyStateChange
-	forward WC_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
-#endif
-
-
-#if defined _ALS_OnPlayerWeaponShot
-	#undef OnPlayerWeaponShot
-#else
-	#define _ALS_OnPlayerWeaponShot
-#endif
-#define OnPlayerWeaponShot WC_OnPlayerWeaponShot
-#if defined WC_OnPlayerWeaponShot
-	forward WC_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
-#endif
-
-
-#if defined _ALS_OnPlayerEnterCheckpoint
-	#undef OnPlayerEnterCheckpoint
-#else
-	#define _ALS_OnPlayerEnterCheckpoint
-#endif
-#define OnPlayerEnterCheckpoint WC_OnPlayerEnterCheckpoint
-#if defined WC_OnPlayerEnterCheckpoint
-	forward WC_OnPlayerEnterCheckpoint(playerid);
-#endif
-
-
-#if defined _ALS_OnPlayerLeaveCheckpoint
-	#undef OnPlayerLeaveCheckpoint
-#else
-	#define _ALS_OnPlayerLeaveCheckpoint
-#endif
-#define OnPlayerLeaveCheckpoint WC_OnPlayerLeaveCheckpoint
-#if defined WC_OnPlayerLeaveCheckpoint
-	forward WC_OnPlayerLeaveCheckpoint(playerid);
-#endif
-
-
-#if defined _ALS_OnInvalidWeaponDamage
-	#undef OnInvalidWeaponDamage
-#else
-	#define _ALS_OnInvalidWeaponDamage
-#endif
-#define OnInvalidWeaponDamage WC_OnInvalidWeaponDamage
-#if defined WC_OnInvalidWeaponDamage
-	forward WC_OnInvalidWeaponDamage(playerid, damagedid, Float:amount, weaponid, bodypart, error, bool:given);
-#endif
-
-
-#if defined _ALS_OnPlayerDamageDone
-	#undef OnPlayerDamageDone
-#else
-	#define _ALS_OnPlayerDamageDone
-#endif
-#define OnPlayerDamageDone WC_OnPlayerDamageDone
-#if defined WC_OnPlayerDamageDone
-	forward WC_OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart);
-#endif
-
-
-#if defined _ALS_OnPlayerDamage
-	#undef OnPlayerDamage
-#else
-	#define _ALS_OnPlayerDamage
-#endif
-#define OnPlayerDamage WC_OnPlayerDamage
-#if defined WC_OnPlayerDamage
-	forward WC_OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart);
-#endif
-
-
-#if defined _ALS_OnPlayerPrepareDeath
-	#undef OnPlayerPrepareDeath
-#else
-	#define _ALS_OnPlayerPrepareDeath
-#endif
-#define OnPlayerPrepareDeath WC_OnPlayerPrepareDeath
-#if defined WC_OnPlayerPrepareDeath
-	forward WC_OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time);
-#endif
-
-
-#if defined _ALS_OnRejectedHit
-	#undef OnRejectedHit
-#else
-	#define _ALS_OnRejectedHit
-#endif
-#define OnRejectedHit WC_OnRejectedHit
-#if defined WC_OnRejectedHit
-	forward WC_OnRejectedHit(playerid, hit[E_REJECTED_HIT]);
-#endif
-
-
-#if WC_CUSTOM_VENDING_MACHINES
-	#if defined _ALS_OnPlayerUseVendingMachine
-		#undef OnPlayerUseVendingMachine
-	#else
-		#define _ALS_OnPlayerUseVendingMachine
-	#endif
-	#define OnPlayerUseVendingMachine WC_OnPlayerUseVendingMachine
-	#if defined WC_OnPlayerUseVendingMachine
-		forward WC_OnPlayerUseVendingMachine(playerid, &Float:health_given);
-	#endif
-#endif
-
-
-#if defined _ALS_OnPlayerDeathFinished
-	#undef OnPlayerDeathFinished
-#else
-	#define _ALS_OnPlayerDeathFinished
-#endif
-#define OnPlayerDeathFinished WC_OnPlayerDeathFinished
-#if defined WC_OnPlayerDeathFinished
-	forward WC_OnPlayerDeathFinished(playerid, bool:cancelable);
-#endif
-
-/*
- * ALS functions
- */
-#if defined _ALS_SpawnPlayer
-	#undef SpawnPlayer
-#else
-	#define _ALS_SpawnPlayer
-#endif
-#define SpawnPlayer WC_SpawnPlayer
-
-
-#if defined _ALS_SetPlayerHealth
-	#undef SetPlayerHealth
-#else
-	#define _ALS_SetPlayerHealth
-#endif
-#define SetPlayerHealth WC_SetPlayerHealth
-
-
-#if defined _ALS_GetPlayerState
-	#undef GetPlayerState
-#else
-	#define _ALS_GetPlayerState
-#endif
-#define GetPlayerState WC_GetPlayerState
-
-
-#if defined _ALS_GetPlayerHealth
-	#undef GetPlayerHealth
-#else
-	#define _ALS_GetPlayerHealth
-#endif
-#define GetPlayerHealth WC_GetPlayerHealth
-
-
-#if defined _ALS_SetPlayerArmour
-	#undef SetPlayerArmour
-#else
-	#define _ALS_SetPlayerArmour
-#endif
-#define SetPlayerArmour WC_SetPlayerArmour
-
-
-#if defined _ALS_GetPlayerArmour
-	#undef GetPlayerArmour
-#else
-	#define _ALS_GetPlayerArmour
-#endif
-#define GetPlayerArmour WC_GetPlayerArmour
-
-
-#if defined _ALS_GetPlayerTeam
-	#undef GetPlayerTeam
-#else
-	#define _ALS_GetPlayerTeam
-#endif
-#define GetPlayerTeam WC_GetPlayerTeam
-
-
-#if defined _ALS_SetPlayerTeam
-	#undef SetPlayerTeam
-#else
-	#define _ALS_SetPlayerTeam
-#endif
-#define SetPlayerTeam WC_SetPlayerTeam
-
-
-#if defined _ALS_SendDeathMessage
-	#undef SendDeathMessage
-#else
-	#define _ALS_SendDeathMessage
-#endif
-#define SendDeathMessage WC_SendDeathMessage
-
-
-#if defined _ALS_GetWeaponName
-	#undef GetWeaponName
-#else
-	#define _ALS_GetWeaponName
-#endif
-#define GetWeaponName WC_GetWeaponName
-
-
-#if defined _ALS_ApplyAnimation
-	#undef ApplyAnimation
-#else
-	#define _ALS_ApplyAnimation
-#endif
-#define ApplyAnimation WC_ApplyAnimation
-
-
-#if defined _ALS_ClearAnimations
-	#undef ClearAnimations
-#else
-	#define _ALS_ClearAnimations
-#endif
-#define ClearAnimations WC_ClearAnimations
-
-
-#if defined _ALS_AddPlayerClass
-	#undef AddPlayerClass
-#else
-	#define _ALS_AddPlayerClass
-#endif
-#define AddPlayerClass WC_AddPlayerClass
-
-
-#if defined _ALS_AddPlayerClassEx
-	#undef AddPlayerClassEx
-#else
-	#define _ALS_AddPlayerClassEx
-#endif
-#define AddPlayerClassEx WC_AddPlayerClassEx
-
-
-#if defined _ALS_SetSpawnInfo
-	#undef SetSpawnInfo
-#else
-	#define _ALS_SetSpawnInfo
-#endif
-#define SetSpawnInfo WC_SetSpawnInfo
-
-
-#if defined _ALS_TogglePlayerSpectating
-	#undef TogglePlayerSpectating
-#else
-	#define _ALS_TogglePlayerSpectating
-#endif
-#define TogglePlayerSpectating WC_TogglePlayerSpectating
-
-
-#if defined _ALS_TogglePlayerControllable
-	#undef TogglePlayerControllable
-#else
-	#define _ALS_TogglePlayerControllable
-#endif
-#define TogglePlayerControllable WC_TogglePlayerControllable
-
-
-#if defined _ALS_SetPlayerPos
-	#undef SetPlayerPos
-#else
-	#define _ALS_SetPlayerPos
-#endif
-#define SetPlayerPos WC_SetPlayerPos
-
-
-#if defined _ALS_SetPlayerPosFindZ
-	#undef SetPlayerPosFindZ
-#else
-	#define _ALS_SetPlayerPosFindZ
-#endif
-#define SetPlayerPosFindZ WC_SetPlayerPosFindZ
-
-
-#if defined _ALS_SetPlayerVelocity
-	#undef SetPlayerVelocity
-#else
-	#define _ALS_SetPlayerVelocity
-#endif
-#define SetPlayerVelocity WC_SetPlayerVelocity
-
-
-#if defined _ALS_SetPlayerVirtualWorld
-	#undef SetPlayerVirtualWorld
-#else
-	#define _ALS_SetPlayerVirtualWorld
-#endif
-#define SetPlayerVirtualWorld wc_SetPlayerVirtualWorld
-
-
-#if defined _ALS_GetPlayerVirtualWorld
-	#undef GetPlayerVirtualWorld
-#else
-	#define _ALS_GetPlayerVirtualWorld
-#endif
-#define GetPlayerVirtualWorld WC_GetPlayerVirtualWorld
-
-
-#if defined _ALS_PlayerSpectatePlayer
-	#undef PlayerSpectatePlayer
-#else
-	#define _ALS_PlayerSpectatePlayer
-#endif
-#define PlayerSpectatePlayer WC_PlayerSpectatePlayer
-
-
-#if defined _ALS_DestroyVehicle
-	#undef DestroyVehicle
-#else
-	#define _ALS_DestroyVehicle
-#endif
-#define DestroyVehicle WC_DestroyVehicle
-
-#if defined _ALS_CreateVehicle
-	#undef CreateVehicle
-#else
-	#define _ALS_CreateVehicle
-#endif
-#define CreateVehicle WC_CreateVehicle
-
-
-#if defined _ALS_AddStaticVehicle
-	#undef AddStaticVehicle
-#else
-	#define _ALS_AddStaticVehicle
-#endif
-#define AddStaticVehicle WC_AddStaticVehicle
-
-
-#if defined _ALS_AddStaticVehicleEx
-	#undef AddStaticVehicleEx
-#else
-	#define _ALS_AddStaticVehicleEx
-#endif
-#define AddStaticVehicleEx WC_AddStaticVehicleEx
-
-#if defined _ALS_IsPlayerInCheckpoint
-	#undef IsPlayerInCheckpoint
-#else
-	#define _ALS_IsPlayerInCheckpoint
-#endif
-#define IsPlayerInCheckpoint WC_IsPlayerInCheckpoint
-
-
-#if defined _ALS_SetPlayerSpecialAction
-	#undef SetPlayerSpecialAction
-#else
-	#define _ALS_SetPlayerSpecialAction
-#endif
-#define SetPlayerSpecialAction WC_SetPlayerSpecialAction
-
-
-#if defined _ALS_TextDrawCreate
-	#undef TextDrawCreate
-#else
-	#define _ALS_TextDrawCreate
-#endif
-#define TextDrawCreate WC_TextDrawCreate
-
-
-#if defined _ALS_TextDrawDestroy
-	#undef TextDrawDestroy
-#else
-	#define _ALS_TextDrawDestroy
-#endif
-#define TextDrawDestroy WC_TextDrawDestroy
-
-
-#if defined _ALS_TextDrawLetterSize
-	#undef TextDrawLetterSize
-#else
-	#define _ALS_TextDrawLetterSize
-#endif
-#define TextDrawLetterSize WC_TextDrawLetterSize
-
-
-#if defined _ALS_TextDrawTextSize
-	#undef TextDrawTextSize
-#else
-	#define _ALS_TextDrawTextSize
-#endif
-#define TextDrawTextSize WC_TextDrawTextSize
-
-
-#if defined _ALS_TextDrawAlignment
-	#undef TextDrawAlignment
-#else
-	#define _ALS_TextDrawAlignment
-#endif
-#define TextDrawAlignment WC_TextDrawAlignment
-
-
-#if defined _ALS_TextDrawColor
-	#undef TextDrawColor
-#else
-	#define _ALS_TextDrawColor
-#endif
-#define TextDrawColor WC_TextDrawColor
-
-
-#if defined _ALS_TextDrawUseBox
-	#undef TextDrawUseBox
-#else
-	#define _ALS_TextDrawUseBox
-#endif
-#define TextDrawUseBox WC_TextDrawUseBox
-
-
-#if defined _ALS_TextDrawBoxColor
-	#undef TextDrawBoxColor
-#else
-	#define _ALS_TextDrawBoxColor
-#endif
-#define TextDrawBoxColor WC_TextDrawBoxColor
-
-
-#if defined _ALS_TextDrawSetShadow
-	#undef TextDrawSetShadow
-#else
-	#define _ALS_TextDrawSetShadow
-#endif
-#define TextDrawSetShadow WC_TextDrawSetShadow
-
-
-#if defined _ALS_TextDrawSetOutline
-	#undef TextDrawSetOutline
-#else
-	#define _ALS_TextDrawSetOutline
-#endif
-#define TextDrawSetOutline WC_TextDrawSetOutline
-
-
-#if defined _ALS_TextDrawBackgroundColor
-	#undef TextDrawBackgroundColor
-#else
-	#define _ALS_TextDrawBackgroundColor
-#endif
-#define TextDrawBackgroundColor WC_TextDrawBackgroundColor
-
-
-#if defined _ALS_TextDrawFont
-	#undef TextDrawFont
-#else
-	#define _ALS_TextDrawFont
-#endif
-#define TextDrawFont WC_TextDrawFont
-
-
-#if defined _ALS_TextDrawSetProportional
-	#undef TextDrawSetProportional
-#else
-	#define _ALS_TextDrawSetProportional
-#endif
-#define TextDrawSetProportional WC_TextDrawSetProportional
-
-
-#if defined _ALS_TextDrawSetSelectable
-	#undef TextDrawSetSelectable
-#else
-	#define _ALS_TextDrawSetSelectable
-#endif
-#define TextDrawSetSelectable WC_TextDrawSetSelectable
-
-
-#if defined _ALS_TextDrawShowForPlayer
-	#undef TextDrawShowForPlayer
-#else
-	#define _ALS_TextDrawShowForPlayer
-#endif
-#define TextDrawShowForPlayer WC_TextDrawShowForPlayer
-
-
-#if defined _ALS_TextDrawHideForPlayer
-	#undef TextDrawHideForPlayer
-#else
-	#define _ALS_TextDrawHideForPlayer
-#endif
-#define TextDrawHideForPlayer WC_TextDrawHideForPlayer
-
-
-#if defined _ALS_TextDrawShowForAll
-	#undef TextDrawShowForAll
-#else
-	#define _ALS_TextDrawShowForAll
-#endif
-#define TextDrawShowForAll WC_TextDrawShowForAll
-
-
-#if defined _ALS_TextDrawHideForAll
-	#undef TextDrawHideForAll
-#else
-	#define _ALS_TextDrawHideForAll
-#endif
-#define TextDrawHideForAll WC_TextDrawHideForAll
-
-
-#if defined _ALS_TextDrawSetString
-	#undef TextDrawSetString
-#else
-	#define _ALS_TextDrawSetString
-#endif
-#define TextDrawSetString WC_TextDrawSetString
-
-
-#if defined _ALS_TextDrawSetPreviewModel
-	#undef TextDrawSetPreviewModel
-#else
-	#define _ALS_TextDrawSetPreviewModel
-#endif
-#define TextDrawSetPreviewModel WC_TextDrawSetPreviewModel
-
-
-#if defined _ALS_TextDrawSetPreviewRot
-	#undef TextDrawSetPreviewRot
-#else
-	#define _ALS_TextDrawSetPreviewRot
-#endif
-#define TextDrawSetPreviewRot WC_TextDrawSetPreviewRot
-
-
-#if defined _ALS_TextDrawSetPreviewVehCol
-	#undef TextDrawSetPreviewVehCol
-#else
-	#define _ALS_TextDrawSetPreviewVehCol
-#endif
-#define TextDrawSetPreviewVehCol WC_TextDrawSetPreviewVehCol
-
-
-#if defined _ALS_CreatePlayerTextDraw
-	#undef CreatePlayerTextDraw
-#else
-	#define _ALS_CreatePlayerTextDraw
-#endif
-#define CreatePlayerTextDraw WC_CreatePlayerTextDraw
-
-
-#if defined _ALS_PlayerTextDrawDestroy
-	#undef PlayerTextDrawDestroy
-#else
-	#define _ALS_PlayerTextDrawDestroy
-#endif
-#define PlayerTextDrawDestroy WC_PlayerTextDrawDestroy
-
-
-#if defined _ALS_PlayerTextDrawLetterSize
-	#undef PlayerTextDrawLetterSize
-#else
-	#define _ALS_PlayerTextDrawLetterSize
-#endif
-#define PlayerTextDrawLetterSize WC_PlayerTextDrawLetterSize
-
-
-#if defined _ALS_PlayerTextDrawTextSize
-	#undef PlayerTextDrawTextSize
-#else
-	#define _ALS_PlayerTextDrawTextSize
-#endif
-#define PlayerTextDrawTextSize WC_PlayerTextDrawTextSize
-
-
-#if defined _ALS_PlayerTextDrawAlignment
-	#undef PlayerTextDrawAlignment
-#else
-	#define _ALS_PlayerTextDrawAlignment
-#endif
-#define PlayerTextDrawAlignment WC_PlayerTextDrawAlignment
-
-
-#if defined _ALS_PlayerTextDrawColor
-	#undef PlayerTextDrawColor
-#else
-	#define _ALS_PlayerTextDrawColor
-#endif
-#define PlayerTextDrawColor WC_PlayerTextDrawColor
-
-
-#if defined _ALS_PlayerTextDrawUseBox
-	#undef PlayerTextDrawUseBox
-#else
-	#define _ALS_PlayerTextDrawUseBox
-#endif
-#define PlayerTextDrawUseBox WC_PlayerTextDrawUseBox
-
-
-#if defined _ALS_PlayerTextDrawBoxColor
-	#undef PlayerTextDrawBoxColor
-#else
-	#define _ALS_PlayerTextDrawBoxColor
-#endif
-#define PlayerTextDrawBoxColor WC_PlayerTextDrawBoxColor
-
-
-#if defined _ALS_PlayerTextDrawSetShadow
-	#undef PlayerTextDrawSetShadow
-#else
-	#define _ALS_PlayerTextDrawSetShadow
-#endif
-#define PlayerTextDrawSetShadow WC_PlayerTextDrawSetShadow
-
-
-#if defined _ALS_PlayerTextDrawSetOutline
-	#undef PlayerTextDrawSetOutline
-#else
-	#define _ALS_PlayerTextDrawSetOutline
-#endif
-#define PlayerTextDrawSetOutline WC_PlayerTextDrawSetOutline
-
-
-#if defined _ALS_PlayerTextDrawBackgroundCo
-	#undef PlayerTextDrawBackgroundColor
-#else
-	#define _ALS_PlayerTextDrawBackgroundCo
-#endif
-#define PlayerTextDrawBackgroundColor WC_PlayerTextDrawBackgroundColo
-
-
-#if defined _ALS_PlayerTextDrawFont
-	#undef PlayerTextDrawFont
-#else
-	#define _ALS_PlayerTextDrawFont
-#endif
-#define PlayerTextDrawFont WC_PlayerTextDrawFont
-
-
-#if defined _ALS_PlayerTextDrawSetProportio
-	#undef PlayerTextDrawSetProportional
-#else
-	#define _ALS_PlayerTextDrawSetProportio
-#endif
-#define PlayerTextDrawSetProportional WC_PlayerTextDrawSetProportiona
-
-
-#if defined _ALS_PlayerTextDrawSetSelectabl
-	#undef PlayerTextDrawSetSelectable
-#else
-	#define _ALS_PlayerTextDrawSetSelectabl
-#endif
-#define PlayerTextDrawSetSelectable WC_PlayerTextDrawSetSelectable
-
-
-#if defined _ALS_PlayerTextDrawShow
-	#undef PlayerTextDrawShow
-#else
-	#define _ALS_PlayerTextDrawShow
-#endif
-#define PlayerTextDrawShow WC_PlayerTextDrawShow
-
-
-#if defined _ALS_PlayerTextDrawHide
-	#undef PlayerTextDrawHide
-#else
-	#define _ALS_PlayerTextDrawHide
-#endif
-#define PlayerTextDrawHide WC_PlayerTextDrawHide
-
-
-#if defined _ALS_PlayerTextDrawSetString
-	#undef PlayerTextDrawSetString
-#else
-	#define _ALS_PlayerTextDrawSetString
-#endif
-#define PlayerTextDrawSetString WC_PlayerTextDrawSetString
-
-
-#if defined _ALS_PlayerTextDrawSetPreviewMo
-	#undef PlayerTextDrawSetPreviewModel
-#else
-	#define _ALS_PlayerTextDrawSetPreviewMo
-#endif
-#define PlayerTextDrawSetPreviewModel WC_PlayerTextDrawSetPreviewMode
-
-
-#if defined _ALS_PlayerTextDrawSetPreviewRo
-	#undef PlayerTextDrawSetPreviewRot
-#else
-	#define _ALS_PlayerTextDrawSetPreviewRo
-#endif
-#define PlayerTextDrawSetPreviewRot WC_PlayerTextDrawSetPreviewRot
-
-
-#if defined _ALS_PlayerTextDrawSetPreviewVe
-	#undef PlayerTextDrawSetPreviewVehCol
-#else
-	#define _ALS_PlayerTextDrawSetPreviewVe
-#endif
-#define PlayerTextDrawSetPreviewVehCol WC_PlayerTextDrawSetPreviewVehC
+#if defined _INC_WEAPON_CONFIG
+	#endinput
+#endif
+#define _INC_WEAPON_CONFIG
+
+#include <a_samp>
+
+// Print debug messages in the chat and server log
+#if !defined WC_DEBUG
+	#define WC_DEBUG false
+#endif
+
+// Print debug messages to the console but not the chat
+#if !defined WC_DEBUG_SILENT
+	#define WC_DEBUG_SILENT false
+#endif
+
+// Max number of rejected hits (GetRejectedHit)
+#if !defined WC_MAX_REJECTED_HITS
+	#define WC_MAX_REJECTED_HITS 15
+#endif
+
+// Max ranges for DAMAGE_TYPE_RANGE(_MULTIPLIER)
+#if !defined WC_MAX_DAMAGE_RANGES
+	#define WC_MAX_DAMAGE_RANGES 5
+#endif
+
+// The world a player has after the death animation finished until he respawns or enters class selection
+#if !defined WC_DEATH_WORLD
+	#define WC_DEATH_WORLD 0x00DEAD00
+#endif
+
+// The max number of entries in the damage feeds
+#if !defined WC_FEED_HEIGHT
+	#define WC_FEED_HEIGHT 5
+#endif
+
+// Use Incognito's streamer for custom vending machines
+#if !defined WC_USE_STREAMER
+	#define WC_USE_STREAMER false
+#endif
+
+// For SetWeaponName
+#if !defined WC_MAX_WEAPON_NAME
+	#define WC_MAX_WEAPON_NAME 21
+#endif
+
+// For modes that always have negative cash
+#if !defined WC_CUSTOM_VENDING_MACHINES
+	#define WC_CUSTOM_VENDING_MACHINES true
+#endif
+
+#if WC_USE_STREAMER && !defined Streamer_IncludeFileVersion
+	#error streamer.inc is required when WC_USE_STREAMER=true
+#endif
+
+// https://github.com/oscar-broman/SKY/blob/master/SKY.inc
+#if !defined _INC_SKY
+	#tryinclude <SKY>
+
+	#if !defined _INC_SKY
+		#error The SKY plugin is required, get it here: github.com/oscar-broman/sky
+	#endif
+#endif
+
+// Given in OnInvalidWeaponDamage
+enum {
+	WC_NO_ERROR,
+	WC_NO_ISSUER,
+	WC_NO_DAMAGED,
+	WC_INVALID_DAMAGE,
+	WC_INVALID_DISTANCE
+}
+
+// Used in SetWeaponDamage
+enum {
+	DAMAGE_TYPE_MULTIPLIER,
+	DAMAGE_TYPE_STATIC,
+	DAMAGE_TYPE_RANGE_MULTIPLIER,
+	DAMAGE_TYPE_RANGE
+}
+
+// Hits displayed in the damage feeds
+enum E_DAMAGE_FEED_HIT {
+	      e_Issuer,
+	      e_Name[MAX_PLAYER_NAME],
+	Float:e_Amount,
+	      e_Weapon,
+	      e_Tick
+}
+
+// Given in OnRejectedHit
+enum E_REJECTED_HIT {
+	e_Time,
+	e_Hour,
+	e_Minute,
+	e_Second,
+	e_Weapon,
+	e_Reason,
+	e_Info1,
+	e_Info2,
+	e_Info3,
+	e_Name[MAX_PLAYER_NAME]
+}
+
+// e_Reason in E_REJECTED_HIT
+enum {
+	HIT_NO_DAMAGEDID,
+	HIT_INVALID_WEAPON,
+	HIT_LAST_SHOT_INVALID,
+	HIT_MULTIPLE_PLAYERS,
+	HIT_MULTIPLE_PLAYERS_SHOTGUN,
+	HIT_DYING_PLAYER,
+	HIT_SAME_TEAM,
+	HIT_UNSTREAMED,
+	HIT_INVALID_HITTYPE,
+	HIT_BEING_RESYNCED,
+	HIT_NOT_SPAWNED,
+	HIT_OUT_OF_RANGE,
+	HIT_TOO_FAR_FROM_SHOT,
+	SHOOTING_RATE_TOO_FAST,
+	SHOOTING_RATE_TOO_FAST_MULTIPLE,
+	HIT_RATE_TOO_FAST,
+	HIT_RATE_TOO_FAST_MULTIPLE,
+	HIT_KNIFE_FAILED,
+	HIT_TOO_FAR_FROM_ORIGIN,
+	HIT_INVALID_DAMAGE,
+	HIT_SAME_VEHICLE,
+	HIT_OWN_VEHICLE,
+	HIT_INVALID_VEHICLE,
+	HIT_DISCONNECTED
+}
+
+// Must be in sync with the enum above
+// Used in debug messages and GetRejectedHit
+stock const g_HitRejectReasons[][] = {
+	"None or invalid player shot",
+	"Invalid weapon",
+	"Last shot invalid",
+	"One bullet hit %d players",
+	"Hit too many players with shotgun: %d",
+	"Hit a dying player",
+	"Hit a teammate",
+	"Hit someone that can't see you (not streamed in)",
+	"Invalid hit type: %d",
+	"Hit while being resynced",
+	"Hit when not spawned or dying",
+	"Hit out of range (%f > %f)",
+	"Hit player too far from hit position (dist %f)",
+	"Shooting rate too fast: %d (%d samples, max %d)",
+	"Shooting rate too fast: %d (%d samples, multiple weapons)",
+	"Hit rate too fast: %d (%d samples, max %d)",
+	"Hit rate too fast: %d (%d samples, multiple weapons)",
+	"The knife kill did not sync",
+	"Damage inflicted too far from current position (dist %f)",
+	"Invalid weapon damage (%.4f)",
+	"Hit a player in the same vehicle",
+	"Hit the vehicle you're in",
+	"Hit invalid vehicle: %d",
+	"Hit a disconnected player ID: %d"
+};
+
+// Used for SetCustomVendingMachines
+#if WC_CUSTOM_VENDING_MACHINES
+	enum E_VENDING_MACHINE {
+		      e_Model,
+		      e_Interior,
+		Float:e_PosX,
+		Float:e_PosY,
+		Float:e_PosZ,
+		Float:e_RotX,
+		Float:e_RotY,
+		Float:e_RotZ,
+		Float:e_FrontX,
+		Float:e_FrontY
+	}
+#endif
+
+// Used to resync players that got team-knifed in lagshot mode
+enum E_RESYNC_DATA {
+	Float:e_Health,
+	Float:e_Armour,
+	      e_Skin,
+	      e_Team,
+	Float:e_PosX,
+	Float:e_PosY,
+	Float:e_PosZ,
+	Float:e_PosA,
+	      e_Weapon,
+	      e_WeaponId[13],
+	      e_WeaponAmmo[13]
+}
+
+// From OnPlayerWeaponShot
+enum E_SHOT_INFO {
+	      e_Tick,
+	      e_Weapon,
+	      e_HitType,
+	      e_HitId,
+	      e_Hits,
+	Float:e_X,
+	Float:e_Y,
+	Float:e_Z,
+	Float:e_OX,
+	Float:e_OY,
+	Float:e_OZ,
+	Float:e_HX,
+	Float:e_HY,
+	Float:e_HZ,
+	Float:e_Length,
+	 bool:e_Valid
+}
+
+enum E_HIT_INFO {
+	      e_Tick,
+	      e_Issuer,
+	      e_Weapon,
+	Float:e_Amount,
+	Float:e_Health,
+	Float:e_Armour,
+	      e_Bodypart
+}
+
+enum E_SPAWN_INFO {
+	      e_Skin,
+	      e_Team,
+	Float:e_PosX,
+	Float:e_PosY,
+	Float:e_PosZ,
+	Float:e_Rot,
+	      e_Weapon1,
+	      e_Ammo1,
+	      e_Weapon2,
+	      e_Ammo2,
+	      e_Weapon3,
+	      e_Ammo3
+}
+
+// When a player takes or gives invalid damage (WC_* errors above)
+forward OnInvalidWeaponDamage(playerid, damagedid, Float:amount, weaponid, bodypart, error, bool:given);
+// Before damage is inflicted
+forward OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart);
+// After OnPlayerDamage
+forward OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart);
+// Before the death animation is applied
+forward OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time);
+// When the death animation is finished and the player has been sent to respawn
+forward OnPlayerDeathFinished(playerid, bool:cancelable);
+// When a shot or damage given is rejected
+forward OnRejectedHit(playerid, hit[E_REJECTED_HIT]);
+
+#if WC_CUSTOM_VENDING_MACHINES
+	// When a player is about to use a vending machine
+	forward OnPlayerUseVendingMachine(playerid, &Float:health_given);
+#endif
+
+// If you have your own definitions, remove them and use these instead
+#define BODY_PART_UNKNOWN 0
+#define WEAPON_UNARMED 0
+#define WEAPON_VEHICLE_M4 19
+#define WEAPON_VEHICLE_MINIGUN 20
+#define WEAPON_PISTOLWHIP 48
+#define WEAPON_HELIBLADES 50
+#define WEAPON_EXPLOSION 51
+#define WEAPON_CARPARK 52
+#define WEAPON_UNKNOWN 55
+
+#if WC_DEBUG_SILENT
+	static s_DebugMsgBuf[512];
+
+	#define DebugMessage(%1,%2) \
+		format(s_DebugMsgBuf,512,%2),printf("(wc:%d) %s",%1,s_DebugMsgBuf)
+
+	#define DebugMessageRed(%1,%2) \
+		format(s_DebugMsgBuf,512,%2),printf("(wc:%d) WARN: %s",%1,s_DebugMsgBuf)
+
+	#define DebugMessageAll(%1) \
+		printf(s_DebugMsgBuf,"(wc) " %1)
+
+	#define DebugMessageRedAll(%1) \
+		printf(s_DebugMsgBuf,"(wc) WARN: " %1)
+#elseif WC_DEBUG
+	static s_DebugMsgBuf[512];
+
+	#define DebugMessage(%1,%2) \
+		format(s_DebugMsgBuf,512,"(wc) " %2),SendClientMessage(%1,-1,s_DebugMsgBuf), \
+		format(s_DebugMsgBuf,512,%2),printf("(wc:%d) %s",%1,s_DebugMsgBuf)
+
+	#define DebugMessageRed(%1,%2) \
+		format(s_DebugMsgBuf,512,"(wc) " %2),SendClientMessage(%1,0xcc0000ff,s_DebugMsgBuf), \
+		format(s_DebugMsgBuf,512,%2),printf("(wc:%d) WARN: %s",%1,s_DebugMsgBuf)
+
+	#define DebugMessageAll(%1) \
+		format(s_DebugMsgBuf,512,"(wc) " %1),SendClientMessageToAll(-1,s_DebugMsgBuf), \
+		printf(s_DebugMsgBuf,"(wc) " %1)
+
+	#define DebugMessageRedAll(%1) \
+		format(s_DebugMsgBuf,512,"(wc) " %1),SendClientMessageToAll(0xcc0000ff,s_DebugMsgBuf), \
+		printf(s_DebugMsgBuf,"(wc) WARN: " %1)
+#else
+	#define DebugMessage(%1);
+	#define DebugMessageRed(%1);
+	#define DebugMessageAll(%1);
+	#define DebugMessageRedAll(%1);
+#endif
+
+// Weapons allowed in OnPlayerGiveDamage
+static const s_ValidDamageGiven[] = {
+	1, // 0 - Fist
+	1, // 1 - Brass knuckles
+	1, // 2 - Golf club
+	1, // 3 - Nitestick
+	1, // 4 - Knife
+	1, // 5 - Bat
+	1, // 6 - Shovel
+	1, // 7 - Pool cue
+	1, // 8 - Katana
+	1, // 9 - Chainsaw
+	1, // 10 - Dildo
+	1, // 11 - Dildo 2
+	1, // 12 - Vibrator
+	1, // 13 - Vibrator 2
+	1, // 14 - Flowers
+	1, // 15 - Cane
+	0, // 16 - Grenade
+	0, // 17 - Teargas
+	0, // 18 - Molotov
+	0, // 19 - Vehicle M4 (custom)
+	0, // 20 - Vehicle minigun
+	0, // 21
+	1, // 22 - Colt 45
+	1, // 23 - Silenced
+	1, // 24 - Deagle
+	1, // 25 - Shotgun
+	1, // 26 - Sawed-off
+	1, // 27 - Spas
+	1, // 28 - UZI
+	1, // 29 - MP5
+	1, // 30 - AK47
+	1, // 31 - M4
+	1, // 32 - Tec9
+	1, // 33 - Cuntgun
+	1, // 34 - Sniper
+	0, // 35 - Rocket launcher
+	0, // 36 - Heatseeker
+	0, // 37 - Flamethrower
+	1, // 38 - Minigun
+	0, // 39 - Satchel
+	0, // 40 - Detonator
+	1, // 41 - Spraycan
+	1, // 42 - Fire extinguisher
+	0, // 43 - Camera
+	0, // 44 - Night vision
+	0, // 45 - Infrared
+	1  // 46 - Parachute
+};
+
+// Weapons allowed in OnPlayerTakeDamage
+// 2 = valid in both OnPlayerGiveDamage and OnPlayerTakeDamage
+static const s_ValidDamageTaken[] = {
+	1, // 0 - Fist
+	1, // 1 - Brass knuckles
+	1, // 2 - Golf club
+	1, // 3 - Nitestick
+	1, // 4 - Knife
+	1, // 5 - Bat
+	1, // 6 - Shovel
+	1, // 7 - Pool cue
+	1, // 8 - Katana
+	1, // 9 - Chainsaw
+	1, // 10 - Dildo
+	1, // 11 - Dildo 2
+	1, // 12 - Vibrator
+	1, // 13 - Vibrator 2
+	1, // 14 - Flowers
+	1, // 15 - Cane
+	0, // 16 - Grenade
+	0, // 17 - Teargas
+	0, // 18 - Molotov
+	0, // 19 - Vehicle M4 (custom)
+	0, // 20 - Vehicle minigun (custom)
+	0, // 21
+	1, // 22 - Colt 45
+	1, // 23 - Silenced
+	1, // 24 - Deagle
+	1, // 25 - Shotgun
+	1, // 26 - Sawed-off
+	1, // 27 - Spas
+	1, // 28 - UZI
+	1, // 29 - MP5
+	1, // 30 - AK47
+	1, // 31 - M4
+	1, // 32 - Tec9
+	1, // 33 - Cuntgun
+	1, // 34 - Sniper
+	0, // 35 - Rocket launcher
+	0, // 36 - Heatseeker
+	2, // 37 - Flamethrower
+	1, // 38 - Minigun
+	0, // 39 - Satchel
+	0, // 40 - Detonator
+	1, // 41 - Spraycan
+	1, // 42 - Fire extinguisher
+	0, // 43 - Camera
+	0, // 44 - Night vision
+	0, // 45 - Infrared
+	1, // 46 - Parachute
+	0, // 47 - Fake pistol
+	0, // 48 - Pistol whip (custom)
+	2, // 49 - Vehicle
+	2, // 50 - Helicopter blades
+	2, // 51 - Explosion
+	0, // 52 - Car park (custom)
+	2, // 53 - Drowning
+	2  // 54 - Splat
+};
+
+// Default weapon damage. Connected to s_DamageType.
+// Melee weapons are multipliers because the damage differs
+// depending on type of punch/kick and fight style.
+static Float:s_WeaponDamage[] = {
+	1.0, // 0 - Fist
+	1.0, // 1 - Brass knuckles
+	1.0, // 2 - Golf club
+	1.0, // 3 - Nitestick
+	1.0, // 4 - Knife
+	1.0, // 5 - Bat
+	1.0, // 6 - Shovel
+	1.0, // 7 - Pool cue
+	1.0, // 8 - Katana
+	1.0, // 9 - Chainsaw
+	1.0, // 10 - Dildo
+	1.0, // 11 - Dildo 2
+	1.0, // 12 - Vibrator
+	1.0, // 13 - Vibrator 2
+	1.0, // 14 - Flowers
+	1.0, // 15 - Cane
+	82.5, // 16 - Grenade
+	0.0, // 17 - Teargas
+	1.0, // 18 - Molotov
+	9.9, // 19 - Vehicle M4 (custom)
+	46.2, // 20 - Vehicle minigun (custom)
+	0.0, // 21
+	8.25, // 22 - Colt 45
+	13.2, // 23 - Silenced
+	46.2, // 24 - Deagle
+	3.3, // 25 - Shotgun
+	3.3, // 26 - Sawed-off
+	4.95, // 27 - Spas
+	6.6, // 28 - UZI
+	8.25, // 29 - MP5
+	9.9, // 30 - AK47
+	9.9, // 31 - M4
+	6.6, // 32 - Tec9
+	24.75, // 33 - Cuntgun
+	41.25, // 34 - Sniper
+	82.5, // 35 - Rocket launcher
+	82.5, // 36 - Heatseeker
+	1.0, // 37 - Flamethrower
+	46.2, // 38 - Minigun
+	82.5, // 39 - Satchel
+	0.0, // 40 - Detonator
+	0.33, // 41 - Spraycan
+	0.33, // 42 - Fire extinguisher
+	0.0, // 43 - Camera
+	0.0, // 44 - Night vision
+	0.0, // 45 - Infrared
+	0.0, // 46 - Parachute
+	0.0, // 47 - Fake pistol
+	2.64, // 48 - Pistol whip (custom)
+	9.9, // 49 - Vehicle
+	330.0, // 50 - Helicopter blades
+	82.5, // 51 - Explosion
+	1.0, // 52 - Car park (custom)
+	1.0, // 53 - Drowning
+	165.0  // 54 - Splat
+};
+
+#assert DAMAGE_TYPE_MULTIPLIER == 0
+#assert DAMAGE_TYPE_STATIC == 1
+
+// Whether the damage is multiplied by the given/taken value (0) or always the same value (1)
+static s_DamageType[] = {
+	0, // 0 - Fist
+	0, // 1 - Brass knuckles
+	0, // 2 - Golf club
+	0, // 3 - Nitestick
+	0, // 4 - Knife
+	0, // 5 - Bat
+	0, // 6 - Shovel
+	0, // 7 - Pool cue
+	0, // 8 - Katana
+	0, // 9 - Chainsaw
+	0, // 10 - Dildo
+	0, // 11 - Dildo 2
+	0, // 12 - Vibrator
+	0, // 13 - Vibrator 2
+	0, // 14 - Flowers
+	0, // 15 - Cane
+	0, // 16 - Grenade
+	1, // 17 - Teargas
+	0, // 18 - Molotov
+	1, // 19 - Vehicle M4 (custom)
+	1, // 20 - Vehicle minigun (custom)
+	0, // 21
+	1, // 22 - Colt 45
+	1, // 23 - Silenced
+	1, // 24 - Deagle
+	1, // 25 - Shotgun
+	1, // 26 - Sawed-off
+	1, // 27 - Spas
+	1, // 28 - UZI
+	1, // 29 - MP5
+	1, // 30 - AK47
+	1, // 31 - M4
+	1, // 32 - Tec9
+	1, // 33 - Cuntgun
+	1, // 34 - Sniper
+	0, // 35 - Rocket launcher
+	0, // 36 - Heatseeker
+	0, // 37 - Flamethrower
+	1, // 38 - Minigun
+	0, // 39 - Satchel
+	0, // 40 - Detonator
+	1, // 41 - Spraycan
+	1, // 42 - Fire extinguisher
+	0, // 43 - Camera
+	0, // 44 - Night vision
+	0, // 45 - Infrared
+	0, // 46 - Parachute
+	0, // 47 - Fake pistol
+	1, // 48 - Pistol whip (custom)
+	1, // 49 - Vehicle
+	1, // 50 - Helicopter blades
+	0, // 51 - Explosion
+	0, // 52 - Car park
+	0, // 53 - Drowning
+	0  // 54 - Splat
+};
+
+// The default weapon range (from weapon.dat)
+// Note that due to various bugs, these can be exceeded, but
+// this include blocks out-of-range values.
+static Float:s_WeaponRange[] = {
+	0.0, // 0 - Fist
+	0.0, // 1 - Brass knuckles
+	0.0, // 2 - Golf club
+	0.0, // 3 - Nitestick
+	0.0, // 4 - Knife
+	0.0, // 5 - Bat
+	0.0, // 6 - Shovel
+	0.0, // 7 - Pool cue
+	0.0, // 8 - Katana
+	0.0, // 9 - Chainsaw
+	0.0, // 10 - Dildo
+	0.0, // 11 - Dildo 2
+	0.0, // 12 - Vibrator
+	0.0, // 13 - Vibrator 2
+	0.0, // 14 - Flowers
+	0.0, // 15 - Cane
+	0.0, // 16 - Grenade
+	0.0, // 17 - Teargas
+	0.0, // 18 - Molotov
+	90.0, // 19 - Vehicle M4 (custom)
+	75.0, // 20 - Vehicle minigun (custom)
+	0.0, // 21
+	35.0, // 22 - Colt 45
+	35.0, // 23 - Silenced
+	35.0, // 24 - Deagle
+	40.0, // 25 - Shotgun
+	35.0, // 26 - Sawed-off
+	40.0, // 27 - Spas
+	35.0, // 28 - UZI
+	45.0, // 29 - MP5
+	70.0, // 30 - AK47
+	90.0, // 31 - M4
+	35.0, // 32 - Tec9
+	100.0, // 33 - Cuntgun
+	320.0, // 34 - Sniper
+	0.0, // 35 - Rocket launcher
+	0.0, // 36 - Heatseeker
+	0.0, // 37 - Flamethrower
+	75.0  // 38 - Minigun
+};
+
+// The fastest possible gap between weapon shots in milliseconds
+static s_MaxWeaponShootRate[] = {
+	250, // 0 - Fist
+	250, // 1 - Brass knuckles
+	250, // 2 - Golf club
+	250, // 3 - Nitestick
+	250, // 4 - Knife
+	250, // 5 - Bat
+	250, // 6 - Shovel
+	250, // 7 - Pool cue
+	250, // 8 - Katana
+	30, // 9 - Chainsaw
+	250, // 10 - Dildo
+	250, // 11 - Dildo 2
+	250, // 12 - Vibrator
+	250, // 13 - Vibrator 2
+	250, // 14 - Flowers
+	250, // 15 - Cane
+	0, // 16 - Grenade
+	0, // 17 - Teargas
+	0, // 18 - Molotov
+	20, // 19 - Vehicle M4 (custom)
+	20, // 20 - Vehicle minigun (custom)
+	0, // 21
+	160, // 22 - Colt 45
+	120, // 23 - Silenced
+	120, // 24 - Deagle
+	800, // 25 - Shotgun
+	120, // 26 - Sawed-off
+	120, // 27 - Spas
+	50, // 28 - UZI
+	90, // 29 - MP5
+	90, // 30 - AK47
+	90, // 31 - M4
+	70, // 32 - Tec9
+	800, // 33 - Cuntgun
+	900, // 34 - Sniper
+	0, // 35 - Rocket launcher
+	0, // 36 - Heatseeker
+	0, // 37 - Flamethrower
+	20, // 38 - Minigun
+	0, // 39 - Satchel
+	0, // 40 - Detonator
+	10, // 41 - Spraycan
+	10, // 42 - Fire extinguisher
+	0, // 43 - Camera
+	0, // 44 - Night vision
+	0, // 45 - Infrared
+	0, // 46 - Parachute
+	0, // 47 - Fake pistol
+	400 // 48 - Pistol whip (custom)
+};
+
+// Whether the damage is applied directly to health (1) or is distributed between health and armour (0), and whether this rule applies only to the torso (1) or not (0)
+static s_DamageArmour[][2] = {
+	{0, 0}, // 0 - Fist
+	{0, 0}, // 1 - Brass knuckles
+	{0, 0}, // 2 - Golf club
+	{0, 0}, // 3 - Nitestick
+	{0, 0}, // 4 - Knife
+	{0, 0}, // 5 - Bat
+	{0, 0}, // 6 - Shovel
+	{0, 0}, // 7 - Pool cue
+	{0, 0}, // 8 - Katana
+	{0, 0}, // 9 - Chainsaw
+	{0, 0}, // 10 - Dildo
+	{0, 0}, // 11 - Dildo 2
+	{0, 0}, // 12 - Vibrator
+	{0, 0}, // 13 - Vibrator 2
+	{0, 0}, // 14 - Flowers
+	{0, 0}, // 15 - Cane
+	{0, 0}, // 16 - Grenade
+	{0, 0}, // 17 - Teargas
+	{0, 0}, // 18 - Molotov
+	{1, 1}, // 19 - Vehicle M4 (custom)
+	{1, 1}, // 20 - Vehicle minigun (custom)
+	{1, 0}, // 21
+	{1, 1}, // 22 - Colt 45
+	{1, 1}, // 23 - Silenced
+	{1, 1}, // 24 - Deagle
+	{1, 1}, // 25 - Shotgun
+	{1, 1}, // 26 - Sawed-off
+	{1, 1}, // 27 - Spas
+	{1, 1}, // 28 - UZI
+	{1, 1}, // 29 - MP5
+	{1, 1}, // 30 - AK47
+	{1, 1}, // 31 - M4
+	{1, 1}, // 32 - Tec9
+	{1, 1}, // 33 - Cuntgun
+	{1, 1}, // 34 - Sniper
+	{0, 0}, // 35 - Rocket launcher
+	{0, 0}, // 36 - Heatseeker
+	{0, 0}, // 37 - Flamethrower
+	{1, 1}, // 38 - Minigun
+	{0, 0}, // 39 - Satchel
+	{0, 0}, // 40 - Detonator
+	{0, 0}, // 41 - Spraycan
+	{0, 0}, // 42 - Fire extinguisher
+	{1, 0}, // 43 - Camera
+	{1, 0}, // 44 - Night vision
+	{1, 0}, // 45 - Infrared
+	{1, 0}, // 46 - Parachute
+	{1, 0}, // 47 - Fake pistol
+	{0, 0}, // 48 - Pistol whip (custom)
+	{0, 0}, // 49 - Vehicle
+	{0, 1}, // 50 - Helicopter blades
+	{0, 0}, // 51 - Explosion
+	{0, 0}, // 52 - Car park
+	{0, 0}, // 53 - Drowning
+	{0, 0}  // 54 - Splat
+};
+
+// That's right, it's called cuntgun
+stock const g_WeaponName[57][WC_MAX_WEAPON_NAME] = {
+	{"Fist"             }, {"Brass knuckles"}, {"Golf club"           },
+	{"Nightstick"       }, {"Knife"         }, {"Bat"                 },
+	{"Shovel"           }, {"Pool cue"      }, {"Katana"              },
+	{"Chainsaw"         }, {"Purple dildo"  }, {"Dildo"               },
+	{"Vibrator"         }, {"Vibrator"      }, {"Flowers"             },
+	{"Cane"             }, {"Grenade"       }, {"Tear gas"            },
+	{"Molotov"          }, {"Vehicle gun"   }, {"Vehicle gun"         },
+	{""                 }, {"Colt 45"       }, {"Silenced pistol"     },
+	{"Deagle"           }, {"Shotgun"       }, {"Sawn-off shotgun"    },
+	{"Combat shotgun"   }, {"Mac-10"        }, {"MP5"                 },
+	{"AK-47"            }, {"M4"            }, {"Tec-9"               },
+	{"Cuntgun"          }, {"Sniper"        }, {"Rocket launcher"     },
+	{"Heat seeking RPG" }, {"Flamethrower"  }, {"Minigun"             },
+	{"Satchel"          }, {"Detonator"     }, {"Spraycan"            },
+	{"Fire extinguisher"}, {"Camera"        }, {"Night vision goggles"},
+	{"Infrared goggles" }, {"Parachute"     }, {"Fake pistol"         },
+	{"Pistol whip"      }, {"Vehicle"       }, {"Helicopter blades"   },
+	{"Explosion"        }, {"Car parking"   }, {"Drowning"            },
+	{"Collision"        }, {"Splat"         }, {"Unknown"             }
+};
+
+// Yes - this is every single one of them
+#if WC_CUSTOM_VENDING_MACHINES
+	static const Float:sc_VendingMachines[][E_VENDING_MACHINE] = {
+		{955, 0, -862.82, 1536.60, 21.98, 0.00, 0.00, 180.00, -862.84, 1537.60},
+		{956, 0, 2271.72, -76.46, 25.96, 0.00, 0.00, 0.00, 2271.72, -77.46},
+		{955, 0, 1277.83, 372.51, 18.95, 0.00, 0.00, 64.00, 1278.73, 372.07},
+		{956, 0, 662.42, -552.16, 15.71, 0.00, 0.00, 180.00, 662.41, -551.16},
+		{955, 0, 201.01, -107.61, 0.89, 0.00, 0.00, 270.00, 200.01, -107.63},
+		{955, 0, -253.74, 2597.95, 62.24, 0.00, 0.00, 90.00, -252.74, 2597.95},
+		{956, 0, -253.74, 2599.75, 62.24, 0.00, 0.00, 90.00, -252.74, 2599.75},
+		{956, 0, -76.03, 1227.99, 19.12, 0.00, 0.00, 90.00, -75.03, 1227.99},
+		{955, 0, -14.70, 1175.35, 18.95, 0.00, 0.00, 180.00, -14.72, 1176.35},
+		{1977, 7, 316.87, -140.35, 998.58, 0.00, 0.00, 270.00, 315.87, -140.36},
+		{1775, 17, 373.82, -178.14, 1000.73, 0.00, 0.00, 0.00, 373.82, -179.14},
+		{1776, 17, 379.03, -178.88, 1000.73, 0.00, 0.00, 270.00, 378.03, -178.90},
+		{1775, 17, 495.96, -24.32, 1000.73, 0.00, 0.00, 180.00, 495.95, -23.32},
+		{1776, 17, 500.56, -1.36, 1000.73, 0.00, 0.00, 0.00, 500.56, -2.36},
+		{1775, 17, 501.82, -1.42, 1000.73, 0.00, 0.00, 0.00, 501.82, -2.42},
+		{956, 0, -1455.11, 2591.66, 55.23, 0.00, 0.00, 180.00, -1455.13, 2592.66},
+		{955, 0, 2352.17, -1357.15, 23.77, 0.00, 0.00, 90.00, 2353.17, -1357.15},
+		{955, 0, 2325.97, -1645.13, 14.21, 0.00, 0.00, 0.00, 2325.97, -1646.13},
+		{956, 0, 2139.51, -1161.48, 23.35, 0.00, 0.00, 87.00, 2140.51, -1161.53},
+		{956, 0, 2153.23, -1016.14, 62.23, 0.00, 0.00, 127.00, 2154.03, -1015.54},
+		{955, 0, 1928.73, -1772.44, 12.94, 0.00, 0.00, 90.00, 1929.73, -1772.44},
+		{1776, 1, 2222.36, 1602.64, 1000.06, 0.00, 0.00, 90.00, 2223.36, 1602.64},
+		{1775, 1, 2222.20, 1606.77, 1000.05, 0.00, 0.00, 90.00, 2223.20, 1606.77},
+		{1775, 1, 2155.90, 1606.77, 1000.05, 0.00, 0.00, 90.00, 2156.90, 1606.77},
+		{1775, 1, 2209.90, 1607.19, 1000.05, 0.00, 0.00, 270.00, 2208.90, 1607.17},
+		{1776, 1, 2155.84, 1607.87, 1000.06, 0.00, 0.00, 90.00, 2156.84, 1607.87},
+		{1776, 1, 2202.45, 1617.00, 1000.06, 0.00, 0.00, 180.00, 2202.43, 1618.00},
+		{1776, 1, 2209.24, 1621.21, 1000.06, 0.00, 0.00, 0.00, 2209.24, 1620.21},
+		{1776, 3, 330.67, 178.50, 1020.07, 0.00, 0.00, 0.00, 330.67, 177.50},
+		{1776, 3, 331.92, 178.50, 1020.07, 0.00, 0.00, 0.00, 331.92, 177.50},
+		{1776, 3, 350.90, 206.08, 1008.47, 0.00, 0.00, 90.00, 351.90, 206.08},
+		{1776, 3, 361.56, 158.61, 1008.47, 0.00, 0.00, 180.00, 361.54, 159.61},
+		{1776, 3, 371.59, 178.45, 1020.07, 0.00, 0.00, 0.00, 371.59, 177.45},
+		{1776, 3, 374.89, 188.97, 1008.47, 0.00, 0.00, 0.00, 374.89, 187.97},
+		{1775, 2, 2576.70, -1284.43, 1061.09, 0.00, 0.00, 270.00, 2575.70, -1284.44},
+		{1775, 15, 2225.20, -1153.42, 1025.90, 0.00, 0.00, 270.00, 2224.20, -1153.43},
+		{955, 0, 1154.72, -1460.89, 15.15, 0.00, 0.00, 270.00, 1153.72, -1460.90},
+		{956, 0, 2480.85, -1959.27, 12.96, 0.00, 0.00, 180.00, 2480.84, -1958.27},
+		{955, 0, 2060.11, -1897.64, 12.92, 0.00, 0.00, 0.00, 2060.11, -1898.64},
+		{955, 0, 1729.78, -1943.04, 12.94, 0.00, 0.00, 0.00, 1729.78, -1944.04},
+		{956, 0, 1634.10, -2237.53, 12.89, 0.00, 0.00, 0.00, 1634.10, -2238.53},
+		{955, 0, 1789.21, -1369.26, 15.16, 0.00, 0.00, 270.00, 1788.21, -1369.28},
+		{956, 0, -2229.18, 286.41, 34.70, 0.00, 0.00, 180.00, -2229.20, 287.41},
+		{955, 256, -1980.78, 142.66, 27.07, 0.00, 0.00, 270.00, -1981.78, 142.64},
+		{955, 256, -2118.96, -423.64, 34.72, 0.00, 0.00, 255.00, -2119.93, -423.40},
+		{955, 256, -2118.61, -422.41, 34.72, 0.00, 0.00, 255.00, -2119.58, -422.17},
+		{955, 256, -2097.27, -398.33, 34.72, 0.00, 0.00, 180.00, -2097.29, -397.33},
+		{955, 256, -2092.08, -490.05, 34.72, 0.00, 0.00, 0.00, -2092.08, -491.05},
+		{955, 256, -2063.27, -490.05, 34.72, 0.00, 0.00, 0.00, -2063.27, -491.05},
+		{955, 256, -2005.64, -490.05, 34.72, 0.00, 0.00, 0.00, -2005.64, -491.05},
+		{955, 256, -2034.46, -490.05, 34.72, 0.00, 0.00, 0.00, -2034.46, -491.05},
+		{955, 256, -2068.56, -398.33, 34.72, 0.00, 0.00, 180.00, -2068.58, -397.33},
+		{955, 256, -2039.85, -398.33, 34.72, 0.00, 0.00, 180.00, -2039.86, -397.33},
+		{955, 256, -2011.14, -398.33, 34.72, 0.00, 0.00, 180.00, -2011.15, -397.33},
+		{955, 2048, -1350.11, 492.28, 10.58, 0.00, 0.00, 90.00, -1349.11, 492.28},
+		{956, 2048, -1350.11, 493.85, 10.58, 0.00, 0.00, 90.00, -1349.11, 493.85},
+		{955, 0, 2319.99, 2532.85, 10.21, 0.00, 0.00, 0.00, 2319.99, 2531.85},
+		{956, 0, 2845.72, 1295.04, 10.78, 0.00, 0.00, 0.00, 2845.72, 1294.04},
+		{955, 0, 2503.14, 1243.69, 10.21, 0.00, 0.00, 180.00, 2503.12, 1244.69},
+		{956, 0, 2647.69, 1129.66, 10.21, 0.00, 0.00, 0.00, 2647.69, 1128.66},
+		{1209, 0, -2420.21, 984.57, 44.29, 0.00, 0.00, 90.00, -2419.21, 984.57},
+		{1302, 0, -2420.17, 985.94, 44.29, 0.00, 0.00, 90.00, -2419.17, 985.94},
+		{955, 0, 2085.77, 2071.35, 10.45, 0.00, 0.00, 90.00, 2086.77, 2071.35},
+		{956, 0, 1398.84, 2222.60, 10.42, 0.00, 0.00, 180.00, 1398.82, 2223.60},
+		{956, 0, 1659.46, 1722.85, 10.21, 0.00, 0.00, 0.00, 1659.46, 1721.85},
+		{955, 0, 1520.14, 1055.26, 10.00, 0.00, 0.00, 270.00, 1519.14, 1055.24},
+		{1775, 6, -19.03, -57.83, 1003.63, 0.00, 0.00, 180.00, -19.05, -56.83},
+		{1775, 18, -16.11, -91.64, 1003.63, 0.00, 0.00, 180.00, -16.13, -90.64},
+		{1775, 16, -15.10, -140.22, 1003.63, 0.00, 0.00, 180.00, -15.11, -139.22},
+		{1775, 17, -32.44, -186.69, 1003.63, 0.00, 0.00, 180.00, -32.46, -185.69},
+		{1775, 16, -35.72, -140.22, 1003.63, 0.00, 0.00, 180.00, -35.74, -139.22},
+		{1776, 6, -36.14, -57.87, 1003.63, 0.00, 0.00, 180.00, -36.16, -56.87},
+		{1776, 18, -17.54, -91.71, 1003.63, 0.00, 0.00, 180.00, -17.56, -90.71},
+		{1776, 16, -16.53, -140.29, 1003.63, 0.00, 0.00, 180.00, -16.54, -139.29},
+		{1776, 17, -33.87, -186.76, 1003.63, 0.00, 0.00, 180.00, -33.89, -185.76},
+		{1775, 6, -19.03, -57.83, 1003.63, 0.00, 0.00, 180.00, -19.05, -56.83},
+		{1776, 6, -36.14, -57.87, 1003.63, 0.00, 0.00, 180.00, -36.16, -56.87},
+		{1775, 18, -16.11, -91.64, 1003.63, 0.00, 0.00, 180.00, -16.13, -90.64},
+		{1776, 18, -17.54, -91.71, 1003.63, 0.00, 0.00, 180.00, -17.56, -90.71},
+		{1776, 16, -16.53, -140.29, 1003.63, 0.00, 0.00, 180.00, -16.54, -139.29},
+		{1775, 16, -15.10, -140.22, 1003.63, 0.00, 0.00, 180.00, -15.11, -139.22},
+		{1776, 17, -33.87, -186.76, 1003.63, 0.00, 0.00, 180.00, -33.89, -185.76},
+		{1775, 17, -32.44, -186.69, 1003.63, 0.00, 0.00, 180.00, -32.46, -185.69},
+		{1775, 16, -35.72, -140.22, 1003.63, 0.00, 0.00, 180.00, -35.74, -139.22}
+	};
+#endif
+
+// Sorry about the mess..
+static s_LagCompMode;
+static s_LastExplosive[MAX_PLAYERS];
+static s_LastShot[MAX_PLAYERS][E_SHOT_INFO];
+static s_LastShotTicks[MAX_PLAYERS][10];
+static s_LastShotWeapons[MAX_PLAYERS][10];
+static s_LastShotIdx[MAX_PLAYERS];
+static s_LastHitTicks[MAX_PLAYERS][10];
+static s_LastHitWeapons[MAX_PLAYERS][10];
+static s_LastHitIdx[MAX_PLAYERS];
+static s_ShotsFired[MAX_PLAYERS];
+static s_HitsIssued[MAX_PLAYERS];
+static s_MaxShootRateSamples = 5;
+static s_MaxHitRateSamples = 5;
+static Float:s_PlayerMaxHealth[MAX_PLAYERS] = {100.0, ...};
+static Float:s_PlayerHealth[MAX_PLAYERS] = {100.0, ...};
+static Float:s_PlayerMaxArmour[MAX_PLAYERS] = {100.0, ...};
+static Float:s_PlayerArmour[MAX_PLAYERS] = {0.0, ...};
+static s_LastSentHealth[MAX_PLAYERS];
+static s_LastSentArmour[MAX_PLAYERS];
+static bool:s_DamageArmourToggle[2] = {false, ...};
+static s_PlayerTeam[MAX_PLAYERS] = {NO_TEAM, ...};
+static s_IsDying[MAX_PLAYERS];
+static s_DeathTimer[MAX_PLAYERS] = {-1, ...};
+static bool:s_HealthBarVisible[MAX_PLAYERS];
+static bool:s_SpawnForStreamedIn[MAX_PLAYERS];
+static s_RespawnTime = 3000;
+static s_CustomFallDamage = false;
+static bool:s_CbugAllowed = true;
+static s_CbugFroze[MAX_PLAYERS];
+static s_DamageFeed = true;
+static s_DamageFeedPlayer[MAX_PLAYERS] = {-1, ...};
+static s_DamageFeedHideDelay = 3000;
+static s_DamageFeedMaxUpdateRate = 250;
+static s_VehiclePassengerDamage = false;
+static s_VehicleUnoccupiedDamage = false;
+static Float:s_FallDeathVelocity = -0.6;
+static s_DamageTakenSound = 1190;
+static s_DamageGivenSound = 17802;
+static s_RejectedHits[MAX_PLAYERS][WC_MAX_REJECTED_HITS][E_REJECTED_HIT];
+static s_RejectedHitsIdx[MAX_PLAYERS];
+static s_World[MAX_PLAYERS];
+static s_LastAnim[MAX_PLAYERS] = {-1, ...};
+static Float:s_LastZVelo[MAX_PLAYERS] = {0.0, ...};
+static Float:s_LastZ[MAX_PLAYERS] = {0.0, ...};
+static s_LastUpdate[MAX_PLAYERS] = {-1, ...};
+static PlayerText:s_DamageFeedTaken[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
+static PlayerText:s_DamageFeedGiven[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
+static s_DamageFeedHitsGiven[MAX_PLAYERS][WC_FEED_HEIGHT][E_DAMAGE_FEED_HIT];
+static s_DamageFeedHitsTaken[MAX_PLAYERS][WC_FEED_HEIGHT][E_DAMAGE_FEED_HIT];
+static s_DamageFeedTimer[MAX_PLAYERS] = {-1, ...};
+static s_DamageFeedLastUpdate[MAX_PLAYERS];
+static s_Spectating[MAX_PLAYERS] = {INVALID_PLAYER_ID, ...};
+static s_LastStop[MAX_PLAYERS];
+static bool:s_FirstSpawn[MAX_PLAYERS] = {true, ...};
+#if WC_CUSTOM_VENDING_MACHINES
+	static bool:s_CustomVendingMachines = true;
+	static s_VendingMachineObject[sizeof(sc_VendingMachines)] = {-1, ...};
+	static s_VendingUseTimer[MAX_PLAYERS] = {-1, ...};
+#endif
+static s_BeingResynced[MAX_PLAYERS];
+static s_KnifeTimeout[MAX_PLAYERS] = {-1, ...};
+static s_SyncData[MAX_PLAYERS][E_RESYNC_DATA];
+static Text:s_HealthBarBorder = Text:INVALID_TEXT_DRAW;
+static Text:s_HealthBarBackground = Text:INVALID_TEXT_DRAW;
+static PlayerText:s_HealthBarForeground[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
+static s_DamageRangeSteps[55];
+static Float:s_DamageRangeRanges[55][WC_MAX_DAMAGE_RANGES];
+static Float:s_DamageRangeValues[55][WC_MAX_DAMAGE_RANGES];
+static s_LastVehicleShooter[MAX_VEHICLES + 1] = {INVALID_PLAYER_ID, ...};
+static bool:s_InternalTextDraw[Text:MAX_TEXT_DRAWS];
+static bool:s_InternalPlayerTextDraw[MAX_PLAYERS][PlayerText:MAX_PLAYER_TEXT_DRAWS];
+static s_LastVehicleEnterTime[MAX_PLAYERS];
+static s_TrueDeath[MAX_PLAYERS];
+static s_InClassSelection[MAX_PLAYERS];
+static s_ForceClassSelection[MAX_PLAYERS];
+static s_ClassSpawnInfo[320][E_SPAWN_INFO];
+static s_PlayerSpawnInfo[MAX_PLAYERS][E_SPAWN_INFO];
+static s_PlayerFallbackSpawnInfo[MAX_PLAYERS][E_SPAWN_INFO];
+static s_PlayerClass[MAX_PLAYERS] = {-2, ...};
+static bool:s_SpawnInfoModified[MAX_PLAYERS];
+static bool:s_AlreadyConnected[MAX_PLAYERS];
+static s_DeathSkip[MAX_PLAYERS];
+static s_DeathSkipTick[MAX_PLAYERS];
+static s_LastVehicleTick[MAX_PLAYERS];
+static s_PreviousHits[MAX_PLAYERS][10][E_HIT_INFO];
+static s_PreviousHitI[MAX_PLAYERS];
+static Float:s_DamageDoneHealth[MAX_PLAYERS];
+static Float:s_DamageDoneArmour[MAX_PLAYERS];
+static s_DelayedDeathTimer[MAX_PLAYERS] = {-1, ...};
+static bool:s_VehicleAlive[MAX_VEHICLES] = {false, ...};
+static s_VehicleRespawnTimer[MAX_VEHICLES] = {-1, ...};
+
+native WC_IsValidVehicle(vehicleid) = IsValidVehicle;
+
+/*
+ * Public API
+ */
+stock IsBulletWeapon(weaponid)
+{
+	return (WEAPON_COLT45 <= weaponid <= WEAPON_SNIPER) || weaponid == WEAPON_MINIGUN;
+}
+
+stock IsHighRateWeapon(weaponid)
+{
+	switch (weaponid) {
+		case WEAPON_FLAMETHROWER, WEAPON_DROWN, WEAPON_CARPARK,
+		     WEAPON_SPRAYCAN, WEAPON_FIREEXTINGUISHER: {
+			return true;
+		}
+	}
+
+	return false;
+}
+
+stock IsMeleeWeapon(weaponid)
+{
+	return (WEAPON_UNARMED <= weaponid <= WEAPON_KATANA) || (WEAPON_DILDO <= weaponid <= WEAPON_CANE) || weaponid == WEAPON_PISTOLWHIP;
+}
+
+stock IsPlayerSpawned(playerid)
+{
+	if (s_IsDying[playerid] || s_BeingResynced[playerid]) {
+		return false;
+	}
+
+	switch (GetPlayerState(playerid)) {
+		case PLAYER_STATE_ONFOOT .. PLAYER_STATE_PASSENGER,
+		     PLAYER_STATE_SPAWNED: {
+			return true;
+		}
+	}
+
+	return false;
+}
+
+stock AverageShootRate(playerid, shots, &multiple_weapons = 0)
+{
+	if (playerid == INVALID_PLAYER_ID || s_ShotsFired[playerid] < shots) {
+		return -1;
+	}
+
+	new total = 0, idx = s_LastShotIdx[playerid];
+
+	multiple_weapons = false;
+
+	for (new i = shots - 2; i >= 0; i--) {
+		new prev_idx = (idx - i - 1) % sizeof(s_LastShotTicks[]);
+
+		// JIT plugin fix
+		if (prev_idx < 0) {
+			prev_idx += sizeof(s_LastShotTicks[]);
+		}
+
+		new prev = s_LastShotTicks[playerid][prev_idx];
+		new prev_weap = s_LastShotWeapons[playerid][prev_idx];
+		new this_idx = (idx - i) % sizeof(s_LastShotTicks[]);
+
+		// JIT plugin fix
+		if (this_idx < 0) {
+			this_idx += sizeof(s_LastShotTicks[]);
+		}
+
+		if (prev_weap != s_LastShotWeapons[playerid][this_idx]) {
+			multiple_weapons = true;
+		}
+
+		total += s_LastShotTicks[playerid][this_idx] - prev;
+	}
+
+	return total / (shots - 1);
+}
+
+stock AverageHitRate(playerid, hits, &multiple_weapons = 0)
+{
+	if (playerid == INVALID_PLAYER_ID || s_HitsIssued[playerid] < hits) {
+		return -1;
+	}
+
+	new total = 0, idx = s_LastHitIdx[playerid];
+
+	multiple_weapons = false;
+
+	for (new i = hits - 2; i >= 0; i--) {
+		new prev_idx = (idx - i - 1) % sizeof(s_LastHitTicks[]);
+
+		// JIT plugin fix
+		if (prev_idx < 0) {
+			prev_idx += sizeof(s_LastHitTicks[]);
+		}
+
+		new prev = s_LastHitTicks[playerid][prev_idx];
+		new prev_weap = s_LastHitWeapons[playerid][prev_idx];
+		new this_idx = (idx - i) % sizeof(s_LastHitTicks[]);
+
+		// JIT plugin fix
+		if (this_idx < 0) {
+			this_idx += sizeof(s_LastHitTicks[]);
+		}
+
+		if (prev_weap != s_LastHitWeapons[playerid][this_idx]) {
+			multiple_weapons = true;
+		}
+
+		total += s_LastHitTicks[playerid][this_idx] - prev;
+	}
+
+	return total / (hits - 1);
+}
+
+stock SetRespawnTime(ms)
+{
+	s_RespawnTime = max(0, ms);
+}
+
+stock GetRespawnTime()
+{
+	return s_RespawnTime;
+}
+
+stock ReturnWeaponName(weaponid)
+{
+	new name[sizeof(g_WeaponName[])];
+
+	WC_GetWeaponName(weaponid, name);
+
+	return name;
+}
+
+stock SetWeaponDamage(weaponid, damage_type, Float:amount, Float:...)
+{
+	if (weaponid < 0 || weaponid >= sizeof(s_WeaponDamage)) {
+		return 0;
+	}
+
+	if (damage_type == DAMAGE_TYPE_RANGE || damage_type == DAMAGE_TYPE_RANGE_MULTIPLIER) {
+		if (!IsBulletWeapon(weaponid)) {
+			return 0;
+		}
+
+		new args = numargs();
+
+		if (!(args & 0b1)) {
+			return 0;
+		}
+
+		new steps = (args - 1) / 2;
+
+		s_DamageType[weaponid] = damage_type;
+		s_DamageRangeSteps[weaponid] = steps;
+
+		for (new i = 0; i < steps; i++) {
+			if (i) {
+				s_DamageRangeRanges[weaponid][i] = Float:getarg(1 + i*2);
+				s_DamageRangeValues[weaponid][i] = Float:getarg(2 + i*2);
+			} else {
+				s_DamageRangeValues[weaponid][i] = amount;
+			}
+		}
+
+		return 1;
+	} else if (damage_type == DAMAGE_TYPE_MULTIPLIER || damage_type == DAMAGE_TYPE_STATIC) {
+		s_DamageType[weaponid] = damage_type;
+		s_DamageRangeSteps[weaponid] = 0;
+		s_WeaponDamage[weaponid] = amount;
+
+		return 1;
+	}
+
+	return 0;
+}
+
+stock SetCustomArmourRules(bool:armour_rules, bool:torso_rules = false)
+{
+	s_DamageArmourToggle[0] = armour_rules;
+	s_DamageArmourToggle[1] = torso_rules;
+}
+
+stock SetWeaponArmourRule(weaponid, bool:affects_armour, bool:torso_only = false)
+{
+	if (weaponid < 0 || weaponid >= sizeof(s_WeaponDamage)) {
+		return 0;
+	}
+
+	s_DamageArmour[weaponid][0] = affects_armour;
+	s_DamageArmour[weaponid][1] = torso_only;
+
+	return 1;
+}
+
+stock SetDamageSounds(taken, given)
+{
+	s_DamageTakenSound = taken;
+	s_DamageGivenSound = given;
+}
+
+stock SetCbugAllowed(bool:enabled)
+{
+	s_CbugAllowed = enabled;
+}
+
+stock bool:GetCbugAllowed()
+{
+	return s_CbugAllowed;
+}
+
+stock SetCustomFallDamage(bool:toggle, Float:damage_multiplier = 25.0, Float:death_velocity = -0.6)
+{
+	s_CustomFallDamage = toggle;
+
+	if (toggle) {
+		s_WeaponDamage[WEAPON_COLLISION] = damage_multiplier;
+		s_FallDeathVelocity = -floatabs(death_velocity);
+	}
+}
+
+#if WC_CUSTOM_VENDING_MACHINES
+	stock SetCustomVendingMachines(bool:toggle)
+	{
+		s_CustomVendingMachines = toggle;
+
+		if (toggle) {
+			CreateVendingMachines();
+		} else {
+			DestroyVendingMachines();
+		}
+	}
+#endif
+
+stock SetVehiclePassengerDamage(bool:toggle)
+{
+	s_VehiclePassengerDamage = toggle;
+}
+
+stock SetVehicleUnoccupiedDamage(bool:toggle)
+{
+	s_VehicleUnoccupiedDamage = toggle;
+}
+
+stock SetDamageFeedForPlayer(playerid, toggle = -1)
+{
+	if (IsPlayerConnected(playerid))
+	{
+		s_DamageFeedPlayer[playerid] = toggle;
+		DamageFeedUpdate(playerid);
+		return 1;
+	}
+
+	return 0;
+}
+
+stock IsDamageFeedActive(playerid = -1)
+{
+	if (playerid != -1) {
+		return s_DamageFeedPlayer[playerid] == 1 || s_DamageFeed && s_DamageFeedPlayer[playerid] != 0;
+	}
+
+	return s_DamageFeed;
+}
+
+stock SetDamageFeed(bool:toggle)
+{
+	s_DamageFeed = toggle;
+
+	for (new i = 0; i < MAX_PLAYERS; i++) {
+		if (IsPlayerConnected(i)) {
+			DamageFeedUpdate(i);
+		}
+	}
+}
+
+stock SetWeaponShootRate(weaponid, max_rate)
+{
+	if (0 <= weaponid < sizeof(s_MaxWeaponShootRate)) {
+		s_MaxWeaponShootRate[weaponid] = max_rate;
+
+		return 1;
+	}
+
+	return 0;
+}
+
+stock IsPlayerDying(playerid)
+{
+	if (0 <= playerid < MAX_PLAYERS) {
+		return s_IsDying[playerid];
+	}
+
+	return false;
+}
+
+stock SetWeaponMaxRange(weaponid, Float:range)
+{
+	if (!IsBulletWeapon(weaponid)) {
+		return 0;
+	}
+
+	s_WeaponRange[weaponid] = range;
+
+	return 1;
+}
+
+stock SetPlayerMaxHealth(playerid, Float:value)
+{
+	if (0 <= playerid < MAX_PLAYERS) {
+		s_PlayerMaxHealth[playerid] = value;
+	}
+}
+
+stock SetPlayerMaxArmour(playerid, Float:value)
+{
+	if (0 <= playerid < MAX_PLAYERS) {
+		s_PlayerMaxArmour[playerid] = value;
+	}
+}
+
+stock Float:GetPlayerMaxHealth(playerid)
+{
+	if (0 <= playerid < MAX_PLAYERS) {
+		return s_PlayerMaxHealth[playerid];
+	}
+
+	return 0.0;
+}
+
+stock Float:GetPlayerMaxArmour(playerid)
+{
+	if (0 <= playerid < MAX_PLAYERS) {
+		return s_PlayerMaxArmour[playerid];
+	}
+
+	return 0.0;
+}
+
+stock Float:GetLastDamageHealth(playerid)
+{
+	if (0 <= playerid < MAX_PLAYERS) {
+		return s_DamageDoneHealth[playerid];
+	}
+
+	return 0.0;
+}
+
+stock Float:GetLastDamageArmour(playerid)
+{
+	if (0 <= playerid < MAX_PLAYERS) {
+		return s_DamageDoneArmour[playerid];
+	}
+
+	return 0.0;
+}
+
+stock DamagePlayer(playerid, Float:amount, issuerid = INVALID_PLAYER_ID, weaponid = WEAPON_UNKNOWN, bodypart = BODY_PART_UNKNOWN, bool:ignore_armour = false)
+{
+	if (playerid < 0 || playerid > MAX_PLAYERS || !IsPlayerConnected(playerid)) {
+		return 0;
+	}
+
+	if (amount < 0.0) {
+		return 0;
+	}
+
+	if (weaponid < 0 || weaponid > 55) {
+		weaponid = WEAPON_UNKNOWN;
+	}
+
+	if (issuerid < 0 || issuerid > MAX_PLAYERS || !IsPlayerConnected(issuerid)) {
+		issuerid = INVALID_PLAYER_ID;
+	}
+
+	InflictDamage(playerid, amount, issuerid, weaponid, bodypart, ignore_armour);
+
+	return 1;
+}
+
+stock GetRejectedHit(playerid, idx, output[], maxlength = sizeof(output))
+{
+	if (idx >= WC_MAX_REJECTED_HITS) {
+		return 0;
+	}
+
+	new real_idx = (s_RejectedHitsIdx[playerid] - idx) % WC_MAX_REJECTED_HITS;
+
+	// JIT plugin fix
+	if (real_idx < 0) {
+		real_idx += WC_MAX_REJECTED_HITS;
+	}
+
+	if (!s_RejectedHits[playerid][real_idx][e_Time]) {
+		return 0;
+	}
+
+	new reason = s_RejectedHits[playerid][real_idx][e_Reason];
+	new hour = s_RejectedHits[playerid][real_idx][e_Hour];
+	new minute = s_RejectedHits[playerid][real_idx][e_Minute];
+	new second = s_RejectedHits[playerid][real_idx][e_Second];
+	new i1 = s_RejectedHits[playerid][real_idx][e_Info1];
+	new i2 = s_RejectedHits[playerid][real_idx][e_Info2];
+	new i3 = s_RejectedHits[playerid][real_idx][e_Info3];
+	new weapon = s_RejectedHits[playerid][real_idx][e_Weapon];
+
+	new weapon_name[32];
+
+	WC_GetWeaponName(weapon, weapon_name);
+
+	format(output, maxlength, "[%02d:%02d:%02d] (%s -> %s) %s", hour, minute, second, weapon_name, s_RejectedHits[playerid][real_idx][e_Name], g_HitRejectReasons[reason]);
+
+	format(output, maxlength, output, i1, i2, i3);
+
+	return 1;
+}
+
+stock ResyncPlayer(playerid)
+{
+	SaveSyncData(playerid);
+
+	s_BeingResynced[playerid] = true;
+
+	SpawnPlayerInPlace(playerid);
+}
+
+/*
+ * Hooked natives
+ */
+
+stock WC_SpawnPlayer(playerid)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
+		return 0;
+	}
+
+	if (s_PlayerHealth[playerid] == 0.0) {
+		s_PlayerHealth[playerid] = s_PlayerMaxHealth[playerid];
+	}
+
+	SpawnPlayer(playerid);
+
+	return 1;
+}
+
+stock WC_GetPlayerState(playerid)
+{
+	if (s_IsDying[playerid]) {
+		return PLAYER_STATE_WASTED;
+	}
+
+	return GetPlayerState(playerid);
+}
+
+stock Float:WC_GetPlayerHealth(playerid, &Float:health = 0.0)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) {
+		health = 0.0;
+
+		return 0.0;
+	}
+
+	health = s_PlayerHealth[playerid];
+
+	return health;
+}
+
+stock WC_SetPlayerHealth(playerid, Float:health, Float:armour = -1.0)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) {
+		return 0;
+	}
+
+	if (health <= 0.0) {
+		s_PlayerArmour[playerid] = 0.0;
+		s_PlayerHealth[playerid] = 0.0;
+
+		InflictDamage(playerid, 0.0);
+	} else {
+		if (armour != -1.0) {
+			if (armour > s_PlayerMaxArmour[playerid]) {
+				armour = s_PlayerMaxArmour[playerid];
+			}
+			s_PlayerArmour[playerid] = armour;
+		}
+
+		if (health > s_PlayerMaxHealth[playerid]) {
+			health = s_PlayerMaxHealth[playerid];
+		}
+		s_PlayerHealth[playerid] = health;
+		UpdateHealthBar(playerid, true);
+	}
+
+	return 1;
+}
+
+stock Float:WC_GetPlayerArmour(playerid, &Float:armour = 0.0)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) {
+		armour = 0.0;
+
+		return 0.0;
+	}
+
+	armour = s_PlayerArmour[playerid];
+
+	return armour;
+}
+
+stock WC_SetPlayerArmour(playerid, Float:armour)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) {
+		return 0;
+	}
+
+	if (armour > s_PlayerMaxArmour[playerid]) {
+		armour = s_PlayerMaxArmour[playerid];
+	}
+	s_PlayerArmour[playerid] = armour;
+	UpdateHealthBar(playerid, true);
+
+	return 1;
+}
+
+stock WC_GetPlayerTeam(playerid)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) {
+		return NO_TEAM;
+	}
+
+	if (!IsPlayerConnected(playerid)) {
+		return NO_TEAM;
+	}
+
+	return s_PlayerTeam[playerid];
+}
+
+stock WC_SetPlayerTeam(playerid, team)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) {
+		return 0;
+	}
+
+	s_PlayerTeam[playerid] = team;
+
+	return 1;
+}
+
+stock WC_SendDeathMessage(killer, killee, weapon)
+{
+	if (weapon == WEAPON_CARPARK) {
+		weapon = WEAPON_VEHICLE;
+	} else if (weapon == WEAPON_PISTOLWHIP) {
+		weapon = WEAPON_UNARMED;
+	} else if (weapon == WEAPON_UNKNOWN) {
+		weapon = WEAPON_DROWN;
+	} else if (weapon == WEAPON_VEHICLE_M4) {
+		weapon = WEAPON_M4;
+	} if (weapon == WEAPON_VEHICLE_MINIGUN) {
+		weapon = WEAPON_MINIGUN;
+	}
+
+	SendDeathMessage(killer, killee, weapon);
+
+	return 1;
+}
+
+stock SetWeaponName(weaponid, const name[])
+{
+	if (weaponid < 0 || weaponid >= sizeof(g_WeaponName)) {
+		return 0;
+	}
+
+	strunpack(g_WeaponName[weaponid], name, sizeof(g_WeaponName[]));
+
+	return 1;
+}
+
+stock WC_GetWeaponName(weaponid, weapon[], len = sizeof(weapon))
+{
+	if (weaponid < 0 || weaponid >= sizeof(g_WeaponName)) {
+		format(weapon, len, "Weapon %d", weaponid);
+	} else {
+		strunpack(weapon, g_WeaponName[weaponid], len);
+	}
+
+	return 1;
+}
+
+stock WC_ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
+		return 0;
+	}
+
+	return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
+}
+
+stock WC_ClearAnimations(playerid, forcesync = 1)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
+		return 0;
+	}
+
+	s_LastStop[playerid] = GetTickCount();
+
+	return ClearAnimations(playerid, forcesync);
+}
+
+stock WC_AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
+{
+	new classid = AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
+
+	s_ClassSpawnInfo[classid][e_Skin] = modelid;
+	s_ClassSpawnInfo[classid][e_Team] = 0x7FFFFFFF;
+	s_ClassSpawnInfo[classid][e_PosX] = spawn_x;
+	s_ClassSpawnInfo[classid][e_PosY] = spawn_y;
+	s_ClassSpawnInfo[classid][e_PosZ] = spawn_z;
+	s_ClassSpawnInfo[classid][e_Rot] = z_angle;
+	s_ClassSpawnInfo[classid][e_Weapon1] = weapon1;
+	s_ClassSpawnInfo[classid][e_Ammo1] = weapon1_ammo;
+	s_ClassSpawnInfo[classid][e_Weapon2] = weapon2;
+	s_ClassSpawnInfo[classid][e_Ammo2] = weapon2_ammo;
+	s_ClassSpawnInfo[classid][e_Weapon3] = weapon3;
+	s_ClassSpawnInfo[classid][e_Ammo3] = weapon3_ammo;
+
+	return classid;
+}
+
+stock WC_AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
+{
+	new classid = AddPlayerClassEx(teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
+
+	s_ClassSpawnInfo[classid][e_Skin] = modelid;
+	s_ClassSpawnInfo[classid][e_Team] = teamid;
+	s_ClassSpawnInfo[classid][e_PosX] = spawn_x;
+	s_ClassSpawnInfo[classid][e_PosY] = spawn_y;
+	s_ClassSpawnInfo[classid][e_PosZ] = spawn_z;
+	s_ClassSpawnInfo[classid][e_Rot] = z_angle;
+	s_ClassSpawnInfo[classid][e_Weapon1] = weapon1;
+	s_ClassSpawnInfo[classid][e_Ammo1] = weapon1_ammo;
+	s_ClassSpawnInfo[classid][e_Weapon2] = weapon2;
+	s_ClassSpawnInfo[classid][e_Ammo2] = weapon2_ammo;
+	s_ClassSpawnInfo[classid][e_Weapon3] = weapon3;
+	s_ClassSpawnInfo[classid][e_Ammo3] = weapon3_ammo;
+
+	return classid;
+}
+
+stock WC_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
+{
+	s_PlayerClass[playerid] = -1;
+	s_SpawnInfoModified[playerid] = false;
+
+	s_PlayerSpawnInfo[playerid][e_Skin] = skin;
+	s_PlayerSpawnInfo[playerid][e_Team] = team;
+	s_PlayerSpawnInfo[playerid][e_PosX] = x;
+	s_PlayerSpawnInfo[playerid][e_PosY] = y;
+	s_PlayerSpawnInfo[playerid][e_PosZ] = z;
+	s_PlayerSpawnInfo[playerid][e_Rot] = rotation;
+	s_PlayerSpawnInfo[playerid][e_Weapon1] = weapon1;
+	s_PlayerSpawnInfo[playerid][e_Ammo1] = weapon1_ammo;
+	s_PlayerSpawnInfo[playerid][e_Weapon2] = weapon2;
+	s_PlayerSpawnInfo[playerid][e_Ammo2] = weapon2_ammo;
+	s_PlayerSpawnInfo[playerid][e_Weapon3] = weapon3;
+	s_PlayerSpawnInfo[playerid][e_Ammo3] = weapon3_ammo;
+
+	return SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
+}
+
+stock WC_TogglePlayerSpectating(playerid, toggle)
+{
+	if (toggle) {
+		if (s_DeathTimer[playerid] != -1) {
+			KillTimer(s_DeathTimer[playerid]);
+			s_DeathTimer[playerid] = -1;
+		}
+
+		#if WC_CUSTOM_VENDING_MACHINES
+			if (s_VendingUseTimer[playerid] != -1) {
+				KillTimer(s_VendingUseTimer[playerid]);
+				s_VendingUseTimer[playerid] = -1;
+			}
+		#endif
+
+		s_IsDying[playerid] = false;
+	}
+
+	return TogglePlayerSpectating(playerid, toggle);
+}
+
+stock WC_TogglePlayerControllable(playerid, toggle)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
+		return 0;
+	}
+
+	s_LastStop[playerid] = GetTickCount();
+
+	return TogglePlayerControllable(playerid, toggle);
+}
+
+stock WC_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
+		return 0;
+	}
+
+	s_LastStop[playerid] = GetTickCount();
+
+	return SetPlayerPos(playerid, x, y, z);
+}
+
+stock WC_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
+		return 0;
+	}
+
+	s_LastStop[playerid] = GetTickCount();
+
+	return SetPlayerPosFindZ(playerid, x, y, z);
+}
+
+stock WC_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS || s_IsDying[playerid]) {
+		return 0;
+	}
+
+	if (X == 0.0 && Y == 0.0 && Z == 0.0) {
+		s_LastStop[playerid] = GetTickCount();
+	}
+
+	return SetPlayerVelocity(playerid, X, Y, Z);
+}
+
+stock wc_SetPlayerVirtualWorld(playerid, worldid)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) {
+		return 0;
+	}
+
+	s_World[playerid] = worldid;
+
+	if (s_IsDying[playerid]) {
+		return 1;
+	}
+
+	return SetPlayerVirtualWorld(playerid, worldid);
+}
+
+stock WC_GetPlayerVirtualWorld(playerid)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) {
+		return 0;
+	}
+
+	new worldid = GetPlayerVirtualWorld(playerid);
+
+	if (worldid == WC_DEATH_WORLD) {
+		return s_World[playerid];
+	}
+
+	return worldid;
+}
+
+stock WC_PlayerSpectatePlayer(playerid, targetplayerid, mode = SPECTATE_MODE_NORMAL)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS || targetplayerid < 0 || targetplayerid >= MAX_PLAYERS) {
+		return 0;
+	}
+
+	s_Spectating[playerid] = targetplayerid;
+
+	return PlayerSpectatePlayer(playerid, targetplayerid, mode);
+}
+
+stock WC_DestroyVehicle(vehicleid)
+{
+	if (0 < vehicleid < MAX_VEHICLES) {
+		s_LastVehicleShooter[vehicleid] = INVALID_PLAYER_ID;
+		s_VehicleAlive[vehicleid] = false;
+		if (s_VehicleRespawnTimer[vehicleid] != -1) {
+			KillTimer(s_VehicleRespawnTimer[vehicleid]);
+			s_VehicleRespawnTimer[vehicleid] = -1;
+		}
+	}
+
+	return DestroyVehicle(vehicleid);
+}
+
+stock WC_CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren = 0)
+{
+	new id = CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay, addsiren);
+	if (id != INVALID_VEHICLE_ID) {
+		s_VehicleAlive[id] = true;
+		return id;
+	}
+	return INVALID_VEHICLE_ID;
+}
+
+
+stock WC_AddStaticVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2)
+{
+	new id = AddStaticVehicle(modelid, x, y, z, angle, color1, color2);
+	if (id != INVALID_VEHICLE_ID) {
+		s_VehicleAlive[id] = true;
+		return id;
+	}
+	return INVALID_VEHICLE_ID;
+}
+
+
+stock WC_AddStaticVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren = 0)
+{
+	new id = AddStaticVehicleEx(modelid, x, y, z, angle, color1, color2, respawn_delay, addsiren);
+	if (id != INVALID_VEHICLE_ID) {
+		s_VehicleAlive[id] = true;
+		return id;
+	}
+	return INVALID_VEHICLE_ID;
+}
+
+stock WC_IsPlayerInCheckpoint(playerid)
+{
+	if (!IsPlayerSpawned(playerid)) {
+		return 0;
+	}
+
+	return IsPlayerInCheckpoint(playerid);
+}
+
+stock WC_SetPlayerSpecialAction(playerid, actionid)
+{
+	if (!IsPlayerSpawned(playerid)) {
+		return 0;
+	}
+
+	return SetPlayerSpecialAction(playerid, actionid);
+}
+
+stock Text:WC_TextDrawCreate(Float:x, Float:y, text[])
+{
+	new Text:td = TextDrawCreate(x, y, text);
+
+	if (td != Text:INVALID_TEXT_DRAW) {
+		s_InternalTextDraw[td] = false;
+	}
+
+	return td;
+}
+
+stock WC_TextDrawDestroy(Text:text)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawDestroy(text);
+}
+
+stock WC_TextDrawLetterSize(Text:text, Float:x, Float:y)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawLetterSize(text, x, y);
+}
+
+stock WC_TextDrawTextSize(Text:text, Float:x, Float:y)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawTextSize(text, x, y);
+}
+
+stock WC_TextDrawAlignment(Text:text, alignment)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawAlignment(text, alignment);
+}
+
+stock WC_TextDrawColor(Text:text, color)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawColor(text, color);
+}
+
+stock WC_TextDrawUseBox(Text:text, use)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawUseBox(text, use);
+}
+
+stock WC_TextDrawBoxColor(Text:text, color)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawBoxColor(text, color);
+}
+
+stock WC_TextDrawSetShadow(Text:text, size)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawSetShadow(text, size);
+}
+
+stock WC_TextDrawSetOutline(Text:text, size)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawSetOutline(text, size);
+}
+
+stock WC_TextDrawBackgroundColor(Text:text, color)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawBackgroundColor(text, color);
+}
+
+stock WC_TextDrawFont(Text:text, font)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawFont(text, font);
+}
+
+stock WC_TextDrawSetProportional(Text:text, set)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawSetProportional(text, set);
+}
+
+stock WC_TextDrawSetSelectable(Text:text, set)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawSetSelectable(text, set);
+}
+
+stock WC_TextDrawShowForPlayer(playerid, Text:text)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawShowForPlayer(playerid, text);
+}
+
+stock WC_TextDrawHideForPlayer(playerid, Text:text)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawHideForPlayer(playerid, text);
+}
+
+stock WC_TextDrawShowForAll(Text:text)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawShowForAll(text);
+}
+
+stock WC_TextDrawHideForAll(Text:text)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawHideForAll(text);
+}
+
+stock WC_TextDrawSetString(Text:text, string[])
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawSetString(text, string);
+}
+
+stock WC_TextDrawSetPreviewModel(Text:text, modelindex)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawSetPreviewModel(text, modelindex);
+}
+
+stock WC_TextDrawSetPreviewRot(Text:text, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fZoom = 1.0)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawSetPreviewRot(text, fRotX, fRotY, fRotZ, fZoom);
+}
+
+stock WC_TextDrawSetPreviewVehCol(Text:text, color1, color2)
+{
+	if (_:text < 0 || _:text >= MAX_TEXT_DRAWS || s_InternalTextDraw[text]) return 0;
+	return TextDrawSetPreviewVehCol(text, color1, color2);
+}
+
+stock PlayerText:WC_CreatePlayerTextDraw(playerid, Float:x, Float:y, text[])
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return PlayerText:INVALID_TEXT_DRAW;
+	new PlayerText:td = CreatePlayerTextDraw(playerid, x, y, text);
+
+	if (td != PlayerText:INVALID_TEXT_DRAW) {
+		s_InternalPlayerTextDraw[playerid][td] = false;
+	}
+
+	return td;
+}
+
+stock WC_PlayerTextDrawDestroy(playerid, PlayerText:text)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawDestroy(playerid, text);
+}
+
+stock WC_PlayerTextDrawLetterSize(playerid, PlayerText:text, Float:x, Float:y)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawLetterSize(playerid, text, x, y);
+}
+
+stock WC_PlayerTextDrawTextSize(playerid, PlayerText:text, Float:x, Float:y)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawTextSize(playerid, text, x, y);
+}
+
+stock WC_PlayerTextDrawAlignment(playerid, PlayerText:text, alignment)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawAlignment(playerid, text, alignment);
+}
+
+stock WC_PlayerTextDrawColor(playerid, PlayerText:text, color)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawColor(playerid, text, color);
+}
+
+stock WC_PlayerTextDrawUseBox(playerid, PlayerText:text, use)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawUseBox(playerid, text, use);
+}
+
+stock WC_PlayerTextDrawBoxColor(playerid, PlayerText:text, color)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawBoxColor(playerid, text, color);
+}
+
+stock WC_PlayerTextDrawSetShadow(playerid, PlayerText:text, size)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawSetShadow(playerid, text, size);
+}
+
+stock WC_PlayerTextDrawSetOutline(playerid, PlayerText:text, size)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawSetOutline(playerid, text, size);
+}
+
+stock WC_PlayerTextDrawBackgroundColo(playerid, PlayerText:text, color)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawBackgroundColor(playerid, text, color);
+}
+
+stock WC_PlayerTextDrawFont(playerid, PlayerText:text, font)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawFont(playerid, text, font);
+}
+
+stock WC_PlayerTextDrawSetProportiona(playerid, PlayerText:text, set)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawSetProportional(playerid, text, set);
+}
+
+stock WC_PlayerTextDrawSetSelectable(playerid, PlayerText:text, set)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawSetSelectable(playerid, text, set);
+}
+
+stock WC_PlayerTextDrawShow(playerid, PlayerText:text)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawShow(playerid, text);
+}
+
+stock WC_PlayerTextDrawHide(playerid, PlayerText:text)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawHide(playerid, text);
+}
+
+stock WC_PlayerTextDrawSetString(playerid, PlayerText:text, string[])
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawSetString(playerid, text, string);
+}
+
+stock WC_PlayerTextDrawSetPreviewMode(playerid, PlayerText:text, modelindex)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawSetPreviewModel(playerid, text, modelindex);
+}
+
+stock WC_PlayerTextDrawSetPreviewRot(playerid, PlayerText:text, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fZoom = 1.0)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawSetPreviewRot(playerid, text, fRotX, fRotY, fRotZ, fZoom);
+}
+
+stock WC_PlayerTextDrawSetPreviewVehC(playerid, PlayerText:text, color1, color2)
+{
+	if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
+	if (_:text < 0 || _:text >= MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
+	return PlayerTextDrawSetPreviewVehCol(playerid, text, color1, color2);
+}
+
+/*
+ * Hooked callbacks
+ */
+public OnGameModeInit()
+{
+	ScriptInit();
+
+	#if defined WC_OnGameModeInit
+		return WC_OnGameModeInit();
+	#else
+		return 1;
+	#endif
+}
+
+public OnGameModeExit()
+{
+	ScriptExit();
+
+	#if defined WC_OnGameModeExit
+		return WC_OnGameModeExit();
+	#else
+		return 1;
+	#endif
+}
+
+public OnFilterScriptInit()
+{
+	ScriptInit();
+
+	#if defined WC_OnFilterScriptInit
+		return WC_OnFilterScriptInit();
+	#else
+		return 1;
+	#endif
+}
+
+public OnFilterScriptExit()
+{
+	ScriptExit();
+
+	#if defined WC_OnFilterScriptExit
+		return WC_OnFilterScriptExit();
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerConnect(playerid)
+{
+	new tick = GetTickCount();
+
+	s_PlayerMaxHealth[playerid] = 100.0;
+	s_PlayerHealth[playerid] = 100.0;
+	s_PlayerMaxArmour[playerid] = 100.0;
+	s_PlayerArmour[playerid] = 0.0;
+	s_LastExplosive[playerid] = 0;
+	s_LastShotIdx[playerid] = 0;
+	s_LastShot[playerid][e_Tick] = 0;
+	s_LastHitIdx[playerid] = 0;
+	s_RejectedHitsIdx[playerid] = 0;
+	s_ShotsFired[playerid] = 0;
+	s_HitsIssued[playerid] = 0;
+	s_PlayerTeam[playerid] = NO_TEAM;
+	s_IsDying[playerid] = false;
+	s_BeingResynced[playerid] = false;
+	s_SpawnForStreamedIn[playerid] = false;
+	s_World[playerid] = 0;
+	s_LastAnim[playerid] = -1;
+	s_LastZVelo[playerid] = 0.0;
+	s_LastZ[playerid] = 0.0;
+	s_LastUpdate[playerid] = tick;
+	s_DamageFeedTimer[playerid] = -1;
+	s_DamageFeedLastUpdate[playerid] = tick;
+	s_Spectating[playerid] = INVALID_PLAYER_ID;
+	s_HealthBarVisible[playerid] = false;
+	s_LastSentHealth[playerid] = 0;
+	s_LastSentArmour[playerid] = 0;
+	s_LastStop[playerid] = tick;
+	s_FirstSpawn[playerid] = true;
+	s_LastVehicleEnterTime[playerid] = 0;
+	s_TrueDeath[playerid] = true;
+	s_InClassSelection[playerid] = false;
+	s_ForceClassSelection[playerid] = false;
+	s_PlayerClass[playerid] = -2;
+	s_SpawnInfoModified[playerid] = false;
+	s_PlayerFallbackSpawnInfo[playerid][e_Skin] = -1;
+	s_DeathSkip[playerid] = 0;
+	s_LastVehicleTick[playerid] = 0;
+	s_PreviousHitI[playerid] = 0;
+	s_CbugFroze[playerid] = 0;
+	s_DeathTimer[playerid] = -1;
+	s_DelayedDeathTimer[playerid] = -1;
+	s_DamageFeedPlayer[playerid] = -1;
+
+	for (new i = 0; i < sizeof(s_PreviousHits[]); i++) {
+		s_PreviousHits[playerid][i][e_Tick] = 0;
+	}
+
+	for (new i = 0; i < sizeof(s_RejectedHits[]); i++) {
+		s_RejectedHits[playerid][i][e_Time] = 0;
+	}
+
+	for (new i = 0; i < sizeof(s_DamageFeedHitsGiven[]); i++) {
+		s_DamageFeedHitsGiven[playerid][i][e_Tick] = 0;
+		s_DamageFeedHitsTaken[playerid][i][e_Tick] = 0;
+	}
+
+	SetPlayerTeam(playerid, 0xFE);
+	FreezeSyncData(playerid, false);
+	SetFakeFacingAngle(playerid, _);
+	DamageFeedUpdate(playerid);
+
+	#if WC_CUSTOM_VENDING_MACHINES
+		if (!s_AlreadyConnected[playerid]) {
+			RemoveDefaultVendingMachines(playerid);
+		}
+	#endif
+
+	s_AlreadyConnected[playerid] = false;
+
+	#if defined WC_OnPlayerConnect
+		return WC_OnPlayerConnect(playerid);
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerDisconnect(playerid, reason)
+{
+	#if defined WC_OnPlayerDisconnect
+		WC_OnPlayerDisconnect(playerid, reason);
+	#endif
+	
+	#if WC_CUSTOM_VENDING_MACHINES
+		if (s_VendingUseTimer[playerid] != -1) {
+			KillTimer(s_VendingUseTimer[playerid]);
+			s_VendingUseTimer[playerid] = -1;
+		}
+	#endif
+
+	if (s_DelayedDeathTimer[playerid] != -1) {
+		KillTimer(s_DelayedDeathTimer[playerid]);
+		s_DelayedDeathTimer[playerid] = -1;
+	}
+
+	if (s_DeathTimer[playerid] != -1) {
+		KillTimer(s_DeathTimer[playerid]);
+		s_DeathTimer[playerid] = -1;
+	}
+
+	if (s_KnifeTimeout[playerid] != -1) {
+		KillTimer(s_KnifeTimeout[playerid]);
+		s_KnifeTimeout[playerid] = -1;
+	}
+
+	if (s_HealthBarForeground[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+		PlayerTextDrawDestroy(playerid, s_HealthBarForeground[playerid]);
+		s_InternalPlayerTextDraw[playerid][s_HealthBarForeground[playerid]] = false;
+		s_HealthBarForeground[playerid] = PlayerText:INVALID_TEXT_DRAW;
+	}
+
+	if (s_DamageFeedGiven[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+		PlayerTextDrawDestroy(playerid, s_DamageFeedGiven[playerid]);
+		s_InternalPlayerTextDraw[playerid][s_DamageFeedGiven[playerid]] = false;
+		s_DamageFeedGiven[playerid] = PlayerText:INVALID_TEXT_DRAW;
+	}
+
+	if (s_DamageFeedTaken[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+		PlayerTextDrawDestroy(playerid, s_DamageFeedTaken[playerid]);
+		s_InternalPlayerTextDraw[playerid][s_DamageFeedTaken[playerid]] = false;
+		s_DamageFeedTaken[playerid] = PlayerText:INVALID_TEXT_DRAW;
+	}
+
+	if (s_DamageFeedTimer[playerid] != -1) {
+		KillTimer(s_DamageFeedTimer[playerid]);
+		s_DamageFeedTimer[playerid] = -1;
+	}
+
+	SetHealthBarVisible(playerid, false);
+
+	s_Spectating[playerid] = INVALID_PLAYER_ID;
+
+	for (new i = 0; i < sizeof(s_LastVehicleShooter); i++) {
+		if (s_LastVehicleShooter[i] == playerid) {
+			s_LastVehicleShooter[i] = INVALID_PLAYER_ID;
+		}
+	}
+
+	for (new i = 0; i < sizeof(s_InternalPlayerTextDraw[]); i++) {
+		s_InternalPlayerTextDraw[playerid][PlayerText:i] = false;
+	}
+
+	for (new i = 0; i < MAX_PLAYERS; i++) {
+		if (!IsPlayerConnected(i)) {
+			continue;
+		}
+
+		for (new j = 0; j < sizeof(s_PreviousHits[]); j++) {
+			if (s_PreviousHits[i][j][e_Issuer] == playerid) {
+				s_PreviousHits[i][j][e_Issuer] = INVALID_PLAYER_ID;
+			}
+		}
+	}
+
+	return 1;
+}
+
+public OnPlayerSpawn(playerid)
+{
+	s_TrueDeath[playerid] = false;
+	s_InClassSelection[playerid] = false;
+
+	if (s_ForceClassSelection[playerid]) {
+		DebugMessage(playerid, "Being forced into class selection");
+		ForceClassSelection(playerid);
+		SetPlayerHealth(playerid, 0.0);
+		SetPlayerVirtualWorld(playerid, WC_DEATH_WORLD);
+
+		return 1;
+	}
+
+	s_LastUpdate[playerid] = GetTickCount();
+	s_LastStop[playerid] = GetTickCount();
+
+	if (s_BeingResynced[playerid]) {
+		s_BeingResynced[playerid] = false;
+
+		UpdateHealthBar(playerid);
+
+		SetPlayerPos(playerid, s_SyncData[playerid][e_PosX], s_SyncData[playerid][e_PosY], s_SyncData[playerid][e_PosZ]);
+		SetPlayerFacingAngle(playerid, s_SyncData[playerid][e_PosA]);
+
+		SetPlayerSkin(playerid, s_SyncData[playerid][e_Skin]);
+		SetPlayerTeam(playerid, s_SyncData[playerid][e_Team]);
+
+		for (new i = 0; i < 13; i++) {
+			if (s_SyncData[playerid][e_WeaponId][i]) {
+				GivePlayerWeapon(playerid, s_SyncData[playerid][e_WeaponId][i], s_SyncData[playerid][e_WeaponAmmo][i]);
+			}
+		}
+
+		GivePlayerWeapon(playerid, s_SyncData[playerid][e_Weapon], 0);
+
+		return 1;
+	}
+
+	if (s_SpawnInfoModified[playerid]) {
+		new spawn_info[E_SPAWN_INFO], classid = s_PlayerClass[playerid];
+
+		s_SpawnInfoModified[playerid] = false;
+
+		if (classid == -1) {
+			spawn_info = s_PlayerSpawnInfo[playerid];
+		} else if (classid == -2) {
+			spawn_info = s_PlayerFallbackSpawnInfo[playerid];
+		} else {
+			if (s_ClassSpawnInfo[classid][e_Skin] == -1 && s_PlayerFallbackSpawnInfo[playerid][e_Skin] != -1) {
+				spawn_info = s_PlayerFallbackSpawnInfo[playerid];
+			} else {
+				spawn_info = s_ClassSpawnInfo[classid];
+			}
+		}
+
+		if (spawn_info[e_Skin] != -1) {
+			SetSpawnInfo(
+				playerid,
+				spawn_info[e_Team],
+				spawn_info[e_Skin],
+				spawn_info[e_PosX],
+				spawn_info[e_PosY],
+				spawn_info[e_PosZ],
+				spawn_info[e_Rot],
+				spawn_info[e_Weapon1],
+				spawn_info[e_Ammo1],
+				spawn_info[e_Weapon2],
+				spawn_info[e_Ammo2],
+				spawn_info[e_Weapon3],
+				spawn_info[e_Ammo3]
+			);
+		}
+	} else {
+		s_PlayerFallbackSpawnInfo[playerid][e_Team] = s_PlayerTeam[playerid];
+		s_PlayerFallbackSpawnInfo[playerid][e_Skin] = GetPlayerSkin(playerid);
+		GetPlayerPos(
+			playerid,
+			s_PlayerFallbackSpawnInfo[playerid][e_PosX],
+			s_PlayerFallbackSpawnInfo[playerid][e_PosY],
+			s_PlayerFallbackSpawnInfo[playerid][e_PosZ]
+		);
+		GetPlayerFacingAngle(playerid, s_PlayerFallbackSpawnInfo[playerid][e_Rot]);
+	}
+
+	if (s_DeathTimer[playerid] != -1) {
+		KillTimer(s_DeathTimer[playerid]);
+		s_DeathTimer[playerid] = -1;
+	}
+
+	if (s_IsDying[playerid]) {
+		s_IsDying[playerid] = false;
+	}
+
+	if (s_PlayerHealth[playerid] == 0.0) {
+		s_PlayerHealth[playerid] = s_PlayerMaxHealth[playerid];
+	}
+
+	UpdatePlayerVirtualWorld(playerid);
+	UpdateHealthBar(playerid, true);
+	FreezeSyncData(playerid, false);
+	SetFakeFacingAngle(playerid, _);
+	DamageFeedUpdate(playerid);
+
+	if (GetPlayerTeam(playerid) != 0xFE) {
+		SetPlayerTeam(playerid, 0xFE);
+	}
+
+	if (s_DeathSkip[playerid] == 2) {
+		DebugMessage(playerid, "Death skipped");
+		SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
+		GivePlayerWeapon(playerid, 0, 1);
+		SetPlayerArmedWeapon(playerid, 0);
+		ClearAnimations(playerid);
+		ApplyAnimation(playerid, "PED", "IDLE_stance", 4.1, 1, 0, 0, 0, 1, 1);
+
+		s_DeathSkip[playerid] = 1;
+		s_DeathSkipTick[playerid] = GetTickCount();
+
+		return 1;
+	}
+
+	if (s_FirstSpawn[playerid]) {
+		s_FirstSpawn[playerid] = false;
+
+		#if WC_CUSTOM_VENDING_MACHINES
+			if (s_CustomVendingMachines) {
+				ApplyAnimation(playerid, "VENDING", "null", 0, 0, 0, 0, 0, 0);
+			}
+		#endif
+	}
+
+	#if defined WC_OnPlayerSpawn
+		return WC_OnPlayerSpawn(playerid);
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerRequestClass(playerid, classid)
+{
+	DebugMessage(playerid, "Requested class: %d", classid);
+
+	if (s_DeathSkip[playerid]) {
+		DebugMessage(playerid, "Skipping death - class selection skipped");
+		SpawnPlayer(playerid);
+
+		return 0;
+	}
+
+	if (s_ForceClassSelection[playerid]) {
+		s_ForceClassSelection[playerid] = false;
+	}
+
+	if (s_BeingResynced[playerid]) {
+		s_TrueDeath[playerid] = false;
+
+		SpawnPlayerInPlace(playerid);
+
+		return 0;
+	}
+
+	if (s_DeathTimer[playerid] != -1) {
+		KillTimer(s_DeathTimer[playerid]);
+		s_DeathTimer[playerid] = -1;
+	}
+
+	if (s_IsDying[playerid]) {
+		OnPlayerDeathFinished(playerid, false);
+		s_IsDying[playerid] = false;
+	}
+
+	FreezeSyncData(playerid, false);
+	UpdatePlayerVirtualWorld(playerid);
+
+	if (s_TrueDeath[playerid]) {
+		if (!s_InClassSelection[playerid]) {
+			DebugMessage(playerid, "True death class selection");
+
+			new Float:x, Float:y, Float:z;
+			GetPlayerPos(playerid, x, y, z);
+			RemoveBuildingForPlayer(playerid, 1484, x, y, z, 350.0),
+			RemoveBuildingForPlayer(playerid, 1485, x, y, z, 350.0),
+			RemoveBuildingForPlayer(playerid, 1486, x, y, z, 350.0);
+
+			s_InClassSelection[playerid] = true;
+		}
+
+		#if defined WC_OnPlayerRequestClass
+			if (WC_OnPlayerRequestClass(playerid, classid)) {
+				s_PlayerClass[playerid] = classid;
+
+				return 1;
+			} else {
+				return 0;
+			}
+		#else
+			s_PlayerClass[playerid] = classid;
+
+			return 1;
+		#endif
+	} else {
+		DebugMessage(playerid, "Not true death - being respawned");
+
+		s_ForceClassSelection[playerid] = true;
+
+		SpawnPlayerInPlace(playerid);
+
+		return 0;
+	}
+}
+
+public OnPlayerDeath(playerid, killerid, reason)
+{
+	s_TrueDeath[playerid] = true;
+	s_InClassSelection[playerid] = false;
+
+	#if WC_CUSTOM_VENDING_MACHINES
+		if (s_VendingUseTimer[playerid] != -1) {
+			KillTimer(s_VendingUseTimer[playerid]);
+			s_VendingUseTimer[playerid] = -1;
+		}
+	#endif
+
+	if (s_BeingResynced[playerid] || s_ForceClassSelection[playerid]) {
+		return 1;
+	}
+
+	// Probably fake death
+	if (killerid != INVALID_PLAYER_ID && !IsPlayerStreamedIn(killerid, playerid)) {
+		killerid = INVALID_PLAYER_ID;
+	}
+
+	DebugMessageRedAll("OnPlayerDeath(%d died by %d from %d)", playerid, reason, killerid);
+
+	if (s_DeathTimer[playerid] != -1) {
+		KillTimer(s_DeathTimer[playerid]);
+	}
+
+	if (s_IsDying[playerid]) {
+		DebugMessageRedAll("death while dying %d", playerid);
+
+		return 1;
+	}
+
+	// WEAPON_UNKNOWN
+	if (reason < 0 || reason > 55) {
+		reason = 55;
+	}
+
+	new vehicleid = GetPlayerVehicleID(playerid);
+
+	// Let's assume they died from an exploading vehicle
+	if (vehicleid) {
+		reason = WEAPON_EXPLOSION;
+		killerid = INVALID_PLAYER_ID;
+
+		if (!HasSameTeam(playerid, s_LastVehicleShooter[vehicleid])) {
+			killerid = s_LastVehicleShooter[vehicleid];
+		}
+	}
+
+	new Float:amount = 0.0;
+	new bodypart = BODY_PART_UNKNOWN;
+
+	if (reason == WEAPON_PARACHUTE) {
+		reason = WEAPON_COLLISION;
+	}
+
+	if (OnPlayerDamage(playerid, amount, killerid, reason, bodypart)) {
+		if (reason < 0 || reason > WEAPON_UNKNOWN) {
+			reason = WEAPON_UNKNOWN;
+		}
+
+		if (amount == 0.0) {
+			amount = s_PlayerHealth[playerid] + s_PlayerArmour[playerid];
+		}
+
+		if (reason == WEAPON_COLLISION || reason == WEAPON_DROWN || reason == WEAPON_CARPARK) {
+			if (amount <= 0.0) {
+				amount = s_PlayerHealth[playerid];
+			}
+
+			s_PlayerHealth[playerid] -= amount;
+		} else {
+			if (amount <= 0.0) {
+				amount = s_PlayerHealth[playerid] + s_PlayerArmour[playerid];
+			}
+
+			s_PlayerArmour[playerid] -= amount;
+		}
+
+		if (s_PlayerArmour[playerid] < 0.0) {
+			s_DamageDoneArmour[playerid] = amount + s_PlayerArmour[playerid];
+			s_DamageDoneHealth[playerid] = -s_PlayerArmour[playerid];
+			s_PlayerHealth[playerid] += s_PlayerArmour[playerid];
+			s_PlayerArmour[playerid] = 0.0;
+		} else {
+			s_DamageDoneArmour[playerid] = amount;
+			s_DamageDoneHealth[playerid] = 0.0;
+		}
+
+		if (s_PlayerHealth[playerid] <= 0.0) {
+			amount += s_PlayerHealth[playerid];
+			s_DamageDoneHealth[playerid] += s_PlayerHealth[playerid];
+			s_PlayerHealth[playerid] = 0.0;
+		}
+
+		OnPlayerDamageDone(playerid, amount, killerid, reason, bodypart);
+	}
+
+	if (s_PlayerHealth[playerid] <= 0.0005) {
+		s_PlayerHealth[playerid] = 0.0;
+		s_IsDying[playerid] = true;
+
+		new animlib[32], animname[32], anim_lock, respawn_time;
+
+		OnPlayerPrepareDeath(playerid, animlib, animname, anim_lock, respawn_time);
+
+		#if defined WC_OnPlayerDeath
+			WC_OnPlayerDeath(playerid, killerid, reason);
+		#endif
+
+		OnPlayerDeathFinished(playerid, false);
+	} else {
+		if (vehicleid || WasPlayerInVehicle(playerid, 10000)) {
+			new Float:x, Float:y, Float:z, Float:r;
+
+			GetPlayerPos(playerid, x, y, z);
+			SetPlayerPos(playerid, x, y, z);
+			SaveSyncData(playerid);
+
+			if (vehicleid) {
+				GetVehicleZAngle(vehicleid, r);
+			} else {
+				GetPlayerFacingAngle(playerid, r);
+			}
+
+			s_DeathSkip[playerid] = 2;
+
+			ForceClassSelection(playerid);
+			SetSpawnInfo(playerid, 0xFE, GetPlayerSkin(playerid), x, y, z, r, 0, 0, 0, 0, 0, 0);
+			TogglePlayerSpectating(playerid, true);
+			TogglePlayerSpectating(playerid, false);
+			SetSpawnInfo(playerid, 0xFE, GetPlayerSkin(playerid), x, y, z, r, 0, 0, 0, 0, 0, 0);
+			TogglePlayerControllable(playerid, true);
+			GivePlayerWeapon(playerid, 1, 1);
+		} else {
+			SpawnPlayerInPlace(playerid);
+		}
+	}
+
+	UpdateHealthBar(playerid);
+
+	return 1;
+}
+
+static Float:AngleBetweenPoints(Float:x1, Float:y1, Float:x2, Float:y2);
+
+forward WC_CbugPunishment(playerid, weapon);
+public WC_CbugPunishment(playerid, weapon) {
+	FreezeSyncData(playerid, false);
+	ClearAnimations(playerid, 1);
+	GivePlayerWeapon(playerid, weapon, 0);
+}
+
+public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
+{
+	if (!s_CbugAllowed && !IsPlayerDying(playerid) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
+		if (newkeys & KEY_CROUCH) {
+			new tick = GetTickCount();
+			new diff = tick - s_LastShot[playerid][e_Tick];
+
+			if (s_LastShot[playerid][e_Tick] && diff < 1200 && !s_CbugFroze[playerid]) {
+				PlayerPlaySound(playerid, 1055, 0.0, 0.0, 0.0);
+
+				if (s_LastShot[playerid][e_Valid] && floatabs(s_LastShot[playerid][e_HX]) > 1.0 && floatabs(s_LastShot[playerid][e_HY]) > 1.0) {
+					SetPlayerFacingAngle(playerid, AngleBetweenPoints(
+						s_LastShot[playerid][e_HX],
+						s_LastShot[playerid][e_HY],
+						s_LastShot[playerid][e_OX],
+						s_LastShot[playerid][e_OY]
+					));
+				}
+
+				new w, a;
+				GetPlayerWeaponData(playerid, 0, w, a);
+
+				ClearAnimations(playerid, 1);
+				ApplyAnimation(playerid, "PED", "IDLE_stance", 4.1, 1, 0, 0, 0, 0, 1);
+				FreezeSyncData(playerid, true);
+				GivePlayerWeapon(playerid, w, 0);
+				SetTimerEx("WC_CbugPunishment", 600, false, "ii", playerid, GetPlayerWeapon(playerid));
+
+				s_CbugFroze[playerid] = tick;
+
+				for (new i = 0; i < MAX_PLAYERS; i++) {
+					if (!IsPlayerConnected(i) && !IsPlayerDying(i)) {
+						continue;
+					}
+
+					for (new j = 0; j < sizeof(s_PreviousHits[]); j++) {
+						if (s_PreviousHits[i][j][e_Issuer] == playerid && tick - s_PreviousHits[i][j][e_Tick] <= 1200) {
+							s_PreviousHits[i][j][e_Issuer] = INVALID_PLAYER_ID;
+
+							new Float:health = WC_GetPlayerHealth(i);
+							new Float:armour = WC_GetPlayerArmour(i);
+
+							if (s_IsDying[i]) {
+								if (s_DelayedDeathTimer[i] == -1) {
+									continue;
+								}
+
+								KillTimer(s_DelayedDeathTimer[i]);
+								s_DelayedDeathTimer[i] = -1;
+								ClearAnimations(i, 1);
+								SetFakeFacingAngle(i, _);
+								FreezeSyncData(i, false);
+
+								s_IsDying[i] = false;
+
+								if (s_DeathTimer[i] != -1) {
+									KillTimer(s_DeathTimer[i]);
+									s_DeathTimer[i] = -1;
+								}
+							}
+
+							health += s_PreviousHits[i][j][e_Health];
+							armour += s_PreviousHits[i][j][e_Armour];
+
+							WC_SetPlayerHealth(i, health, armour);
+						}
+					}
+				}
+			}
+		}
+	}
+
+	if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
+		#if WC_CUSTOM_VENDING_MACHINES
+			if (s_CustomVendingMachines
+			 && newkeys == KEY_SECONDARY_ATTACK
+			 && !oldkeys
+			 && s_VendingUseTimer[playerid] == -1
+			 && GetPlayerAnimationIndex(playerid) != 1660) {
+				new bool:failed = false;
+
+				if (GetPlayerMoney(playerid) <= 0 || s_PlayerHealth[playerid] >= s_PlayerMaxHealth[playerid]) {
+					failed = true;
+				}
+
+				new Float:z;
+
+				GetPlayerPos(playerid, z, z, z);
+
+				for (new i = 0; i < sizeof(sc_VendingMachines); i++) {
+					if (floatabs(z - sc_VendingMachines[i][e_PosZ]) > 1.5) {
+						continue;
+					}
+
+					if (IsPlayerInRangeOfPoint(playerid, 0.5, sc_VendingMachines[i][e_FrontX], sc_VendingMachines[i][e_FrontY], z)) {
+						if (failed) {
+							PlayerPlaySound(playerid, 1055, 0.0, 0.0, 0.0);
+							break;
+						}
+
+						new Float:health_given = 35.0;
+
+						if (OnPlayerUseVendingMachine(playerid, health_given)) {
+							s_VendingUseTimer[playerid] = SetTimerEx("WC_VendingMachineUsed", 2500, false, "if", playerid, health_given);
+
+							SetPlayerFacingAngle(playerid, sc_VendingMachines[i][e_RotZ]);
+							SetPlayerPos(playerid, sc_VendingMachines[i][e_FrontX], sc_VendingMachines[i][e_FrontY], z);
+							ApplyAnimation(playerid, "VENDING", "VEND_USE", 4.1, 0, 0, 1, 0, 0, 1);
+
+							PlayerPlaySound(playerid, 42600, 0.0, 0.0, 0.0);
+						} else {
+							PlayerPlaySound(playerid, 1055, 0.0, 0.0, 0.0);
+						}
+
+						break;
+					}
+				}
+			}
+		#endif
+
+		if (newkeys & KEY_FIRE) {
+			new weap = GetPlayerWeapon(playerid);
+
+			switch (weap) {
+				case WEAPON_BOMB, WEAPON_SATCHEL: {
+					s_LastExplosive[playerid] = WEAPON_SATCHEL;
+				}
+
+				case WEAPON_ROCKETLAUNCHER, WEAPON_HEATSEEKER, WEAPON_GRENADE: {
+					s_LastExplosive[playerid] = weap;
+				}
+			}
+		}
+	}
+
+	#if defined WC_OnPlayerKeyStateChange
+		return WC_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerStreamIn(playerid, forplayerid)
+{
+	// Send ped floor_hit_f
+	if (s_IsDying[playerid]) {
+		SendLastSyncData(playerid, forplayerid, 0x2e040000 + 1150);
+	}
+
+	#if defined WC_OnPlayerStreamIn
+		return WC_OnPlayerStreamIn(playerid, forplayerid);
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
+{
+	#if WC_CUSTOM_VENDING_MACHINES
+		if (s_VendingUseTimer[playerid] != -1) {
+			KillTimer(s_VendingUseTimer[playerid]);
+			s_VendingUseTimer[playerid] = -1;
+		}
+	#endif
+
+	s_LastVehicleEnterTime[playerid] = gettime();
+	s_LastVehicleTick[playerid] = GetTickCount();
+
+	#if defined WC_OnPlayerEnterVehicle
+		return WC_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerExitVehicle(playerid, vehicleid)
+{
+	s_LastVehicleTick[playerid] = GetTickCount();
+
+	#if defined WC_OnPlayerExitVehicle
+		return WC_OnPlayerExitVehicle(playerid, vehicleid);
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerStateChange(playerid, newstate, oldstate)
+{
+	if (s_Spectating[playerid] != INVALID_PLAYER_ID && newstate != PLAYER_STATE_SPECTATING) {
+		s_Spectating[playerid] = INVALID_PLAYER_ID;
+	}
+
+	#if WC_CUSTOM_VENDING_MACHINES
+		if (s_VendingUseTimer[playerid] != -1) {
+			KillTimer(s_VendingUseTimer[playerid]);
+			s_VendingUseTimer[playerid] = -1;
+		}
+	#endif
+
+	if (s_IsDying[playerid] && (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)) {
+		TogglePlayerControllable(playerid, false);
+	}
+
+	if (oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) {
+		s_LastVehicleTick[playerid] = GetTickCount();
+
+		if (newstate == PLAYER_STATE_ONFOOT) {
+			new Float:vx, Float:vy, Float:vz;
+			GetPlayerVelocity(playerid, vx, vy, vz);
+
+			if (vx*vx + vy*vy + vz*vz <= 0.05) {
+				for (new i = 0; i < MAX_PLAYERS; i++) {
+					if (i != playerid && IsPlayerConnected(i) && IsPlayerStreamedIn(playerid, i)) {
+						SendLastSyncData(playerid, i);
+						ClearAnimationsForPlayer(playerid, i);
+					}
+				}
+			}
+		}
+	}
+
+	switch (newstate) {
+		case PLAYER_STATE_ONFOOT,
+		     PLAYER_STATE_DRIVER,
+		     PLAYER_STATE_PASSENGER: {
+			SetHealthBarVisible(playerid, true);
+		}
+
+		default: {
+			SetHealthBarVisible(playerid, false);
+		}
+	}
+
+	#if defined WC_OnPlayerStateChange
+		return WC_OnPlayerStateChange(playerid, newstate, oldstate);
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerPickUpPickup(playerid, pickupid)
+{
+	if (!IsPlayerSpawned(playerid)) {
+		return 0;
+	}
+
+	#if defined WC_OnPlayerPickUpPickup
+		return WC_OnPlayerPickUpPickup(playerid, pickupid);
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerUpdate(playerid)
+{
+	if (s_IsDying[playerid]) {
+		return 1;
+	}
+
+	if (s_DeathSkip[playerid] == 1) {
+		if (s_DeathSkipTick[playerid]) {
+			if (GetTickCount() - s_DeathSkipTick[playerid] > 1000) {
+				new Float:x, Float:y, Float:z, Float:r;
+
+				GetPlayerPos(playerid, x, y, z);
+				GetPlayerFacingAngle(playerid, r);
+
+				SetSpawnInfo(playerid, 0xFE, GetPlayerSkin(playerid), x, y, z, r, 0, 0, 0, 0, 0, 0);
+
+				s_DeathSkipTick[playerid] = 0;
+
+				ApplyAnimation(playerid, "PED", "IDLE_stance", 4.1, 1, 0, 0, 0, 1, 1);
+			}
+		} else {
+			if (GetPlayerAnimationIndex(playerid) != 1189) {
+				s_DeathSkip[playerid] = 0;
+
+				WC_DeathSkipEnd(playerid);
+
+				DebugMessage(playerid, "Death skip end");
+			}
+		}
+	}
+
+	if (s_SpawnForStreamedIn[playerid]) {
+		WC_SpawnForStreamedIn(playerid);
+
+		s_SpawnForStreamedIn[playerid] = false;
+	}
+
+	new tick = GetTickCount();
+
+	s_LastUpdate[playerid] = tick;
+
+	// Detect fall damage based on velocity and animation
+	if (s_CustomFallDamage) {
+		new Float:vz, Float:z;
+
+		GetPlayerVelocity(playerid, vz, vz, vz);
+		GetPlayerPos(playerid, z, z, z);
+
+		new surfing = GetPlayerSurfingVehicleID(playerid);
+
+		if (surfing && surfing == INVALID_VEHICLE_ID) {
+			surfing = GetPlayerSurfingObjectID(playerid) != INVALID_OBJECT_ID;
+		} else {
+			surfing = 1;
+		}
+
+		if (surfing || tick - s_LastStop[playerid] < 2000) {
+			vz = 0.0;
+			s_LastZVelo[playerid] = 0.0;
+		} else {
+			if (vz != 0.0) {
+				s_LastZVelo[playerid] = vz;
+			}
+
+			if (z - s_LastZ[playerid] > 1.0) {
+				s_LastZVelo[playerid] = 0.1;
+				vz = 0.1;
+			}
+		}
+
+		s_LastZ[playerid] = z;
+
+		new anim = GetPlayerAnimationIndex(playerid);
+
+		if (anim != s_LastAnim[playerid]) {
+			new prev = s_LastAnim[playerid];
+			s_LastAnim[playerid] = anim;
+
+			if (((prev == 1130 && vz == 0.0) || 1128 <= anim <= 1134 || anim == 1208)) {
+				new Float:amount = -1.0;
+				DebugMessage(playerid, "vz: %f anim: %d prev: %d", vz, anim, prev);
+
+				vz = s_LastZVelo[playerid];
+
+				if (vz <= s_FallDeathVelocity) {
+					amount = 0.0;
+				} else if (vz <= -0.2) {
+					if (vz == -0.2) {
+						amount = s_WeaponDamage[WEAPON_COLLISION] * 0.2;
+					} else {
+						amount = (vz + 0.2) / (s_FallDeathVelocity + 0.2);
+						amount *= s_WeaponDamage[WEAPON_COLLISION];
+					}
+				}
+
+				if (GetPlayerWeapon(playerid) == WEAPON_PARACHUTE && anim == 1134) {
+					amount = -1.0;
+				}
+
+				if (amount >= 0.0) {
+					DebugMessage(playerid, "fall dmg: %.5f (vz: %f, anim: %d, prev: %d)", amount, vz, anim, prev);
+
+					InflictDamage(playerid, amount, INVALID_PLAYER_ID, WEAPON_COLLISION, 3);
+
+					if (amount == 0.0) {
+						amount = s_PlayerHealth[playerid];
+					}
+				}
+			}
+		}
+	}
+
+	#if defined WC_OnPlayerUpdate
+		return WC_OnPlayerUpdate(playerid);
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
+{
+	if (!IsHighRateWeapon(weaponid)) {
+		DebugMessage(playerid, "OnPlayerGiveDamage(%d gave %f to %d using %d on bodypart %d)", playerid, amount, damagedid, weaponid, bodypart);
+	}
+
+	// Nobody got damaged
+	if (damagedid == INVALID_PLAYER_ID) {
+		#if defined OnInvalidWeaponDamage
+			OnInvalidWeaponDamage(playerid, damagedid, amount, weaponid, bodypart, WC_NO_DAMAGED, true);
+		#endif
+
+		AddRejectedHit(playerid, damagedid, HIT_NO_DAMAGEDID, weaponid);
+
+		return 0;
+	}
+
+	if (s_IsDying[damagedid]) {
+		AddRejectedHit(playerid, damagedid, HIT_DYING_PLAYER, weaponid);
+		return 0;
+	}
+
+	if (!s_LagCompMode) {
+		new npc = IsPlayerNPC(damagedid);
+
+		if (weaponid == WEAPON_KNIFE && _:amount == _:0.0) {
+			if (s_KnifeTimeout[damagedid] != -1) {
+				KillTimer(s_KnifeTimeout[damagedid]);
+			}
+
+			s_KnifeTimeout[damagedid] = SetTimerEx("WC_SetSpawnForStreamedIn", 2500, false, "i", damagedid);
+		}
+
+		if (!npc) {
+			return 0;
+		}
+	}
+
+	// Ignore unreliable and invalid damage
+	if (weaponid < 0 || weaponid >= sizeof(s_ValidDamageGiven) || !s_ValidDamageGiven[weaponid]) {
+		// Fire is synced as taken damage (because it's not reliable as given), so no need to show a rejected hit.
+		// Vehicle damage is also synced as taken, so no need to show that either.
+		if (weaponid != WEAPON_FLAMETHROWER && weaponid != WEAPON_VEHICLE) {
+			AddRejectedHit(playerid, damagedid, HIT_INVALID_WEAPON, weaponid);
+		}
+
+		return 0;
+	}
+
+	if (!IsPlayerSpawned(playerid)) {
+		// Make sure the rejected hit wasn't added in OnPlayerWeaponShot
+		if (!IsBulletWeapon(weaponid) || s_LastShot[playerid][e_Valid]) {
+			AddRejectedHit(playerid, damagedid, HIT_NOT_SPAWNED, weaponid);
+		}
+
+		return 0;
+	}
+
+	new npc = IsPlayerNPC(damagedid);
+
+	// From stealth knife, can be any weapon
+	if (_:amount == _:1833.33154296875) {
+		return 0;
+	}
+
+	if (weaponid == WEAPON_KNIFE) {
+		if (_:amount == _:0.0) {
+			// Resync without bothering the player being knifed
+			if (npc || HasSameTeam(playerid, damagedid)) {
+				if (s_KnifeTimeout[damagedid] != -1) {
+					KillTimer(s_KnifeTimeout[damagedid]);
+				}
+
+				s_KnifeTimeout[damagedid] = SetTimerEx("WC_SpawnForStreamedIn", 150, false, "i", damagedid);
+				ClearAnimations(playerid, 1);
+				SetPlayerArmedWeapon(playerid, 0);
+
+				return 0;
+			}
+
+			if (!OnPlayerDamage(damagedid, amount, playerid, weaponid, bodypart)) {
+				if (s_KnifeTimeout[damagedid] != -1) {
+					KillTimer(s_KnifeTimeout[damagedid]);
+				}
+
+				s_KnifeTimeout[damagedid] = SetTimerEx("WC_SpawnForStreamedIn", 150, false, "i", damagedid);
+				ClearAnimations(playerid, 1);
+				SetPlayerArmedWeapon(playerid, 0);
+
+				return 0;
+			}
+
+			s_DamageDoneHealth[playerid] = s_PlayerHealth[playerid];
+			s_DamageDoneArmour[playerid] = s_PlayerArmour[playerid];
+
+			OnPlayerDamageDone(damagedid, s_PlayerHealth[damagedid] + s_PlayerArmour[damagedid], playerid, weaponid, bodypart);
+
+			ClearAnimations(damagedid, 1);
+
+			PlayerDeath(damagedid, "KNIFE", "KILL_Knife_Ped_Damage", _, 5200);
+
+			SetTimerEx("WC_SecondKnifeAnim", 2200, false, "i", damagedid);
+
+			#if defined WC_OnPlayerDeath
+				WC_OnPlayerDeath(damagedid, playerid, weaponid);
+			#endif
+
+			DebugMessage(damagedid, "being knifed by %d", playerid);
+			DebugMessage(playerid, "knifing %d", damagedid);
+
+			new Float:x, Float:y, Float:z, Float:a;
+
+			GetPlayerFacingAngle(damagedid, a);
+			SetPlayerFacingAngle(playerid, a);
+			PosInFront(damagedid, -1.0, x, y, z);
+
+			SetPlayerVelocity(damagedid, 0.0, 0.0, 0.0);
+			SetPlayerVelocity(playerid, 0.0, 0.0, 0.0);
+
+			new forcesync = 2;
+
+			if (747 < GetPlayerAnimationIndex(playerid) > 748) {
+				DebugMessageRed(playerid, "applying knife anim for you too (current: %d)", GetPlayerAnimationIndex(playerid));
+
+				forcesync = 1;
+			}
+
+			ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Player", 4.1, 0, 1, 1, 0, 1800, forcesync);
+
+			return 0;
+		}
+	}
+
+	if (HasSameTeam(playerid, damagedid)) {
+		AddRejectedHit(playerid, damagedid, HIT_SAME_TEAM, weaponid);
+		return 0;
+	}
+
+	// Both players should see eachother
+	if ((!IsPlayerStreamedIn(playerid, damagedid) && !IsPlayerPaused(damagedid)) || !IsPlayerStreamedIn(damagedid, playerid)) {
+		AddRejectedHit(playerid, damagedid, HIT_UNSTREAMED, weaponid, damagedid);
+		return 0;
+	}
+
+	new Float:bullets, err;
+
+	if ((err = ProcessDamage(damagedid, playerid, amount, weaponid, bodypart, bullets))) {
+		if (err == WC_INVALID_DAMAGE) {
+			AddRejectedHit(playerid, damagedid, HIT_INVALID_DAMAGE, weaponid, _:amount);
+		}
+
+		if (err != WC_INVALID_DISTANCE) {
+			#if defined OnInvalidWeaponDamage
+				OnInvalidWeaponDamage(playerid, damagedid, amount, weaponid, bodypart, err, true);
+			#endif
+		}
+
+		return 0;
+	}
+
+	new tick = GetTickCount();
+	if (tick == 0) tick = 1;
+
+	new idx = (s_LastHitIdx[playerid] + 1) % sizeof(s_LastHitTicks[]);
+
+	// JIT plugin fix
+	if (idx < 0) {
+		idx += sizeof(s_LastHitTicks[]);
+	}
+
+	s_LastHitIdx[playerid] = idx;
+	s_LastHitTicks[playerid][idx] = tick;
+	s_LastHitWeapons[playerid][idx] = weaponid;
+	s_HitsIssued[playerid] += 1;
+
+	#if WC_DEBUG
+		if (s_HitsIssued[playerid] > 1) {
+			new prev_tick_idx = (idx - 1) % sizeof(s_LastHitTicks[]);
+
+			// JIT plugin fix
+			if (prev_tick_idx < 0) {
+				prev_tick_idx += sizeof(s_LastHitTicks[]);
+			}
+
+			new prev_tick = s_LastHitTicks[playerid][prev_tick_idx];
+
+			DebugMessage(playerid, "(hit) last: %d last 3: %d", tick - prev_tick, AverageHitRate(playerid, 3));
+		}
+	#endif
+
+	new multiple_weapons;
+	new avg_rate = AverageHitRate(playerid, s_MaxHitRateSamples, multiple_weapons);
+
+	// Hit issue flood?
+	// Could be either a cheat or just lag
+	if (avg_rate != -1) {
+		if (multiple_weapons) {
+			if (avg_rate < 100) {
+				AddRejectedHit(playerid, damagedid, HIT_RATE_TOO_FAST_MULTIPLE, weaponid, avg_rate, s_MaxHitRateSamples);
+				return 0;
+			}
+		} else if (s_MaxWeaponShootRate[weaponid] - avg_rate > 20) {
+			AddRejectedHit(playerid, damagedid, HIT_RATE_TOO_FAST, weaponid, avg_rate, s_MaxHitRateSamples, s_MaxWeaponShootRate[weaponid]);
+			return 0;
+		}
+	}
+
+	if (IsBulletWeapon(weaponid) && _:amount != _:2.6400001049041748046875 && !(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0)) {
+		new valid = true;
+
+		if (!s_LastShot[playerid][e_Valid]) {
+			//AddRejectedHit(playerid, damagedid, HIT_LAST_SHOT_INVALID, weaponid);
+			valid = false;
+			DebugMessageRed(playerid, "last shot not valid");
+		} else if (WEAPON_SHOTGUN <= weaponid <= WEAPON_SHOTGSPA) {
+			// Let's assume someone won't hit 3 players with 1 shotgun shot, and that one OnPlayerWeaponShot can be out of sync
+			if (s_LastShot[playerid][e_Hits] >= 3) {
+				valid = false;
+				AddRejectedHit(playerid, damagedid, HIT_MULTIPLE_PLAYERS_SHOTGUN, weaponid, s_LastShot[playerid][e_Hits] + 1);
+			}
+		} else if (s_LastShot[playerid][e_Hits] > 0) {
+			// Sniper doesn't always send OnPlayerWeaponShot
+			if (s_LastShot[playerid][e_Hits] > 4 && weaponid != WEAPON_SNIPER) {
+				valid = false;
+				AddRejectedHit(playerid, damagedid, HIT_MULTIPLE_PLAYERS, weaponid, s_LastShot[playerid][e_Hits] + 1);
+			} else {
+				DebugMessageRed(playerid, "hit %d players with 1 shot", s_LastShot[playerid][e_Hits] + 1);
+			}
+		}
+
+		s_LastShot[playerid][e_Hits] += 1;
+
+		if (!valid) {
+			return 0;
+		}
+	}
+
+	if (npc) {
+		OnPlayerDamageDone(damagedid, amount, playerid, weaponid, bodypart);
+	} else {
+		InflictDamage(damagedid, amount, playerid, weaponid, bodypart);
+	}
+
+	// Don't send OnPlayerGiveDamage to the rest of the script, since it should not be used
+	return 0;
+}
+
+public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
+{
+	UpdateHealthBar(playerid, true);
+
+	if (s_IsDying[playerid]) {
+		return 0;
+	}
+
+	if (s_BeingResynced[playerid]) {
+		return 0;
+	}
+
+	if (!IsHighRateWeapon(weaponid)) {
+		DebugMessage(playerid, "OnPlayerTakeDamage(%d took %f from %d by %d on bodypart %d)", playerid, amount, issuerid, weaponid, bodypart);
+	}
+
+	// Ignore unreliable and invalid damage
+	if (weaponid < 0 || weaponid >= sizeof(s_ValidDamageTaken) || !s_ValidDamageTaken[weaponid]) {
+		return 0;
+	}
+
+	if (playerid == INVALID_PLAYER_ID || IsPlayerNPC(playerid)) {
+		return 0;
+	}
+
+	// Carjack damage
+	if (weaponid == 54 && _:amount == _:0.0) {
+		return 0;
+	}
+
+	// From stealth knife, can be any weaponid
+	if (_:amount == _:1833.33154296875) {
+		return 0;
+	}
+
+	// Climb bug
+	if (weaponid == WEAPON_COLLISION) {
+		if (s_CustomFallDamage) {
+			return 0;
+		}
+
+		new anim = GetPlayerAnimationIndex(playerid);
+
+		if (1061 <= anim <= 1067) {
+			DebugMessage(playerid, "climb bug prevented");
+			return 0;
+		}
+	}
+
+	// Being knifed client-side
+	if (weaponid == WEAPON_KNIFE) {
+		if (s_IsDying[playerid]) {
+			return 0;
+		}
+
+		// With the plugin, this part is never actually used (it can't happen)
+		if (_:amount == _:0.0) {
+			if (s_KnifeTimeout[playerid] != -1) {
+				KillTimer(s_KnifeTimeout[playerid]);
+
+				s_KnifeTimeout[playerid] = -1;
+			}
+
+			if (issuerid == INVALID_PLAYER_ID || HasSameTeam(playerid, issuerid)) {
+				ResyncPlayer(playerid);
+
+				return 0;
+			}
+
+			if (!OnPlayerDamage(playerid, amount, issuerid, weaponid, bodypart)) {
+				ResyncPlayer(playerid);
+
+				return 0;
+			}
+
+			// Make sure the values were not modified
+			weaponid = WEAPON_KNIFE;
+			amount = 0.0;
+
+			s_DamageDoneHealth[playerid] = s_PlayerHealth[playerid];
+			s_DamageDoneArmour[playerid] = s_PlayerArmour[playerid];
+
+			OnPlayerDamageDone(playerid, s_PlayerHealth[playerid] + s_PlayerArmour[playerid], issuerid, weaponid, bodypart);
+
+			PlayerDeath(playerid, "KNIFE", "KILL_Knife_Ped_Die", _, 4000 - GetPlayerPing(playerid));
+
+			#if defined WC_OnPlayerDeath
+				WC_OnPlayerDeath(playerid, issuerid, weaponid);
+			#endif
+
+			SetPlayerHealth(playerid, Float:0x7f7fffff);
+
+			DebugMessage(playerid, "being knifed by %d", issuerid);
+			DebugMessage(issuerid, "knifing %d", playerid);
+
+			new Float:x, Float:y, Float:z, Float:a;
+
+			GetPlayerFacingAngle(playerid, a);
+			SetPlayerFacingAngle(issuerid, a);
+			PosInFront(playerid, -1.0, x, y, z);
+
+			SetPlayerVelocity(playerid, 0.0, 0.0, 0.0);
+			SetPlayerVelocity(issuerid, 0.0, 0.0, 0.0);
+
+			new forcesync = 2;
+
+			if (GetPlayerAnimationIndex(issuerid) != 747) {
+				DebugMessageRed(issuerid, "applying knife anim for you too (current: %d)", GetPlayerAnimationIndex(issuerid));
+
+				forcesync = 1;
+			}
+
+			ApplyAnimation(issuerid, "KNIFE", "KILL_Knife_Player", 4.1, 0, 1, 1, 0, 1800, forcesync);
+
+			return 0;
+		}
+	}
+
+	// If it's lagcomp, only allow damage that's valid for both modes
+	if (s_LagCompMode && s_ValidDamageTaken[weaponid] != 2) {
+		if (issuerid != INVALID_PLAYER_ID && IsPlayerInAnyVehicle(issuerid) && GetPlayerVehicleSeat(issuerid) == 0 && (weaponid == WEAPON_M4 || weaponid == WEAPON_MINIGUN)) {
+			weaponid = weaponid == WEAPON_M4 ? WEAPON_VEHICLE_M4 : WEAPON_VEHICLE_MINIGUN;
+		} else {
+			return 0;
+		}
+	}
+
+	// Should still be damaged by grenades or fire after someone has died
+	if (issuerid != INVALID_PLAYER_ID) {
+		if (HasSameTeam(playerid, issuerid)) {
+			return 0;
+		}
+
+		if (s_IsDying[issuerid] && (IsBulletWeapon(weaponid) || IsMeleeWeapon(weaponid))) {
+			DebugMessageRed(playerid, "shot/punched by dead player (%d)", issuerid);
+
+			return 0;
+		}
+
+		if (s_BeingResynced[issuerid]) {
+			return 0;
+		}
+	}
+
+	new Float:bullets = 0.0, err;
+
+	if ((err = ProcessDamage(playerid, issuerid, amount, weaponid, bodypart, bullets))) {
+		if (err == WC_INVALID_DAMAGE) {
+			AddRejectedHit(issuerid, playerid, HIT_INVALID_DAMAGE, weaponid, _:amount);
+		}
+
+		if (err != WC_INVALID_DISTANCE) {
+			#if defined OnInvalidWeaponDamage
+				OnInvalidWeaponDamage(issuerid, playerid, amount, weaponid, bodypart, err, false);
+			#endif
+		}
+
+		return 0;
+	}
+
+	if (IsBulletWeapon(weaponid)) {
+		new Float:x, Float:y, Float:z;
+		GetPlayerPos(issuerid, x, y, z);
+		new Float:dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
+
+		if (dist > s_WeaponRange[weaponid] + 2.0) {
+			AddRejectedHit(issuerid, playerid, HIT_OUT_OF_RANGE, weaponid, _:dist, _:s_WeaponRange[weaponid]);
+			return 0;
+		}
+	}
+
+	InflictDamage(playerid, amount, issuerid, weaponid, bodypart);
+
+	return 0;
+}
+
+public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
+{
+	#if WC_CUSTOM_VENDING_MACHINES
+		if (s_VendingUseTimer[playerid] != -1) {
+			KillTimer(s_VendingUseTimer[playerid]);
+			s_VendingUseTimer[playerid] = -1;
+		}
+	#endif
+
+	s_LastShot[playerid][e_Valid] = false;
+	s_LastShot[playerid][e_Hits] = false;
+
+	if (s_CbugFroze[playerid] && GetTickCount() - s_CbugFroze[playerid] < 900) {
+		return 0;
+	}
+
+	s_CbugFroze[playerid] = 0;
+
+	new damagedid = INVALID_PLAYER_ID;
+
+	if (hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID) {
+		if (!IsPlayerConnected(hitid)) {
+			AddRejectedHit(playerid, hitid, HIT_DISCONNECTED, weaponid, hitid);
+
+			return 0;
+		}
+
+		damagedid = hitid;
+	}
+
+	if (hittype < 0 || hittype > 5) {
+		AddRejectedHit(playerid, damagedid, HIT_INVALID_HITTYPE, weaponid, hittype);
+
+		return 0;
+	}
+
+	#if WC_DEBUG
+		if (hittype == BULLET_HIT_TYPE_PLAYER) {
+			DebugMessage(playerid, "OnPlayerWeaponShot(%d shot %d with %d at %f, %f, %f)", playerid, hitid, weaponid, fX, fY, fZ);
+		} else if (hittype) {
+			DebugMessage(playerid, "OnPlayerWeaponShot(%d shot %d %d with %d at %f, %f, %f)", playerid, hittype, hitid, weaponid, fX, fY, fZ);
+		} else {
+			DebugMessage(playerid, "OnPlayerWeaponShot(%d shot with %d at %f, %f, %f)", playerid, weaponid, fX, fY, fZ);
+		}
+	#endif
+
+	if (s_BeingResynced[playerid]) {
+		AddRejectedHit(playerid, damagedid, HIT_BEING_RESYNCED, weaponid);
+
+		return 0;
+	}
+
+	if (!IsPlayerSpawned(playerid)) {
+		AddRejectedHit(playerid, damagedid, HIT_NOT_SPAWNED, weaponid);
+
+		return 0;
+	}
+
+	if (!IsBulletWeapon(weaponid)) {
+		AddRejectedHit(playerid, damagedid, HIT_INVALID_WEAPON, weaponid);
+
+		return 0;
+	}
+
+	new Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ;
+	new Float:x, Float:y, Float:z;
+
+	GetPlayerPos(playerid, x, y, z);
+	GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
+
+	new Float:length = VectorSize(fOriginX - fHitPosX, fOriginY - fHitPosY, fOriginZ - fHitPosZ);
+	new Float:origin_dist = VectorSize(fOriginX - x, fOriginY - y, fOriginZ - z);
+
+	if (origin_dist > 15.0) {
+		new in_veh = IsPlayerInAnyVehicle(hitid) || GetPlayerSurfingVehicleID(playerid);
+
+		if ((!in_veh && GetPlayerSurfingVehicleID(playerid) == INVALID_VEHICLE_ID) || origin_dist > 50.0) {
+			AddRejectedHit(playerid, damagedid, HIT_TOO_FAR_FROM_ORIGIN, weaponid, _:origin_dist);
+
+			return 0;
+		}
+	}
+
+	// Shot exceeding the max range?
+	if (hittype != BULLET_HIT_TYPE_NONE) {
+		if (length > s_WeaponRange[weaponid]) {
+			if (hittype == BULLET_HIT_TYPE_PLAYER) {
+				AddRejectedHit(playerid, damagedid, HIT_OUT_OF_RANGE, weaponid, _:length, _:s_WeaponRange[weaponid]);
+			}
+
+			return 0;
+		}
+
+		if (hittype == BULLET_HIT_TYPE_PLAYER) {
+			if (IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleID(playerid) == GetPlayerVehicleID(hitid)) {
+				AddRejectedHit(playerid, damagedid, HIT_SAME_VEHICLE, weaponid);
+				return 0;
+			}
+
+			new Float:dist = GetPlayerDistanceFromPoint(hitid, fHitPosX, fHitPosY, fHitPosZ);
+			new in_veh = IsPlayerInAnyVehicle(hitid);
+
+			if ((!in_veh && dist > 20.0) || dist > 50.0) {
+				AddRejectedHit(playerid, damagedid, HIT_TOO_FAR_FROM_SHOT, weaponid, _:dist);
+
+				return 0;
+			}
+		}
+	}
+
+	new tick = GetTickCount();
+	if (tick == 0) tick = 1;
+
+	new idx = (s_LastShotIdx[playerid] + 1) % sizeof(s_LastShotTicks[]);
+
+	// JIT plugin fix
+	if (idx < 0) {
+		idx += sizeof(s_LastShotTicks[]);
+	}
+
+	s_LastShotIdx[playerid] = idx;
+	s_LastShotTicks[playerid][idx] = tick;
+	s_LastShotWeapons[playerid][idx] = weaponid;
+	s_ShotsFired[playerid] += 1;
+
+	#if WC_DEBUG
+		if (s_ShotsFired[playerid] > 1) {
+			new prev_tick_idx = (idx - 1) % sizeof(s_LastShotTicks[]);
+
+			// JIT plugin fix
+			if (prev_tick_idx < 0) {
+				prev_tick_idx += sizeof(s_LastShotTicks[]);
+			}
+
+			new prev_tick = s_LastShotTicks[playerid][prev_tick_idx];
+
+			DebugMessage(playerid, "(shot) last: %d last 3: %d", tick - prev_tick, AverageShootRate(playerid, 3));
+		}
+	#endif
+
+	s_LastShot[playerid][e_Tick] = tick;
+	s_LastShot[playerid][e_Weapon] = weaponid;
+	s_LastShot[playerid][e_HitType] = hittype;
+	s_LastShot[playerid][e_HitId] = hitid;
+	s_LastShot[playerid][e_X] = fX;
+	s_LastShot[playerid][e_Y] = fY;
+	s_LastShot[playerid][e_Z] = fZ;
+	s_LastShot[playerid][e_OX] = fOriginX;
+	s_LastShot[playerid][e_OY] = fOriginY;
+	s_LastShot[playerid][e_OZ] = fOriginZ;
+	s_LastShot[playerid][e_HX] = fHitPosX;
+	s_LastShot[playerid][e_HY] = fHitPosY;
+	s_LastShot[playerid][e_HZ] = fHitPosZ;
+	s_LastShot[playerid][e_Length] = length;
+	s_LastShot[playerid][e_Hits] = 0;
+
+	new multiple_weapons;
+	new avg_rate = AverageShootRate(playerid, s_MaxShootRateSamples, multiple_weapons);
+
+	// Bullet flood?
+	// Could be either a cheat or just lag
+	if (avg_rate != -1) {
+		if (multiple_weapons) {
+			if (avg_rate < 100) {
+				AddRejectedHit(playerid, damagedid, SHOOTING_RATE_TOO_FAST_MULTIPLE, weaponid, avg_rate, s_MaxShootRateSamples);
+				return 0;
+			}
+		} else if (s_MaxWeaponShootRate[weaponid] - avg_rate > 20) {
+			AddRejectedHit(playerid, damagedid, SHOOTING_RATE_TOO_FAST, weaponid, avg_rate, s_MaxShootRateSamples, s_MaxWeaponShootRate[weaponid]);
+			return 0;
+		}
+	}
+
+	// Destroy vehicles with passengers in them
+	if (hittype == BULLET_HIT_TYPE_VEHICLE) {
+		if (hitid < 0 || hitid > MAX_VEHICLES || !WC_IsValidVehicle(hitid)) {
+			AddRejectedHit(playerid, damagedid, HIT_INVALID_VEHICLE, weaponid, hitid);
+			return 0;
+		}
+
+		new vehicleid = GetPlayerVehicleID(playerid);
+
+		// Shouldn't be possible to damage the vehicle you're in
+		if (hitid == vehicleid) {
+			AddRejectedHit(playerid, damagedid, HIT_OWN_VEHICLE, weaponid);
+			return 0;
+		}
+
+		if (s_VehiclePassengerDamage) {
+			new has_driver = false;
+			new has_passenger = false;
+
+			for (new otherid = 0; otherid < MAX_PLAYERS; otherid++) {
+				if (otherid == playerid || !IsPlayerConnected(otherid)) {
+					continue;
+				}
+
+				if (GetPlayerVehicleID(otherid) != hitid) {
+					continue;
+				}
+
+				new seat = GetPlayerVehicleSeat(otherid);
+
+				if (seat == 0) {
+					has_driver = true;
+				} else {
+					has_passenger = true;
+				}
+			}
+
+			if (!has_driver && has_passenger) {
+				new Float:health;
+
+				GetVehicleHealth(hitid, health);
+
+				if (WEAPON_SHOTGUN <= weaponid <= WEAPON_SHOTGSPA) {
+					health -= 120.0;
+				} else {
+					health -= s_WeaponDamage[weaponid] * 3.0;
+				}
+
+				if (health <= 0.0) {
+					health = 0.0;
+				}
+
+				SetVehicleHealth(hitid, health);
+			}
+		}
+
+		if (s_VehicleUnoccupiedDamage) {
+			new has_occupent = false;
+
+			for (new otherid = 0; otherid < MAX_PLAYERS; otherid++) {
+				if (otherid == playerid || !IsPlayerConnected(otherid)) {
+					continue;
+				}
+
+				if (GetPlayerVehicleID(otherid) != hitid) {
+					continue;
+				}
+
+				has_occupent = true;
+			}
+
+			if (!has_occupent) {
+				new Float:health;
+
+				GetVehicleHealth(hitid, health);
+				if (health >= 249.0) { //vehicles start on fire at 249 or under so theres no need to check once the vehicle is at or below 250
+					if (WEAPON_SHOTGUN <= weaponid <= WEAPON_SHOTGSPA) {
+						health -= 120.0;
+					} else {
+						health -= s_WeaponDamage[weaponid] * 3.0;
+					}
+
+					if (health <= 249.0) {
+						if (s_VehicleRespawnTimer[hitid] == -1) {
+							health = 249.0;
+							s_VehicleRespawnTimer[hitid] = SetTimerEx("WC_KillVehicle", 6000, false, "ii", hitid, playerid);
+						}
+					}
+
+					SetVehicleHealth(hitid, health);
+				}
+			}
+		}
+	}
+
+	new retval = 1;
+
+	#if defined WC_OnPlayerWeaponShot
+		retval = WC_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
+	#else
+		retval = 1;
+	#endif
+
+	s_LastShot[playerid][e_Valid] = !!retval;
+
+	// Valid shot?
+	if (retval) {
+		if (hittype == BULLET_HIT_TYPE_VEHICLE) {
+			s_LastVehicleShooter[hitid] = playerid;
+		}
+	}
+
+	return retval;
+}
+
+forward WC_KillVehicle(vehicleid, killerid);
+public WC_KillVehicle(vehicleid, killerid)
+{
+	OnVehicleDeath(vehicleid, killerid);
+	s_VehicleRespawnTimer[vehicleid] = SetTimerEx("WC_OnDeadVehicleSpawn", 10000, false, "i", vehicleid);
+	return 1;
+}
+
+
+forward WC_OnDeadVehicleSpawn(vehicleid);
+public WC_OnDeadVehicleSpawn(vehicleid)
+{
+	s_VehicleRespawnTimer[vehicleid] = -1;
+	return SetVehicleToRespawn(vehicleid);
+}
+
+
+
+public OnVehicleSpawn(vehicleid)
+{
+	if (s_VehicleRespawnTimer[vehicleid] != -1) {
+		KillTimer(s_VehicleRespawnTimer[vehicleid]);
+		s_VehicleRespawnTimer[vehicleid] = -1;
+	}
+
+	s_VehicleAlive[vehicleid] = true;
+
+
+	#if defined WC_OnVehicleSpawn
+		return WC_OnVehicleSpawn(vehicleid);
+	#else
+		return 1;
+	#endif
+}
+
+
+public OnVehicleDeath(vehicleid, killerid)
+{
+	if (s_VehicleRespawnTimer[vehicleid] != -1) {
+		KillTimer(s_VehicleRespawnTimer[vehicleid]);
+		s_VehicleRespawnTimer[vehicleid] = -1;
+	}
+	if (s_VehicleAlive[vehicleid]) {
+		s_VehicleAlive[vehicleid] = false;
+
+		#if defined WC_OnVehicleDeath
+			return WC_OnVehicleDeath(vehicleid, killerid);
+		#else
+			return 1;
+		#endif
+	}
+	return 1;
+}
+
+
+public OnPlayerEnterCheckpoint(playerid)
+{
+	if (!IsPlayerSpawned(playerid)) {
+		return 1;
+	}
+
+	#if defined WC_OnPlayerEnterCheckpoint
+		return WC_OnPlayerEnterCheckpoint(playerid);
+	#else
+		return 1;
+	#endif
+}
+
+public OnPlayerLeaveCheckpoint(playerid)
+{
+	// If they're dying, it will be called in PlayerDeath (when the death anim begins)
+	if (s_IsDying[playerid]) {
+		return 1;
+	}
+
+	#if defined WC_OnPlayerLeaveCheckpoint
+		return WC_OnPlayerLeaveCheckpoint(playerid);
+	#else
+		return 1;
+	#endif
+}
+
+/*
+ * Internal functions
+ */
+
+static ScriptInit()
+{
+	s_LagCompMode = GetServerVarAsInt("lagcompmode");
+
+	if (s_LagCompMode) {
+		SetKnifeSync(false);
+	} else {
+		s_DamageTakenSound = 0;
+		SetKnifeSync(true);
+	}
+
+	for (new i = 0; i < sizeof(s_ClassSpawnInfo); i++) {
+		s_ClassSpawnInfo[i][e_Skin] = -1;
+	}
+
+	s_HealthBarBorder = TextDrawCreate(610.01, 68.25, "\1");
+
+	if (s_HealthBarBorder == Text:INVALID_TEXT_DRAW) {
+		printf("(wc) WARN: Unable to create healthbar border textdraw");
+	} else {
+		s_InternalTextDraw[s_HealthBarBorder] = true;
+
+		TextDrawUseBox    (s_HealthBarBorder, 1);
+		TextDrawLetterSize(s_HealthBarBorder, 0.0, 0.64);
+		TextDrawTextSize  (s_HealthBarBorder, 543.75, 0.0);
+		TextDrawBoxColor  (s_HealthBarBorder, 0x000000FF);
+	}
+
+	s_HealthBarBackground = TextDrawCreate(608.01, 70.25, "\1");
+
+	if (s_HealthBarBackground == Text:INVALID_TEXT_DRAW) {
+		printf("(wc) WARN: Unable to create healthbar background textdraw");
+	} else {
+		s_InternalTextDraw[s_HealthBarBackground] = true;
+
+		TextDrawUseBox    (s_HealthBarBackground, 1);
+		TextDrawLetterSize(s_HealthBarBackground, 0.0, 0.2);
+		TextDrawTextSize  (s_HealthBarBackground, 545.75, 0.0);
+		TextDrawBoxColor  (s_HealthBarBackground, 0x5A0C10FF);
+	}
+
+	#if WC_CUSTOM_VENDING_MACHINES
+		if (s_CustomVendingMachines) {
+			CreateVendingMachines();
+		}
+	#endif
+
+	new tick = GetTickCount();
+
+	for (new playerid = 0; playerid < MAX_PLAYERS; playerid++) {
+		if (!IsPlayerConnected(playerid)) {
+			continue;
+		}
+
+		new team = GetPlayerTeam(playerid);
+
+		if (team == 0xFE) {
+			s_PlayerTeam[playerid] = NO_TEAM;
+		} else {
+			s_PlayerTeam[playerid] = team;
+		}
+
+		SetPlayerTeam(playerid, 0xFE);
+		DamageFeedUpdate(playerid);
+
+		new worldid = GetPlayerVirtualWorld(playerid);
+
+		if (worldid == WC_DEATH_WORLD) {
+			worldid = 0;
+
+			SetPlayerVirtualWorld(playerid, worldid);
+		}
+
+		s_World[playerid] = worldid;
+		s_LastUpdate[playerid] = tick;
+		s_DamageFeedLastUpdate[playerid] = tick;
+		s_LastStop[playerid] = tick;
+		s_LastVehicleEnterTime[playerid] = 0;
+		s_TrueDeath[playerid] = true;
+		s_InClassSelection[playerid] = true;
+		s_PlayerFallbackSpawnInfo[playerid][e_Skin] = -1;
+		s_AlreadyConnected[playerid] = true;
+
+		#if WC_CUSTOM_VENDING_MACHINES
+			RemoveDefaultVendingMachines(playerid);
+		#endif
+
+		if (PLAYER_STATE_ONFOOT <= GetPlayerState(playerid) <= PLAYER_STATE_PASSENGER) {
+			GetPlayerHealth(playerid, s_PlayerHealth[playerid]);
+			GetPlayerArmour(playerid, s_PlayerArmour[playerid]);
+
+			if (s_PlayerHealth[playerid] == 0.0) {
+				s_PlayerHealth[playerid] = s_PlayerMaxHealth[playerid];
+			}
+
+			UpdateHealthBar(playerid);
+		}
+
+		switch (GetPlayerState(playerid)) {
+			case PLAYER_STATE_ONFOOT,
+			     PLAYER_STATE_DRIVER,
+			     PLAYER_STATE_PASSENGER,
+			     PLAYER_STATE_SPAWNED: {
+				SetHealthBarVisible(playerid, true);
+			}
+
+			default: {
+				SetHealthBarVisible(playerid, false);
+			}
+		}
+	}
+}
+
+static ScriptExit()
+{
+	SetKnifeSync(true);
+
+	#if WC_CUSTOM_VENDING_MACHINES
+		DestroyVendingMachines();
+	#endif
+
+	for (new playerid = 0; playerid < MAX_PLAYERS; playerid++) {
+		#if WC_CUSTOM_VENDING_MACHINES
+			if (s_VendingUseTimer[playerid] != -1) {
+				KillTimer(s_VendingUseTimer[playerid]);
+				s_VendingUseTimer[playerid] = -1;
+			}
+		#endif
+
+		if (!IsPlayerConnected(playerid)) {
+			continue;
+		}
+
+		// Put things back the way they were
+		SetPlayerTeam(playerid, s_PlayerTeam[playerid]);
+
+		if (PLAYER_STATE_ONFOOT <= GetPlayerState(playerid) <= PLAYER_STATE_PASSENGER) {
+			new Float:health = s_PlayerHealth[playerid];
+
+			if (health == 0.0) {
+				health = s_PlayerMaxHealth[playerid];
+			}
+
+			SetPlayerHealth(playerid, health);
+			SetPlayerArmour(playerid, s_PlayerArmour[playerid]);
+		}
+
+		SetFakeHealth(playerid, 255);
+		SetFakeArmour(playerid, 255);
+		FreezeSyncData(playerid, false);
+		SetFakeFacingAngle(playerid, _);
+		SetHealthBarVisible(playerid, false);
+
+		if (s_HealthBarForeground[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+			PlayerTextDrawDestroy(playerid, s_HealthBarForeground[playerid]);
+			s_InternalPlayerTextDraw[playerid][s_HealthBarForeground[playerid]] = false;
+			s_HealthBarForeground[playerid] = PlayerText:INVALID_TEXT_DRAW;
+		}
+
+		if (s_DamageFeedGiven[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+			PlayerTextDrawDestroy(playerid, s_DamageFeedGiven[playerid]);
+			s_InternalPlayerTextDraw[playerid][s_DamageFeedGiven[playerid]] = false;
+			s_DamageFeedGiven[playerid] = PlayerText:INVALID_TEXT_DRAW;
+		}
+
+		if (s_DamageFeedTaken[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+			PlayerTextDrawDestroy(playerid, s_DamageFeedTaken[playerid]);
+			s_InternalPlayerTextDraw[playerid][s_DamageFeedTaken[playerid]] = false;
+			s_DamageFeedTaken[playerid] = PlayerText:INVALID_TEXT_DRAW;
+		}
+	}
+
+	if (s_HealthBarBorder != Text:INVALID_TEXT_DRAW) {
+		TextDrawDestroy(s_HealthBarBorder);
+		s_InternalTextDraw[s_HealthBarBorder] = false;
+	}
+
+	if (s_HealthBarBackground != Text:INVALID_TEXT_DRAW) {
+		TextDrawDestroy(s_HealthBarBackground);
+		s_InternalTextDraw[s_HealthBarBackground] = false;
+	}
+}
+
+static UpdatePlayerVirtualWorld(playerid)
+{
+	new worldid = GetPlayerVirtualWorld(playerid);
+
+	if (worldid == WC_DEATH_WORLD) {
+		worldid = s_World[playerid];
+	} else if (worldid != s_World[playerid]) {
+		s_World[playerid] = worldid;
+	}
+
+	SetPlayerVirtualWorld(playerid, worldid);
+}
+
+static HasSameTeam(playerid, otherid)
+{
+	if (otherid < 0 || otherid >= MAX_PLAYERS || playerid < 0 || playerid >= MAX_PLAYERS) {
+		return 0;
+	}
+
+	if (s_PlayerTeam[playerid] == NO_TEAM || s_PlayerTeam[otherid] == NO_TEAM) {
+		return 0;
+	}
+
+	return (s_PlayerTeam[playerid] == s_PlayerTeam[otherid]);
+}
+
+static IsPlayerPaused(playerid)
+{
+	return (GetTickCount() - s_LastUpdate[playerid] > 2000);
+}
+
+static UpdateHealthBar(playerid, bool:force = false)
+{
+	if (s_BeingResynced[playerid] || s_ForceClassSelection[playerid]) {
+		return;
+	}
+
+	new health = floatround(s_PlayerHealth[playerid] / s_PlayerMaxHealth[playerid] * 100.0, floatround_ceil);
+	new armour = floatround(s_PlayerArmour[playerid] / s_PlayerMaxArmour[playerid] * 100.0, floatround_ceil);
+
+	// Make the values reflect what the client should see
+	if (s_IsDying[playerid]) {
+		health = 0;
+		armour = 0;
+	} else {
+		if (health > 100) {
+			health = 100;
+		}
+
+		if (armour > 100) {
+			armour = 100;
+		}
+	}
+
+	if (force) {
+		s_LastSentHealth[playerid] = -1;
+		s_LastSentArmour[playerid] = -1;
+	} else if (s_HealthBarVisible[playerid] && s_HealthBarForeground[playerid] == PlayerText:INVALID_TEXT_DRAW && !s_IsDying[playerid]) {
+		s_LastSentHealth[playerid] = -1;
+	} else if (health == s_LastSentHealth[playerid] && armour == s_LastSentArmour[playerid]) {
+		return;
+	}
+
+	SetFakeHealth(playerid, health);
+	SetFakeArmour(playerid, armour);
+
+	UpdateSyncData(playerid);
+
+	if (health != s_LastSentHealth[playerid]) {
+		s_LastSentHealth[playerid] = health;
+
+		SetPlayerHealth(playerid, 8000000.0 + float(health));
+
+		if (s_HealthBarVisible[playerid] && !s_IsDying[playerid]) {
+			if (s_HealthBarForeground[playerid] == PlayerText:INVALID_TEXT_DRAW) {
+				s_HealthBarForeground[playerid] = CreatePlayerTextDraw(
+					playerid,
+					551.5 + float(health) * 0.5651,
+					70.25,
+					"\1"
+				);
+
+				if (s_HealthBarForeground[playerid] == PlayerText:INVALID_TEXT_DRAW) {
+					printf("(wc) WARN: Unable to create player healthbar foreground");
+				} else {
+					s_InternalPlayerTextDraw[playerid][s_HealthBarForeground[playerid]] = true;
+
+					PlayerTextDrawUseBox    (playerid, s_HealthBarForeground[playerid], 1);
+					PlayerTextDrawLetterSize(playerid, s_HealthBarForeground[playerid], 0.0, 0.2);
+					PlayerTextDrawTextSize  (playerid, s_HealthBarForeground[playerid], 545.75, 0.0);
+					PlayerTextDrawBoxColor  (playerid, s_HealthBarForeground[playerid], 0xB51821FF);
+
+					PlayerTextDrawShow(playerid, s_HealthBarForeground[playerid]);
+				}
+			} else {
+				PlayerTextDrawSetPosition(playerid, s_HealthBarForeground[playerid], 551.5 + float(health) * 0.5651, 70.25);
+				PlayerTextDrawShow(playerid, s_HealthBarForeground[playerid]);
+			}
+
+		} else if (s_HealthBarForeground[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+			PlayerTextDrawDestroy(playerid, s_HealthBarForeground[playerid]);
+			s_InternalPlayerTextDraw[playerid][s_HealthBarForeground[playerid]] = false;
+			s_HealthBarForeground[playerid] = PlayerText:INVALID_TEXT_DRAW;
+		}
+	}
+
+	if (armour != s_LastSentArmour[playerid]) {
+		s_LastSentArmour[playerid] = armour;
+
+		SetPlayerArmour(playerid, float(armour));
+	}
+}
+
+static SetHealthBarVisible(playerid, bool:toggle)
+{
+	if (s_HealthBarVisible[playerid] == toggle) {
+		return;
+	}
+
+	s_HealthBarVisible[playerid] = toggle;
+
+	if (toggle) {
+		if (s_HealthBarBorder != Text:INVALID_TEXT_DRAW) {
+			TextDrawShowForPlayer(playerid, s_HealthBarBorder);
+		}
+
+		if (s_HealthBarBackground != Text:INVALID_TEXT_DRAW) {
+			TextDrawShowForPlayer(playerid, s_HealthBarBackground);
+		}
+
+		UpdateHealthBar(playerid, true);
+	} else {
+		if (s_HealthBarForeground[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+			PlayerTextDrawHide(playerid, s_HealthBarForeground[playerid]);
+		}
+
+		if (s_HealthBarBorder != Text:INVALID_TEXT_DRAW) {
+			TextDrawHideForPlayer(playerid, s_HealthBarBorder);
+		}
+
+		if (s_HealthBarBackground != Text:INVALID_TEXT_DRAW) {
+			TextDrawHideForPlayer(playerid, s_HealthBarBackground);
+		}
+	}
+}
+
+static SpawnPlayerInPlace(playerid) {
+	new Float:x, Float:y, Float:z, Float:r;
+
+	GetPlayerPos(playerid, x, y, z);
+	GetPlayerFacingAngle(playerid, r);
+
+	SetSpawnInfo(playerid, 0xFE, GetPlayerSkin(playerid), x, y, z, r, 0, 0, 0, 0, 0, 0);
+
+	s_SpawnInfoModified[playerid] = true;
+
+	SpawnPlayer(playerid);
+}
+
+static PosInFront(playerid, Float:distance, &Float:x, &Float:y, &Float:z)
+{
+	new Float:a;
+
+	GetPlayerPos(playerid, x, y, z);
+	GetPlayerFacingAngle(playerid, a);
+
+	x += (distance * floatsin(-a, degrees));
+	y += (distance * floatcos(-a, degrees));
+}
+
+static Float:AngleBetweenPoints(Float:x1, Float:y1, Float:x2, Float:y2)
+{
+	return -(90.0 - atan2(y1 - y2, x1 - x2));
+}
+
+static UpdateSyncData(playerid)
+{
+	// Currently re-sending onfoot data is only supported
+	if (!IsPlayerConnected(playerid) || GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) {
+		return;
+	}
+
+	for (new i = 0; i < MAX_PLAYERS; i++) {
+		if (i != playerid && IsPlayerConnected(i) && IsPlayerStreamedIn(playerid, i)) {
+			SendLastSyncData(playerid, i);
+		}
+	}
+}
+
+static WasPlayerInVehicle(playerid, time) {
+	if (!s_LastVehicleTick[playerid]) {
+		return 0;
+	}
+
+	if (GetTickCount() - time < s_LastVehicleTick[playerid]) {
+		return 1;
+	}
+
+	return 0;
+}
+
+#if WC_CUSTOM_VENDING_MACHINES
+	static RemoveDefaultVendingMachines(playerid)
+	{
+		RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 20000.0); // CJ_EXT_SPRUNK
+		RemoveBuildingForPlayer(playerid, 956, 0.0, 0.0, 0.0, 20000.0); // CJ_EXT_CANDY
+		RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 20000.0); // vendmach
+		RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 20000.0); // vendmachfd
+		RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 20000.0); // CJ_SPRUNK1
+		RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 20000.0); // CJ_CANDYVENDOR
+		RemoveBuildingForPlayer(playerid, 1977, 0.0, 0.0, 0.0, 20000.0); // vendin3
+
+		// Make sure they're all gone..
+		for (new i = 0; i < sizeof(sc_VendingMachines); i++) {
+			RemoveBuildingForPlayer(
+				playerid,
+				sc_VendingMachines[i][e_Model],
+				sc_VendingMachines[i][e_PosX],
+				sc_VendingMachines[i][e_PosY],
+				sc_VendingMachines[i][e_PosZ],
+				1.0
+			);
+		}
+	}
+
+	static CreateVendingMachines()
+	{
+		DestroyVendingMachines();
+
+		for (new i = 0; i < sizeof(sc_VendingMachines); i++) {
+			#if WC_USE_STREAMER
+				s_VendingMachineObject[i] = CreateDynamicObject(
+					sc_VendingMachines[i][e_Model],
+					sc_VendingMachines[i][e_PosX],
+					sc_VendingMachines[i][e_PosY],
+					sc_VendingMachines[i][e_PosZ],
+					sc_VendingMachines[i][e_RotX],
+					sc_VendingMachines[i][e_RotY],
+					sc_VendingMachines[i][e_RotZ],
+					.interiorid = sc_VendingMachines[i][e_Interior]
+				);
+			#else
+				s_VendingMachineObject[i] = CreateObject(
+					sc_VendingMachines[i][e_Model],
+					sc_VendingMachines[i][e_PosX],
+					sc_VendingMachines[i][e_PosY],
+					sc_VendingMachines[i][e_PosZ],
+					sc_VendingMachines[i][e_RotX],
+					sc_VendingMachines[i][e_RotY],
+					sc_VendingMachines[i][e_RotZ]
+				);
+			#endif
+		}
+	}
+
+	static DestroyVendingMachines()
+	{
+		for (new i = 0; i < sizeof(s_VendingMachineObject); i++) {
+			if (s_VendingMachineObject[i] != -1) {
+				#if WC_USE_STREAMER
+					DestroyDynamicObject(s_VendingMachineObject[i]);
+				#else
+					DestroyObject(s_VendingMachineObject[i]);
+				#endif
+
+				s_VendingMachineObject[i] = -1;
+			}
+		}
+	}
+#endif
+
+forward WC_DeathSkipEnd(playerid);
+public WC_DeathSkipEnd(playerid)
+{
+	TogglePlayerControllable(playerid, true);
+
+	ResetPlayerWeapons(playerid);
+
+	for (new i = 0; i < 13; i++) {
+		if (s_SyncData[playerid][e_WeaponId][i]) {
+			GivePlayerWeapon(playerid, s_SyncData[playerid][e_WeaponId][i], s_SyncData[playerid][e_WeaponAmmo][i]);
+		}
+	}
+
+	GivePlayerWeapon(playerid, s_SyncData[playerid][e_Weapon], 0);
+	SetPlayerSpecialAction(playerid, 0);
+}
+
+forward WC_SpawnForStreamedIn(playerid);
+public WC_SpawnForStreamedIn(playerid)
+{
+	if (!IsPlayerConnected(playerid)) {
+		return;
+	}
+
+	SpawnPlayerForWorld(playerid);
+
+	for (new i = 0; i < MAX_PLAYERS; i++) {
+		if (i != playerid && IsPlayerConnected(i) && IsPlayerStreamedIn(playerid, i)) {
+			SendLastSyncData(playerid, i);
+			ClearAnimationsForPlayer(playerid, i);
+		}
+	}
+}
+
+forward WC_SetSpawnForStreamedIn(playerid);
+public WC_SetSpawnForStreamedIn(playerid)
+{
+	s_SpawnForStreamedIn[playerid] = true;
+}
+
+forward WC_SpawnPlayerInPlace(playerid);
+public WC_SpawnPlayerInPlace(playerid)
+{
+	SpawnPlayerInPlace(playerid);
+}
+
+static ProcessDamage(&playerid, &issuerid, &Float:amount, &weaponid, &bodypart, &Float:bullets)
+{
+	if (amount < 0.0) {
+		return WC_INVALID_DAMAGE;
+	}
+
+	// Adjust invalid amounts caused by an animation bug
+	switch (amount) {
+		case 3.63000011444091796875,
+		     5.940000057220458984375,
+		     5.610000133514404296875: {
+			amount = 2.6400001049041748046875;
+		}
+
+		case 3.30000019073486328125: {
+			if (weaponid != WEAPON_SHOTGUN && weaponid != WEAPON_SAWEDOFF) {
+				amount = 2.6400001049041748046875;
+			}
+		}
+
+		case 4.950000286102294921875: {
+			if (IsMeleeWeapon(weaponid)) {
+				amount = 2.6400001049041748046875;
+			}
+		}
+
+		case 6.270000457763671875,
+		     6.93000030517578125,
+		     7.2600002288818359375,
+		     7.9200000762939453125,
+		     8.5799999237060546875,
+		     9.24000072479248046875,
+		     11.88000011444091796875,
+		     11.22000026702880859375: {
+			amount = 2.6400001049041748046875;
+		}
+
+		case 9.90000057220458984375: {
+			switch (weaponid) {
+				case WEAPON_VEHICLE, WEAPON_VEHICLE_M4, WEAPON_AK47,
+				     WEAPON_M4, WEAPON_SHOTGUN, WEAPON_SAWEDOFF, WEAPON_SHOTGSPA: {}
+
+				default: {
+					amount = 6.6000003814697265625;
+				}
+			}
+		}
+	}
+
+	// Car parking
+	if (weaponid == WEAPON_HELIBLADES && _:amount != _:330.0) {
+		weaponid = WEAPON_CARPARK;
+	}
+
+	// Finish processing drown/fire/carpark quickly, since they are sent at very high rates
+	if (IsHighRateWeapon(weaponid)) {
+		// Apply reasonable bounds
+		if (weaponid == WEAPON_DROWN) {
+			if (amount > 10.0) amount = 10.0;
+		} else if (amount > 1.0) {
+			amount = 1.0;
+		}
+
+		// Adjust the damage if the multiplier is not 1.0
+		if (_:s_WeaponDamage[weaponid] != _:1.0) {
+			amount *= s_WeaponDamage[weaponid];
+		}
+
+		// Make sure the distance and issuer is valid; carpark can be self-inflicted so it doesn't require an issuer
+		if (weaponid == WEAPON_SPRAYCAN || weaponid == WEAPON_FIREEXTINGUISHER || (weaponid == WEAPON_CARPARK && issuerid != INVALID_PLAYER_ID)) {
+			if (issuerid == INVALID_PLAYER_ID) {
+				return WC_NO_ISSUER;
+			}
+
+			new Float:x, Float:y, Float:z, Float:dist;
+			GetPlayerPos(issuerid, x, y, z);
+			dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
+
+			if (dist > 15.0) {
+				AddRejectedHit(issuerid, playerid, HIT_TOO_FAR_FROM_ORIGIN, weaponid, _:dist);
+				return WC_INVALID_DISTANCE;
+			}
+		}
+
+		return WC_NO_ERROR;
+	}
+
+	// Bullet or melee damage must have an issuerid, otherwise something has gone wrong (e.g. sniper bug)
+	if (issuerid == INVALID_PLAYER_ID && (IsBulletWeapon(weaponid) || IsMeleeWeapon(weaponid))) {
+		return WC_NO_ISSUER;
+	}
+
+	// Punching with a parachute
+	if (weaponid == WEAPON_PARACHUTE) {
+		weaponid = WEAPON_UNARMED;
+	}
+
+	// Collision damage should never be above 165
+	if (weaponid == WEAPON_COLLISION) {
+		if (amount > 165.0) {
+			amount = 1.0;
+		} else {
+			amount /= 165.0;
+		}
+	}
+
+	if (weaponid == WEAPON_EXPLOSION) {
+		// Explosions do at most 82.5 damage. This will later be multipled by the damage value
+		amount /= 82.5;
+
+		// Figure out what caused the explosion
+		if (issuerid != INVALID_PLAYER_ID && s_LastExplosive[issuerid]) {
+			weaponid = s_LastExplosive[issuerid];
+		}
+	}
+
+	// Check for pistol whip
+	switch (weaponid) {
+		case WEAPON_COLT45 .. WEAPON_SNIPER,
+		     WEAPON_MINIGUN, WEAPON_SPRAYCAN, WEAPON_FIREEXTINGUISHER: {
+			// A pistol whip inflicts 2.64 damage
+			if (_:amount == _:2.6400001049041748046875) {
+				// Save the weapon in the bodypart argument (it's always BODY_PART_TORSO)
+				bodypart = weaponid;
+				weaponid = WEAPON_PISTOLWHIP;
+			}
+		}
+	}
+
+	new melee = IsMeleeWeapon(weaponid);
+
+	// Can't punch from a vehicle
+	if (melee && IsPlayerInAnyVehicle(issuerid)) {
+		return WC_INVALID_DAMAGE;
+	}
+
+	if (weaponid != WEAPON_PISTOLWHIP) {
+		switch (amount) {
+			case 1.32000005245208740234375,
+			     1.650000095367431640625,
+			     1.980000019073486328125,
+			     2.3100001811981201171875,
+			     2.6400001049041748046875,
+			     2.9700000286102294921875,
+			     3.96000003814697265625,
+			     4.28999996185302734375,
+			     4.62000036239624023437,
+			     5.280000209808349609375: {
+				// Damage is most likely from punching and switching weapon quickly
+				if (!melee) {
+					DebugMessage(issuerid, "weapon changed from %d to melee (punch & swap)", weaponid);
+					weaponid = WEAPON_UNARMED;
+					melee = true;
+				}
+			}
+
+			case 6.6000003814697265625: {
+				if (!melee) {
+					switch (weaponid) {
+						case WEAPON_UZI, WEAPON_TEC9, WEAPON_CHAINSAW,
+						     WEAPON_SHOTGUN, WEAPON_SAWEDOFF: {}
+
+						default: {
+							DebugMessage(issuerid, "weapon changed from %d to melee (punch & swap)", weaponid);
+							weaponid = WEAPON_UNARMED;
+							melee = true;
+						}
+					}
+				}
+			}
+
+			case 54.12000274658203125: {
+				if (!melee) {
+					DebugMessage(issuerid, "weapon changed from %d to melee (punch & swap)", weaponid);
+					melee = true;
+					weaponid = WEAPON_UNARMED;
+					amount = 1.32000005245208740234375;
+				}
+
+				// Be extra sure about this one
+				if (GetPlayerFightingStyle(issuerid) != FIGHT_STYLE_KNEEHEAD) {
+					return WC_INVALID_DAMAGE;
+				}
+			}
+
+			// Melee damage has been tampered with
+			default: {
+				if (melee) {
+					return WC_INVALID_DAMAGE;
+				}
+			}
+		}
+	}
+
+	if (melee) {
+		new Float:x, Float:y, Float:z, Float:dist;
+		GetPlayerPos(issuerid, x, y, z);
+		dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
+
+		if (dist > 15.0) {
+			AddRejectedHit(issuerid, playerid, HIT_TOO_FAR_FROM_ORIGIN, weaponid, _:dist);
+			return WC_INVALID_DISTANCE;
+		}
+	}
+
+	switch (weaponid) {
+		// The spas shotguns shoot 8 bullets, each inflicting 4.95 damage
+		case WEAPON_SHOTGSPA: {
+			bullets = amount / 4.950000286102294921875;
+
+			if (8.0 - bullets < -0.05) {
+				return WC_INVALID_DAMAGE;
+			}
+		}
+
+		// Shotguns and sawed-off shotguns shoot 15 bullets, each inflicting 3.3 damage
+		case WEAPON_SHOTGUN, WEAPON_SAWEDOFF: {
+			bullets = amount / 3.30000019073486328125;
+
+			if (15.0 - bullets < -0.05) {
+				return WC_INVALID_DAMAGE;
+			}
+		}
+	}
+
+	if (_:bullets) {
+		new Float:f = floatfract(bullets);
+
+		// The damage for each bullet has been tampered with
+		if (f > 0.01 && f < 0.99) {
+			return WC_INVALID_DAMAGE;
+		}
+
+		// Divide the damage amount by the number of bullets
+		amount /= bullets;
+	}
+
+	// Check chainsaw damage
+	if (weaponid == WEAPON_CHAINSAW) {
+		switch (amount) {
+			case 6.6000003814697265625,
+			     13.5300006866455078125,
+			     16.1700000762939453125,
+			     26.40000152587890625,
+			     27.060001373291015625: {}
+
+			default: {
+				return WC_INVALID_DAMAGE;
+			}
+		}
+	}
+	
+	// Check deagle damage
+	if (weaponid == WEAPON_DEAGLE) {
+		switch (amount) {
+			case 46.200000762939453125,
+			     23.1000003814697265625: {}
+
+			default: {
+				return WC_INVALID_DAMAGE;
+			}
+		}
+	}
+
+	// Check gun damage
+	new Float:def_amount = 0.0;
+
+	switch (weaponid) {
+		case WEAPON_COLT45,
+		     WEAPON_MP5: def_amount = 8.25;
+		case WEAPON_SILENCED: def_amount = 13.200000762939453125;
+		case WEAPON_UZI,
+		     WEAPON_TEC9: def_amount = 6.6000003814697265625;
+		case WEAPON_AK47,
+		     WEAPON_M4,
+		     WEAPON_VEHICLE_M4: def_amount = 9.90000057220458984375;
+		case WEAPON_RIFLE: def_amount = 24.7500019073486328125;
+		case WEAPON_SNIPER: def_amount = 41.25;
+		case WEAPON_MINIGUN,
+		     WEAPON_VEHICLE_MINIGUN: def_amount = 46.200000762939453125;
+		case WEAPON_VEHICLE: def_amount = 9.90000057220458984375;
+	}
+
+	if (_:def_amount && _:def_amount != _:amount) {
+		return WC_INVALID_DAMAGE;
+	}
+
+	// Adjust the damage
+	switch (s_DamageType[weaponid]) {
+		case DAMAGE_TYPE_MULTIPLIER: {
+			if (_:s_WeaponDamage[weaponid] != _:1.0) {
+				amount *= s_WeaponDamage[weaponid];
+			}
+		}
+
+		case DAMAGE_TYPE_STATIC: {
+			if (_:bullets) {
+				amount = s_WeaponDamage[weaponid] * bullets;
+			} else {
+				amount = s_WeaponDamage[weaponid];
+			}
+		}
+
+		case DAMAGE_TYPE_RANGE,
+		     DAMAGE_TYPE_RANGE_MULTIPLIER: {
+			new Float:length = s_LastShot[issuerid][e_Length];
+
+			for (new i = s_DamageRangeSteps[weaponid] - 1; i >= 0; i--) {
+				if (i == 0 || length >= s_DamageRangeRanges[weaponid][i]) {
+					if (s_DamageType[weaponid] == DAMAGE_TYPE_RANGE_MULTIPLIER) {
+						if (_:s_DamageRangeValues[weaponid][i] != _:1.0) {
+							amount *= s_DamageRangeValues[weaponid][i];
+						}
+					} else {
+						if (_:bullets) {
+							amount = s_DamageRangeValues[weaponid][i] * bullets;
+						} else {
+							amount = s_DamageRangeValues[weaponid][i];
+						}
+					}
+
+					break;
+				}
+			}
+		}
+	}
+
+	return WC_NO_ERROR;
+}
+
+static InflictDamage(playerid, Float:amount, issuerid = INVALID_PLAYER_ID, weaponid = WEAPON_UNKNOWN, bodypart = BODY_PART_UNKNOWN, bool:ignore_armour = false)
+{
+	if (!IsPlayerSpawned(playerid) || amount < 0.0) {
+		return;
+	}
+
+	if (!OnPlayerDamage(playerid, amount, issuerid, weaponid, bodypart)) {
+		UpdateHealthBar(playerid);
+
+		if (weaponid < 0 || weaponid > WEAPON_UNKNOWN) {
+			weaponid = WEAPON_UNKNOWN;
+		}
+
+		#if WC_DEBUG
+			new Float:length = 0.0;
+
+			if (issuerid != INVALID_PLAYER_ID) {
+				if (IsBulletWeapon(weaponid)) {
+					length = s_LastShot[issuerid][e_Length];
+				}
+			}
+
+			if (!IsHighRateWeapon(weaponid)) {
+				DebugMessageAll("!InflictDamage(%d, %.4f, %d, %d, %d) length = %f", playerid, amount, issuerid, weaponid, bodypart, length);
+			}
+		#endif
+
+		return;
+	}
+
+	if (weaponid < 0 || weaponid > WEAPON_UNKNOWN) {
+		weaponid = WEAPON_UNKNOWN;
+	}
+
+	#if WC_DEBUG
+		new Float:length = 0.0;
+
+		if (issuerid != INVALID_PLAYER_ID) {
+			if (IsBulletWeapon(weaponid)) {
+				length = s_LastShot[issuerid][e_Length];
+			}
+		}
+
+		if (!IsHighRateWeapon(weaponid)) {
+			DebugMessageAll("InflictDamage(%d, %.4f, %d, %d, %d) length = %f", playerid, amount, issuerid, weaponid, bodypart, length);
+		}
+	#endif
+
+	if (!ignore_armour && weaponid != WEAPON_COLLISION && weaponid != WEAPON_DROWN && weaponid != WEAPON_CARPARK && (!s_DamageArmourToggle[0] || (s_DamageArmour[weaponid][0] && (!s_DamageArmourToggle[1] || ((s_DamageArmour[weaponid][1] && bodypart == 3) || (!s_DamageArmour[weaponid][1])))))) {
+		if (amount <= 0.0) {
+			amount = s_PlayerHealth[playerid] + s_PlayerArmour[playerid];
+		}
+
+		s_PlayerArmour[playerid] -= amount;
+	} else {
+		if (amount <= 0.0) {
+			amount = s_PlayerHealth[playerid];
+		}
+
+		s_PlayerHealth[playerid] -= amount;
+	}
+
+	if (s_PlayerArmour[playerid] < 0.0) {
+		s_DamageDoneArmour[playerid] = amount + s_PlayerArmour[playerid];
+		s_DamageDoneHealth[playerid] = -s_PlayerArmour[playerid];
+		s_PlayerHealth[playerid] += s_PlayerArmour[playerid];
+		s_PlayerArmour[playerid] = 0.0;
+	} else {
+		s_DamageDoneArmour[playerid] = amount;
+		s_DamageDoneHealth[playerid] = 0.0;
+	}
+
+	if (s_PlayerHealth[playerid] <= 0.0) {
+		amount += s_PlayerHealth[playerid];
+		s_DamageDoneHealth[playerid] += s_PlayerHealth[playerid];
+		s_PlayerHealth[playerid] = 0.0;
+	}
+
+	OnPlayerDamageDone(playerid, amount, issuerid, weaponid, bodypart);
+
+	if (s_PlayerHealth[playerid] <= 0.0005) {
+		new vehicleid = GetPlayerVehicleID(playerid);
+
+		if (vehicleid) {
+			new modelid = GetVehicleModel(vehicleid);
+			new seat = GetPlayerVehicleSeat(playerid);
+
+			TogglePlayerControllable(playerid, false);
+
+			switch (modelid) {
+				case 509, 481, 510, 462, 448, 581, 522,
+				     461, 521, 523, 463, 586, 468, 471: {
+					new Float:vx, Float:vy, Float:vz;
+					GetVehicleVelocity(vehicleid, vx, vy, vz);
+
+					if (vx*vx + vy*vy + vz*vz >= 0.4) {
+						PlayerDeath(playerid, "PED", "BIKE_fallR", 0);
+					} else {
+						PlayerDeath(playerid, "PED", "BIKE_fall_off", 0);
+					}
+				}
+
+				default: {
+					if (seat & 1) {
+						PlayerDeath(playerid, "PED", "CAR_dead_LHS");
+					} else {
+						PlayerDeath(playerid, "PED", "CAR_dead_RHS");
+					}
+				}
+			}
+		} else if (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) {
+			PlayerDeath(playerid, "PED", "KO_skid_back", .freeze_sync = false);
+		} else {
+			if (gettime() - s_LastVehicleEnterTime[playerid] < 10) {
+				TogglePlayerControllable(playerid, false);
+			}
+
+			new anim = GetPlayerAnimationIndex(playerid);
+
+			if (anim == 1250 || (1538 <= anim <= 1544) || weaponid == WEAPON_DROWN) {
+				// In water
+				PlayerDeath(playerid, "PED", "Drown");
+			} else if (1195 <= anim <= 1198) {
+				// Jumping animation
+				PlayerDeath(playerid, "PED", "KO_skid_back");
+			} else if (WEAPON_SHOTGUN <= weaponid <= WEAPON_SHOTGSPA) {
+				if (IsPlayerBehindPlayer(issuerid, playerid)) {
+					MakePlayerFacePlayer(playerid, issuerid, true);
+					PlayerDeath(playerid, "PED", "KO_shot_front");
+				} else {
+					MakePlayerFacePlayer(playerid, issuerid);
+					PlayerDeath(playerid, "PED", "BIKE_fall_off");
+				}
+			} else if (WEAPON_RIFLE <= weaponid <= WEAPON_SNIPER) {
+				if (bodypart == 9) {
+					PlayerDeath(playerid, "PED", "KO_shot_face");
+				} else if (IsPlayerBehindPlayer(issuerid, playerid)) {
+					PlayerDeath(playerid, "PED", "KO_shot_front");
+				} else {
+					PlayerDeath(playerid, "PED", "KO_shot_stom");
+				}
+			} else if (IsBulletWeapon(weaponid)) {
+				if (bodypart == 9) {
+					PlayerDeath(playerid, "PED", "KO_shot_face");
+				} else {
+					PlayerDeath(playerid, "PED", "KO_shot_front");
+				}
+			} else if (weaponid == WEAPON_PISTOLWHIP) {
+				PlayerDeath(playerid, "PED", "KO_spin_R");
+			} else if (IsMeleeWeapon(weaponid) || weaponid == WEAPON_CARPARK) {
+				PlayerDeath(playerid, "PED", "KO_skid_front");
+			} else if (weaponid == WEAPON_SPRAYCAN || weaponid == WEAPON_FIREEXTINGUISHER) {
+				PlayerDeath(playerid, "KNIFE", "KILL_Knife_Ped_Die");
+			} else {
+				PlayerDeath(playerid, "PED", "KO_skid_back");
+			}
+		}
+
+		#if defined WC_OnPlayerDeath
+			if (s_CbugAllowed) {
+				WC_OnPlayerDeath(playerid, issuerid, weaponid);
+			} else {
+				s_DelayedDeathTimer[playerid] = SetTimerEx(#WC_DelayedDeath, 1200, false, "iii", playerid, issuerid, weaponid);
+			}
+		#endif
+	}
+
+	UpdateHealthBar(playerid);
+}
+
+forward WC_DelayedDeath(playerid, issuerid, reason);
+public WC_DelayedDeath(playerid, issuerid, reason) {
+	s_DelayedDeathTimer[playerid] = -1;
+
+	#if defined WC_OnPlayerDeath
+		WC_OnPlayerDeath(playerid, issuerid, reason);
+	#endif
+}
+
+static PlayerDeath(playerid, animlib[32], animname[32], anim_lock = 0, respawn_time = -1, bool:freeze_sync = true, anim_freeze = 1)
+{
+	s_PlayerHealth[playerid] = 0.0;
+	s_PlayerArmour[playerid] = 0.0;
+	s_IsDying[playerid] = true;
+
+	new action = GetPlayerSpecialAction(playerid);
+
+	if (action && action != SPECIAL_ACTION_DUCK) {
+		if (action == SPECIAL_ACTION_USEJETPACK) {
+			ClearAnimations(playerid);
+		}
+
+		SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
+
+		if (action == SPECIAL_ACTION_USEJETPACK) {
+			new Float:vx, Float:vy, Float:vz;
+			GetPlayerVelocity(playerid, vx, vy, vz);
+			SetPlayerVelocity(playerid, vx, vy, vz);
+		}
+	}
+
+	OnPlayerPrepareDeath(playerid, animlib, animname, anim_lock, respawn_time);
+
+	UpdateHealthBar(playerid);
+	FreezeSyncData(playerid, freeze_sync);
+
+	if (respawn_time == -1) {
+		respawn_time = s_RespawnTime;
+	}
+
+	if (animlib[0] && animname[0]) {
+		ApplyAnimation(playerid, animlib, animname, 4.1, 0, anim_lock, anim_lock, anim_freeze, 0, 1);
+	}
+
+	if (s_DeathTimer[playerid] != -1) {
+		KillTimer(s_DeathTimer[playerid]);
+	}
+
+	s_DeathTimer[playerid] = SetTimerEx("WC_PlayerDeathRespawn", respawn_time, false, "i", playerid);
+
+	if (s_HealthBarForeground[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+		PlayerTextDrawHide(playerid, s_HealthBarForeground[playerid]);
+	}
+
+	#if defined WC_OnPlayerLeaveCheckpoint
+		if (IsPlayerInCheckpoint(playerid)) {
+			WC_OnPlayerLeaveCheckpoint(playerid);
+		}
+	#endif
+}
+
+public OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time)
+{
+	#if defined WC_OnPlayerPrepareDeath
+		WC_OnPlayerPrepareDeath(playerid, animlib, animname, anim_lock, respawn_time);
+	#endif
+}
+
+public OnRejectedHit(playerid, hit[E_REJECTED_HIT])
+{
+	#if WC_DEBUG
+		new output[256];
+		new reason = hit[e_Reason];
+		new i1 = hit[e_Info1];
+		new i2 = hit[e_Info2];
+		new i3 = hit[e_Info3];
+		new weapon = hit[e_Weapon];
+
+		new weapon_name[32];
+
+		WC_GetWeaponName(weapon, weapon_name);
+
+		format(output, sizeof(output), "(%s -> %s) %s", weapon_name, hit[e_Name], g_HitRejectReasons[reason]);
+
+		format(output, sizeof(output), output, i1, i2, i3);
+
+		DebugMessageRed(playerid, "Rejected hit: %s", output);
+	#endif
+
+	#if defined WC_OnRejectedHit
+		WC_OnRejectedHit(playerid, hit);
+	#endif
+}
+
+public OnPlayerDeathFinished(playerid, bool:cancelable)
+{
+	if (s_PlayerHealth[playerid] == 0.0) {
+		s_PlayerHealth[playerid] = s_PlayerMaxHealth[playerid];
+	}
+
+	if (s_DeathTimer[playerid] != -1) {
+		KillTimer(s_DeathTimer[playerid]);
+		s_DeathTimer[playerid] = -1;
+	}
+
+	#if defined WC_OnPlayerDeathFinished
+		new retval = WC_OnPlayerDeathFinished(playerid, cancelable);
+
+		if (!retval && cancelable) {
+			return 0;
+		}
+	#endif
+
+	ResetPlayerWeapons(playerid);
+
+	return 1;
+}
+
+#if WC_CUSTOM_VENDING_MACHINES
+	public OnPlayerUseVendingMachine(playerid, &Float:health_given) {
+		#if defined WC_OnPlayerUseVendingMachine
+			return WC_OnPlayerUseVendingMachine(playerid, health_given);
+		#else
+			if (GetPlayerMoney(playerid) > 0) {
+				GivePlayerMoney(playerid, -1);
+
+				return 1;
+			} else {
+				return 0;
+			}
+		#endif
+	}
+
+	forward WC_VendingMachineUsed(playerid, Float:health_given);
+	public WC_VendingMachineUsed(playerid, Float:health_given)
+	{
+		s_VendingUseTimer[playerid] = -1;
+
+		if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && !s_IsDying[playerid]) {
+			new Float:health = s_PlayerHealth[playerid];
+
+			health += health_given;
+
+			if (health > s_PlayerMaxHealth[playerid]) {
+				health = s_PlayerMaxHealth[playerid];
+			}
+
+			WC_SetPlayerHealth(playerid, health);
+		}
+	}
+#endif
+
+forward WC_DamageFeedUpdate(playerid);
+public WC_DamageFeedUpdate(playerid)
+{
+	s_DamageFeedTimer[playerid] = -1;
+
+	if (IsPlayerConnected(playerid) && IsDamageFeedActive(playerid)) {
+		DamageFeedUpdate(playerid, true);
+	}
+}
+
+static DamageFeedUpdate(playerid, bool:modified = false)
+{
+	if (!IsDamageFeedActive(playerid)) {
+		if (s_DamageFeedGiven[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+			PlayerTextDrawDestroy(playerid, s_DamageFeedGiven[playerid]);
+			s_InternalPlayerTextDraw[playerid][s_DamageFeedGiven[playerid]] = false;
+			s_DamageFeedGiven[playerid] = PlayerText:INVALID_TEXT_DRAW;
+		}
+
+		if (s_DamageFeedTaken[playerid] != PlayerText:INVALID_TEXT_DRAW) {
+			PlayerTextDrawDestroy(playerid, s_DamageFeedTaken[playerid]);
+			s_InternalPlayerTextDraw[playerid][s_DamageFeedTaken[playerid]] = false;
+			s_DamageFeedTaken[playerid] = PlayerText:INVALID_TEXT_DRAW;
+		}
+
+		return;
+	}
+
+	if (s_DamageFeedGiven[playerid] == PlayerText:INVALID_TEXT_DRAW) {
+		new PlayerText:td = CreatePlayerTextDraw(playerid, 200.0, 365.0, "_");
+
+		if (td == PlayerText:INVALID_TEXT_DRAW) {
+			printf("(wc) WARN: Unable to create damage feed textdraw");
+		} else {
+			s_InternalPlayerTextDraw[playerid][td] = true;
+
+			PlayerTextDrawLetterSize(playerid, td, 0.2, 0.9);
+			PlayerTextDrawColor(playerid, td, 0x30FF50FF);
+			PlayerTextDrawFont(playerid, td, 1);
+			PlayerTextDrawSetShadow(playerid, td, 0);
+			PlayerTextDrawAlignment(playerid, td, 2);
+			PlayerTextDrawSetOutline(playerid, td, 1);
+			PlayerTextDrawBackgroundColor(playerid, td, 0x0000001A);
+
+			s_DamageFeedGiven[playerid] = td;
+		}
+	}
+
+	if (s_DamageFeedTaken[playerid] == PlayerText:INVALID_TEXT_DRAW) {
+		new PlayerText:td = CreatePlayerTextDraw(playerid, 440.0, 365.0, "_");
+
+		if (td == PlayerText:INVALID_TEXT_DRAW) {
+			printf("(wc) WARN: Unable to create damage feed textdraw");
+		} else {
+			s_InternalPlayerTextDraw[playerid][td] = true;
+
+			PlayerTextDrawLetterSize(playerid, td, 0.2, 0.9);
+			PlayerTextDrawColor(playerid, td, 0x33CCFFFF);
+			PlayerTextDrawFont(playerid, td, 1);
+			PlayerTextDrawSetShadow(playerid, td, 0);
+			PlayerTextDrawAlignment(playerid, td, 2);
+			PlayerTextDrawSetOutline(playerid, td, 1);
+			PlayerTextDrawBackgroundColor(playerid, td, 0x0000001A);
+
+			s_DamageFeedTaken[playerid] = td;
+		}
+	}
+
+	new tick = GetTickCount();
+	if (tick == 0) tick = 1;
+	new lowest_tick = tick + 1;
+
+	for (new i = 0; i < sizeof(s_DamageFeedHitsGiven[]) - 1; i++) {
+		if (!s_DamageFeedHitsGiven[playerid][i][e_Tick]) {
+			break;
+		}
+
+		if (tick - s_DamageFeedHitsGiven[playerid][i][e_Tick] >= s_DamageFeedHideDelay) {
+			modified = true;
+
+			for (new j = i; j < sizeof(s_DamageFeedHitsGiven[]) - 1; j++) {
+				s_DamageFeedHitsGiven[playerid][j][e_Tick] = 0;
+			}
+
+			break;
+		}
+
+		if (s_DamageFeedHitsGiven[playerid][i][e_Tick] < lowest_tick) {
+			lowest_tick = s_DamageFeedHitsGiven[playerid][i][e_Tick];
+		}
+	}
+
+	for (new i = 0; i < sizeof(s_DamageFeedHitsTaken[]) - 1; i++) {
+		if (!s_DamageFeedHitsTaken[playerid][i][e_Tick]) {
+			break;
+		}
+
+		if (tick - s_DamageFeedHitsTaken[playerid][i][e_Tick] >= s_DamageFeedHideDelay) {
+			modified = true;
+
+			for (new j = i; j < sizeof(s_DamageFeedHitsTaken[]) - 1; j++) {
+				s_DamageFeedHitsTaken[playerid][j][e_Tick] = 0;
+			}
+
+			break;
+		}
+
+		if (s_DamageFeedHitsTaken[playerid][i][e_Tick] < lowest_tick) {
+			lowest_tick = s_DamageFeedHitsTaken[playerid][i][e_Tick];
+		}
+	}
+
+	if (s_DamageFeedTimer[playerid] != -1) {
+		KillTimer(s_DamageFeedTimer[playerid]);
+	}
+
+	if (tick - s_DamageFeedLastUpdate[playerid] < s_DamageFeedMaxUpdateRate && modified) {
+		s_DamageFeedTimer[playerid] = SetTimerEx("WC_DamageFeedUpdate", s_DamageFeedMaxUpdateRate - (tick - s_DamageFeedLastUpdate[playerid]), false, "i", playerid);
+	} else {
+		if (lowest_tick == tick + 1) {
+			s_DamageFeedTimer[playerid] = -1;
+			modified = true;
+		} else {
+			s_DamageFeedTimer[playerid] = SetTimerEx("WC_DamageFeedUpdate", s_DamageFeedHideDelay - (tick - lowest_tick) + 10, false, "i", playerid);
+		}
+
+		if (modified) {
+			DamageFeedUpdateText(playerid);
+
+			s_DamageFeedLastUpdate[playerid] = tick;
+		}
+	}
+}
+
+static DamageFeedUpdateText(playerid)
+{
+	new buf[64 * WC_FEED_HEIGHT] = "";
+
+	for (new i = 0; i < sizeof(s_DamageFeedHitsGiven[]) - 1; i++) {
+		if (!s_DamageFeedHitsGiven[playerid][i][e_Tick]) {
+			break;
+		}
+
+		new weapon[32];
+
+		if (s_DamageFeedHitsGiven[playerid][i][e_Weapon] == -1) {
+			weapon = "Multiple";
+		} else {
+			WC_GetWeaponName(s_DamageFeedHitsGiven[playerid][i][e_Weapon], weapon);
+		}
+
+		if (s_DamageFeedHitsGiven[playerid][i][e_Issuer] == INVALID_PLAYER_ID) {
+			format(
+				buf,
+				sizeof(buf),
+				"%s%s +%.2f~n~",
+				buf,
+				weapon,
+				s_DamageFeedHitsGiven[playerid][i][e_Amount] + 0.009
+			);
+		} else {
+			format(
+				buf,
+				sizeof(buf),
+				"%s%s - %s +%.2f~n~",
+				buf,
+				s_DamageFeedHitsGiven[playerid][i][e_Name],
+				weapon,
+				s_DamageFeedHitsGiven[playerid][i][e_Amount] + 0.009
+			);
+		}
+	}
+
+	if (s_DamageFeedGiven[playerid] == PlayerText:INVALID_TEXT_DRAW) {
+		printf("(wc) WARN: Doesn't have feed textdraw when needed");
+	} else {
+		if (buf[0]) {
+			PlayerTextDrawSetString(playerid, s_DamageFeedGiven[playerid], buf);
+			PlayerTextDrawShow(playerid, s_DamageFeedGiven[playerid]);
+		} else {
+			PlayerTextDrawHide(playerid, s_DamageFeedGiven[playerid]);
+		}
+	}
+
+	buf = "";
+
+	for (new i = 0; i < sizeof(s_DamageFeedHitsTaken[]) - 1; i++) {
+		if (!s_DamageFeedHitsTaken[playerid][i][e_Tick]) {
+			break;
+		}
+
+		new weapon[32];
+
+		if (s_DamageFeedHitsTaken[playerid][i][e_Weapon] == -1) {
+			weapon = "Multiple";
+		} else {
+			WC_GetWeaponName(s_DamageFeedHitsTaken[playerid][i][e_Weapon], weapon);
+		}
+
+		if (s_DamageFeedHitsTaken[playerid][i][e_Issuer] == INVALID_PLAYER_ID) {
+			format(
+				buf,
+				sizeof(buf),
+				"%s%s -%.2f~n~",
+				buf,
+				weapon,
+				s_DamageFeedHitsTaken[playerid][i][e_Amount] + 0.009
+			);
+		} else {
+			format(
+				buf,
+				sizeof(buf),
+				"%s%s - %s -%.2f~n~",
+				buf,
+				s_DamageFeedHitsTaken[playerid][i][e_Name],
+				weapon,
+				s_DamageFeedHitsTaken[playerid][i][e_Amount] + 0.009
+			);
+		}
+	}
+
+	if (s_DamageFeedTaken[playerid] == PlayerText:INVALID_TEXT_DRAW) {
+		printf("(wc) WARN: Doesn't have feed textdraw when needed");
+	} else {
+		if (buf[0]) {
+			PlayerTextDrawSetString(playerid, s_DamageFeedTaken[playerid], buf);
+			PlayerTextDrawShow(playerid, s_DamageFeedTaken[playerid]);
+		} else {
+			PlayerTextDrawHide(playerid, s_DamageFeedTaken[playerid]);
+		}
+	}
+}
+
+static DamageFeedAddHitGiven(playerid, issuerid, Float:amount, weapon)
+{
+	for (new i = 0; i < MAX_PLAYERS; i++) {
+		if (s_Spectating[i] == playerid && i != playerid) {
+			DamageFeedAddHit(s_DamageFeedHitsGiven[i], i, issuerid, amount, weapon);
+		}
+	}
+
+	DamageFeedAddHit(s_DamageFeedHitsGiven[playerid], playerid, issuerid, amount, weapon);
+}
+
+static DamageFeedAddHitTaken(playerid, issuerid, Float:amount, weapon)
+{
+	for (new i = 0; i < MAX_PLAYERS; i++) {
+		if (s_Spectating[i] == playerid && i != playerid) {
+			DamageFeedAddHit(s_DamageFeedHitsTaken[i], i, issuerid, amount, weapon);
+		}
+	}
+
+	DamageFeedAddHit(s_DamageFeedHitsTaken[playerid], playerid, issuerid, amount, weapon);
+}
+
+static DamageFeedAddHit(arr[WC_FEED_HEIGHT][E_DAMAGE_FEED_HIT], playerid, issuerid, Float:amount, weapon)
+{
+	if (!IsDamageFeedActive(playerid)) {
+		return;
+	}
+
+	new tick = GetTickCount();
+	if (tick == 0) tick = 1;
+	new idx = -1;
+
+	for (new i = 0; i < sizeof(arr) - 1; i++) {
+		if (!arr[i][e_Tick]) {
+			break;
+		}
+
+		if (tick - arr[i][e_Tick] >= s_DamageFeedHideDelay) {
+			DamageFeedRemoveHit(arr, i);
+			break;
+		}
+
+		// Remove it and add it on top below
+		if (arr[i][e_Issuer] == issuerid) {
+			// Multiple weapons
+			if (arr[i][e_Weapon] != weapon) {
+				//weapon = -1;
+			}
+
+			amount += arr[i][e_Amount];
+			idx = i;
+			break;
+		}
+	}
+
+	if (idx == -1) {
+		idx = 0;
+
+		// Insert it at the top
+		for (new i = sizeof(arr) - 1; i >= 1; i--) {
+			arr[i] = arr[i - 1];
+		}
+	}
+
+	arr[idx][e_Tick] = tick;
+	arr[idx][e_Amount] = amount;
+	arr[idx][e_Issuer] = issuerid;
+	arr[idx][e_Weapon] = weapon;
+
+	GetPlayerName(issuerid, arr[idx][e_Name], MAX_PLAYER_NAME);
+
+	DamageFeedUpdate(playerid, true);
+}
+
+static DamageFeedRemoveHit(arr[WC_FEED_HEIGHT][E_DAMAGE_FEED_HIT], idx)
+{
+	for (new i = 0; i < WC_FEED_HEIGHT; i++) {
+		if (i >= idx) {
+			arr[i][e_Tick] = 0;
+		}
+	}
+}
+
+static SaveSyncData(playerid)
+{
+	GetPlayerHealth(playerid, s_SyncData[playerid][e_Health]);
+	GetPlayerArmour(playerid, s_SyncData[playerid][e_Armour]);
+
+	GetPlayerPos(playerid, s_SyncData[playerid][e_PosX], s_SyncData[playerid][e_PosY], s_SyncData[playerid][e_PosZ]);
+	GetPlayerFacingAngle(playerid, s_SyncData[playerid][e_PosA]);
+
+	s_SyncData[playerid][e_Skin] = GetPlayerSkin(playerid);
+	s_SyncData[playerid][e_Team] = GetPlayerTeam(playerid);
+
+	s_SyncData[playerid][e_Weapon] = GetPlayerWeapon(playerid);
+
+	for (new i = 0; i < 13; i++) {
+		GetPlayerWeaponData(playerid, i, s_SyncData[playerid][e_WeaponId][i], s_SyncData[playerid][e_WeaponAmmo][i]);
+	}
+}
+
+static MakePlayerFacePlayer(playerid, targetid, opposite = false, forcesync = true)
+{
+	new Float:x1, Float:y1, Float:z1;
+	new Float:x2, Float:y2, Float:z2;
+
+	GetPlayerPos(playerid, x1, y1, z1);
+	GetPlayerPos(targetid, x2, y2, z2);
+	new Float:angle = AngleBetweenPoints(x2, y2, x1, y1);
+
+	if (opposite) {
+		angle += 180.0;
+		if (angle > 360.0) angle -= 360.0;
+	}
+
+	if (angle < 0.0) angle += 360.0;
+	if (angle > 360.0) angle -= 360.0;
+
+	SetPlayerFacingAngle(playerid, angle);
+
+	if (forcesync) {
+		SetFakeFacingAngle(playerid, angle);
+		UpdateSyncData(playerid);
+	}
+}
+
+static IsPlayerBehindPlayer(playerid, targetid, Float:diff = 90.0)
+{
+	new Float:x1, Float:y1, Float:z1;
+	new Float:x2, Float:y2, Float:z2;
+	new Float:ang, Float:angdiff;
+
+	GetPlayerPos(playerid, x1, y1, z1);
+	GetPlayerPos(targetid, x2, y2, z2);
+	GetPlayerFacingAngle(targetid, ang);
+
+	angdiff = AngleBetweenPoints(x1, y1, x2, y2);
+
+	if (angdiff < 0.0) angdiff += 360.0;
+	if (angdiff > 360.0) angdiff -= 360.0;
+
+	ang = ang - angdiff;
+
+	if (ang > 180.0) ang -= 360.0;
+	if (ang < -180.0) ang += 360.0;
+
+	return floatabs(ang) > diff;
+}
+
+static AddRejectedHit(playerid, damagedid, reason, weapon, i1 = 0, i2 = 0, i3 = 0)
+{
+	new idx = s_RejectedHitsIdx[playerid];
+
+	if (s_RejectedHits[playerid][idx][e_Time]) {
+		idx += 1;
+
+		if (idx >= sizeof(s_RejectedHits[])) {
+			idx = 0;
+		}
+
+		s_RejectedHitsIdx[playerid] = idx;
+	}
+
+	new time, hour, minute, second;
+
+	time = gettime(hour, minute, second);
+
+	s_RejectedHits[playerid][idx][e_Reason] = reason;
+	s_RejectedHits[playerid][idx][e_Time] = time;
+	s_RejectedHits[playerid][idx][e_Weapon] = weapon;
+	s_RejectedHits[playerid][idx][e_Hour] = hour;
+	s_RejectedHits[playerid][idx][e_Minute] = minute;
+	s_RejectedHits[playerid][idx][e_Second] = second;
+	s_RejectedHits[playerid][idx][e_Info1] = _:i1;
+	s_RejectedHits[playerid][idx][e_Info2] = _:i2;
+	s_RejectedHits[playerid][idx][e_Info3] = _:i3;
+
+	if (damagedid != INVALID_PLAYER_ID) {
+		GetPlayerName(damagedid, s_RejectedHits[playerid][idx][e_Name], MAX_PLAYER_NAME);
+	} else {
+		s_RejectedHits[playerid][idx][e_Name][0] = '#';
+		s_RejectedHits[playerid][idx][e_Name][1] = '\0';
+	}
+
+	OnRejectedHit(playerid, s_RejectedHits[playerid][idx]);
+}
+
+forward WC_SecondKnifeAnim(playerid);
+public WC_SecondKnifeAnim(playerid)
+{
+	ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 1, 1, 1, 3000, 1);
+}
+
+forward WC_PlayerDeathRespawn(playerid);
+public WC_PlayerDeathRespawn(playerid)
+{
+	if (!s_IsDying[playerid]) {
+		return;
+	}
+
+	s_IsDying[playerid] = false;
+
+	if (!OnPlayerDeathFinished(playerid, true)) {
+		UpdateHealthBar(playerid);
+		SetFakeFacingAngle(playerid, _);
+		FreezeSyncData(playerid, false);
+
+		return;
+	}
+
+	s_IsDying[playerid] = true;
+	s_TrueDeath[playerid] = false;
+
+	if (IsPlayerInAnyVehicle(playerid)) {
+		new Float:x, Float:y, Float:z;
+		GetPlayerPos(playerid, x, y, z);
+		SetPlayerPos(playerid, x, y, z);
+	}
+
+	SetPlayerVirtualWorld(playerid, WC_DEATH_WORLD);
+	SetFakeFacingAngle(playerid, _);
+	TogglePlayerSpectating(playerid, true);
+	TogglePlayerSpectating(playerid, false);
+}
+
+public OnInvalidWeaponDamage(playerid, damagedid, Float:amount, weaponid, bodypart, error, bool:given)
+{
+	DebugMessageRedAll("OnInvalidWeaponDamage(%d, %d, %f, %d, %d, %d, %d)", playerid, damagedid, amount, weaponid, bodypart, error, given);
+
+	#if defined WC_OnInvalidWeaponDamage
+		WC_OnInvalidWeaponDamage(playerid, damagedid, Float:amount, weaponid, bodypart, error, bool:given);
+	#endif
+}
+
+public OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart)
+{
+	new idx = s_PreviousHitI[playerid];
+
+	s_PreviousHitI[playerid] = (s_PreviousHitI[playerid] - 1) % sizeof(s_PreviousHits[]);
+
+	// JIT plugin fix
+	if (s_PreviousHitI[playerid] < 0) {
+		s_PreviousHitI[playerid] += sizeof(s_PreviousHits[]);
+	}
+
+	s_PreviousHits[playerid][idx][e_Tick] = GetTickCount();
+	s_PreviousHits[playerid][idx][e_Issuer] = issuerid;
+	s_PreviousHits[playerid][idx][e_Weapon] = weapon;
+	s_PreviousHits[playerid][idx][e_Amount] = amount;
+	s_PreviousHits[playerid][idx][e_Bodypart] = bodypart;
+	s_PreviousHits[playerid][idx][e_Health] = GetLastDamageHealth(playerid);
+	s_PreviousHits[playerid][idx][e_Armour] = GetLastDamageArmour(playerid);
+
+	if (!IsHighRateWeapon(weapon)) {
+		DebugMessageAll("OnPlayerDamageDone(%d did %f to %d with %d on bodypart %d)", issuerid, amount, playerid, weapon, bodypart);
+
+		if (s_DamageTakenSound) {
+			PlayerPlaySound(playerid, s_DamageTakenSound, 0.0, 0.0, 0.0);
+
+			for (new i = 0; i < MAX_PLAYERS; i++) {
+				if (s_Spectating[i] == playerid && i != playerid) {
+					PlayerPlaySound(i, s_DamageTakenSound, 0.0, 0.0, 0.0);
+				}
+			}
+		}
+
+		if (s_DamageGivenSound && issuerid != INVALID_PLAYER_ID) {
+			PlayerPlaySound(issuerid, s_DamageGivenSound, 0.0, 0.0, 0.0);
+
+			for (new i = 0; i < MAX_PLAYERS; i++) {
+				if (s_Spectating[i] == issuerid && i != issuerid) {
+					PlayerPlaySound(i, s_DamageGivenSound, 0.0, 0.0, 0.0);
+				}
+			}
+		}
+	}
+
+	if (issuerid != INVALID_PLAYER_ID) {
+		DamageFeedAddHitGiven(issuerid, playerid, amount, weapon);
+	}
+
+	DamageFeedAddHitTaken(playerid, issuerid, amount, weapon);
+
+	#if defined WC_OnPlayerDamageDone
+		WC_OnPlayerDamageDone(playerid, amount, issuerid, weapon, bodypart);
+	#endif
+}
+
+public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
+{
+	#if defined WC_OnPlayerDamage
+		return WC_OnPlayerDamage(playerid, amount, issuerid, weapon, bodypart);
+	#else
+		return 1;
+	#endif
+}
+
+/*
+ * ALS callbacks
+ */
+#if defined _ALS_OnGameModeInit
+	#undef OnGameModeInit
+#else
+	#define _ALS_OnGameModeInit
+#endif
+#define OnGameModeInit WC_OnGameModeInit
+#if defined WC_OnGameModeInit
+	forward WC_OnGameModeInit();
+#endif
+
+
+#if defined _ALS_OnGameModeExit
+	#undef OnGameModeExit
+#else
+	#define _ALS_OnGameModeExit
+#endif
+#define OnGameModeExit WC_OnGameModeExit
+#if defined WC_OnGameModeExit
+	forward WC_OnGameModeExit();
+#endif
+
+
+#if defined _ALS_OnFilterScriptInit
+	#undef OnFilterScriptInit
+#else
+	#define _ALS_OnFilterScriptInit
+#endif
+#define OnFilterScriptInit WC_OnFilterScriptInit
+#if defined WC_OnFilterScriptInit
+	forward WC_OnFilterScriptInit();
+#endif
+
+
+#if defined _ALS_OnFilterScriptExit
+	#undef OnFilterScriptExit
+#else
+	#define _ALS_OnFilterScriptExit
+#endif
+#define OnFilterScriptExit WC_OnFilterScriptExit
+#if defined WC_OnFilterScriptExit
+	forward WC_OnFilterScriptExit();
+#endif
+
+
+#if defined _ALS_OnPlayerConnect
+	#undef OnPlayerConnect
+#else
+	#define _ALS_OnPlayerConnect
+#endif
+#define OnPlayerConnect WC_OnPlayerConnect
+#if defined WC_OnPlayerConnect
+	forward WC_OnPlayerConnect(playerid);
+#endif
+
+
+#if defined _ALS_OnPlayerDisconnect
+	#undef OnPlayerDisconnect
+#else
+	#define _ALS_OnPlayerDisconnect
+#endif
+#define OnPlayerDisconnect WC_OnPlayerDisconnect
+#if defined WC_OnPlayerDisconnect
+	forward WC_OnPlayerDisconnect(playerid, reason);
+#endif
+
+
+#if defined _ALS_OnPlayerStreamIn
+	#undef OnPlayerStreamIn
+#else
+	#define _ALS_OnPlayerStreamIn
+#endif
+#define OnPlayerStreamIn WC_OnPlayerStreamIn
+#if defined WC_OnPlayerStreamIn
+	forward WC_OnPlayerStreamIn(playerid, forplayerid);
+#endif
+
+#if defined _ALS_OnVehicleDeath
+	#undef OnVehicleDeath
+#else
+	#define _ALS_OnVehicleDeath
+#endif
+#define OnVehicleDeath WC_OnVehicleDeath
+#if defined WC_OnVehicleDeath
+	forward WC_OnVehicleDeath(vehicleid, killerid);
+#endif
+
+
+#if defined _ALS_OnVehicleSpawn
+	#undef OnVehicleSpawn
+#else
+	#define _ALS_OnVehicleSpawn
+#endif
+#define OnVehicleSpawn WC_OnVehicleSpawn
+#if defined WC_OnVehicleSpawn
+	forward WC_OnVehicleSpawn(vehicleid);
+#endif
+
+#if defined _ALS_OnPlayerEnterVehicle
+	#undef OnPlayerEnterVehicle
+#else
+	#define _ALS_OnPlayerEnterVehicle
+#endif
+#define OnPlayerEnterVehicle WC_OnPlayerEnterVehicle
+#if defined WC_OnPlayerEnterVehicle
+	forward WC_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
+#endif
+
+
+#if defined _ALS_OnPlayerExitVehicle
+	#undef OnPlayerExitVehicle
+#else
+	#define _ALS_OnPlayerExitVehicle
+#endif
+#define OnPlayerExitVehicle WC_OnPlayerExitVehicle
+#if defined WC_OnPlayerExitVehicle
+	forward WC_OnPlayerExitVehicle(playerid, vehicleid);
+#endif
+
+
+#if defined _ALS_OnPlayerStateChange
+	#undef OnPlayerStateChange
+#else
+	#define _ALS_OnPlayerStateChange
+#endif
+#define OnPlayerStateChange WC_OnPlayerStateChange
+#if defined WC_OnPlayerStateChange
+	forward WC_OnPlayerStateChange(playerid, newstate, oldstate);
+#endif
+
+
+#if defined _ALS_OnPlayerPickUpPickup
+	#undef OnPlayerPickUpPickup
+#else
+	#define _ALS_OnPlayerPickUpPickup
+#endif
+#define OnPlayerPickUpPickup WC_OnPlayerPickUpPickup
+#if defined WC_OnPlayerPickUpPickup
+	forward WC_OnPlayerPickUpPickup(playerid, pickupid);
+#endif
+
+
+#if defined _ALS_OnPlayerUpdate
+	#undef OnPlayerUpdate
+#else
+	#define _ALS_OnPlayerUpdate
+#endif
+#define OnPlayerUpdate WC_OnPlayerUpdate
+#if defined WC_OnPlayerUpdate
+	forward WC_OnPlayerUpdate(playerid);
+#endif
+
+
+#if defined _ALS_OnPlayerSpawn
+	#undef OnPlayerSpawn
+#else
+	#define _ALS_OnPlayerSpawn
+#endif
+#define OnPlayerSpawn WC_OnPlayerSpawn
+#if defined WC_OnPlayerSpawn
+	forward WC_OnPlayerSpawn(playerid);
+#endif
+
+
+#if defined _ALS_OnPlayerRequestClass
+	#undef OnPlayerRequestClass
+#else
+	#define _ALS_OnPlayerRequestClass
+#endif
+#define OnPlayerRequestClass WC_OnPlayerRequestClass
+#if defined WC_OnPlayerRequestClass
+	forward WC_OnPlayerRequestClass(playerid, classid);
+#endif
+
+
+#if defined _ALS_OnPlayerDeath
+	#undef OnPlayerDeath
+#else
+	#define _ALS_OnPlayerDeath
+#endif
+#define OnPlayerDeath WC_OnPlayerDeath
+#if defined WC_OnPlayerDeath
+	forward WC_OnPlayerDeath(playerid, killerid, reason);
+#endif
+
+
+#if defined _ALS_OnPlayerKeyStateChange
+	#undef OnPlayerKeyStateChange
+#else
+	#define _ALS_OnPlayerKeyStateChange
+#endif
+#define OnPlayerKeyStateChange WC_OnPlayerKeyStateChange
+#if defined WC_OnPlayerKeyStateChange
+	forward WC_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
+#endif
+
+
+#if defined _ALS_OnPlayerWeaponShot
+	#undef OnPlayerWeaponShot
+#else
+	#define _ALS_OnPlayerWeaponShot
+#endif
+#define OnPlayerWeaponShot WC_OnPlayerWeaponShot
+#if defined WC_OnPlayerWeaponShot
+	forward WC_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
+#endif
+
+
+#if defined _ALS_OnPlayerEnterCheckpoint
+	#undef OnPlayerEnterCheckpoint
+#else
+	#define _ALS_OnPlayerEnterCheckpoint
+#endif
+#define OnPlayerEnterCheckpoint WC_OnPlayerEnterCheckpoint
+#if defined WC_OnPlayerEnterCheckpoint
+	forward WC_OnPlayerEnterCheckpoint(playerid);
+#endif
+
+
+#if defined _ALS_OnPlayerLeaveCheckpoint
+	#undef OnPlayerLeaveCheckpoint
+#else
+	#define _ALS_OnPlayerLeaveCheckpoint
+#endif
+#define OnPlayerLeaveCheckpoint WC_OnPlayerLeaveCheckpoint
+#if defined WC_OnPlayerLeaveCheckpoint
+	forward WC_OnPlayerLeaveCheckpoint(playerid);
+#endif
+
+
+#if defined _ALS_OnInvalidWeaponDamage
+	#undef OnInvalidWeaponDamage
+#else
+	#define _ALS_OnInvalidWeaponDamage
+#endif
+#define OnInvalidWeaponDamage WC_OnInvalidWeaponDamage
+#if defined WC_OnInvalidWeaponDamage
+	forward WC_OnInvalidWeaponDamage(playerid, damagedid, Float:amount, weaponid, bodypart, error, bool:given);
+#endif
+
+
+#if defined _ALS_OnPlayerDamageDone
+	#undef OnPlayerDamageDone
+#else
+	#define _ALS_OnPlayerDamageDone
+#endif
+#define OnPlayerDamageDone WC_OnPlayerDamageDone
+#if defined WC_OnPlayerDamageDone
+	forward WC_OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart);
+#endif
+
+
+#if defined _ALS_OnPlayerDamage
+	#undef OnPlayerDamage
+#else
+	#define _ALS_OnPlayerDamage
+#endif
+#define OnPlayerDamage WC_OnPlayerDamage
+#if defined WC_OnPlayerDamage
+	forward WC_OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart);
+#endif
+
+
+#if defined _ALS_OnPlayerPrepareDeath
+	#undef OnPlayerPrepareDeath
+#else
+	#define _ALS_OnPlayerPrepareDeath
+#endif
+#define OnPlayerPrepareDeath WC_OnPlayerPrepareDeath
+#if defined WC_OnPlayerPrepareDeath
+	forward WC_OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time);
+#endif
+
+
+#if defined _ALS_OnRejectedHit
+	#undef OnRejectedHit
+#else
+	#define _ALS_OnRejectedHit
+#endif
+#define OnRejectedHit WC_OnRejectedHit
+#if defined WC_OnRejectedHit
+	forward WC_OnRejectedHit(playerid, hit[E_REJECTED_HIT]);
+#endif
+
+
+#if WC_CUSTOM_VENDING_MACHINES
+	#if defined _ALS_OnPlayerUseVendingMachine
+		#undef OnPlayerUseVendingMachine
+	#else
+		#define _ALS_OnPlayerUseVendingMachine
+	#endif
+	#define OnPlayerUseVendingMachine WC_OnPlayerUseVendingMachine
+	#if defined WC_OnPlayerUseVendingMachine
+		forward WC_OnPlayerUseVendingMachine(playerid, &Float:health_given);
+	#endif
+#endif
+
+
+#if defined _ALS_OnPlayerDeathFinished
+	#undef OnPlayerDeathFinished
+#else
+	#define _ALS_OnPlayerDeathFinished
+#endif
+#define OnPlayerDeathFinished WC_OnPlayerDeathFinished
+#if defined WC_OnPlayerDeathFinished
+	forward WC_OnPlayerDeathFinished(playerid, bool:cancelable);
+#endif
+
+/*
+ * ALS functions
+ */
+#if defined _ALS_SpawnPlayer
+	#undef SpawnPlayer
+#else
+	#define _ALS_SpawnPlayer
+#endif
+#define SpawnPlayer WC_SpawnPlayer
+
+
+#if defined _ALS_SetPlayerHealth
+	#undef SetPlayerHealth
+#else
+	#define _ALS_SetPlayerHealth
+#endif
+#define SetPlayerHealth WC_SetPlayerHealth
+
+
+#if defined _ALS_GetPlayerState
+	#undef GetPlayerState
+#else
+	#define _ALS_GetPlayerState
+#endif
+#define GetPlayerState WC_GetPlayerState
+
+
+#if defined _ALS_GetPlayerHealth
+	#undef GetPlayerHealth
+#else
+	#define _ALS_GetPlayerHealth
+#endif
+#define GetPlayerHealth WC_GetPlayerHealth
+
+
+#if defined _ALS_SetPlayerArmour
+	#undef SetPlayerArmour
+#else
+	#define _ALS_SetPlayerArmour
+#endif
+#define SetPlayerArmour WC_SetPlayerArmour
+
+
+#if defined _ALS_GetPlayerArmour
+	#undef GetPlayerArmour
+#else
+	#define _ALS_GetPlayerArmour
+#endif
+#define GetPlayerArmour WC_GetPlayerArmour
+
+
+#if defined _ALS_GetPlayerTeam
+	#undef GetPlayerTeam
+#else
+	#define _ALS_GetPlayerTeam
+#endif
+#define GetPlayerTeam WC_GetPlayerTeam
+
+
+#if defined _ALS_SetPlayerTeam
+	#undef SetPlayerTeam
+#else
+	#define _ALS_SetPlayerTeam
+#endif
+#define SetPlayerTeam WC_SetPlayerTeam
+
+
+#if defined _ALS_SendDeathMessage
+	#undef SendDeathMessage
+#else
+	#define _ALS_SendDeathMessage
+#endif
+#define SendDeathMessage WC_SendDeathMessage
+
+
+#if defined _ALS_GetWeaponName
+	#undef GetWeaponName
+#else
+	#define _ALS_GetWeaponName
+#endif
+#define GetWeaponName WC_GetWeaponName
+
+
+#if defined _ALS_ApplyAnimation
+	#undef ApplyAnimation
+#else
+	#define _ALS_ApplyAnimation
+#endif
+#define ApplyAnimation WC_ApplyAnimation
+
+
+#if defined _ALS_ClearAnimations
+	#undef ClearAnimations
+#else
+	#define _ALS_ClearAnimations
+#endif
+#define ClearAnimations WC_ClearAnimations
+
+
+#if defined _ALS_AddPlayerClass
+	#undef AddPlayerClass
+#else
+	#define _ALS_AddPlayerClass
+#endif
+#define AddPlayerClass WC_AddPlayerClass
+
+
+#if defined _ALS_AddPlayerClassEx
+	#undef AddPlayerClassEx
+#else
+	#define _ALS_AddPlayerClassEx
+#endif
+#define AddPlayerClassEx WC_AddPlayerClassEx
+
+
+#if defined _ALS_SetSpawnInfo
+	#undef SetSpawnInfo
+#else
+	#define _ALS_SetSpawnInfo
+#endif
+#define SetSpawnInfo WC_SetSpawnInfo
+
+
+#if defined _ALS_TogglePlayerSpectating
+	#undef TogglePlayerSpectating
+#else
+	#define _ALS_TogglePlayerSpectating
+#endif
+#define TogglePlayerSpectating WC_TogglePlayerSpectating
+
+
+#if defined _ALS_TogglePlayerControllable
+	#undef TogglePlayerControllable
+#else
+	#define _ALS_TogglePlayerControllable
+#endif
+#define TogglePlayerControllable WC_TogglePlayerControllable
+
+
+#if defined _ALS_SetPlayerPos
+	#undef SetPlayerPos
+#else
+	#define _ALS_SetPlayerPos
+#endif
+#define SetPlayerPos WC_SetPlayerPos
+
+
+#if defined _ALS_SetPlayerPosFindZ
+	#undef SetPlayerPosFindZ
+#else
+	#define _ALS_SetPlayerPosFindZ
+#endif
+#define SetPlayerPosFindZ WC_SetPlayerPosFindZ
+
+
+#if defined _ALS_SetPlayerVelocity
+	#undef SetPlayerVelocity
+#else
+	#define _ALS_SetPlayerVelocity
+#endif
+#define SetPlayerVelocity WC_SetPlayerVelocity
+
+
+#if defined _ALS_SetPlayerVirtualWorld
+	#undef SetPlayerVirtualWorld
+#else
+	#define _ALS_SetPlayerVirtualWorld
+#endif
+#define SetPlayerVirtualWorld wc_SetPlayerVirtualWorld
+
+
+#if defined _ALS_GetPlayerVirtualWorld
+	#undef GetPlayerVirtualWorld
+#else
+	#define _ALS_GetPlayerVirtualWorld
+#endif
+#define GetPlayerVirtualWorld WC_GetPlayerVirtualWorld
+
+
+#if defined _ALS_PlayerSpectatePlayer
+	#undef PlayerSpectatePlayer
+#else
+	#define _ALS_PlayerSpectatePlayer
+#endif
+#define PlayerSpectatePlayer WC_PlayerSpectatePlayer
+
+
+#if defined _ALS_DestroyVehicle
+	#undef DestroyVehicle
+#else
+	#define _ALS_DestroyVehicle
+#endif
+#define DestroyVehicle WC_DestroyVehicle
+
+#if defined _ALS_CreateVehicle
+	#undef CreateVehicle
+#else
+	#define _ALS_CreateVehicle
+#endif
+#define CreateVehicle WC_CreateVehicle
+
+
+#if defined _ALS_AddStaticVehicle
+	#undef AddStaticVehicle
+#else
+	#define _ALS_AddStaticVehicle
+#endif
+#define AddStaticVehicle WC_AddStaticVehicle
+
+
+#if defined _ALS_AddStaticVehicleEx
+	#undef AddStaticVehicleEx
+#else
+	#define _ALS_AddStaticVehicleEx
+#endif
+#define AddStaticVehicleEx WC_AddStaticVehicleEx
+
+#if defined _ALS_IsPlayerInCheckpoint
+	#undef IsPlayerInCheckpoint
+#else
+	#define _ALS_IsPlayerInCheckpoint
+#endif
+#define IsPlayerInCheckpoint WC_IsPlayerInCheckpoint
+
+
+#if defined _ALS_SetPlayerSpecialAction
+	#undef SetPlayerSpecialAction
+#else
+	#define _ALS_SetPlayerSpecialAction
+#endif
+#define SetPlayerSpecialAction WC_SetPlayerSpecialAction
+
+
+#if defined _ALS_TextDrawCreate
+	#undef TextDrawCreate
+#else
+	#define _ALS_TextDrawCreate
+#endif
+#define TextDrawCreate WC_TextDrawCreate
+
+
+#if defined _ALS_TextDrawDestroy
+	#undef TextDrawDestroy
+#else
+	#define _ALS_TextDrawDestroy
+#endif
+#define TextDrawDestroy WC_TextDrawDestroy
+
+
+#if defined _ALS_TextDrawLetterSize
+	#undef TextDrawLetterSize
+#else
+	#define _ALS_TextDrawLetterSize
+#endif
+#define TextDrawLetterSize WC_TextDrawLetterSize
+
+
+#if defined _ALS_TextDrawTextSize
+	#undef TextDrawTextSize
+#else
+	#define _ALS_TextDrawTextSize
+#endif
+#define TextDrawTextSize WC_TextDrawTextSize
+
+
+#if defined _ALS_TextDrawAlignment
+	#undef TextDrawAlignment
+#else
+	#define _ALS_TextDrawAlignment
+#endif
+#define TextDrawAlignment WC_TextDrawAlignment
+
+
+#if defined _ALS_TextDrawColor
+	#undef TextDrawColor
+#else
+	#define _ALS_TextDrawColor
+#endif
+#define TextDrawColor WC_TextDrawColor
+
+
+#if defined _ALS_TextDrawUseBox
+	#undef TextDrawUseBox
+#else
+	#define _ALS_TextDrawUseBox
+#endif
+#define TextDrawUseBox WC_TextDrawUseBox
+
+
+#if defined _ALS_TextDrawBoxColor
+	#undef TextDrawBoxColor
+#else
+	#define _ALS_TextDrawBoxColor
+#endif
+#define TextDrawBoxColor WC_TextDrawBoxColor
+
+
+#if defined _ALS_TextDrawSetShadow
+	#undef TextDrawSetShadow
+#else
+	#define _ALS_TextDrawSetShadow
+#endif
+#define TextDrawSetShadow WC_TextDrawSetShadow
+
+
+#if defined _ALS_TextDrawSetOutline
+	#undef TextDrawSetOutline
+#else
+	#define _ALS_TextDrawSetOutline
+#endif
+#define TextDrawSetOutline WC_TextDrawSetOutline
+
+
+#if defined _ALS_TextDrawBackgroundColor
+	#undef TextDrawBackgroundColor
+#else
+	#define _ALS_TextDrawBackgroundColor
+#endif
+#define TextDrawBackgroundColor WC_TextDrawBackgroundColor
+
+
+#if defined _ALS_TextDrawFont
+	#undef TextDrawFont
+#else
+	#define _ALS_TextDrawFont
+#endif
+#define TextDrawFont WC_TextDrawFont
+
+
+#if defined _ALS_TextDrawSetProportional
+	#undef TextDrawSetProportional
+#else
+	#define _ALS_TextDrawSetProportional
+#endif
+#define TextDrawSetProportional WC_TextDrawSetProportional
+
+
+#if defined _ALS_TextDrawSetSelectable
+	#undef TextDrawSetSelectable
+#else
+	#define _ALS_TextDrawSetSelectable
+#endif
+#define TextDrawSetSelectable WC_TextDrawSetSelectable
+
+
+#if defined _ALS_TextDrawShowForPlayer
+	#undef TextDrawShowForPlayer
+#else
+	#define _ALS_TextDrawShowForPlayer
+#endif
+#define TextDrawShowForPlayer WC_TextDrawShowForPlayer
+
+
+#if defined _ALS_TextDrawHideForPlayer
+	#undef TextDrawHideForPlayer
+#else
+	#define _ALS_TextDrawHideForPlayer
+#endif
+#define TextDrawHideForPlayer WC_TextDrawHideForPlayer
+
+
+#if defined _ALS_TextDrawShowForAll
+	#undef TextDrawShowForAll
+#else
+	#define _ALS_TextDrawShowForAll
+#endif
+#define TextDrawShowForAll WC_TextDrawShowForAll
+
+
+#if defined _ALS_TextDrawHideForAll
+	#undef TextDrawHideForAll
+#else
+	#define _ALS_TextDrawHideForAll
+#endif
+#define TextDrawHideForAll WC_TextDrawHideForAll
+
+
+#if defined _ALS_TextDrawSetString
+	#undef TextDrawSetString
+#else
+	#define _ALS_TextDrawSetString
+#endif
+#define TextDrawSetString WC_TextDrawSetString
+
+
+#if defined _ALS_TextDrawSetPreviewModel
+	#undef TextDrawSetPreviewModel
+#else
+	#define _ALS_TextDrawSetPreviewModel
+#endif
+#define TextDrawSetPreviewModel WC_TextDrawSetPreviewModel
+
+
+#if defined _ALS_TextDrawSetPreviewRot
+	#undef TextDrawSetPreviewRot
+#else
+	#define _ALS_TextDrawSetPreviewRot
+#endif
+#define TextDrawSetPreviewRot WC_TextDrawSetPreviewRot
+
+
+#if defined _ALS_TextDrawSetPreviewVehCol
+	#undef TextDrawSetPreviewVehCol
+#else
+	#define _ALS_TextDrawSetPreviewVehCol
+#endif
+#define TextDrawSetPreviewVehCol WC_TextDrawSetPreviewVehCol
+
+
+#if defined _ALS_CreatePlayerTextDraw
+	#undef CreatePlayerTextDraw
+#else
+	#define _ALS_CreatePlayerTextDraw
+#endif
+#define CreatePlayerTextDraw WC_CreatePlayerTextDraw
+
+
+#if defined _ALS_PlayerTextDrawDestroy
+	#undef PlayerTextDrawDestroy
+#else
+	#define _ALS_PlayerTextDrawDestroy
+#endif
+#define PlayerTextDrawDestroy WC_PlayerTextDrawDestroy
+
+
+#if defined _ALS_PlayerTextDrawLetterSize
+	#undef PlayerTextDrawLetterSize
+#else
+	#define _ALS_PlayerTextDrawLetterSize
+#endif
+#define PlayerTextDrawLetterSize WC_PlayerTextDrawLetterSize
+
+
+#if defined _ALS_PlayerTextDrawTextSize
+	#undef PlayerTextDrawTextSize
+#else
+	#define _ALS_PlayerTextDrawTextSize
+#endif
+#define PlayerTextDrawTextSize WC_PlayerTextDrawTextSize
+
+
+#if defined _ALS_PlayerTextDrawAlignment
+	#undef PlayerTextDrawAlignment
+#else
+	#define _ALS_PlayerTextDrawAlignment
+#endif
+#define PlayerTextDrawAlignment WC_PlayerTextDrawAlignment
+
+
+#if defined _ALS_PlayerTextDrawColor
+	#undef PlayerTextDrawColor
+#else
+	#define _ALS_PlayerTextDrawColor
+#endif
+#define PlayerTextDrawColor WC_PlayerTextDrawColor
+
+
+#if defined _ALS_PlayerTextDrawUseBox
+	#undef PlayerTextDrawUseBox
+#else
+	#define _ALS_PlayerTextDrawUseBox
+#endif
+#define PlayerTextDrawUseBox WC_PlayerTextDrawUseBox
+
+
+#if defined _ALS_PlayerTextDrawBoxColor
+	#undef PlayerTextDrawBoxColor
+#else
+	#define _ALS_PlayerTextDrawBoxColor
+#endif
+#define PlayerTextDrawBoxColor WC_PlayerTextDrawBoxColor
+
+
+#if defined _ALS_PlayerTextDrawSetShadow
+	#undef PlayerTextDrawSetShadow
+#else
+	#define _ALS_PlayerTextDrawSetShadow
+#endif
+#define PlayerTextDrawSetShadow WC_PlayerTextDrawSetShadow
+
+
+#if defined _ALS_PlayerTextDrawSetOutline
+	#undef PlayerTextDrawSetOutline
+#else
+	#define _ALS_PlayerTextDrawSetOutline
+#endif
+#define PlayerTextDrawSetOutline WC_PlayerTextDrawSetOutline
+
+
+#if defined _ALS_PlayerTextDrawBackgroundCo
+	#undef PlayerTextDrawBackgroundColor
+#else
+	#define _ALS_PlayerTextDrawBackgroundCo
+#endif
+#define PlayerTextDrawBackgroundColor WC_PlayerTextDrawBackgroundColo
+
+
+#if defined _ALS_PlayerTextDrawFont
+	#undef PlayerTextDrawFont
+#else
+	#define _ALS_PlayerTextDrawFont
+#endif
+#define PlayerTextDrawFont WC_PlayerTextDrawFont
+
+
+#if defined _ALS_PlayerTextDrawSetProportio
+	#undef PlayerTextDrawSetProportional
+#else
+	#define _ALS_PlayerTextDrawSetProportio
+#endif
+#define PlayerTextDrawSetProportional WC_PlayerTextDrawSetProportiona
+
+
+#if defined _ALS_PlayerTextDrawSetSelectabl
+	#undef PlayerTextDrawSetSelectable
+#else
+	#define _ALS_PlayerTextDrawSetSelectabl
+#endif
+#define PlayerTextDrawSetSelectable WC_PlayerTextDrawSetSelectable
+
+
+#if defined _ALS_PlayerTextDrawShow
+	#undef PlayerTextDrawShow
+#else
+	#define _ALS_PlayerTextDrawShow
+#endif
+#define PlayerTextDrawShow WC_PlayerTextDrawShow
+
+
+#if defined _ALS_PlayerTextDrawHide
+	#undef PlayerTextDrawHide
+#else
+	#define _ALS_PlayerTextDrawHide
+#endif
+#define PlayerTextDrawHide WC_PlayerTextDrawHide
+
+
+#if defined _ALS_PlayerTextDrawSetString
+	#undef PlayerTextDrawSetString
+#else
+	#define _ALS_PlayerTextDrawSetString
+#endif
+#define PlayerTextDrawSetString WC_PlayerTextDrawSetString
+
+
+#if defined _ALS_PlayerTextDrawSetPreviewMo
+	#undef PlayerTextDrawSetPreviewModel
+#else
+	#define _ALS_PlayerTextDrawSetPreviewMo
+#endif
+#define PlayerTextDrawSetPreviewModel WC_PlayerTextDrawSetPreviewMode
+
+
+#if defined _ALS_PlayerTextDrawSetPreviewRo
+	#undef PlayerTextDrawSetPreviewRot
+#else
+	#define _ALS_PlayerTextDrawSetPreviewRo
+#endif
+#define PlayerTextDrawSetPreviewRot WC_PlayerTextDrawSetPreviewRot
+
+
+#if defined _ALS_PlayerTextDrawSetPreviewVe
+	#undef PlayerTextDrawSetPreviewVehCol
+#else
+	#define _ALS_PlayerTextDrawSetPreviewVe
+#endif
+#define PlayerTextDrawSetPreviewVehCol WC_PlayerTextDrawSetPreviewVehC

+ 640 - 1013
pawno/include/ysi.inc

@@ -1,1022 +1,649 @@
-/*----------------------------------------------------------------------------*\
-                                        =======================================
-                                          YSI - YSI Server Includes functions
-                                        =======================================
+/*----------------------------------------------------------------------------*-
+					=======================
+					Y Sever Includes - Main
+					=======================
 Description:
-        Lists all the functions available in YSI for PAWNO.
+	Main include to use the YSI script libraries.  Simply add:
+	
+	#include <YSI>
+	
+	to the top of your script to get the full power of all the YSI libraries
+	and the functions and features they expose.
 Legal:
-        Version: MPL 1.1
-       
-        The contents of this file are subject to the Mozilla Public License Version
-        1.1 (the "License"); you may not use this file except in compliance with
-        the License. You may obtain a copy of the License at
-        http://www.mozilla.org/MPL/
-       
-        Software distributed under the License is distributed on an "AS IS" basis,
-        WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-        for the specific language governing rights and limitations under the
-        License.
-       
-        The Original Code is the YSI group include.
-       
-        The Initial Developer of the Original Code is Alex "Y_Less" Cole.
-        Portions created by the Initial Developer are Copyright (C) 2011
-        the Initial Developer. All Rights Reserved.
-       
-        Contributors:
-                ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
-       
-        Thanks:
-                JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
-                ZeeX - Very productive conversations.
-                koolk - IsPlayerinAreaEx code.
-                TheAlpha - Danish translation.
-                breadfish - German translation.
-                Fireburn - Dutch translation.
-                yom - French translation.
-                50p - Polish translation.
-                Zamaroht - Spanish translation.
-                Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes
-                        for me to strive to better.
-                Pixels^ - Running XScripters where the idea was born.
-                Matite - Pestering me to release it and using it.
-       
-        Very special thanks to:
-                Thiadmer - PAWN, whose limits continue to amaze me!
-                Kye/Kalcor - SA:MP.
-                SA:MP Team past, present and future - SA:MP.
-       
+	Copyright (C) 2007 Alex "Y_Less" Cole
+
+	This program is free software; you can redistribute it and/or
+	modify it under the terms of the GNU General Public License
+	as published by the Free Software Foundation; either version 2
+	of the License, or (at your option) any later version.
+
+	This program is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with this program; if not, write to the Free Software
+	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+	MA 02110-1301, USA.
 Version:
-        1.0
+	0.1.3
 Changelog:
-        25/02/12:
-                First version
-\*----------------------------------------------------------------------------*/
- 
-#include <YSI\internal\y_version>
- 
-/*
- 
-native
-native __y_als__();
-native
-native
-native
- 
-*/
- 
-// CAN'T include by default.
-//#include <YSI\y_als>
- 
-/*
- 
-native
-native __y_amx__();
-native
-native
-native AMX_GetBaseCount(E_AMX_TABLE:table, &base, &count)
-native AMX_GetGlobalAddress(...);
-native AMX_Read(addr)
-native AMX_Write(addr, value)
-native AMX_ReadString(addr, str[], len = sizeof (str))
-native AMX_WriteString(addr, const str[], len = sizeof (str))
-native AMX_ReadArray(addr, dest[], len = sizeof (dest))
-native AMX_WriteArray(addr, const src[], len = sizeof (src))
-native
-native AMX_GetPublicEntry(idx, &buffer, const pattern[] = "")
-native AMX_GetNativeEntry(idx, &buffer, const pattern[] = "")
-native AMX_GetLibraryEntry(idx, &buffer, const pattern[] = "")
-native AMX_GetPubvarEntry(idx, &buffer, const pattern[] = "")
-native AMX_GetTagEntry(idx, &buffer, const pattern[] = "")
-native AMX_GetEntry(E_AMX_TABLE:table, idx, &buffer, const pattern[] = "")
-native
-native AMX_GetPublicEntryPrefix(idx, &buffer, pattern)
-native AMX_GetNativeEntryPrefix(idx, &buffer, pattern)
-native AMX_GetLibraryEntryPrefix(idx, &buffer, pattern)
-native AMX_GetPubvarEntryPrefix(idx, &buffer, pattern)
-native AMX_GetTagEntryPrefix(idx, &buffer, pattern)
-native AMX_GetEntryPrefix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
-native AMX_GetPublicEntrySuffix(idx, &buffer, pattern)
-native AMX_GetNativeEntrySuffix(idx, &buffer, pattern)
-native AMX_GetLibraryEntrySuffix(idx, &buffer, pattern)
-native AMX_GetPubvarEntrySuffix(idx, &buffer, pattern)
-native AMX_GetTagEntrySuffix(idx, &buffer, pattern)
-native AMX_GetEntrySuffix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
-native AMX_GetPublicName(idx, buffer[32], const pattern[] = "")
-native AMX_GetNativeName(idx, buffer[32], const pattern[] = "")
-native AMX_GetLibraryName(idx, buffer[32], const pattern[] = "")
-native AMX_GetPubvarName(idx, buffer[32], const pattern[] = "")
-native AMX_GetTagName(idx, buffer[32], const pattern[] = "")
-native AMX_GetName(E_AMX_TABLE:table, idx, buffer[32], const pattern[] = "")
-native
-native AMX_GetPublicNamePrefix(idx, buffer[32], pattern)
-native AMX_GetNativeNamePrefix(idx, buffer[32], pattern)
-native AMX_GetLibraryNamePrefix(idx, buffer[32], pattern)
-native AMX_GetPubvarNamePrefix(idx, buffer[32], pattern)
-native AMX_GetTagNamePrefix(idx, buffer[32], pattern)
-native AMX_GetNamePrefix(E_AMX_TABLE:table, idx, buffer[32], pattern)
-native
-native AMX_GetPublicNameSuffix(idx, buffer[32], pattern)
-native AMX_GetNativeNameSuffix(idx, buffer[32], pattern)
-native AMX_GetLibraryNameSuffix(idx, buffer[32], pattern)
-native AMX_GetPubvarNameSuffix(idx, buffer[32], pattern)
-native AMX_GetTagNameSuffix(idx, buffer[32], pattern)
-native AMX_GetNameSuffix(E_AMX_TABLE:table, idx, buffer[32], pattern)
-native
-native AMX_GetPublicPointer(idx, &buffer, const pattern[] = "")
-native AMX_GetNativePointer(idx, &buffer, const pattern[] = "")
-native AMX_GetLibraryPointer(idx, &buffer, const pattern[] = "")
-native AMX_GetPubvarPointer(idx, &buffer, const pattern[] = "")
-native AMX_GetTagPointer(idx, &buffer, const pattern[] = "")
-native AMX_GetPointer(E_AMX_TABLE:table, idx, &buffer, const pattern[] = "")
-native
-native AMX_GetPublicPointerPrefix(idx, &buffer, pattern)
-native AMX_GetNativePointerPrefix(idx, &buffer, pattern)
-native AMX_GetLibraryPointerPrefix(idx, &buffer, pattern)
-native AMX_GetPubvarPointerPrefix(idx, &buffer, pattern)
-native AMX_GetTagPointerPrefix(idx, &buffer, pattern)
-native AMX_GetPointerPrefix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
-native AMX_GetPublicPointerSuffix(idx, &buffer, pattern)
-native AMX_GetNativePointerSuffix(idx, &buffer, pattern)
-native AMX_GetLibraryPointerSuffix(idx, &buffer, pattern)
-native AMX_GetPubvarPointerSuffix(idx, &buffer, pattern)
-native AMX_GetTagPointerSuffix(idx, &buffer, pattern)
-native AMX_GetPointerSuffix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
-native AMX_GetPublicValue(idx, &buffer, const pattern[] = "")
-native AMX_GetNativeValue(idx, &buffer, const pattern[] = "")
-native AMX_GetLibraryValue(idx, &buffer, const pattern[] = "")
-native AMX_GetPubvarValue(idx, &buffer, const pattern[] = "")
-native AMX_GetTagValue(idx, &buffer, const pattern[] = "")
-native AMX_GetValue(E_AMX_TABLE:table, idx, &buffer, const pattern[] = "")
-native
-native AMX_GetPublicValuePrefix(idx, &buffer, pattern)
-native AMX_GetNativeValuePrefix(idx, &buffer, pattern)
-native AMX_GetLibraryValuePrefix(idx, &buffer, pattern)
-native AMX_GetPubvarValuePrefix(idx, &buffer, pattern)
-native AMX_GetTagValuePrefix(idx, &buffer, pattern)
-native AMX_GetValuePrefix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
-native AMX_GetPublicValueSuffix(idx, &buffer, pattern)
-native AMX_GetNativeValueSuffix(idx, &buffer, pattern)
-native AMX_GetLibraryValueSuffix(idx, &buffer, pattern)
-native AMX_GetPubvarValueSuffix(idx, &buffer, pattern)
-native AMX_GetTagValueSuffix(idx, &buffer, pattern)
-native AMX_GetValueSuffix(E_AMX_TABLE:table, idx, &buffer, pattern)
-native
- 
-*/
- 
-#include <YSI\y_amx>
- 
-/*
- 
-native
-native __y_areas__();
-native
-native
-native Area_AddCube(Float:x0, Float:y0, Float:z0, Float:x1, Float:y1, Float:z1);
-native Area_AddBox(Float:minx, Float:miny, Float:maxx, Float:maxy);
-native Area_AddCircle(Float:x, Float:y, Float:r, Float:h = FLOAT_INFINITY)
-native Area_AddSphere(Float:x, Float:y, Float:z, Float:r);
-native Area_AddPoly(Float:x1, Float:y1, Float:x2, Float:y2, Float:x3, Float:y3, Float:...);
-native Area_Delete(area);
-native Area_GetPlayerArea(playerid);
-native Area_SetPlayer(area, playerid, bool:set);
-native bool:Area_GetPlayer(area, playerid);
-native Area_SetAllPlayers(area, bool:set);
-native Area_SetWorld(area, world, bool:set);
-native bool:Area_GetWorld(area, world);
-native Area_SetAllWorlds(area, bool:set);
-native bool:Area_IsValid(area);
-native bool:Area_IsEmpty(area);
-native
- 
-*/
- 
-#include <YSI\y_areas>
- 
-/*
- 
-native
-native __y_bintree__();
-native
-native
-native Bintree_Generate(BinaryTree:output<>, input[][E_BINTREE_INPUT], size);
-native Bintree_Reset(BinaryTree:tree<>, pointer = 0);
-native Bintree_FindValue(BinaryTree:tree<>, value, &cont = 0, &old = 0);
-native Bintree_Add(BinaryTree:data<>, pointer, value, offset, maxsize = sizeof (data));
-native Bintree_Delete(BinaryTree:source<>, index, count);
-native Bintree_UpdatePointers(BinaryTree:data<>, offset, size, mod = -1);
-native
- 
-*/
- 
-#include <YSI\y_bintree>
- 
-/*
- 
-native
-native __y_bit__();
-native
-native
-native Bit_Set(BitArray:array<>, slot, bool:set);
-native Bit_SetAll(BitArray:array<>, bool:set, size = sizeof (array));
-native Bit_Get(BitArray:array<>, slot);
-native Bit_Let(BitArray:array<>, slot);
-native Bit_Vet(BitArray:array<>, slot);
-native Bit_Slot(value);
-native Bit_Mask(value);
-native Bit_GetCount(BitArray:array<>, size = sizeof (array));
-native Bit_Display(BitArray:array<>, size = sizeof (array));
-native Iterator:Bits(BitArray:array<>);
-native Iterator:Blanks(BitArray:array<>);
-native
-native bits();
-native bitsof();
-native
- 
-*/
- 
-#include <YSI\y_bit>
- 
-/*
- 
-native
-native __y_cell__();
-native
-native
-native Cell_ReverseBits({Float, _}:data);
-native Cell_ReverseNibbles({Float, _}:data);
-native Cell_ReverseBytes({Float, _}:data);
-native Cell_CountBits({Float, _}:data);
-native Cell_GetLowestBit({Float, _}:data);
-native Cell_GetLowestComponent({Float, _}:data);
-native
- 
-*/
- 
-#include <YSI\y_cell>
- 
-/*
- 
-native
-native __y_classes__();
-native
-native
-native Class_Add(skin, Float:x, Float:y, Float:z, Float:a, ...);
-native
-native Class_AddEx(Group:forgroup, Group:setgroup, skin, Float:x, Float:y, Float:z, Float:a, ...);
-native Class_AddForGroup(Group:group, skin, Float:x, Float:y, Float:z, Float:a, ...);
-native Class_AddWithGroupSet(Group:group, skin, Float:x, Float:y, Float:z, Float:a, ...);
-native Class_Enable(classid, bool:toggle);
-native Class_Delete(classid);
-native Class_SetPlayer(classid, playerid, bool:s);
-native bool:Class_GetPlayer(classid, playerid);
-native Class_Get(playerid);
-native Class_Goto(playerid, playerclass);
-native
-native Class_DisableSelection(playerid);
-native Class_DisableReselection(playerid);
-native Class_EnableReselection(playerid);
-native Class_ForceReselection(playerid);
-native Class_ReturnToSelection(playerid);
-native
- 
-*/
- 
-#include <YSI\y_classes>
- 
-/*
- 
-native
-native __y_colours__();
-native __y_colors__();
-native
-native
-native SetColoursCanHaveSpaces(bool:set);
-native SetColour(const name[], color);
-native SetColourHash(hash, color);
-native GetColour(const name[], alpha = 0xAA);
-native GetColourStream(const str[], &idx, alpha = 0xAA);
-native GetColourHash(hash, alpha = 0xAA);
-native
- 
-*/
- 
-#include <YSI\y_colours>
- 
-/*
- 
-native
-native __y_commands__();
-native
-native
-native Command_AddAlt(commandid, altname[]);
-native Command_AddAltNamed(command[], altname[]);
-native Command_SetPlayer(commandid, playerid, bool:set);
-native Command_SetPlayerNamed(command[], playerid, bool:set);
-native
-native Command_SetDeniedReturn(bool:set);
-native bool:Command_GetDeniedReturn();
-native Command_SetIllegalReturn(bool:set);
-native bool:Command_GetIllegalReturn();
-native Command_SetUnknownReturn(bool:set);
-native bool:Command_GetUnknownReturn();
-native Command_SetDisconnectReturn(bool:set);
-native bool:Command_GetDisconnectReturn();
-native
-native Command_GetID(command[]);
-native bool:Command_GetPlayer(commandid, playerid);
-native bool:Command_GetPlayerNamed(command[], playerid);
-native Command_Remove(commandid);
-native Command_RemoveNamed(command[]);
-native Command_ReProcess(playerid, cmdtext[], help);
-native Command_GetName(commandid);
-native Command_GetDisplay(commandid, playerid);
-native Command_GetDisplayNamed(command[], playerid);
-native Command_GetPlayerCommandCount(playerid);
-native Command_GetNext(index, playerid);
-native
-native Command_SetProvider(p);
-native Command_GetProvider();
-native Command_SetPlayerProvider(playerid, p);
-native Command_GetPlayerProvider(playerid);
-native
- 
-*/
- 
-#include <YSI\y_commands>
- 
-/*
- 
-native
-native __y_debug__();
-native
-native
-native P_level(str[], {Float, _}:...);
-native P_I(str[], {Float, _}:...);
-native P_W(str[], {Float, _}:...);
-native P_E(str[], {Float, _}:...);
-native P_F(str[], {Float, _}:...);
-native P_C(str[], {Float, _}:...);
-native
- 
-*/
- 
-#include <YSI\y_debug>
- 
-/*
- 
-native
-native __y_dialog__();
-native
-native
-native Dialog_Show(playerid, style, title[], caption[], button1[], button2[] = "", dialogid = -1);
-native Dialog_ShowCallback(playerid, using:callback[], style, title[], caption[], button1[], button2[] = "", dialogid = -1);
-native
-native Dialog_ObtainID();
-native Dialog_TryObtainID(id);
-native Dialog_Get(playerid);
-native Dialog_Garbage(dialogid);
-native Dialog_Free(dialogid);
-native Dialog_Set(playerid, dialogid);
-native Dialog_ShowCallbackData(playerid, callback[E_CALLBACK_DATA], style, title[], caption[], button1[], button2[] = "", dialogid = -1);
-native Dialog_Hide(playerid);
-native Dialog_SetCallback(dialogid, using:callback[]);
-native Dialog_SetCallbackData(dialogid, callback[E_CALLBACK_DATA]);
-native
- 
-*/
- 
-#include <YSI\y_dialog>
- 
-/*
- 
-native
-native __y_flooding__();
-native
-native
-native SetMaxConnections(max = -1, e_FLOOD_ACTION:action = e_FLOOD_ACTION_BLOCK)
-native
- 
-*/
- 
-#include <YSI\y_flooding>
- 
-/*
- 
-native
-native __y_groups__();
-native
-native
-native Group:Group_Create(name[]);
-native Group_Destroy(Group:group);
-native Group_SetPlayer(Group:group, playerid, bool:s);
-native bool:Group_GetPlayer(Group:group, playerid);
-native
-native Group_SetCommand(Group:group, commandid, bool:s);
-native Group_SetCommandDefault(Group:group, bool:s);
-native Group_SetGlobalCommand(commandid, bool:s);
-native Group_SetGlobalCommandDefault(bool:s);
-native
-native Group_SetArea(Group:group, area, bool:s);
-native Group_SetAreaDefault(Group:group, bool:s);
-native Group_SetGlobalArea(area, bool:s);
-native Group_SetGlobalAreaDefault(bool:s);
-native
-native Group_SetClass(Group:group, class, bool:s);
-native Group_SetClassDefault(Group:group, bool:s);
-native Group_SetGlobalClass(class, bool:s);
-native Group_SetGlobalCalssDefault(bool:s);
-native
-native Iterator:PlayerGroups(playerid)
-native Iterator:Group(Group:group)
-native
-native Group:Group_SetBalanced(playerid, Group:...)
-native Group_GetColour(Group:group);
-native Group_GetColor(Group:group);
-native Group_SetColour(Group:group, colour);
-native Group_SetColor(Group:group, color);
-native bool:Group_GetGang(Group:group);
-native Group_SetGang(Group:group, bool:set);
-native Group:Group_GetID(name[]);
-native Group_GetName(Group:group);
-native Group_SetName(Group:group, name[]);
-native
- 
-*/
- 
-#include <YSI\y_groups>
- 
-/*
- 
-native
-native __y_hooks__();
-native
-native
-native hook();
-native
- 
-*/
- 
-// Is included as then they can use hooks straight off.
-#include <YSI\y_hooks>
- 
-/*
- 
-native
-native __y_ini__();
-native
-native
-native bool:INI_ParseFile(fname[], remoteFormat[], bool:bFileFirst = false, bool:bExtra = false, extra = 0, bool:bLocal = true, bool:bPassTag = false, bool:bFilter = true, filter[] = "")
-native bool:INI_Load(filename[], bool:bExtra = false, extra = 0, bool:bLocal = true)
-native
-native INI_Int(name[], &dest);
-native INI_Float(name[], &Float:dest);
-native INI_Hex(name[], &dest);
-native INI_Bin(name[], &dest);
-native INI_String(name[], dest[], size);
-native
-native INI:INI_Open(filename[])
-native INI_Close(INI:file)
-native
-native INI_SetTag(INI:file, tag[])
-native INI_DeleteTag(INI:file, tag[])
-native INI_WriteArray(INI:file, const name[], data[], len)
-native INI_RemoveEntry(INI:file, name[])
-native INI_WriteString(INI:file, name[], data[])
-native INI_WriteInt(INI:file, name[], data)
-native INI_WriteHex(INI:file, name[], data)
-native INI_WriteBin(INI:file, name[], data)
-native INI_WriteBool(INI:file, name[], bool:data)
-native INI_WriteFloat(INI:file, name[], Float:data, accuracy = 6)
-native
- 
-*/
- 
-#include <YSI\y_ini>
- 
-/*
- 
-native
-native __y_inline__();
-native
-native
-native using();
-native inline();
-native
-native Callback_Get(callback:name, result[E_CALLBACK_DATA], expect = -1);
-native Callback_Release(const input[E_CALLBACK_DATA]);
-native Callback_Call(const input[E_CALLBACK_DATA], {Float, _}:...);
-native
- 
-*/
- 
-#include <YSI\y_inline>
- 
-/*
- 
-native
-native __y_iterate__();
-native
-native
-native Iter_Init(Iterator:arr[]<>);
-native Iter_Add(Iterator:iter<>, element);
-native Iter_Remove(Iterator:iter<>, element);
-native Iter_Contains(Iterator:iter<>, element);
-native Iter_SafeRemove(Iterator:iter<>, element, &ret);
-native Iter_Random(Iterator:iter<>);
-native Iter_Count(Iterator:iter<>);
-native Iter_Clear(Iterator:iter<>);
-native Iter_Free(Iterator:iter<>);
-native
-native foreach();
-native
-native Iter_Begin(Iterator:iter<>);
-native Iter_End(Iterator:iter<>);
-native Iter_First(Iterator:iter<>);
-native Iter_Last(Iterator:iter<>);
-native Iter_Next(Iterator:iter<>, cur);
-native Iter_Prev(Iterator:iter<>, cur);
-native
- 
-*/
- 
-#include <YSI\y_iterate>
- 
-/*
- 
-native
-native __y_languages__();
-native
-native
-native Language:Langs_Add(code[], name[]);
-native Language:Langs_SetPlayerLanguage(playerid, Language:l);
-native Language:Langs_GetPlayerLanguage(playerid);
-native
-native Language:Langs_AddLanguage(code[], name[]);
-native Langs_RemoveLanguage(Language:l);
-native Language:Langs_GetLanguage(identifier[]);
-native Language:Langs_GetLanguageCount();
-native Langs_GetLanguageCodes();
-native Langs_GetName(Language:l);
-native Langs_GetCode(Language:l);
-native bool:Langs_IsValid(Language:l);
-native Language:Langs_SetPlayerCode(playerid, code[]);
-native
- 
-*/
- 
-#include <YSI\y_languages>
- 
-/*
- 
-native
-native __y_lock__();
-native
-native
-native
- 
-*/
- 
-// DO NOT include by default!
-//#include <YSI\y_lock>
- 
-/*
- 
-native
-native __y_malloc__();
-native
-native
-native Alloc:malloc(size);
-native Alloc:calloc(size);
-native free(Alloc:slot);
-native
-native mget(Alloc:array, index);
-native mset(Alloc:array, index, value);
-native mgets(target[], length, Alloc:array, index);
-native msets(Alloc:array, index, const str[]);
-native
-native Malloc_SlotSize(Alloc:array);
-native Malloc_Get(Alloc:array, index);
-native Malloc_Set(Alloc:array, index, value);
-native Malloc_GetS(target[], length, Alloc:array, index);
-native Malloc_SetS(Alloc:array, index, const str[]);
-native Malloc_GetA(target[], length, Alloc:array, index);
-native Malloc_SetA(Alloc:array, index, const arr[], len);
-native
- 
-*/
- 
-#include <YSI\y_malloc>
- 
-/*
- 
-native
-native __y_master__();
-native
-native
-native Master_Caller();
-native
-native foreign();
-native global();
-native
- 
-*/
- 
-#include <YSI\y_master>
- 
-/*
- 
-native
-native __y_php__();
-native
-native
-native PHP_SendString(string:name[], string:value[], bool:priority = false);
-native PHP_SendFloat(string:name[], Float:value, bool:priority = false);
-native PHP_SendBool(string:name[], bool:value, bool:priority = false);
-native PHP_SendInt(string:name[], value, bool:priority = false);
-native
-native phpdata();
-native phpfunc();
-native
- 
-*/
- 
-// DO NOT include by default!
-//#include <YSI\y_php>
- 
-/*
- 
-native
-native __y_playerarray__();
-native
-native
-native PA_Init(PlayerArray:pa<>, bool:init = false, s = bits<MAX_PLAYERS>);
-native PA_FastInit(PlayerArray:pa<>);
-native PA_Set(PlayerArray:pa<>, slot, bool:set);
-native PA_Let(PlayerArray:pa<>, slot);
-native PA_Vet(PlayerArray:pa<>, slot);
-native PA_Get(PlayerArray:pa<>, slot);
-native PA_GetCount(PlayerArray:pa<>);
-native Iterator:PA(PlayerArray:pa<>);
-native
- 
-*/
- 
-#include <YSI\y_playerarray>
- 
-/*
- 
-native
-native __y_playerset__();
-native
-native
-native Iterator:PS(@PlayerSet:iter);
-native
- 
-*/
- 
-#include <YSI\y_playerset>
- 
-/*
- 
-native
-native __y_remote__();
-native
-native
-native remotefunc();
-native broadcastfunc();
-native localfunc();
-native targetfunc();
-native
- 
-*/
- 
-#include <YSI\y_remote>
- 
-/*
- 
-native
-native __y_scriptinit__();
-native
-native
-native
- 
-*/
- 
-#include <YSI\y_scriptinit>
- 
-/*
- 
-native
-native __y_stringhash__();
-native
-native
-native YHash(const str[], bool:sensitive = true, e_HASH_TYPE:type = hash_bernstein, len = -1, pack = false);
-native
- 
-*/
- 
-#include <YSI\y_stringhash>
- 
-/*
- 
-native
-native __y_svar__();
-native
-native
-native svar();
-native
- 
-*/
- 
-#include <YSI\y_svar>
- 
-/*
- 
-native
-native __y_td__();
-native
-native
-native Style:TD_Create(Float:x = 0.0, Float:y = 0.0, Float:letterX = 0.48, Float:letterY = 1.12, Float:textX = 1280.0, Float:textY = 1280.0, colour = 0xE1E1E1FF, boxColour = 0x80808080, bgColour = 0x000000FF, shadow = 2, outline = 0, align = _:td_align_none, font = 1, bool:proportional = false, bool:box = false, time = 0, name[] = "\1");
-native TD_Delete(Style:styleId);
-native
-native Text:TD_Display(text[], Style:id, Float:x = NAN, Float:y = NAN);
-native TD_Destroy(Text:textDraw);
-native TD_TextPosition(Text:textID, Float:x, Float:y);
-native TD_TextXPos(Text:textID, Float:x);
-native TD_TextYPos(Text:textID, Float:y);
-native TD_SetString(Text:td, text[]);
-native
-native TD_ShowForPlayer(playerid, Text:textDraw);
-native TD_HideForPlayer(playerid, Text:textDraw);
-native TD_ShowForAll(Text:textDraw);
-native TD_HideForAll(Text:textDraw);
-native Text:TD_DisplayForPlayer(playerid, text[], Style:id, Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayForAll(text[], Style:id, Float:x = NAN, Float:y = NAN);
-native
-native TD_StylePosition(Style:styleID, Float:x, Float:y);
-native TD_StyleXPos(Style:styleID, Float:x);
-native TD_StyleYPos(Style:styleID, Float:y);
-native TD_LetterSize(Style:styleID, Float:x, Float:y);
-native TD_LetterX(Style:styleID, Float:x);
-native TD_LetterY(Style:styleID, Float:y);
-native TD_TextSize(Style:styleID, Float:x, Float:y);
-native TD_TextX(Style:styleID, Float:x);
-native TD_TextY(Style:styleID, Float:y);
-native TD_Alignment(Style:styleID, alignment = _:td_align_none);
-native TD_Colour(Style:styleID, colour);
-native TD_Color(Style:styleID, color);
-native TD_UseBox(Style:styleID, bool:use);
-native TD_BoxColour(Style:styleID, colour);
-native TD_BoxColor(Style:styleID, color);
-native TD_SetShadow(Style:styleID, size);
-native TD_SetOutline(Style:styleID, size);
-native TD_BackgroundColour(Style:styleID, colour);
-native TD_BackgroundColor(Style:styleID, color);
-native TD_Font(Style:styleID, font);
-native TD_SetProportional(Style:styleID, bool:set);
-native TD_SetTime(Style:styleID, time, bool:existing = false);
-native
-native TD_Morph(Text:textDraw, Style:style, time, delay = 0);
-native TD_Link(Text:base, Text:other);
-native TD_Unlink(Text:td);
-native Style:TD_GetDisplayStyle(Text:td);
-native Text:TD_DisplayHashed(text[], hash, Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayHashedForPlayer(playerid, text[], hash, Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayHashedForAll(text[], hash, Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayNamed(text[], style[], Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayNamedForPlayer(playerid, text[], style[], Float:x = NAN, Float:y = NAN);
-native Text:TD_DisplayNamedForAll(text[], style[], Float:x = NAN, Float:y = NAN);
-native TD_Garbage(Text:textDraw);
-native TD_Parse(filename[]);
-native
-native Style:TD_GetNamed(name[]);
-native Style:TD_GetID(hash);
-native Style:TD_Clone(Style:styleID, name[] = "\1");
-native TD_GetStyleData(Style:styleID, ret[E_TD_DATA]);
-native TD_Name(Style:styleID, name[]);
-native
- 
-*/
- 
-#include <YSI\y_td>
- 
-/*
- 
-native
-native __y_testing__();
-native
-native
-native Testing_RunAll();
-native
- 
-*/
- 
-// DO NOT include by default!
-//#include <YSI\y_testing>
- 
-/*
- 
-native
-native __y_text__();
-native
-native
-native Text_Send(@PlayerSet:players, message[], {Float, _}:...);
-native
-native Text_MessageBox(@PlayerSet:players, using:callback[], title[], text[], button1[], button2[], {Float, _}:...);
-native Text_InputBox(@PlayerSet:players, using:callback[], title[], text[], button1[], button2[], {Float, _}:...);
-native Text_ListBox(@PlayerSet:players, using:callback[], title[], text[], button1[], button2[], {Float, _}:...);
-native Text_PasswordBox(@PlayerSet:players, using:callback[], title[], text[], button1[], button2[], {Float, _}:...);
-native Text_DialogBox(@PlayerSet:players, style, using:callback[], title[], text[], button1[], button2[], {Float, _}:...);
-native
- 
-*/
- 
-#include <YSI\y_text>
- 
-/*
- 
-native
-native __y_timers__();
-native
-native
-native stop();
-native defer();
-native repeat();
-native timer();
-native task();
-native ptask();
-native pause();
-native resume();
-native
- 
-*/
- 
-#include <YSI\y_timers>
- 
-/*
- 
-native
-native __y_users__();
-native
-native
-native Language:Player_GetPreloadLanguage(playerid);
-native Player_IsRegistered(playerid);
-native bool:Player_IsLoggedIn(playerid);
-native Player_GetYID(playerid);
-native
-native Player_RemoveEntry(name[]);
-native Player_WriteString(name[], data[]);
-native Player_WriteArray(const name[], data[], len);
-native Player_WriteInt(name[], data);
-native Player_WriteHex(name[], data);
-native Player_WriteBin(name[], data);
-native Player_WriteBool(name[], bool:data);
-native Player_WriteFloat(name[], Float:data, accuracy = 6);
-native Player_SetTag(tag[]);
-native Player_DeleteTag(tag[]);
-native
-native Player_TryLogin(playerid, password[]);
-native Player_ForceLogin(playerid);
-native Player_TryRegister(playerid, password[]);
-native Player_ChangePassword(playerid, password[]);
-native Player_TryGroup(playerid, other[], password[]);
-native Player_ForceGroup(playerid, other[]);
-native
-native Player_Reload(playerid);
-native Player_SetPreload(playerid, data[E_USER_PRELOAD]);
-native Player_Preload(name[], ret[E_USER_PRELOAD]);
-native
- 
-*/
- 
-#include <YSI\y_users>
- 
-/*
- 
-native
-native __y_utils__();
-native
-native
-native ceildiv(num, denom);
-native floordiv(num, denom);
-native isnull(str[]);
-native isodd(num);
+	18/06/07:
+		Updated YSI_text functions.
+	18/04/07:
+		Added new files.
+		Moved objects and checkpoints to YSI/Visual/.
+	17/04/07:
+		Added new files.
+	16/04/07:
+		Added native definitions
+	15/04/07:
+		First version
+Functions:
+	Public:
+		-
+	Core:
+		-
+	Stock:
+		-
+	Static:
+		-
+	Inline:
+		-
+	API:
+		-
+Callbacks:
+	-
+Definitions:
+	-
+Enums:
+	-
+Macros:
+	-
+Tags:
+	-
+Variables:
+	Global:
+		-
+	Static:
+		-
+Commands:
+	-
+Compile options:
+	_YSI_DEBUG - Use YSI/YSI_debug.own.
+	_YSI_MISC - Use YSI/YSI_misc.own.
+	_YSI_CORE_BIT - Use YSI/Core/YSI_bit.own.
+	_YSI_CORE_BINTREE - Use YSI/Core/YSI_bintree.own.
+	_YSI_CORE_INI - Use YSI/Core/YSI_INI.own.
+	_YSI_CORE_TEXT - Use YSI/Core/YSI_text.own.
+	_YSI_CORE_FORMAT - Use YSI/Core/YSI_format.own.
+	_YSI_CORE_LANGUAGES - Use YSI/Core/YSI_languages.own.
+	_YSI_CORE_COMMANDS - Use YSI/Core/YSI_commands.own.
+	_YSI_CORE_PLAYER - Use YSI/Core/YSI_player.own.
+	_YSI_SERVER_MODULES - Use YSI/Server/YSI_modules.own.
+	_YSI_VISUAL_OBJECTS - Use YSI/Visual/YSI_objects.own
+	_YSI_VISUAL_CHECKPOINTS - Use YSI/Visual/YSI_objects.own
+	_YSI_SYSTEM_DEFAULT - Use YSI/System/YSI_default.own.
+Operators:
+	-
+-*----------------------------------------------------------------------------*/
+
+#include <a_samp>
+
+#if defined _YSI_included
+	#endinput
+#endif
+#define _YSI_included
+
+/*----------------------------------------------------------------------------*-
+					===============
+					/YSI/ Libraries
+					===============
+-*----------------------------------------------------------------------------*/
+
+/*
+native _DEPENDECENCY_FUNCTIONS_();
+	native
+*/
+#include "YSI/YSI_dependencies.own"
+
+/*
+native _DEBUG_FUNCTIONS_();
+	native
+native Debug_Code_<level>(code);
+native Debug_Print_<level>(format[], {Float,_}:...);
+	native
+*/
+#if defined _YSI_DEBUG
+	#include "YSI/YSI_debug.own"
+#endif
+
+/*
+native _MISC_FUNCTIONS_();
+	native
+native ceildiv(num, div);
+native floordiv(num, div);
 native iseven(num);
-native strcpy(dest[], src[], maxlength = sizeof (dest));
-native StripNL(str[]);
-native endofline(line[], pos);
+native isodd(num);
 native chrfind(needle, haystack[], start = 0);
-native chrfindp(needle, haystack[], start = 0);
+native chrnfind(needle, haystack[], start = 0);
+native strcpy(dest[], source[], max, len = -1);
 native bernstein(string[]);
-native ishex(str[]);
-native unpack(const str[]);
-native GetIP(playerid);
-native getstring(addr);
-native getstringarg(addr);
-native isnumeric(str[]);
+native StripNL(str[]);
+native strconcat(...);
+native QuickSort(numbers[], arraySize);
+native chrtolower(chr);
+native strtolower(str[]);
 native hexstr(string[]);
-native bool:boolstr(string[]);
-native binstr(string[]);
-native memset(dest[], size = sizeof (dest), val = 0, blocksize = 8);
+native bool:binstr(string[]);
 native ReturnPlayerName(playerid);
-native ftouch(const filename[]);
-native
- 
-*/
- 
-#include <YSI\y_utils>
- 
-/*
- 
-native
-native __y_uvar__();
-native
-native
-native uvar();
-native
- 
-*/
- 
-#include <YSI\y_uvar>
- 
-/*
- 
-native
-native __y_va__();
-native
-native
-native va_printf(fmat[], va_start);
-native va_format(out[], size, fmat[], va_start);
-native va_strlen(arg);
-native va_getstring(dest[], arg, len = sizeof (dest));
-native
- 
-*/
- 
-#include <YSI\y_va>
- 
-/*
- 
-native
-native __y_writemem__();
-native
-native
-native WriteMem(addr, value);
-native
- 
-*/
- 
-#include <YSI\y_writemem>
- 
-/*
- 
-native
-native __y_xml__();
-native
-native
-native XML:XML_New();
-native XML_Destroy(XML:rule);
-native
-native XML_AddHandler(XML:rule, trigger[], function[]);
-native XML_RemoveHandler(XML:rule, trigger[]);
-native XML_Parse(XML:rule, filename[]);
-native XML_GetKeyValue(key[], value[]);
-native
-native XMLEntry:XML_AddParameter(XMLEntry:parent, tag[], value[] = "");
-native XMLEntry:XML_AddItem(tag[], name[] = "", XMLEntry:parent = XMLEntry:cellmax);
-native XMLEntry:XML_CreateEntry(tag[], name[] = "", XMLEntry:parent = XMLEntry:cellmax);
-native XMLEntry:XML_AddSubEntry(tag[], name[] = "", XMLEntry:parent = XMLEntry:cellmax);
-native XML_WriteItem(filename[], XMLEntry:item, bool:bIncludeXML = true, bool:bFavourShort = false);
-native XML_WriteEntry(filename[], XMLEntry:item, bool:bIncludeXML = true, bool:bFavourShort = false);
-naitve XML_RemoveItem(file[], tag[], name[]);
-naitve XML_ReplaceItem(file[], tag[], name[], replacement);
-native
- 
-*/
- 
-#include <YSI\y_xml>
- 
-/*
- 
-native
-native __y_zonepulse__();
-native
-native
-native GangZonePulse(@PlayerSet:players, zone, from, to, time, delay = ZONE_PULSE_STAGE_TIME, time2 = -1, delay2 = -1);
-native GangZonePulseForPlayer(playerid, zone, from, to, time, delay = ZONE_PULSE_STAGE_TIME, time2 = -1, delay2 = -1);
-native GangZonePulseForAll(zone, from, to, time, delay = ZONE_PULSE_STAGE_TIME, time2 = -1, delay2 = -1);
-native GangZoneStopPulse(@PlayerSet:players, zone);
-native GangZoneStopPulseForPlayer(playerid, zone);
-native GangZoneStopPulseForAll(zone);
-native
- 
-*/
- 
-#include <YSI\y_zonepulse>
+native ishex(str[]);
+native numstr(num);
+native chrtoupper(chr);
+native strtoupper(str[]);
+	native
+*/
+#if defined _YSI_MISC
+	#include "YSI/YSI_misc.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					====================
+					/YSI/Core/ Libraries
+					====================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _CORE_BIT_FUNCTIONS_();
+	native
+native Bit_Bits(num);
+native Bit_Get(Bit:array[], slot, size = sizeof (array));
+native Bit_Set(Bit:array[], slot, set, size = sizeof (array));
+native Bit_SetAll(Bit:array[], set, size = sizeof (array));
+native Bit_GetCount(Bit:array[], size = sizeof (array));
+native Bit_GetBits(Bit:array[], slot);
+	native
+*/
+#if defined _YSI_CORE_BIT
+	#include "YSI/Core/YSI_bit.own"
+#endif
+
+/*
+native _CORE_BINTREE_FUNCTIONS_();
+	native
+native Bintree_Sort(input[][E_BINTREE_INPUT], size);
+native Bintree_Fill(Bintree:output[][E_BINTREE_INPUT], data[][E_BINTREE_INPUT], size);
+native Bintree_Generate(Bintree:output[][E_BINTREE_TREE], input[][E_BINTREE_INPUT], size);
+native Bintree_Reset(Bintree:tree[][E_BINTREE_TREE], pointer = 0);
+native Bintree_FindValue(Bintree:tree[][E_BINTREE_TREE], value, &cont = 0, &old = 0);
+native Bintree_Add(Bintree:data[][E_BINTREE_TREE], input[E_BINTREE_INPUT], offset, maxsize = sizeof (data));
+native Bintree_Delete(Bintree:source[][E_BINTREE_TREE], index, count);
+native Bintree_UpdatePointers(Bintree:data[][E_BINTREE_TREE], offset, size, mod = -1);
+	native
+*/
+#if defined _YSI_CORE_BINTREE
+	#include "YSI/Core/YSI_bintree.own"
+#endif
+
+/*
+native _CORE_INI_FUNCTIONS_();
+	native
+native bool:INI_Load(filename[]);
+native bool:INI_ParseFile(filename[], remoteFormat[], bool:bFileFirst = false);
+native INI_GetEntryText(source[], dest[], i);
+native INI_BroadcastData(function[], identifier[], text[]);
+native bool:INI_GetEntryName(source[], dest[], &i);
+native INI_INI();
+native INI:INI_Open(filename[]);
+native INI_Close(INI:file);
+native INI_SetTag(INI:file, tag[]);
+native INI_WriteString(INI:file, name[], data[]);
+native INI_WriteInt(INI:file, name[], data);
+native INI_WriteFloat(INI:file, name[], Float:data, accuracy = 6);
+native INI_WriteBuffer(INI:file);
+native INI_String(name[], function);
+native INI_Bin(name[], function);
+native INI_Hex(name[], function);
+native INI_Float(name[], function);
+native INI_Int(name[], function);
+	native
+*/
+#if defined _YSI_CORE_INI
+	#include "YSI/Core/YSI_INI.own"
+#endif
+
+/*
+native _CORE_TEXT_FUNCTIONS_();
+	native
+naitve Text_Send(playerid, identifier[]);
+native Text_SendToAll(identifier[]);
+native Text_SendToGroup(group, identifier[]);
+native Text_SendToPlayers(Bit:players[], identifier[]);
+naitve Text_SendFormat(playerid, identifier[], {Float,_}:...);
+native Text_SendToAllFormat(identifier[], {Float,_}:...);
+native Text_SendToGroupFormat(group, identifier[], {Float,_}:...);
+native Text_SendToPlayersFormat(Bit:players[], identifier[], {Float,_}:...);
+native Text_Text();
+native Text_AddToBuffer(identifier[], text[]);
+native Text_ResetAll();
+native Text_NewLanguage(Language:languageID);
+native Text_Parse();
+native Text_GetText(identifier[], Language:languageID);
+native Text_RegisterTag(tag[]);
+native Text_GetTextStyle(index);
+native Text_GetTextColour(index);
+native Text_GetTextTime(index);
+native Text_GetTextFromIndex(index, Language:languageID, identifier[]);
+native Text_GetErrorMessage(Language:languageID);
+	native
+*/
+#if defined _YSI_CORE_TEXT
+	#include "YSI/Core/YSI_text.own"
+#endif
+
+/*
+native _CORE_FORMAT_FUNCTIONS_();
+	native
+native Format_SendFormattedText(playerid, type, colorTime, identifier[], {Float,_}:...);
+	native
+*/
+#if defined _YSI_CORE_FORMAT
+	#include "YSI/Core/YSI_format.own"
+#endif
+
+/*
+native _CORE_COMMAND_FUNCTIONS_();
+	native
+native Command_IsCleared(playerid, command);
+native Command_SetDisconnectReturn(set);
+native Command_SetIllegalReturn(set);
+native Command_UseShortCuts(set);
+native Command_SetDeniedReturn(set);
+native Command_UseDeniedMessage(set);
+native Command_UseAltNames(set);
+native Command_UsePrefix(set);
+native Command_UseSpace(set);
+native Command_Add(funcname[]);
+native Command_Parse();
+native Command_SetAltName(funcname[], altname[]);.
+native Comamnd_SetPlayerUse(command[], playerid, set);
+native Comamnd_SetPlayerUseByID(command, playerid, set);
+native Command_SetPrefix(prefix[]);
+native Command_Process(playerid, cmdtext[], help = 0);
+native Command_Name(funcname[]);
+	native
+native ycmd(command[]);
+	native
+*/
+#if defined _YSI_CORE_COMMANDS
+	#include "YSI/Core/YSI_commands.own"
+#endif
+
+/*
+native _CORE_LANGUAGE_FUNCTIONS_();
+	native
+native Langs_Langs();
+native Langs_IsActive(Language:languageID);
+native Langs_GetLanguageIdentifier(Language:languageID);
+native Langs_GetLanguageID(identifier[]);
+native Langs_ResetAll();
+native Langs_SaveEnteredData();
+native bool:Langs_LoadLanguage(LanguagelanguageID);
+native Langs_LoadAll();
+native Langs_AddLanguage(identifer[], name[]);
+native Langs_AddFile(filename[], path[] = "");
+native Langs_GetLanguageName(Language:languageID);
+native Langs_IsValid(Language:languageID);
+	native
+*/
+#if defined _YSI_CORE_LANGUAGES
+	#include "YSI/Core/YSI_languages.own"
+#endif
+
+/*
+native _CORE_PLAYER_FUNCTIONS_();
+	native
+native Language:Player_GetPlayerLanguage(playerid);
+native Player_OnPlayerConnect(playerid);
+native Player_Player();
+native Player_OnPlayerDisconnect(playerid, reason);
+native Player_SetPlayerLanguage(playerid, Language:languageID);
+native Player_FindShortCut(playerid, shortcut, cmdname[]);
+native Player_SetTag(tag[]);
+native Player_WriteString(name[], data[]);
+native Player_WriteInt(name[], data);
+native Player_WriteFloat(name[], Float:data, accuracy = 6);
+	native
+*/
+#if defined _YSI_CORE_PLAYER
+	#include "YSI/Core/YSI_player.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					======================
+					/YSI/Server/ Libraries
+					======================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _SERVER_MODULE_FUNCTIONS_();
+	native
+native Modules_Modules();
+native Modules_IsActive(Module:moduleID);
+native Modules_IsPrivate(Module:moduleID);
+native bool:Modules_LoadAll();
+native Modules_CloseAll();
+native Modules_Close(name[]);
+native Modules_CloseID(Module:id);
+native Module:Modules_Register(name[], tag[], hidden);
+native Modules_GetModuleCount();
+native Modules_GetVisibleCount();
+native Modules_GetHiddenCount();
+	native
+*/
+#if defined _YSI_SERVER_MODULES
+	#include "YSI/Server/YSI_modules.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					======================
+					/YSI/Visual/ Libraries
+					======================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _VISUAL_OBJECT_FUNCTIONS_();
+	native
+native Object_Object();
+native Object_AddToPlayer(objectid, playerid);
+native Object_AddToWorld(objectid, virtualworld);
+native Object_AddToAllPlayers(objectid);
+native Object_AddToAllWorlds(objectid);
+native Object_RemoveFromPlayer(objectid, playerid);
+native Object_RemoveFromWorld(objectid, virtualworld);
+native Object_RemoveFromAllPlayers(objectid);
+native Object_RemoveFromAllWorlds(objectid);
+native Object_OnPlayerDisconnect(playerid, reason);
+native Object_IsGlobal(objectid);
+	native
+native MoveDynamicObject(objectid, Float:X, Float:Y, Float:Z, Float:S);
+native StopDynamicObject(objectid);
+native IsValidDynamicObject(objectid);
+native CreateDynamicObject(model, Float:X, Float:Y, Float:Z, Float:RX = 0.0, Float:RY = 0.0, Float:RZ = 0.0);
+native CreatePlayerDynamicObject(playerid, model, Float:X, Float:Y, Float:Z, Float:RX = 0.0, Float:RY = 0.0, Float:RZ = 0.0);
+native CreateVWDynamicObject(virtualworld, model, Float:X, Float:Y, Float:Z, Float:RX = 0.0, Float:RY = 0.0, Float:RZ = 0.0);
+native CreatePlayerVWDynamicObject(playerid, virtualworld, model, Float:X, Float:Y, Float:Z, Float:RX = 0.0, Float:RY = 0.0, Float:RZ = 0.0);
+native DestroyDynamicObject(objectid);
+native GetDynamicObjectPos(objectid, &Float:X, &Float:Y, &Float:Z);
+native GetDynamicObjectRot(objectid, &Float:RX, &Float:RY, &Float:RZ);
+native SetDynamicObjectPos(objectid, Float:X, Float:Y, Float:Z);
+native SetDynamicObjectRot(objectid, Float:RX, Float:RY, Float:RZ);
+native AttachDynamicObjectToPlayer(objectid, playerid, Float:offX, Float:offY, Float:offZ, Float:rX, Float:rY, Float:rZ);
+native DetachDynamicObjectFromPlayer(objectid);
+native IsValidModel(modelid);
+	native
+*/
+#if defined _YSI_VISUAL_OBJECTS
+	#include "YSI/Visual/YSI_objects.own"
+#endif
+
+/*
+native _VISUAL_CHECKPOINT_FUNCTIONS_();
+	native
+native Checkpoint_Checkpoint();
+native Checkpoint_SetVisible(cpid, set);
+native Checkpoint_SetAllWorlds(cpid, set);
+native Checkpoint_SetAllPlayers(cpid, set);
+native Checkpoint_AddPlayer(cpid, playerid);
+native Checkpoint_RemovePlayer(cpid, playerid);
+native Checkpoint_AddVW(cpid, vwid);
+native Checkpoint_RemoveVW(cpid, vwid);
+native Checkpoint_HasPlayer(cpid, playerid);
+native Checkpoint_HasPlayerNoWorld(cpid, playerid);
+native Checkpoint_Get(playerid);
+native Checkpoint_OnPlayerEnterCheckpoint(playerid);
+native Checkpoint_OnPlayerLeaveCheckpoint(playerid);
+native Checkpoint_OnPlayerConnect(playerid);
+native Checkpoint_IsGlobal(checkpoint);
+	native
+native CreateCheckpoint(Float:x, Float:y, Float:z, Float:size, players = 0, vws = 0);
+native IsValidCheckpoint(cpid);
+native DestroyCheckpoint(cpid);
+	native
+*/
+#if defined _YSI_VISUAL_CHECKPOINTS
+	#include "YSI/Visual/YSI_checkpoints.own"
+#endif
+
+/*
+native _VISUAL_RACE_FUNCTIONS_();
+	native
+native Race_Race();
+native Race_OnPlayerEnterRaceCP(playerid);
+native Race_OnPlayerStateChange(playerid, newstate, oldstate);
+native Race_OnPlayerDisconnect(playerid, reason);
+native Race_Create(laps = 0, entry = 0, countdown = 3, bool:arial = 0, bool:fixedPrize = 1, exitTime = 0, interior = 0, world = 0, bool:restart = 0);
+native Race_AddCheckpoint(raceid, Float:x, Float:y, Float:z);
+native Race_AddStart(raceid, Float:x, Float:y, Float:z, Float:a);
+native Race_SetFixedWin(raceid, set);
+native Race_SetArial(raceid, set);
+native Race_PlayerLeave(playerid, refund = 0);
+native Race_SetCountdown(raceid, countdown);
+native Race_SetInterior(raceid, interior);
+native Race_SetWorld(raceid, world);
+native Race_SetPrize(raceid, position, amount);
+native Race_SetExitTime(raceid, time);
+native Race_IsActive(raceid);
+native Race_SetLaps(raceid, laps);
+native Race_SetEntry(raceid, cost);
+native Race_GetPlayerExitedTime(playerid);
+native Race_PlayerJoin(playerid, race);
+native Race_Start(race);
+native Race_GetPlayerRaceTime(playerid);
+native Race_GetPlayerPosition(playerid);
+	native
+*/
+#if defined _YSI_VISUAL_RACE
+	#include "YSI/Visual/YSI_race.own"
+#endif
+
+/*
+native _VISUAL_AREA_FUNCTIONS_();
+	native
+native Area_Area();
+native Area_OnPlayerConnect(playerid);
+native Area_Delete(area);
+native Area_AddCube(Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz);
+native Area_AddBox(Float:minx, Float:miny, Float:maxx, Float:maxy);
+native Area_AddCircle(Float:x, Float:y, Float:r, Float:h = 10000.0);
+native Area_AddSphere(Float:x, Float:y, Float:z, Float:r);
+native Area_AddPoly(Float:x1, Float:y1, Float:x2, Float:y2, Float:x3, Float:y3, Float:...);
+native Area_GetPlayerArea(playerid);
+native Area_SetPlayer(area, playerid, set);
+native Area_SetAllPlayers(area, set);
+native Area_SetAllWorlds(area, set);
+native Area_SetWorld(area, world, set);
+native Area_IsValid(area);
+	native
+*/
+#if defined _YSI_VISUAL_AREAS
+	#include "YSI/Visual/YSI_areas.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					========================
+					/YSI/Gamemode/ Libraries
+					========================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _GAMEMODE_PROPERTY_FUNCTIONS_();
+	native
+native Property_OnPlayerSelectedMenuRow(playerid, row);
+native Property_OnPlayerExitedMenu(playerid);
+native Property_OnPlayerEnterCheckpointEx(playerid, cpid);
+native Property_OnPlayerLeaveCheckpointEx(playerid, cpid);
+native Property_OnPlayerSpawn(playerid);
+native Property_OnPlayerConnect(playerid);
+native Property_OnPlayerLeaveArea(playerid, area);
+native Property_OnPlayerEnterArea(playerid, area);
+native Property_GetPlayerPropCount(playerid);
+native Property_GetLink(property);
+native Property_GetType(property);
+native Property_IsValid(property);
+native Property_Bank(playerid, amount);
+native Property_SavePlayerWeapon(playerid, weaponslot, ammo);
+native Property_SaveWeapons(playerid);
+native Property_LoadWeapons(playerid, identifier[], text[]);
+native Property_SaveBank(playerid);
+native Property_LoadBank(playerid, identifier[], text[]);
+	native
+native CreateProperty(name[], Float:x, Float:y, Float:z, price, reward, interval = 60000, sell = 0, multi = 0, reduce = 0, increase = 0);
+native CreateBank(Float:x, Float:y, Float:z, name[] = "");
+native CreateAmmunation(Float:x, Float:y, Float:z, spawn, instant, weapon, ammo, price, ...);
+native CreateMoneyArea(area, money = 100, interval = 10000);
+native CreateMoneyPoint(Float:x, Float:y, Float:z, Float:s, money = 100, interval = 10000);
+native CreateTeleport(Float:sx, Float:sy, Float:sz, Float:tx, Float:ty, Float:tz, cost = 0, name[] = "");
+native CreateForbiddenArea(area, kick = 0, health = 1000, invert = 0, name[] = "");
+native DestroyProperty(property);
+	native
+*/
+#if defined _YSI_GAMEMODE_PROPERTIES
+	#include "YSI/Gamemode/YSI_properties.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					======================
+					/YSI/System/ Libraries
+					======================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _SYSTEM_DEFAULT_FUNCTIONS_();
+	native
+native Default_Setup();
+native Default_OnGameModeInit();
+native Default_OnGameModeExit();
+native Default_OnFilterScriptInit();
+native Default_OnFilterScriptExit();
+native Default_OnPlayerConnect(playerid);
+native Default_OnPlayerDisconnect(playerid, reason);
+native Default_OnPlayerSpawn(playerid);
+native Default_OnPlayerDeath(playerid, killerid, reason);
+native Default_OnVehicleSpawn(vehicleid);
+native Default_OnVehicleDeath(vehicleid, killerid);
+native Default_OnPlayerText(playerid, text[]);
+native Default_OnPlayerCommandText(playerid, cmdtext[]);
+native Default_OnPlayerInfoChange(playerid);
+native Default_OnPlayerRequestClass(playerid, classid);
+native Default_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
+native Default_OnPlayerExitVehicle(playerid, vehicleid);
+native Default_OnPlayerStateChange(playerid, newstate, oldstate);
+native Default_OnPlayerEnterCheckpoint(playerid);
+native Default_OnPlayerLeaveCheckpoint(playerid);
+native Default_OnPlayerEnterRaceCheckpoint(playerid);
+native Default_OnPlayerLeaveRaceCheckpoint(playerid);
+native Default_OnRconCommand(cmd[]);
+native Default_OnPlayerPrivmsg(playerid, recieverid, text[]);
+native Default_OnPlayerRequestSpawn(playerid);
+native Default_OnObjectMoved(objectid);
+native Default_OnPlayerObjectMoved(playerid, objectid);
+native Default_OnPlayerPickUpPickup(playerid, pickupid);
+native Default_OnVehicleMod(vehicleid, componentid);
+native Default_OnVehiclePaintjob(vehicleid, paintjobid);
+native Default_OnVehicleRespray(vehicleid, color1, color2);
+native Default_OnPlayerSelectedMenuRow(playerid, row);
+native Default_OnPlayerExitedMenu(playerid);
+	native
+native LoadScript();
+	native
+*/
+#if defined _YSI_SYSTEM_DEFAULT
+	#include "YSI/System/YSI_default.own"
+#endif
+
+/*
+native _SYSTEM_GROUP_FUNCTIONS_();
+	native
+native Group_NameGroup(group, name[]);
+native Group_SetCommand(group, command[], set);
+native Group_SetCommandByID(group, command, set);
+native Group_UpdatePlayerCommand(command, playerid);
+native Group_SetCheckpoint(group, checkpoint, set);
+native Group_UpdatePlayerCheckpoint(checkpoint, playerid);
+native Group_SetObject(group, object, set);
+native Group_UpdatePlayerObject(object, playerid);
+native Group_SetArea(group, area, set);
+native Group_UpdatePlayerArea(area, playerid);
+native Group_SetProperty(group, property, set);
+native Group_UpdatePlayerProperty(property, playerid);
+native Group_AddPlayer(group, playerid);
+native Group_RemovePlayer(group, playerid);
+native Group_RemovePlayerFromAllGroups(playerid);
+native Bit:Group_GetGroupMembers(group);
+native Group_GetGroups(playerid);
+	native
+*/
+#if defined _YSI_SYSTEM_GROUPS
+	#include "YSI/System/YSI_groups.own"
+#endif
+
+/*
+native _SYSTEM_SCRIPT_FUNCTIONS_();
+	native
+native Script_OnGameModeInit();
+native Script_OnGameModeExit();
+native Script_OnFilterScriptInit();
+native Script_OnFilterScriptExit();
+native Script_OnPlayerConnect(playerid);
+native Script_OnPlayerDisconnect(playerid, reason);
+native Script_OnPlayerSpawn(playerid);
+native Script_OnPlayerDeath(playerid, killerid, reason);
+native Script_OnVehicleSpawn(vehicleid);
+native Script_OnVehicleDeath(vehicleid, killerid);
+native Script_OnPlayerText(playerid, text[]);
+native Script_OnPlayerCommandText(playerid, cmdtext[]);
+native Script_OnPlayerInfoChange(playerid);
+native Script_OnPlayerRequestClass(playerid, classid);
+native Script_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
+native Script_OnPlayerExitVehicle(playerid, vehicleid);
+native Script_OnPlayerStateChange(playerid, newstate, oldstate);
+native Script_OnPlayerEnterCheckpoint(playerid);
+native Script_OnPlayerLeaveCheckpoint(playerid);
+native Script_OnPlayerEnterRaceCheckpoint(playerid);
+native Script_OnPlayerLeaveRaceCheckpoint(playerid);
+native Script_OnRconCommand(cmd[]);
+native Script_OnPlayerPrivmsg(playerid, recieverid, text[]);
+native Script_OnPlayerRequestSpawn(playerid);
+native Script_OnObjectMoved(objectid);
+native Script_OnPlayerObjectMoved(playerid, objectid);
+native Script_OnPlayerPickUpPickup(playerid, pickupid);
+native Script_OnVehicleMod(vehicleid, componentid);
+native Script_OnVehiclePaintjob(vehicleid, paintjobid);
+native Script_OnVehicleRespray(vehicleid, color1, color2);
+native Script_OnPlayerSelectedMenuRow(playerid, row);
+native Script_OnPlayerExitedMenu(playerid);
+native Script_OnPlayerLogin(playerid, data[]);
+native Script_OnPlayerLogout(playerid);
+native Script_OnPlayerEnterCheckpointEx(playerid, cpid);
+native Script_OnPlayerLeaveCheckpointEx(playerid, cpid);
+native Script_OnPlayerEnterArea(playerid, area);
+native Script_OnPlayerLeaveArea(playerid, area);
+	native
+*/
+#if defined _YSI_SYSTEM_SCRIPT
+	#include "YSI/System/YSI_script.own"
+#endif
+
+/*----------------------------------------------------------------------------*-
+					===================
+					/YSI/ Libraries (2)
+					===================
+-*----------------------------------------------------------------------------*/
+
+/*
+native _POST_FUNCTIONS_();
+	native
+*/
+#include "YSI/YSI_post.own"

BIN
pawno/pawncc.exe


+ 6 - 6
pawno/settings.ini

@@ -2,13 +2,13 @@
 FileAssoc=1
 [Display]
 WindowMax=1
-WindowX=279
-WindowY=112
-WindowW=790
-WindowH=485
-Splitter=339
+WindowX=26
+WindowY=0
+WindowW=1024
+WindowH=575
+Splitter=30
 Font_Name=Courier New
-Font_Size=10
+Font_Size=11
 ShowFuncList=1
 [RunOpts]
 CopyDir=\

BIN
samp-npc


+ 634 - 0
scriptfiles/users/Dr_Smelly.ini

@@ -0,0 +1,634 @@
+Key=12DA034558716F854739ACA49ABF4005E40554C38F1284BCD673CD060B867AA7EF2B8C285A473BCF205D63FDFF60300D5197404E5641E5C4D9C1C3892B3D623A
+Level=1
+AdminLevel=0
+AdminName=0
+BanAppealer=0
+FactionMod=0
+GangMod=0
+HelperMod=0
+Donator=0
+Band=0
+WalkStyle=0
+PermBand=0
+Disabled=0
+IP=192.168.1.98
+Registered=1
+Tutorial=0
+Sex=1
+Age=18
+Skin=299
+SPos_x=2351.5
+SPos_y=-1169.9
+SPos_z=-22.3
+SPos_r=0.9
+ConnectedTime=0
+Respect=0
+PhoneNr=0
+Warnings=0
+Gang=255
+Faction=0
+Leader=0
+Rank=0
+Job=0
+Job2=0
+UpgradePoints=0
+SpawnArmor=0.0
+Cash=100
+Bank=100
+Insurance=0
+Crimes=0
+Arrested=0
+WantedLevel=0
+Health=100.0
+Armor=0.0
+Pot=0
+Crack=0
+Radio=0
+RadioFreq=0
+Phonebook=0
+Dice=0
+CDPlayer=0
+Materials=0
+Rope=0
+Cigars=0
+Sprunk=0
+Spraycan=0
+House=-1
+House2=-1
+Renting=-1
+Int=0
+VirtualWorld=0
+Jailed=0
+JailTime=0
+Gun0=0
+Gun1=0
+Gun2=0
+Gun3=0
+Gun4=0
+Gun5=0
+Gun6=0
+Gun7=0
+Gun8=0
+Gun9=0
+Gun10=0
+Gun11=0
+Paycheck=119
+PayReady=0
+Hospital=0
+DetSkill=0
+LawSkill=0
+SexSkill=0
+DrugsSkill=0
+SmugglerSkill=0
+ArmsSkill=0
+MechSkill=0
+FishSkill=0
+BoxSkill=0
+TruckSkill=0
+CarSkill=0
+LawyerTime=0
+LawyerFreeTime=0
+DrugsTime=0
+MechTime=0
+SexTime=0
+CarTime=0
+Fishes=0
+BiggestFish=0
+pWExists=0
+pWX=0.000000
+pWY=0.000000
+pWZ=0.000000
+pWVW=0
+pWInt=0
+pWValue=-1
+pWSeeds=0
+Wins=0
+Loses=0
+FightingStyle=4
+Screwdriver=0
+Smslog=0
+Wristwatch=0
+Tire=0
+Firstaid=0
+Rccam=0
+Receiver=0
+GPS=0
+Sweep=0
+SweepLeft=0
+Bugged=0
+pv0PosX=0.0
+pv0PosY=0.0
+pv0PosZ=0.0
+pv0PosAngle=0.0
+pv0ModelId=0
+pv0Lock=0
+pv0Locked=0
+pv0PaintJob=-1
+pv0Color1=0
+pv0Color2=0
+pv0Price=0
+pv0Ticket=0
+pv0Weapon0=0
+pv0Weapon1=0
+pv0Weapon2=0
+pv0WepUpgrade=0
+pv0Fuel=100.00
+pv0Impound=0
+pv0Spawned=0
+pv0Disabled=0
+pv0NumPlate=
+pv0Mod0=0
+pv0Mod1=0
+pv0Mod2=0
+pv0Mod3=0
+pv0Mod4=0
+pv0Mod5=0
+pv0Mod6=0
+pv0Mod7=0
+pv0Mod8=0
+pv0Mod9=0
+pv0Mod10=0
+pv0Mod11=0
+pv0Mod12=0
+pv0Mod13=0
+pv0Mod14=0
+pv1PosX=0.0
+pv1PosY=0.0
+pv1PosZ=0.0
+pv1PosAngle=0.0
+pv1ModelId=0
+pv1Lock=0
+pv1Locked=0
+pv1PaintJob=-1
+pv1Color1=0
+pv1Color2=0
+pv1Price=0
+pv1Ticket=0
+pv1Weapon0=0
+pv1Weapon1=0
+pv1Weapon2=0
+pv1WepUpgrade=0
+pv1Fuel=100.00
+pv1Impound=0
+pv1Spawned=0
+pv1Disabled=0
+pv1NumPlate=
+pv1Mod0=0
+pv1Mod1=0
+pv1Mod2=0
+pv1Mod3=0
+pv1Mod4=0
+pv1Mod5=0
+pv1Mod6=0
+pv1Mod7=0
+pv1Mod8=0
+pv1Mod9=0
+pv1Mod10=0
+pv1Mod11=0
+pv1Mod12=0
+pv1Mod13=0
+pv1Mod14=0
+pv2PosX=0.0
+pv2PosY=0.0
+pv2PosZ=0.0
+pv2PosAngle=0.0
+pv2ModelId=0
+pv2Lock=0
+pv2Locked=0
+pv2PaintJob=-1
+pv2Color1=0
+pv2Color2=0
+pv2Price=0
+pv2Ticket=0
+pv2Weapon0=0
+pv2Weapon1=0
+pv2Weapon2=0
+pv2WepUpgrade=0
+pv2Fuel=100.00
+pv2Impound=0
+pv2Spawned=0
+pv2Disabled=0
+pv2NumPlate=
+pv2Mod0=0
+pv2Mod1=0
+pv2Mod2=0
+pv2Mod3=0
+pv2Mod4=0
+pv2Mod5=0
+pv2Mod6=0
+pv2Mod7=0
+pv2Mod8=0
+pv2Mod9=0
+pv2Mod10=0
+pv2Mod11=0
+pv2Mod12=0
+pv2Mod13=0
+pv2Mod14=0
+pv3PosX=0.0
+pv3PosY=0.0
+pv3PosZ=0.0
+pv3PosAngle=0.0
+pv3ModelId=0
+pv3Lock=0
+pv3Locked=0
+pv3PaintJob=-1
+pv3Color1=0
+pv3Color2=0
+pv3Price=0
+pv3Ticket=0
+pv3Weapon0=0
+pv3Weapon1=0
+pv3Weapon2=0
+pv3WepUpgrade=0
+pv3Fuel=100.00
+pv3Impound=0
+pv3Spawned=0
+pv3Disabled=0
+pv3NumPlate=
+pv3Mod0=0
+pv3Mod1=0
+pv3Mod2=0
+pv3Mod3=0
+pv3Mod4=0
+pv3Mod5=0
+pv3Mod6=0
+pv3Mod7=0
+pv3Mod8=0
+pv3Mod9=0
+pv3Mod10=0
+pv3Mod11=0
+pv3Mod12=0
+pv3Mod13=0
+pv3Mod14=0
+pv4PosX=0.0
+pv4PosY=0.0
+pv4PosZ=0.0
+pv4PosAngle=0.0
+pv4ModelId=0
+pv4Lock=0
+pv4Locked=0
+pv4PaintJob=-1
+pv4Color1=0
+pv4Color2=0
+pv4Price=0
+pv4Ticket=0
+pv4Weapon0=0
+pv4Weapon1=0
+pv4Weapon2=0
+pv4WepUpgrade=0
+pv4Fuel=100.00
+pv4Impound=0
+pv4Spawned=0
+pv4Disabled=0
+pv4NumPlate=
+pv4Mod0=0
+pv4Mod1=0
+pv4Mod2=0
+pv4Mod3=0
+pv4Mod4=0
+pv4Mod5=0
+pv4Mod6=0
+pv4Mod7=0
+pv4Mod8=0
+pv4Mod9=0
+pv4Mod10=0
+pv4Mod11=0
+pv4Mod12=0
+pv4Mod13=0
+pv4Mod14=0
+pv5PosX=0.0
+pv5PosY=0.0
+pv5PosZ=0.0
+pv5PosAngle=0.0
+pv5ModelId=0
+pv5Lock=0
+pv5Locked=0
+pv5PaintJob=-1
+pv5Color1=0
+pv5Color2=0
+pv5Price=0
+pv5Ticket=0
+pv5Weapon0=0
+pv5Weapon1=0
+pv5Weapon2=0
+pv5WepUpgrade=0
+pv5Fuel=100.00
+pv5Impound=0
+pv5Spawned=0
+pv5Disabled=1
+pv5NumPlate=
+pv5Mod0=0
+pv5Mod1=0
+pv5Mod2=0
+pv5Mod3=0
+pv5Mod4=0
+pv5Mod5=0
+pv5Mod6=0
+pv5Mod7=0
+pv5Mod8=0
+pv5Mod9=0
+pv5Mod10=0
+pv5Mod11=0
+pv5Mod12=0
+pv5Mod13=0
+pv5Mod14=0
+pv6PosX=0.0
+pv6PosY=0.0
+pv6PosZ=0.0
+pv6PosAngle=0.0
+pv6ModelId=0
+pv6Lock=0
+pv6Locked=0
+pv6PaintJob=-1
+pv6Color1=0
+pv6Color2=0
+pv6Price=0
+pv6Ticket=0
+pv6Weapon0=0
+pv6Weapon1=0
+pv6Weapon2=0
+pv6WepUpgrade=0
+pv6Fuel=100.00
+pv6Impound=0
+pv6Spawned=0
+pv6Disabled=1
+pv6NumPlate=
+pv6Mod0=0
+pv6Mod1=0
+pv6Mod2=0
+pv6Mod3=0
+pv6Mod4=0
+pv6Mod5=0
+pv6Mod6=0
+pv6Mod7=0
+pv6Mod8=0
+pv6Mod9=0
+pv6Mod10=0
+pv6Mod11=0
+pv6Mod12=0
+pv6Mod13=0
+pv6Mod14=0
+pv7PosX=0.0
+pv7PosY=0.0
+pv7PosZ=0.0
+pv7PosAngle=0.0
+pv7ModelId=0
+pv7Lock=0
+pv7Locked=0
+pv7PaintJob=-1
+pv7Color1=0
+pv7Color2=0
+pv7Price=0
+pv7Ticket=0
+pv7Weapon0=0
+pv7Weapon1=0
+pv7Weapon2=0
+pv7WepUpgrade=0
+pv7Fuel=100.00
+pv7Impound=0
+pv7Spawned=0
+pv7Disabled=1
+pv7NumPlate=
+pv7Mod0=0
+pv7Mod1=0
+pv7Mod2=0
+pv7Mod3=0
+pv7Mod4=0
+pv7Mod5=0
+pv7Mod6=0
+pv7Mod7=0
+pv7Mod8=0
+pv7Mod9=0
+pv7Mod10=0
+pv7Mod11=0
+pv7Mod12=0
+pv7Mod13=0
+pv7Mod14=0
+pv8PosX=0.0
+pv8PosY=0.0
+pv8PosZ=0.0
+pv8PosAngle=0.0
+pv8ModelId=0
+pv8Lock=0
+pv8Locked=0
+pv8PaintJob=-1
+pv8Color1=0
+pv8Color2=0
+pv8Price=0
+pv8Ticket=0
+pv8Weapon0=0
+pv8Weapon1=0
+pv8Weapon2=0
+pv8WepUpgrade=0
+pv8Fuel=100.00
+pv8Impound=0
+pv8Spawned=0
+pv8Disabled=1
+pv8NumPlate=
+pv8Mod0=0
+pv8Mod1=0
+pv8Mod2=0
+pv8Mod3=0
+pv8Mod4=0
+pv8Mod5=0
+pv8Mod6=0
+pv8Mod7=0
+pv8Mod8=0
+pv8Mod9=0
+pv8Mod10=0
+pv8Mod11=0
+pv8Mod12=0
+pv8Mod13=0
+pv8Mod14=0
+pv9PosX=0.0
+pv9PosY=0.0
+pv9PosZ=0.0
+pv9PosAngle=0.0
+pv9ModelId=0
+pv9Lock=0
+pv9Locked=0
+pv9PaintJob=-1
+pv9Color1=0
+pv9Color2=0
+pv9Price=0
+pv9Ticket=0
+pv9Weapon0=0
+pv9Weapon1=0
+pv9Weapon2=0
+pv9WepUpgrade=0
+pv9Fuel=100.00
+pv9Impound=0
+pv9Spawned=0
+pv9Disabled=1
+pv9NumPlate=
+pv9Mod0=0
+pv9Mod1=0
+pv9Mod2=0
+pv9Mod3=0
+pv9Mod4=0
+pv9Mod5=0
+pv9Mod6=0
+pv9Mod7=0
+pv9Mod8=0
+pv9Mod9=0
+pv9Mod10=0
+pv9Mod11=0
+pv9Mod12=0
+pv9Mod13=0
+pv9Mod14=0
+OnDuty=0
+CarLic=1
+FlyLic=0
+BoatLic=1
+FishLic=1
+GunLic=1
+Division=0
+TicketTime=0
+HeadValue=0
+ContractBy=Nobody
+ContractDetail=None
+Bombs=0
+CHits=0
+FHits=0
+PrisonedBy=Nobody
+PrisonReason=None
+AcceptReport=0
+TrashReport=0
+Accent=0
+NewMuted=0
+NewMutedTotal=0
+AdMuted=0
+AdMutedTotal=0
+ReportMuted=0
+ReportMutedTotal=0
+ReportMutedTime=0
+Speedo=0
+GCMuted=0
+GCMutedTime=0
+CallsAccepted=0
+PatientsDelivered=0
+TriageTime=0
+Married=0
+MarriedTo=Nobody
+pt0ModelID=0
+pt0Bone=0
+pt0PosX=0.00000
+pt0PosY=0.00000
+pt0PosZ=0.00000
+pt0RotX=0.00000
+pt0RotY=0.00000
+pt0RotZ=0.00000
+pt0ScaX=1.00000
+pt0ScaY=1.00000
+pt0ScaZ=1.00000
+pt1ModelID=0
+pt1Bone=0
+pt1PosX=0.00000
+pt1PosY=0.00000
+pt1PosZ=0.00000
+pt1RotX=0.00000
+pt1RotY=0.00000
+pt1RotZ=0.00000
+pt1ScaX=1.00000
+pt1ScaY=1.00000
+pt1ScaZ=1.00000
+pt2ModelID=0
+pt2Bone=0
+pt2PosX=0.00000
+pt2PosY=0.00000
+pt2PosZ=0.00000
+pt2RotX=0.00000
+pt2RotY=0.00000
+pt2RotZ=0.00000
+pt2ScaX=1.00000
+pt2ScaY=1.00000
+pt2ScaZ=1.00000
+pt3ModelID=0
+pt3Bone=0
+pt3PosX=0.00000
+pt3PosY=0.00000
+pt3PosZ=0.00000
+pt3RotX=0.00000
+pt3RotY=0.00000
+pt3RotZ=0.00000
+pt3ScaX=1.00000
+pt3ScaY=1.00000
+pt3ScaZ=1.00000
+pt4ModelID=0
+pt4Bone=0
+pt4PosX=0.00000
+pt4PosY=0.00000
+pt4PosZ=0.00000
+pt4RotX=0.00000
+pt4RotY=0.00000
+pt4RotZ=0.00000
+pt4ScaX=1.00000
+pt4ScaY=1.00000
+pt4ScaZ=1.00000
+pt5ModelID=0
+pt5Bone=0
+pt5PosX=0.00000
+pt5PosY=0.00000
+pt5PosZ=0.00000
+pt5RotX=0.00000
+pt5RotY=0.00000
+pt5RotZ=0.00000
+pt5ScaX=1.00000
+pt5ScaY=1.00000
+pt5ScaZ=1.00000
+pt6ModelID=0
+pt6Bone=0
+pt6PosX=0.00000
+pt6PosY=0.00000
+pt6PosZ=0.00000
+pt6RotX=0.00000
+pt6RotY=0.00000
+pt6RotZ=0.00000
+pt6ScaX=1.00000
+pt6ScaY=1.00000
+pt6ScaZ=1.00000
+pt7ModelID=0
+pt7Bone=0
+pt7PosX=0.00000
+pt7PosY=0.00000
+pt7PosZ=0.00000
+pt7RotX=0.00000
+pt7RotY=0.00000
+pt7RotZ=0.00000
+pt7ScaX=1.00000
+pt7ScaY=1.00000
+pt7ScaZ=1.00000
+KillLog0=
+KillLog1=
+KillLog2=
+KillLog3=
+KillLog4=
+KillLog5=
+KillLog6=
+KillLog7=
+KillLog8=
+KillLog9=
+Flag=
+ReferredBy=0
+RefTokens=0
+WepRes=0
+TT=0
+NC=0
+BizID=0
+Claim=0
+Land=0
+Pills=0
+Crew1=0
+Crew2=0
+Crew3=0
+Former=0
+Old School=0
+Vintage=0
+Famed=0
+RefTokensOffline=0
+Helper=0
+Backpack=0
+BackpackPot=0
+BackpackCrack=0
+Wearing=0
+LiveBanned=0

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác