diff --git a/plugins/include/array.inc b/plugins/include/array.inc new file mode 100755 index 00000000..0b5bd12d --- /dev/null +++ b/plugins/include/array.inc @@ -0,0 +1,260 @@ +/* (C)2004 David "BAILOPAN" Anderson + Licensed under the GNU General Public License verion 2 + array.inc - Used for advanced array techniques + */ + +/* This module uses some constructs capable of being memory intensive. + * If you are making temporary keytables/lists, make sure you clear them! + * For example: + * new a = new_keytable() + * //(code) + * keytable_clear(a) + * new b = new_floatlist() + * //code + * floatlist_delete(b) + */ + +/* IMPORTANT NOTE! Bad Errors will return -1, Most errors return 0 + * HOWEVER, the first key/list you create will be zero, so do not do this! + * new a = new keytable() + * if (a) { .... + * This will not work since the first keytable (and lists) are always id=0. + * Also, errors on strings will fill the string with "dne" and/or return <=0 + */ + + +/* Key Table functions + * key tables are variables that hold a key and value pair, like this: + * C++: std::map; table[key] = value; + * PHP: $table[$key] = $value; + * Perl: my(%table);$table{$key}=$value; + * For example, you can pair the value "ASDF" with the key "TEST_STRING" + * and then retrieve ASDF with TEST_STRING, like "vault". + * (Internally stores as a vector of maps) + */ + +//Returns a reference to a new keytable +native new_keytable(); + +//Deletes a keytable and unlinks the reference +native keytable_delete(keytab); + + +//Stores an integer value into a keytable +native store_int(keytab, key[], value); + +//Stores a float value into a keytable +native store_float(keytab, key[], Float:value); + +//Stores a string value into a keytable +native store_string(keytab, key[], value[]); + + +//Retrieves a keytable value as an integer +//Leave the key blank to retrieve the current iterator value +native getkey_int(keytab, key[]); + +//Retrieves a keytable value as a float +//Leave the key blank to retrieve the current iterator value +native Float:getkey_float(keytab, key[]); + +//Retrieves a keytable value as a string +//Leave the key blank to retrieve the current iterator value +native getkey_string(keytab, key[], ret[], len); + + +//Resets the internal iteration pointer of a keytable +native keytable_reset(keytab); + +//Deletes all keys and values from a keytable +native keytable_clear(keytab); + +//Advances the internal iteration pointer of a keytable +native keytable_next(keytab); + +//Retrieves the current iteration pointer key of a keytable +native keytable_getkey(keytab, key[], len); + +//Retrieves the current iteration pointer value of a keytable +native keytable_getval(keytab, val[], len); + +//Retrieves the size of a keytable +native keytable_count(keytab) + +/* List functions + * Use for dynamic array allocation + * Implemented as a vector of vectors. + * There are stocks to abstract the type. + */ + +enum { + list_int = 1, + list_float, + list_string, +} + +//Do not use this native - use the stocks +native new_list(type); + +/* Functions to create lists */ + +//Creates a list of floats +stock new_float_list() { + new_list(list_float) +} + +//Creates a list of ints +stock new_int_list() { + return new_list(list_int) +} + +//Creates a list of strings +stock new_string_list() { + return new_list(list_string) +} + +/* Functions to store data in lists */ + +//Store a float into a list at member list_posn +native list_store_float(list_id, list_posn, Float:value); + +//Push a float to the end of the list +native list_push_float(list_id, Float:value); + +//Store an int into a list at member list_posn +native list_store_int(list_id, list_posn, value); + +//Push an int to the end of the list +native list_push_int(list_id, value) + +//Store a string into a list at member list_posn +native list_store_string(list_id, list_posn, value[]) + +//Push a string to the end of the list +native list_push_string(list_id, list_posn, value[]) + + +/* Functions to get data from lists */ + +//Do not use this native - use the stocks +native list_get(list_id, type, list_posn, retr[]="", retr_len=0); +native Float:list_getf(list_id, type, list_posn=-1) + +//Returns the value of a float list at list_posn. If list_posn is -1, the current +// iterator position value is returned. +stock Float:list_get_float(list_id, list_posn=-1) { + return list_getf(list_id, list_float, posn) +} + +//Returns the value of an int list at list_posn. If list_posn is -1, the current +// iterator position value is returned. +stock list_get_int(list_id, list_posn=-1) { + return list_get(list_id, list_int, list_posn) +} + +//Returns the value of a string list at list_posn. If list_posn is -1. the current +// iterator position value is returned. +stock list_get_string(list_id, list_posn=-1, retr[], retr_len) { + return list_get(list_id, list_string, list_posn, retr, retr_len) +} + + +//Do not use this native - use stocks +native list_delete(list_id, type); + +//List delete functions +stock list_delete_float(list_id) { + return list_delete(list_id, list_float) +} + +stock list_delete_int(list_id) { + return list_delete(list_id, list_int) +} + +stock list_delete_string(list_id) { + return list_delete(list_id, list_string) +} + + +//Do not use this native - use stocks +native list_clear(list_id, list_type); + +//Clear all data from a list +stock list_clear_float(list_id) { + return list_clear(list_id, list_float) +} + +stock list_clear_int(list_id) { + return list_clear(list_id, list_int) +} + +stock list_clear_string(list_id) { + return list_clear(list_id, list_string) +} + + +//Do not use this native - use stocks +native list_reset(list_id, list_type); + +//Reset the internal iterator pointer for a list +stock list_reset_float(list_id) { + return list_reset(list_id, list_float) +} + +stock list_reset_int(list_id) { + return list_reset(list_id, list_int) +} + +stock list_reset_string(list_id) { + return list_reset(list_id, list_string) +} + + +//Do not use this native - use stocks +native list_next(list_id, list_type); + +//Advance the internal iterator pointer +stock list_next_float(list_id) { + return list_next(list_id, list_float) +} + +stock list_next_int(list_id) { + return list_next(list_id, list_int) +} + +stock list_next_string(list_id) { + return list_next(list_id, list_string) +} + + +//Do not use this native - use stocks +native list_size(list_id, list_type); + +//Return the size of a list +stock list_size_float(list_id) { + return list_size(list_id, list_float) +} + +stock list_size_int(list_id) { + return list_size(list_id, list_int) +} + +stock list_size_string(list_id) { + return list_size(list_id, list_string) +} + +//Do not use this native - use stocks +native list_pop(list_id, list_type); + +//Pop the last member off the list - returns 0 on failure +stock list_pop_float(list_id) { + return list_pop(list_id, list_float) +} + +stock list_pop_int(list_id) { + return list_pop(list_id, list_int) +} + +stock list_pop_string(list_id) { + return list_pop(list_id, list_string) +} \ No newline at end of file diff --git a/plugins/include/csstats.inc b/plugins/include/csstats.inc index 3733788e..1a9b9bfd 100755 --- a/plugins/include/csstats.inc +++ b/plugins/include/csstats.inc @@ -1,10 +1,4 @@ -/* CS Stats functions -* -* by the AMX Mod X Development Team -* originally developed by OLO -* -* This file is provided as is (no warranties). -*/ + #if defined _csstats_included #endinput @@ -21,6 +15,7 @@ * 4 - shots * 5 - hits * 6 - damage + * For body hits fields see amxconst.inc. */ native get_user_wstats(index,wpnindex,stats[8],bodyhits[8]); @@ -54,4 +49,14 @@ native reset_user_wstats(index); native get_stats(index,stats[8],bodyhits[8],name[],len); /* Returns number of all entries in stats. */ -native get_statsnum(); \ No newline at end of file +native get_statsnum(); + +/* +* new stats: +* 0 - total defusions +* 1 - bomb defused +* 2 - bomb plants +* 3 - bomb explosions +*/ +native get_user_stats2(index,stats[4]); +native get_stats2(index,stats[4]); diff --git a/plugins/include/dodconst.inc b/plugins/include/dodconst.inc new file mode 100755 index 00000000..80900036 --- /dev/null +++ b/plugins/include/dodconst.inc @@ -0,0 +1,85 @@ +/* DoDX functions + * + * (c) 2004, SidLuke + * This file is provided as is (no warranties). + */ + +#if defined _dodconst_included + #endinput +#endif +#define _dodconst_included + +/* DoD teams */ +#define ALLIES 1 +#define AXIS 2 + +#define FT_NEW 1<<0 +#define FT_OLD 1<<1 + +#define STAMINA_SET 0 +#define STAMINA_RESET 1 + +#define FUSE_SET 0 +#define FUSE_RESET 1 + +#define DODMAX_WEAPONS 46 // 5 slots for custom weapons + +enum { + PS_NOPRONE =0, + PS_PRONE, + PS_PRONEDEPLOY, + PS_DEPLOY, +} + +/* info types for dod_get_map_info native */ +enum { + MI_ALLIES_TEAM = 0, + MI_ALLIES_PARAS, + MI_AXIS_PARAS, +} + +/* DoD weapons */ +enum { + DODW_AMERKNIFE = 1, + DODW_GERKNIFE, + DODW_COLT, + DODW_LUGER, + DODW_GARAND, + DODW_SCOPED_KAR, + DODW_THOMPSON, + DODW_STG44, + DODW_SPRINGFIELD, + DODW_KAR, + DODW_BAR, + DODW_MP40, + DODW_HANDGRENADE, + DODW_STICKGRENADE, + DODW_STICKGRENADE_EX, + DODW_HANDGRENADE_EX, + DODW_MG42, + DODW_30_CAL, + DODW_SPADE, + DODW_M1_CARBINE, + DODW_MG34, + DODW_GREASEGUN, + DODW_FG42, + DODW_K43, + DODW_ENFIELD, + DODW_STEN, + DODW_BREN, + DODW_WEBLEY, + DODW_BAZOOKA, + DODW_PANZERSCHRECK, + DODW_PIAT, + DODW_SCOPED_FG42, + DODW_FOLDING_CARBINE, + DODW_KAR_BAYONET, + DODW_SCOPED_ENFIELD, + DODW_MILLS_BOMB, + DODW_BRITKNIFE, + DODW_GARAND_BUTT, + DODW_ENFIELD_BAYONET, + DODW_MORTAR, + DODW_K43_BUTT, +}; + diff --git a/plugins/include/dodfun.inc b/plugins/include/dodfun.inc new file mode 100755 index 00000000..0bb5c891 --- /dev/null +++ b/plugins/include/dodfun.inc @@ -0,0 +1,59 @@ +/* DoDFun functions + * + * (c) 2004, SidLuke + * This file is provided as is (no warranties). + */ + +#if defined _dodfun_included + #endinput +#endif +#define _dodfun_included + +#include + + +/* Function is called after grenade throw */ +forward grenade_throw(index,greindex,wId); + +/* Example: for full stamina use set_player_stamina(1,STAMINA_SET,100,100) */ +/* value is from 0 - 100 */ +native dod_set_stamina(index,set=STAMINA_SET,minvalue=0,maxvalue=100); + +/* Sets fuse for grenades. Valid number is from 0.1-20.0 */ +/* types : new or preprimed */ +native dod_set_fuse(index,set=FUSE_SET,Float:newFuse=5.0, Type=FT_NEW); + +/* Sets player class */ +native dod_set_user_class(index,classId); + +/* Sets player team and random class. Don't work for spectators. */ +native dod_set_user_team(index,teamId,refresh=1); + +/* Returns next player class. Usefull is player is using random class */ +native dod_get_next_class(index); + +/* Returns 1 if player choose random class */ +native dod_is_randomclass(index); + +/* Returns player deaths */ +native dod_get_pl_deaths(index); + +/* Sets player deaths. */ +native dod_set_pl_deaths(index,value,refresh=1); + +/* Sets player score. */ +native dod_set_user_score(index,value,refresh=1); + +/* Sets new team name for this player */ +native dod_set_pl_teamname(index,szName[]); + +/* Gets player team name */ +native dod_get_pl_teamname(index,szName[],len); + +/* Returns 1 is player weapon is deployed (bar,mg..) */ +native dod_is_deployed(index); + +native dod_set_user_ammo(index,wid,value); +native dod_get_user_ammo(index,wid); + + diff --git a/plugins/include/dodstats.inc b/plugins/include/dodstats.inc new file mode 100755 index 00000000..ed93d5a5 --- /dev/null +++ b/plugins/include/dodstats.inc @@ -0,0 +1,63 @@ +/* DoDX Stats functions + * + * (c) 2004, SidLuke + * This file is provided as is (no warranties). + */ + +#if defined _dodstats_included + #endinput +#endif +#define _dodstats_included + +/* Gets stats from given weapon index. If wpnindex is 0 +* then the stats are from all weapons. If weapon has not been used function +* returns 0 in other case 1. Fields in stats are: +* 0 - kills +* 1 - deaths +* 2 - headshots +* 3 - teamkilling +* 4 - shots +* 5 - hits +* 6 - damage +* 7 - score +* For body hits fields see amxconst.inc. */ +native get_user_wstats(index,wpnindex,stats[9],bodyhits[8]); + +/* Gets round stats from given weapon index.*/ +native get_user_wrstats(index,wpnindex,stats[9],bodyhits[8]); + +/* Gets life (from spawn to spawn) stats from given weapon index.*/ +native get_user_wlstats(index,wpnindex,stats[9],bodyhits[8]); + +/* Gets overall stats which are stored in file on server +* and updated on every respawn or user disconnect. +* Function returns the position in stats by diff. kills to deaths. */ +native get_user_stats(index,stats[9],bodyhits[8]); + +/* Gets round stats of player. */ +native get_user_rstats(index,stats[9],bodyhits[8]); + +/* Gets life (from spawn to spawn) stats of player. */ +native get_user_lstats(index,stats[9],bodyhits[8]); + +/* Gets stats with which user have killed/hurt his victim. If victim is 0 +* then stats are from all victims. If victim has not been hurt, function +* returns 0 in other case 1. User stats are reset on his respawn. */ +native get_user_vstats(index,victim,stats[9],bodyhits[8],wpnname[]="",len=0); + +/* Gets stats with which user have been killed/hurt. If killer is 0 +* then stats are from all attacks. If killer has not hurt user, function +* returns 0 in other case 1. User stats are reset on his respawn. */ +native get_user_astats(index,wpnindex,stats[9],bodyhits[8],wpnname[]="",len=0); + +/* Resets life, weapon, victims and attackers user stats. */ +native reset_user_wstats(index); + +/* Gets overall stats which stored in stats.dat file in amx folder +* and updated on every mapchange or user disconnect. +* Function returns next index of stats entry or 0 if no more exists. */ +native get_stats(index,stats[9],bodyhits[8],name[],len); + +/* Returns number of all entries in stats. */ +native get_statsnum(); + diff --git a/plugins/include/dodx.inc b/plugins/include/dodx.inc new file mode 100755 index 00000000..10ee5dd5 --- /dev/null +++ b/plugins/include/dodx.inc @@ -0,0 +1,87 @@ +/* DoDX functions + * + * (c) 2004, SidLuke + * This file is provided as is (no warranties). + */ + +#if defined _dodx_included + #endinput +#endif +#define _dodx_included + +#include +#include + +/************* Shared Natives Start ********************************/ + +/* Forward types */ +enum { + XMF_DAMAGE = 0, + XMF_DEATH, +} + +/* Use this function to register forwards */ +native register_statsfwd( ftype ); + +/* Function is called after player to player attacks , +* if players were damaged by teammate TA is set to 1 */ +forward client_damage(attacker,victim,damage,wpnindex,hitplace,TA); + +/* Function is called after player death , +* if player was killed by teammate TK is set to 1 */ +forward client_death(killer,victim,wpnindex,hitplace,TK); + +/* Custom Weapon Support */ +/* function will return index of new weapon */ +native custom_weapon_add( wpnname[],melee = 0,logname[]="" ); +/* Function will pass damage done by this custom weapon to stats module and other plugins */ +native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 ); +/* Function will pass info about custom weapon shot to stats module */ +native custom_weapon_shot( weapon,index ); // weapon id , player id + +/* function will return 1 if true */ +native xmod_is_melee_wpn(wpnindex); + +/* Returns weapon name. */ +native xmod_get_wpnname(wpnindex,name[],len); + +/* Returns weapon logname. */ +native xmod_get_wpnlogname(wpnindex,name[],len); + +/* Returns weapons array size */ +native xmod_get_maxweapons(); + +/* Returns stats array size ex. 8 in TS , 9 in DoD */ +native xmod_get_stats_size(); + +/* Returns 1 if true */ +native xmod_is_custom_wpn(wpnindex); + +/************* Shared Natives End ********************************/ + +/* weapon logname to weapon name convertion */ +native dod_wpnlog_to_name(logname[],name[],len); + +/* weapon logname to weapon index convertion */ +native dod_wpnlog_to_id(logname[]); + +native dod_get_map_info( info ); + +/* Returns id of currently carried weapon. Gets also +* ammount of ammo in clip and backpack. */ +native dod_get_user_weapon(index,&clip,&ammo); + +/* Returns team score */ +native dod_get_team_score(teamId); + +/* Returns player class id */ +native dod_get_user_class(index); + +/* Returns player score */ +native dod_get_user_score(index); + +/* values are: 0-no prone, 1-prone, 2-prone + w_deploy */ +native dod_get_pronestate(index); + +/* It is not as safe as original but player deaths will not be increased */ +native dod_user_kill(index); diff --git a/plugins/include/geoip.inc b/plugins/include/geoip.inc new file mode 100755 index 00000000..4a42f49a --- /dev/null +++ b/plugins/include/geoip.inc @@ -0,0 +1,21 @@ +/* GeoIP module functions for AMX Mod X + by David "BAILOPAN" Anderson + (C)Copyrighted under the GNU General Public License, Version 2 + */ + +#if defined geoip_included + #endinput +#endif +#define _geoip_included + + +//IP address can contain ports, the ports will be stripped out + +//get a two character country code (eg US, CA etc) +native geoip_code2(ip[], ccode[3]); + +//get a three character country code (eg USA, cAN etc) +native geoip_code3(ip[], result[4]); + +//get a full country name. max name is 45 chars +native geoip_country(ip[], result[], len=45); diff --git a/plugins/include/sockets.inc b/plugins/include/sockets.inc new file mode 100755 index 00000000..df3af6a2 --- /dev/null +++ b/plugins/include/sockets.inc @@ -0,0 +1,51 @@ +/* + * + * AMX Mod X Module + * Basic Socket Functions + * + * Codebase from Ivan, -g-s-ivan@web.de (AMX 0.9.3) + * Modification by Olaf Reusch, kenterfie@hlsw.de (AMXX 0.16, AMX 0.96) + * + */ + +#if defined _socket_included + #endinput +#endif +#define _socket_included + +// Use SOCKET_TCP for TCP Socket connections + +#define SOCKET_TCP 1 + +// Use SOCKET_UDP for UDP Socket connections + +#define SOCKET_UDP 2 + +/* Opens a new connection to hostname:port via protocol (either SOCKET_TCP or SOCKET_UDP), + * returns a socket (positive) or negative or zero on error. + * States of error: + * 0 - no error + * 1 - error while creating socket + * 2 - couldn't resolve hostname + * 3 - couldn't connect to given hostname:port +*/ + +native socket_open(_hostname[], _port, _protocol = SOCKET_TCP, &_error); + +/* Closes a Socket */ + +native socket_close(_socket); + +/* Recieves Data to string with the given length */ + +native socket_recv(_socket, _data[], _length); + +/* Sends data to the Socket */ + +native socket_send(_socket, _data[], _length); + +/* This function will return true if the state (buffer content) have changed within the last recieve or +* the timeout, where timeout is a value in µSeconds, (1 sec =1000000 µsec). +* Use to check if new data is in your socket. */ + +native socket_change(_socket, _timeout=100000); diff --git a/plugins/include/tfcconst.inc b/plugins/include/tfcconst.inc new file mode 100755 index 00000000..8657ad39 --- /dev/null +++ b/plugins/include/tfcconst.inc @@ -0,0 +1,71 @@ +/* TFCX const + * + * (c) 2004, SidLuke + * This file is provided as is (no warranties). + */ + +#if defined _tfcconst_included + #endinput +#endif +#define _tfcconst_included + + +#define TFCMAX_WEAPONS 37 + +enum { + TFC_AMMO_SHELLS = 0, + TFC_AMMO_BULLETS, + TFC_AMMO_CELLS, + TFC_AMMO_ROCKETS, + TFC_AMMO_NADE1, + TFC_AMMO_NADE2, +}; + +enum { + TFC_WPN_NONE = 0, + TFC_WPN_TIMER,//TFC_WPN_UNK1, + TFC_WPN_SENTRYGUN,//TFC_WPN_UNK2, + TFC_WPN_MEDIKIT, + TFC_WPN_SPANNER, + TFC_WPN_AXE, + TFC_WPN_SNIPERRIFLE, + TFC_WPN_AUTORIFLE, + TFC_WPN_SHOTGUN, + TFC_WPN_SUPERSHOTGUN, + TFC_WPN_NG, + TFC_WPN_SUPERNG, + TFC_WPN_GL, + TFC_WPN_FLAMETHROWER, + TFC_WPN_RPG, + TFC_WPN_IC, + TFC_WPN_FLAMES,//TFC_WPN_UNK16, + TFC_WPN_AC, + TFC_WPN_UNK18, + TFC_WPN_UNK19, + TFC_WPN_TRANQ, + TFC_WPN_RAILGUN, + TFC_WPN_PL, + TFC_WPN_KNIFE, + TFC_WPN_CALTROP, // 24 + TFC_WPN_CONCUSSIONGRENADE, + TFC_WPN_NORMALGRENADE, + TFC_WPN_NAILGRENADE, + TFC_WPN_MIRVGRENADE, + TFC_WPN_NAPALMGRENADE, + TFC_WPN_GASGRENADE, + TFC_WPN_EMPGRENADE, +}; + +enum { + TFC_PC_SCOUT = 1, + TFC_PC_SNIPER, + TFC_PC_SOLDIER, + TFC_PC_DEMOMAN, + TFC_PC_MEDIC, + TFC_PC_HWGUY, + TFC_PC_PYRO, + TFC_PC_SPY, + TFC_PC_ENGENEER, + TFC_PC_CIVILIAN, +}; + diff --git a/plugins/include/tfcstats.inc b/plugins/include/tfcstats.inc new file mode 100755 index 00000000..252de8e8 --- /dev/null +++ b/plugins/include/tfcstats.inc @@ -0,0 +1,56 @@ +/* TFCX Stats functions + * + * (c) 2004, SidLuke + * This file is provided as is (no warranties). + */ + +#if defined _tfcstats_included + #endinput +#endif +#define _tfcstats_included + +/* Gets stats from given weapon index. If wpnindex is 0 +* then the stats are from all weapons. If weapon has not been used function +* returns 0 in other case 1. Fields in stats are: +* 0 - kills +* 1 - deaths +* 2 - headshots +* 3 - teamkilling +* 4 - shots +* 5 - hits +* 6 - damage +* For body hits fields see amxconst.inc. */ +native get_user_wstats(index,wpnindex,stats[8],bodyhits[8]); + +/* Gets round stats from given weapon index.*/ +native get_user_wrstats(index,wpnindex,stats[8],bodyhits[8]); + +/* Gets overall stats which are stored in file on server +* and updated on every respawn or user disconnect. +* Function returns the position in stats by diff. kills to deaths. */ +native get_user_stats(index,stats[8],bodyhits[8]); + +/* Gets round stats of player. */ +native get_user_rstats(index,stats[8],bodyhits[8]); + +/* Gets stats with which user have killed/hurt his victim. If victim is 0 +* then stats are from all victims. If victim has not been hurt, function +* returns 0 in other case 1. User stats are reset on his respawn. */ +native get_user_vstats(index,victim,stats[8],bodyhits[8],wpnname[]="",len=0); + +/* Gets stats with which user have been killed/hurt. If killer is 0 +* then stats are from all attacks. If killer has not hurt user, function +* returns 0 in other case 1. User stats are reset on his respawn. */ +native get_user_astats(index,wpnindex,stats[8],bodyhits[8],wpnname[]="",len=0); + +/* Resets life, weapon, victims and attackers user stats. */ +native reset_user_wstats(index); + +/* Gets overall stats which stored in stats.dat file in amx folder +* and updated on every mapchange or user disconnect. +* Function returns next index of stats entry or 0 if no more exists. */ +native get_stats(index,stats[8],bodyhits[8],name[],len); + +/* Returns number of all entries in stats. */ +native get_statsnum(); + diff --git a/plugins/include/tfcx.inc b/plugins/include/tfcx.inc new file mode 100755 index 00000000..3436d1db --- /dev/null +++ b/plugins/include/tfcx.inc @@ -0,0 +1,113 @@ +/* tfcX functions + * + * (c) 2004, SidLuke + * This file is provided as is (no warranties). + */ + +#if defined _tfcx_included + #endinput +#endif +#define _tfcx_included + +#include +#include + + +/************* Shared Natives Start ********************************/ + +/* Forward types */ +enum { + XMF_DAMAGE = 0, + XMF_DEATH, +} + +/* Use this function to register forwards */ +native register_statsfwd( ftype ); + +/* Function is called after player to player attacks , +* if players were damaged by teammate TA is set to 1 */ +forward client_damage(attacker,victim,damage,wpnindex,hitplace,TA); + +/* Function is called after player death , +* if player was killed by teammate TK is set to 1 */ +forward client_death(killer,victim,wpnindex,hitplace,TK); + +/* Custom Weapon Support */ +/* function will return index of new weapon */ +native custom_weapon_add( wpnname[],melee = 0,logname[]="" ); +/* Function will pass damage done by this custom weapon to stats module and other plugins */ +native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 ); +/* Function will pass info about custom weapon shot to stats module */ +native custom_weapon_shot( weapon,index ); // weapon id , player id + +/* function will return 1 if true */ +native xmod_is_melee_wpn(wpnindex); + +/* Returns weapon name. */ +native xmod_get_wpnname(wpnindex,name[],len); + +/* Returns weapon logname. */ +native xmod_get_wpnlogname(wpnindex,name[],len); + +/* Returns weapons array size */ +native xmod_get_maxweapons(); + +/* Returns stats array size ex. 8 in TS , 9 in DoD */ +native xmod_get_stats_size(); + +/* Returns 1 if true */ +native xmod_is_custom_wpn(wpnindex); + +/************* Shared Natives End ********************************/ + +stock tfc_isgrenade( weapon ){ + switch( weapon ) + { + case TFC_WPN_CALTROP, + TFC_WPN_CONCUSSIONGRENADE, + TFC_WPN_NORMALGRENADE, + TFC_WPN_NAILGRENADE, + TFC_WPN_MIRVGRENADE, + TFC_WPN_NAPALMGRENADE, + TFC_WPN_GASGRENADE, + TFC_WPN_EMPGRENADE: + return 1; + default: return 0; + } + return 0; +} + +native tfc_userkill( index ); + +/* Use this function to set private data offsets if needed +Default offsets: + timer: 932 + sentrygun: 83 +from AssKicR + shells: 53 + bullets: 55 + cells: 57 + rockets: 59 + nade1: 14 + nade2: 15 +*/ +native tfc_setpddata(timer,sentrygun,shells,bullets,cells,rockets,nade1,nade2); + +/*********************************************************************/ + +native tfc_setmodel(index, const Model[], const Skin[]); +native tfc_clearmodel(index); + +/* Get amount of ammo in backpack on a user for a specific weapon */ +/* Ammo Types in tfcconst.inc */ +native tfc_getbammo(index, ammo); + +/* Set amount of ammo in backpack on a user for a specific weapon */ +native tfc_setbammo(index, ammo, value); + +/* Returns amount of ammo in weapon's clip (backpack) */ +/* Weapons list in tfcconst.inc */ +native tfc_getweaponbammo(index, weapon); + +/* Sets amount of ammo in weapon's clip (backpack) */ +native tfc_setweaponbammo(index, weapon, value); \ No newline at end of file diff --git a/plugins/include/tsconst.inc b/plugins/include/tsconst.inc new file mode 100755 index 00000000..9764a0e6 --- /dev/null +++ b/plugins/include/tsconst.inc @@ -0,0 +1,129 @@ +/* TSXMod functions + * + * (c) 2004, SidLuke + * This file is provided as is (no warranties). + */ + +#if defined _tsconst_included + #endinput +#endif +#define _tsconst_included + +#define TSMAX_WEAPONS 44 // 37 + throwing knife + brekable + 5 custom weapon slots + +#define TSPWUP_RANDOM 0 +#define TSPWUP_SLOWMO 1 +#define TSPWUP_INFAMMO 2 +#define TSPWUP_KUNGFU 4 +#define TSPWUP_SLOWPAUSE 8 +#define TSPWUP_DFIRERATE 16 +#define TSPWUP_GRENADE 32 +#define TSPWUP_HEALTH 64 +#define TSPWUP_ARMOR 128 +#define TSPWUP_SUPERJUMP 256 + +#define TSITEM_KUNGFU 1<<0 +#define TSITEM_SUPERJUMP 1<<1 + +#define TSKF_STUNTKILL 1<<0 +#define TSKF_SLIDINGKILL 1<<1 +#define TSKF_DOUBLEKILL 1<<2 +#define TSKF_ISSPEC 1<<3 +#define TSKF_KILLEDSPEC 1<<4 + +#define TSA_SILENCER 1 +#define TSA_LASERSIGHT 2 +#define TSA_FLASHLIGHT 4 +#define TSA_SCOPE 8 + +enum { + TSW_GLOCK18 = 1, + TSW_UNK1, + TSW_UZI, + TSW_M3, + TSW_M4A1, + TSW_MP5SD, + TSW_MP5K, + TSW_ABERETTAS, + TSW_MK23, + TSW_AMK23, + TSW_USAS, + TSW_DEAGLE, + TSW_AK47, + TSW_57, + TSW_AUG, + TSW_AUZI, + TSW_TMP, + TSW_M82A1, + TSW_MP7, + TSW_SPAS, + TSW_GCOLTS, + TSW_GLOCK20, + TSW_UMP, + TSW_M61GRENADE, + TSW_CKNIFE, + TSW_MOSSBERG, + TSW_M16A4, + TSW_MK1, + TSW_C4, + TSW_A57, + TSW_RBULL, + TSW_M60E3, + TSW_SAWED_OFF, + TSW_KATANA, + TSW_SKNIFE, + TSW_KUNG_FU, + TSW_TKNIFE, +} + +/* +valid tsweaponid in TS_GiveWeapon + +1: "Glock 18" +3: "Mini Uzi" +4: "Benelli M3" +5: "M4A1" +6: "MP5SD" +7: "MP5K" +8: "Akimbo Berettas" +9: "Socom Mk23" +11: "Usas12" +12: "Desert Eagle" +13: "Ak47" +14: "FiveSeven" +15: "Steyr Aug" +17: "Steyr Tmp" +18: "Barrett M82" +19: "HK Pdw" +20: "Spas12" +21: "Akimbo colts" +22: "Glock 20" +23: "Mac10" +25: "Combat Knife" +26: "Mossberg 500" +27: "M16A4" +28: "Ruger Mk1" +24: "M61 Grenade" +29: "C4" +31: "Raging Bull" +32: "M60" +33: "Sawed off" +34: "Katana" +35: "Seal Knife" + +valid pwuptype in TS_GivePwUp + +0: "Random" +1: "Slow Motion" +2: "Infinite Clip" +4: "Kung Fu" +8: "Slow Pause" +16: "Double Firerate" +32: "Grenade" +64: "Health" +128: "Armor" +256: "Superjump" + +*/ + + diff --git a/plugins/include/tsstats.inc b/plugins/include/tsstats.inc new file mode 100755 index 00000000..7ec543f9 --- /dev/null +++ b/plugins/include/tsstats.inc @@ -0,0 +1,58 @@ +/* TSXMod Stats functions + * + * (c) 2004, SidLuke + * This file is provided as is (no warranties). + */ + +#if defined _tsstats_included + #endinput +#endif +#define _tsstats_included + +/* Gets stats from given weapon index. If wpnindex is 0 +* then the stats are from all weapons. If weapon has not been used function +* returns 0 in other case 1. Fields in stats are: +* 0 - kills +* 1 - deaths +* 2 - headshots +* 3 - teamkilling +* 4 - shots +* 5 - hits +* 6 - damage +* For body hits fields see amxconst.inc. */ +native get_user_wstats(index,wpnindex,stats[8],bodyhits[8]); + +/* Gets round stats from given weapon index.*/ +native get_user_wrstats(index,wpnindex,stats[8],bodyhits[8]); + +/* Gets life (from spawn to spawn) stats from given weapon index.*/ +native get_user_wlstats(index,wpnindex,stats[8],bodyhits[8]); + +/* Gets overall stats which are stored in file on server +* and updated on every respawn or user disconnect. +* Function returns the position in stats by diff. kills to deaths. */ +native get_user_stats(index,stats[8],bodyhits[8]); + +/* Gets round stats of player. */ +native get_user_rstats(index,stats[8],bodyhits[8]); + +/* Gets stats with which user have killed/hurt his victim. If victim is 0 +* then stats are from all victims. If victim has not been hurt, function +* returns 0 in other case 1. User stats are reset on his respawn. */ +native get_user_vstats(index,victim,stats[8],bodyhits[8],wpnname[]="",len=0); + +/* Gets stats with which user have been killed/hurt. If killer is 0 +* then stats are from all attacks. If killer has not hurt user, function +* returns 0 in other case 1. User stats are reset on his respawn. */ +native get_user_astats(index,wpnindex,stats[8],bodyhits[8],wpnname[]="",len=0); + +/* Resets life, weapon, victims and attackers user stats. */ +native reset_user_wstats(index); + +/* Gets overall stats which stored in stats.dat file in amx folder +* and updated on every mapchange or user disconnect. +* Function returns next index of stats entry or 0 if no more exists. */ +native get_stats(index,stats[8],bodyhits[8],name[],len); + +/* Returns number of all entries in stats. */ +native get_statsnum(); diff --git a/plugins/include/tsx.inc b/plugins/include/tsx.inc new file mode 100755 index 00000000..d098b2d0 --- /dev/null +++ b/plugins/include/tsx.inc @@ -0,0 +1,84 @@ +/* TSXMod functions + * + * (c) 2004, SidLuke + * This file is provided as is (no warranties). + */ + +#if defined _tsx_included + #endinput +#endif +#define _tsx_included + +#include +#include + +/************* Shared Natives Start ********************************/ + +/* Forward types */ +enum { + XMF_DAMAGE = 0, + XMF_DEATH, +} + +/* Use this function to register forwards */ +native register_statsfwd( ftype ); + +/* Function is called after player to player attacks , +* if players were damaged by teammate TA is set to 1 */ +forward client_damage(attacker,victim,damage,wpnindex,hitplace,TA); + +/* Function is called after player death , +* if player was killed by teammate TK is set to 1 */ +forward client_death(killer,victim,wpnindex,hitplace,TK); + +/* Custom Weapon Support */ +/* function will return index of new weapon */ +native custom_weapon_add( wpnname[],melee = 0,logname[]="" ); +/* Function will pass damage done by this custom weapon to stats module and other plugins */ +native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 ); +/* Function will pass info about custom weapon shot to stats module */ +native custom_weapon_shot( weapon,index ); // weapon id , player id + +/* function will return 1 if true */ +native xmod_is_melee_wpn(wpnindex); + +/* Returns weapon name. */ +native xmod_get_wpnname(wpnindex,name[],len); + +/* Returns weapon logname. */ +native xmod_get_wpnlogname(wpnindex,name[],len); + +/* Returns weapons array size */ +native xmod_get_maxweapons(); + +/* Returns stats array size ex. 8 in TS , 9 in DoD */ +native xmod_get_stats_size(); + +/* Returns 1 if true */ +native xmod_is_custom_wpn(wpnindex); + +/************* Shared Natives End ********************************/ + +/* weapon logname to weapon name convertion */ +native ts_wpnlogtoname(logname[],name[],len); + +/* weapon logname to weapon index convertion */ +native ts_wpnlogtoid(logname[]); + +native ts_getuserwpn( index,&ammo,&clip,&mode,&extra ); +native ts_getusercash( index ); +native ts_getuserspace( index ); +native ts_getuserpwup( index,&Value ); +native ts_getuseritems( index ); +native ts_getuserkillflags(killer); +native ts_getkillingstreak( index ); +native ts_getuserlastfrag( index ); + +native ts_giveweapon( index,weapon,clips,extra ); + +/* Function will create pwup entity and return its index (pwupent) */ +native ts_createpwup( index,pwup ); + +native ts_givepwup( index,pwupent ); + +native ts_setpddata( knifeoffset ); \ No newline at end of file