[Half-Life AMXX] / include / tsfun.inc Repository:
ViewVC logotype

Annotation of /include/tsfun.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (view) (download)

1 : ian 1 /* TSFUN
2 :     *
3 :     * (c) 2005-2006, AMX Mod X Dev Team
4 :     * This file is provided as is (no warranties).
5 :     */
6 :    
7 :     #if defined _tsxfun_included
8 :     #endinput
9 :     #endif
10 :     #define _tsxfun_included
11 :    
12 :     #include <tsx>
13 :     #include <tsconst>
14 :    
15 :     /************* Shared Natives Start ********************************/
16 :    
17 :     /* Forward types */
18 :     enum {
19 :     XMF_DAMAGE = 0,
20 :     XMF_DEATH,
21 : ian 17 };
22 : ian 1
23 :     #if AMXX_VERSION_NUM >= 175
24 :     #pragma reqlib tsfun
25 :     #if !defined AMXMODX_NOAUTOLOAD
26 :     #pragma loadlib tsfun
27 :     #endif
28 :     #else
29 :     #pragma library tsfun
30 :     #endif
31 :    
32 :     /************* Shared Natives End ********************************/
33 :    
34 :     /* Function is called just before a kung foo attack is done,
35 :     * damage and time length may be altered with natives.
36 :     * Return PLUGIN_HANDLED to stop attack.
37 :     * UNAVAILABLE IN 1.70
38 :     */
39 :     forward Melee_Attack(id,Float:time,Float:damage,UNAVAILABLE);
40 :    
41 :    
42 :     // Returns when someone stunts, after they do it.
43 :     //UNAVAILABLE IN 1.70
44 :     forward client_stunt(id,stunttype,UNAVAILABLE);
45 :    
46 :     /* Function is called when powerups are ran,
47 :     * Returns value of powerup. Use TSPWUP_*'s
48 :     * to find exactly which one it is.
49 :     * UNAVAILABLE IN 1.70
50 :     */
51 :     forward client_powerup(id,powerup,UNAVAILABLE);
52 :    
53 :     /* weapon logname to weapon name convertion */
54 :     native ts_wpnlogtoname(const logname[],name[],len);
55 :    
56 :     /* weapon logname to weapon index convertion */
57 :     native ts_wpnlogtoid(const logname[]);
58 :    
59 :     //UNAVAILABLE IN 1.70
60 :     //native Float:ts_getusertime( index ); //!
61 :     //native ts_setusertime( index, Float:time ); //!
62 :    
63 :     native ts_getusercash( index );
64 :     native ts_setusercash( index, money );
65 :    
66 :     native ts_getuserslots( index );
67 :     native ts_setuserslots( index, slots );
68 :    
69 :     native ts_getuserstate( index );
70 : ian 17 native ts_getuserwpn( index,&clip=0,&ammo=0,&mode=0,&extra=0 );
71 : ian 1 native ts_getuserspace( index );
72 :    
73 :     native ts_getuserkillflags(killer);
74 :     native ts_getkillingstreak( index );
75 :     native ts_getuserlastfrag( index );
76 :    
77 :     native ts_giveweapon( index,weapon,clips,extra );
78 :    
79 :     native ts_getuserpwup( index );
80 :    
81 :     stock ts_has_slowmo(id) return (ts_getuserpwup(id) &TSPWUP_SLOWMO);
82 :     stock ts_has_infammo(id) return (ts_getuserpwup(id) &TSPWUP_INFAMMO);
83 :     stock ts_has_slowpause(id) return (ts_getuserpwup(id) &TSPWUP_SLOWPAUSE);
84 :     stock ts_has_dfirerate(id) return (ts_getuserpwup(id) &TSPWUP_DFIRERATE);
85 :     stock ts_has_grenade(id) return (ts_getuserpwup(id) &TSPWUP_GRENADE);
86 :     stock ts_has_health(id) return (ts_getuserpwup(id) &TSPWUP_HEALTH);
87 :     stock ts_has_armor(id) return (ts_getuserpwup(id) &TSPWUP_ARMOR);
88 :    
89 :     /* Function will create pwup entity and return its index (pwupent) */
90 :     native ts_createpwup( pwup );
91 :    
92 :     native ts_givepwup( index,pwupent );
93 :    
94 :     native ts_setpddata( knifeoffset );
95 :    
96 :     // Alters a fu attack. Use with fu forward
97 :     // UNAVAILABLE IN 1.70
98 :     // native ts_set_fuattack(id,Float:time,Float:damage); //!
99 :    
100 :     // Changes board message
101 :     native ts_set_message(id,message);
102 :    
103 :     // Gets the message board message
104 :     native ts_get_message(id);
105 :    
106 :     stock ts_is_normal(id)
107 :     {
108 :     new msg = ts_get_message(id);
109 :     if( (msg > 11) || (msg > 6 && msg < 10) ) return 1;
110 :     return 0;
111 :     }
112 :     stock ts_is_waiting(id) return (ts_get_message(id) == TSMSG_WAITING);
113 :     stock ts_is_dead(id) return (ts_get_message(id) == TSMSG_DEAD);
114 :     stock ts_is_killer(id) return (ts_get_message(id) == TSMSG_KILLER);
115 :     stock ts_is_demolition(id) return (ts_get_message(id) == TSMSG_DEMOLITION);
116 :     stock ts_is_specialist(id) return (ts_get_message(id) == TSMSG_SPECIALIST);
117 :     stock ts_is_unstoppable(id) return (ts_get_message(id) == TSMSG_UNSTOPPABLE);
118 :     stock ts_is_theone(id) return (ts_get_message(id) == TSMSG_THEONE);
119 :    
120 :     // Return one on true, 0 on false
121 :     // UNAVAILABLE IN 1.70
122 :     native ts_has_superjump(id); //!
123 :     native ts_has_fupowerup(id); //!
124 :     native ts_is_in_slowmo(id);
125 :    
126 :     // Get and set consecutive frags
127 :     //UNAVAILABLE IN 1.70
128 :     //native ts_get_cons_frags(id);
129 :     //native ts_set_cons_frags(id,num);
130 :    
131 :     // Set to see cool bullet trails. Only id will see them.
132 :     native ts_set_bullettrail(id,yesorno);
133 :    
134 :     // Sets fake versions of slow mo and slow pause. Use ts_set_speed for more options.
135 :     native ts_set_fakeslowmo(id,Float:time);
136 :     native ts_set_fakeslowpause(id,Float:time);
137 :    
138 :     /* Sets speed artificially. 1.0 is default, Go into fractions and decimals for slower
139 :     * and put in higher numbers for higher speeds. Aura is how far things around you are effected
140 :     * Time is the time until it wears off. 0.0 for speed will freeze people. Do not use negatives. */
141 :    
142 :     native ts_set_speed(id,Float:speed,Float:auradist,Float:time);
143 :    
144 :     /* Sets physics speed artificially. Things like sparks and sounds will be effected.
145 :     * Any negative number will render all physics paused. */
146 :     native ts_set_physics_speed(id,Float:speed);
147 :    
148 :     // Returns 0 if no powerup is running. Returns the powerup type otherwise.
149 :     native ts_is_running_powerup(id);
150 :    
151 :     // Highly experimental command which overrides powerup types.
152 :     // Use if a powerup is already running, or if a powerup is not running.
153 :     // Safe to use in powerup forward.
154 :     native ts_force_run_powerup(id,PWUP_TYPE);

Contact
ViewVC Help
Powered by ViewVC 1.0.4