Current scripting API:

#
# Hooks:
#
void syh_tick(float time):
	Called every tick, with the current time.
void syh_chat(int type, const string &in msg):
	Called when the client attempts to send a chat message.
	Note, chat() bypasses this hook.
	If this is not set, the message goes through as expected.

	Admittedly this probably isn't all that useful, but it works!

# 
# Globals:
# 
int curplr:
	Current player index.
int curtool:
	Current selected tool by player.
int specplr:
	Currently spectated player when in spectate mode.
float time_current:
	Current time in seconds.
float time_mul:
	Multiplier to convert ticks to seconds.

#
# Structures:
#
	kv6vox_t:
	{
		uint col;
		uint16 z;
		uint8 vis, dir;
	}
	col is in the format 0xLLRRGGBB (LL is typically 0x80).
	z indicates the +Z (typically down) position of this voxel.
	vis consists of these flags indicating visibility in a certain direction:
	 0 0 +Z -Z +Y -Y +X -X
	dir is unknown.
	
	kv6_t:
	{
		int xsiz, ysiz, zsiz;
		float xpiv, ypiv, zpiv;
		unsigned int numvoxs;
		kv6vox_t @vox[numvoxs];
		unsigned int @xlen[xsiz];
		unsigned int16 @ylen[xsiz*ysiz];
	}
	typically, numvoxs = sum(xlen) = sum(ylen).
	offs(x,y) = sum(xlen[:x]) + sum(ylen[x*ysiz:x*ysiz+y]). (I think. This might be wrong.)

	bone_t:
	{
		float px,py,pz;
		float mxx,mxy,mxz;
		float myx,myy,myz;
		float mzx,mzy,mzz;
		kv6_t @kv6;
	}

	player_t:
	{
		bone_t bones[8];
		float p1x;
		float p1y;
		float p1z;
		float p2x;
		float p2y;
		float p2z;
		float vx;
		float vy;
		float vz;
		float camxx; // rightward vector
		float camxy;
		float camxz;
		float camyx; // forward vector
		float camyy;
		float camyz;
		float camzx; // downward vector
		float camzy;
		float camzz;
		int team;
		int gun;
		// modding the k*/m* stuff doesn't work except for the case of mright being scope
		int kforward;
		int kback;
		int kleft;
		int kright;
		int kjump;
		int kcrouch;
		int ksneak;
		int ksprint;
		int mleft;
		int mright; // stays on when scoped
		int tool;
		int block_color;
		int alive;
		int exists;
		int inair;
		int inwater;
		int kills;
		int blocks;
		int ammo_clip;
		int ammo_reserve;
		int nades;
		int health;
		float time_toolplace;
		float time_nadeboom; // also time when secondary spade hits the block
		float time_laststep;
		float time_laststepup;
		int time_respawn;
		int id; // THIS is what's shown in the scores list when you hit TAB, NOT the index.
		string name; // max size of 31 excluding null terminator
	}

	gun_t:
	{
		int block_dmg;
		int ammo_clip;
		int ammo_reserve;
		int type;
		int pallets;
		float shot_time;
		float reload_time;
		float spread;
		float recoil_y;
		float recoil_x;
	}
# 
# Functions:
# 

void print(const string &msg):
	I shouldn't have to explain this. Just remember to shove in the newlines yourself, or bad things happen!

float sqrt(float v):
float sin(float v):
float cos(float v):
	Various math functions. If you don't know what they are... LEARN THEM.

void chat(int type, const string &msg):
	Sends a chat message to the server. Type is one of the following:
		0: Global
		1: Local
		Anything else: Might crash. The server SHOULD filter this (I suspect it DOESN'T).

player_t @player_get(int plr_index):
	Obtains a player in the list for general harrassment.
	Player indices range from 0 through (max-1) inclusively.

gun_t @gun_get(int gun_index):
	Obtains one of currently 6 guns for rebalancing and whatnot.

	Gun indices range from 0 through (max-1) inclusively.
	The latter 3 are rebalanced versions of the former 3.
	You should be able to work out what they are.

kv6_t @kv6_get(int kv6_index):
	Obtains a kv6 in the main kv6 list for fetching + altering.
	Range is from 0 through 36 inclusively (there are 37 models).

	For reference here's the names list in the disassembly:
	db 53H, 50H, 41H, 44H, 45H, 5FH, 33H, 2CH       ; 00447E48 _ SPADE_3,
	db 42H, 4CH, 4FH, 43H, 4BH, 5FH, 33H, 2CH       ; 00447E50 _ BLOCK_3,
	db 53H, 45H, 4DH, 49H, 5FH, 33H, 2CH, 53H       ; 00447E58 _ SEMI_3,S
	db 4DH, 47H, 5FH, 33H, 2CH, 53H, 48H, 4FH       ; 00447E60 _ MG_3,SHO
	db 54H, 47H, 55H, 4EH, 5FH, 33H, 2CH, 47H       ; 00447E68 _ TGUN_3,G
	db 52H, 45H, 4EH, 41H, 44H, 45H, 5FH, 33H       ; 00447E70 _ RENADE_3
	db 2CH, 53H, 50H, 41H, 44H, 45H, 2CH, 42H       ; 00447E78 _ ,SPADE,B
	db 4CH, 4FH, 43H, 4BH, 2CH, 53H, 45H, 4DH       ; 00447E80 _ LOCK,SEM
	db 49H, 2CH, 53H, 4DH, 47H, 2CH, 53H, 48H       ; 00447E88 _ I,SMG,SH
	db 4FH, 54H, 47H, 55H, 4EH, 2CH, 47H, 52H       ; 00447E90 _ OTGUN,GR
	db 45H, 4EH, 41H, 44H, 45H, 2CH, 50H, 4CH       ; 00447E98 _ ENADE,PL
	db 41H, 59H, 45H, 52H, 48H, 45H, 41H, 44H       ; 00447EA0 _ AYERHEAD
	db 5FH, 42H, 2CH, 50H, 4CH, 41H, 59H, 45H       ; 00447EA8 _ _B,PLAYE
	db 52H, 54H, 4FH, 52H, 53H, 4FH, 5FH, 42H       ; 00447EB0 _ RTORSO_B
	db 2CH, 50H, 4CH, 41H, 59H, 45H, 52H, 54H       ; 00447EB8 _ ,PLAYERT
	db 4FH, 52H, 53H, 4FH, 43H, 5FH, 42H, 2CH       ; 00447EC0 _ ORSOC_B,
	db 50H, 4CH, 41H, 59H, 45H, 52H, 41H, 52H       ; 00447EC8 _ PLAYERAR
	db 4DH, 53H, 5FH, 42H, 2CH, 50H, 4CH, 41H       ; 00447ED0 _ MS_B,PLA
	db 59H, 45H, 52H, 4CH, 45H, 47H, 5FH, 42H       ; 00447ED8 _ YERLEG_B
	db 2CH, 50H, 4CH, 41H, 59H, 45H, 52H, 4CH       ; 00447EE0 _ ,PLAYERL
	db 45H, 47H, 43H, 5FH, 42H, 2CH, 50H, 4CH       ; 00447EE8 _ EGC_B,PL
	db 41H, 59H, 45H, 52H, 44H, 45H, 41H, 44H       ; 00447EF0 _ AYERDEAD
	db 5FH, 42H, 2CH, 50H, 4CH, 41H, 59H, 45H       ; 00447EF8 _ _B,PLAYE
	db 52H, 48H, 45H, 41H, 44H, 5FH, 47H, 2CH       ; 00447F00 _ RHEAD_G,
	db 50H, 4CH, 41H, 59H, 45H, 52H, 54H, 4FH       ; 00447F08 _ PLAYERTO
	db 52H, 53H, 4FH, 5FH, 47H, 2CH, 50H, 4CH       ; 00447F10 _ RSO_G,PL
	db 41H, 59H, 45H, 52H, 54H, 4FH, 52H, 53H       ; 00447F18 _ AYERTORS
	db 4FH, 43H, 5FH, 47H, 2CH, 50H, 4CH, 41H       ; 00447F20 _ OC_G,PLA
	db 59H, 45H, 52H, 41H, 52H, 4DH, 53H, 5FH       ; 00447F28 _ YERARMS_
	db 47H, 2CH, 50H, 4CH, 41H, 59H, 45H, 52H       ; 00447F30 _ G,PLAYER
	db 4CH, 45H, 47H, 5FH, 47H, 2CH, 50H, 4CH       ; 00447F38 _ LEG_G,PL
	db 41H, 59H, 45H, 52H, 4CH, 45H, 47H, 43H       ; 00447F40 _ AYERLEGC
	db 5FH, 47H, 2CH, 50H, 4CH, 41H, 59H, 45H       ; 00447F48 _ _G,PLAYE
	db 52H, 44H, 45H, 41H, 44H, 5FH, 47H, 2CH       ; 00447F50 _ RDEAD_G,
	db 49H, 4EH, 54H, 45H, 4CH, 5FH, 42H, 2CH       ; 00447F58 _ INTEL_B,
	db 49H, 4EH, 54H, 45H, 4CH, 5FH, 47H, 2CH       ; 00447F60 _ INTEL_G,
	db 43H, 50H, 5FH, 42H, 2CH, 43H, 50H, 5FH       ; 00447F68 _ CP_B,CP_
	db 47H, 2CH, 43H, 50H, 5FH, 4EH, 2CH, 53H       ; 00447F70 _ G,CP_N,S
	db 45H, 4DH, 49H, 54H, 52H, 41H, 43H, 45H       ; 00447F78 _ EMITRACE
	db 52H, 2CH, 53H, 4DH, 47H, 54H, 52H, 41H       ; 00447F80 _ R,SMGTRA
	db 43H, 45H, 52H, 2CH, 53H, 48H, 4FH, 54H       ; 00447F88 _ CER,SHOT
	db 47H, 55H, 4EH, 54H, 52H, 41H, 43H, 45H       ; 00447F90 _ GUNTRACE
	db 52H, 2CH, 53H, 45H, 4DH, 49H, 43H, 41H       ; 00447F98 _ R,SEMICA
	db 53H, 49H, 4EH, 47H, 2CH, 53H, 4DH, 47H       ; 00447FA0 _ SING,SMG
	db 43H, 41H, 53H, 49H, 4EH, 47H, 2CH, 53H       ; 00447FA8 _ CASING,S
	db 48H, 4FH, 54H, 47H, 55H, 4EH, 43H, 41H       ; 00447FB0 _ HOTGUNCA
	db 53H, 49H, 4EH, 47H, 2CH, 00H, 00H, 00H       ; 00447FB8 _ SING,...

kv6_t @kv6_new(int xsiz, int ysiz, int zsiz, int numvoxs):
	Creates a kv6_t with the appropriate dimensions + voxel count.
	Note, you WILL need to understand the kv6 format to make any sense of this!

	This MIGHT help: http://aoswiki.rakiru.com/index.php/KV6

void kv6_free(kv6_t @k):
	Frees the given kv6_t from memory.

