Commited to show new natives

This commit is contained in:
Twilight Suzuka 2006-01-14 03:16:25 +00:00
parent 7183954b08
commit 8ee50cee1b
4 changed files with 403 additions and 0 deletions

146
dlls/ts/tsconst.inc Normal file
View File

@ -0,0 +1,146 @@
/* TSFUN constants
*
* (c) 2005, Suzuka
* 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_NONE 0
#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
#define TSMSG_NORMAL 6
#define TSMSG_WAITING 11
#define TSMSG_DEAD 1
#define TSMSG_KILLER 2
#define TSMSG_DEMOLITION 3
#define TSMSG_SPECIALIST 4
#define TSMSG_UNSTOPPABLE 5
#define TSMSG_THEONE 10
#define STUNT_NONE 0
#define STUNT_DUCK 1
#define STUNT_ROLL 2
#define STUNT_DIVE 3
#define STUNT_GETUP 4
#define STUNT_FLIP 5
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"
*/

154
dlls/ts/tsfun.inc Normal file
View File

@ -0,0 +1,154 @@
/* TSFUN
*
* (c) 2005, Twilight Suzuka
* This file is provided as is (no warranties).
*/
#if defined _tsxfun_included
#endinput
#endif
#define _tsxfun_included
#include <tsconst>
/************* Shared Natives Start ********************************/
/* Forward types */
enum {
XMF_DAMAGE = 0,
XMF_DEATH,
}
#pragma library tsfun
/************* Shared Natives End ********************************/
/* 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 */
stock xmod_get_stats_size() return 8;
/* Returns 1 if true */
native xmod_is_custom_wpn(wpnindex);
/* Function is called just before a kung foo attack is done,
* damage and time length may be altered with natives.
* Return PLUGIN_HANDLED to stop attack. */
forward Melee_Attack(id,Float:time,Float:damage);
// Returns when someone stunts, after they do it.
forward client_stunt(id,stunttype);
/* Function is called when powerups are ran,
* Returns value of powerup. Use TSPWUP_*'s
* to find exactly which one it is. */
forward client_powerup(id,powerup);
/* weapon logname to weapon name convertion */
native ts_wpnlogtoname(logname[],name[],len);
/* weapon logname to weapon index convertion */
native ts_wpnlogtoid(logname[]);
native Float:ts_getusertime( index );
native ts_setusertime( index, Float:time );
native ts_getusercash( index );
native ts_setusercash( index, money );
native ts_getuserslots( index );
native ts_setuserslots( index, slots );
native ts_getuserstate( index );
native ts_getuserwpn( index,&ammo,&clip,&mode,&extra );
native ts_getuserspace( index );
native ts_getuserkillflags(killer);
native ts_getkillingstreak( index );
native ts_getuserlastfrag( index );
native ts_giveweapon( index,weapon,clips,extra );
native ts_getuserpwup( index );
stock ts_has_slowmo(id) return (ts_getuserpwup(id) &TSPWUP_SLOWMO);
stock ts_has_infammo(id) return (ts_getuserpwup(id) &TSPWUP_INFAMMO);
stock ts_has_slowpause(id) return (ts_getuserpwup(id) &TSPWUP_SLOWPAUSE);
stock ts_has_dfirerate(id) return (ts_getuserpwup(id) &TSPWUP_DFIRERATE);
stock ts_has_grenade(id) return (ts_getuserpwup(id) &TSPWUP_GRENADE);
stock ts_has_health(id) return (ts_getuserpwup(id) &TSPWUP_HEALTH);
stock ts_has_armor(id) return (ts_getuserpwup(id) &TSPWUP_ARMOR);
/* Function will create pwup entity and return its index (pwupent) */
native ts_createpwup( pwup );
native ts_givepwup( index,pwupent );
native ts_setpddata( knifeoffset );
// Alters a fu attack. Use with fu forward
native ts_set_fuattack(id,Float:time,Float:damage)
// Changes board message
native ts_set_message(id,message)
// Gets the message board message
native ts_get_message(id)
stock ts_is_normal(id)
{
new msg = ts_get_message(id)
if( (msg > 11) || (msg > 6 && msg < 10) ) return 1;
return 0;
}
stock ts_is_waiting(id) return (ts_get_message(id) == TSMSG_WAITING)
stock ts_is_dead(id) return (ts_get_message(id) == TSMSG_DEAD)
stock ts_is_killer(id) return (ts_get_message(id) == TSMSG_KILLER)
stock ts_is_demolition(id) return (ts_get_message(id) == TSMSG_DEMOLITION)
stock ts_is_specialist(id) return (ts_get_message(id) == TSMSG_SPECIALIST)
stock ts_is_unstoppable(id) return (ts_get_message(id) == TSMSG_UNSTOPPABLE)
stock ts_is_theone(id) return (ts_get_message(id) == TSMSG_THEONE)
// Return one on true, 0 on false
native ts_has_superjump(id)
native ts_has_fupowerup(id)
native ts_is_in_slowmo(id)
// Get and set consecutive frags
native ts_get_cons_frags(id)
native ts_set_cons_frags(id,num)
// Set to see cool bullet trails. Only id will see them.
native ts_set_bullettrail(id,yesorno)
// Sets fake versions of slow mo and slow pause. Use ts_set_speed for more options.
native ts_set_fakeslowmo(id,Float:time)
native ts_set_fakeslowpause(id,Float:time)
/* Sets speed artificially. 1.0 is default, Go into fractions and decimals for slower
* and put in higher numbers for higher speeds. Aura is how far things around you are effected
* Time is the time until it wears off. 0.0 for speed will freeze people. Do not use negatives. */
native ts_set_speed(id,Float:speed,Float:auradist,Float:time)
/* Sets physics speed artificially. Things like sparks and sounds will be effected.
* Any negative number will render all physics paused. */
native ts_set_physics_speed(id,Float:speed)
// Returns 0 if no powerup is running. Returns the powerup type otherwise.
native ts_is_running_powerup(id)
// Highly experimental command which overrides powerup types.
// Use if a powerup is already running, or if a powerup is not running.
// Safe to use in powerup forward.
native ts_force_run_powerup(id,PWUP_TYPE)

58
dlls/ts/tsstats.inc Normal file
View File

@ -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();

45
dlls/ts/tsx.inc Normal file
View File

@ -0,0 +1,45 @@
/* TSXMod functions
*
* (c) 2004, SidLuke
* This file is provided as is (no warranties).
*/
#if defined _tsx_included
#endinput
#endif
#define _tsx_included
#include <tsstats>
#include <tsfun>
#pragma library tsx
/************* 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
/************* Shared Natives End ********************************/