Parent Directory | Revision Log
Revision 17 - (view) (download)
1 : | ian | 1 | /* tfcX functions |
2 : | * | ||
3 : | * (c) 2004, SidLuke | ||
4 : | * This file is provided as is (no warranties). | ||
5 : | */ | ||
6 : | |||
7 : | #if defined _tfcx_included | ||
8 : | #endinput | ||
9 : | #endif | ||
10 : | #define _tfcx_included | ||
11 : | |||
12 : | #include <tfcconst> | ||
13 : | #include <tfcstats> | ||
14 : | |||
15 : | #if AMXX_VERSION_NUM >= 175 | ||
16 : | #pragma reqclass xstats | ||
17 : | #if !defined AMXMODX_NOAUTOLOAD | ||
18 : | #pragma defclasslib xstats tfcx | ||
19 : | #endif | ||
20 : | #else | ||
21 : | #pragma library tfcx | ||
22 : | #endif | ||
23 : | |||
24 : | /************* Shared Natives Start ********************************/ | ||
25 : | |||
26 : | /* Forward types */ | ||
27 : | enum { | ||
28 : | XMF_DAMAGE = 0, | ||
29 : | XMF_DEATH, | ||
30 : | ian | 17 | }; |
31 : | ian | 1 | |
32 : | /* Use this function to register forwards */ | ||
33 : | native register_statsfwd( ftype ); | ||
34 : | |||
35 : | /* Function is called after player to player attacks , | ||
36 : | * if players were damaged by teammate TA is set to 1 */ | ||
37 : | forward client_damage(attacker,victim,damage,wpnindex,hitplace,TA); | ||
38 : | |||
39 : | /* Function is called after player death , | ||
40 : | * if player was killed by teammate TK is set to 1 */ | ||
41 : | forward client_death(killer,victim,wpnindex,hitplace,TK); | ||
42 : | |||
43 : | /* Custom Weapon Support */ | ||
44 : | /* function will return index of new weapon */ | ||
45 : | native custom_weapon_add( const wpnname[],melee = 0,const logname[]="" ); | ||
46 : | /* Function will pass damage done by this custom weapon to stats module and other plugins */ | ||
47 : | native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 ); | ||
48 : | /* Function will pass info about custom weapon shot to stats module */ | ||
49 : | native custom_weapon_shot( weapon,index ); // weapon id , player id | ||
50 : | |||
51 : | /* function will return 1 if true */ | ||
52 : | native xmod_is_melee_wpn(wpnindex); | ||
53 : | |||
54 : | /* Returns weapon name. */ | ||
55 : | native xmod_get_wpnname(wpnindex,name[],len); | ||
56 : | |||
57 : | /* Returns weapon logname. */ | ||
58 : | native xmod_get_wpnlogname(wpnindex,name[],len); | ||
59 : | |||
60 : | /* Returns weapons array size */ | ||
61 : | native xmod_get_maxweapons(); | ||
62 : | |||
63 : | /* Returns stats array size ex. 8 in TS , 9 in DoD */ | ||
64 : | native xmod_get_stats_size(); | ||
65 : | |||
66 : | /* Returns 1 if true */ | ||
67 : | native xmod_is_custom_wpn(wpnindex); | ||
68 : | |||
69 : | /************* Shared Natives End ********************************/ | ||
70 : | |||
71 : | stock tfc_isgrenade( weapon ){ | ||
72 : | switch( weapon ) | ||
73 : | { | ||
74 : | case TFC_WPN_CALTROP, | ||
75 : | TFC_WPN_CONCUSSIONGRENADE, | ||
76 : | TFC_WPN_NORMALGRENADE, | ||
77 : | TFC_WPN_NAILGRENADE, | ||
78 : | TFC_WPN_MIRVGRENADE, | ||
79 : | TFC_WPN_NAPALMGRENADE, | ||
80 : | TFC_WPN_GASGRENADE, | ||
81 : | TFC_WPN_EMPGRENADE: | ||
82 : | return 1; | ||
83 : | default: return 0; | ||
84 : | } | ||
85 : | return 0; | ||
86 : | } | ||
87 : | |||
88 : | native tfc_userkill( index ); | ||
89 : | |||
90 : | /* Use this function to set private data offsets if needed | ||
91 : | Default offsets: | ||
92 : | timer: 932 | ||
93 : | sentrygun: 83 | ||
94 : | from AssKicR | ||
95 : | shells: 53 | ||
96 : | bullets: 55 | ||
97 : | cells: 57 | ||
98 : | rockets: 59 | ||
99 : | nade1: 14 | ||
100 : | nade2: 15 | ||
101 : | */ | ||
102 : | native tfc_setpddata(timer,sentrygun,shells,bullets,cells,rockets,nade1,nade2); | ||
103 : | |||
104 : | /*********************************************************************/ | ||
105 : | |||
106 : | native tfc_setmodel(index, const Model[], const Skin[]); | ||
107 : | native tfc_clearmodel(index); | ||
108 : | |||
109 : | /* Get amount of ammo in backpack on a user for a specific weapon */ | ||
110 : | /* Ammo Types in tfcconst.inc */ | ||
111 : | native tfc_getbammo(index, ammo); | ||
112 : | |||
113 : | /* Set amount of ammo in backpack on a user for a specific weapon */ | ||
114 : | native tfc_setbammo(index, ammo, value); | ||
115 : | |||
116 : | /* Returns amount of ammo in weapon's clip (backpack) */ | ||
117 : | /* Weapons list in tfcconst.inc */ | ||
118 : | native tfc_getweaponbammo(index, weapon); | ||
119 : | |||
120 : | /* Sets amount of ammo in weapon's clip (backpack) */ | ||
121 : | native tfc_setweaponbammo(index, weapon, value); | ||
122 : | |||
123 : | /* Returns amount of ammo in weapon's clip */ | ||
124 : | /* Index must be weapon's entity index */ | ||
125 : | native tfc_getweaponammo(index); | ||
126 : | |||
127 : | /* Sets amount of ammo in weapon's clip */ | ||
128 : | /* Index must be weapon's entity index */ | ||
129 : | native tfc_setweaponammo(index, value); | ||
130 : | |||
131 : | /* Returns 1 if user is carrying a goal item such as a flag or a keycard, else 0. | ||
132 : | * Team is by reference parameter that will be set to owning team(s) of the goal item. | ||
133 : | * Use the TFC_GOALITEM_* constants to determine the owning team. | ||
134 : | */ | ||
135 : | native tfc_get_user_goalitem(index, &team); | ||
136 : | ian | 17 | |
137 : | /* Returns 1 if the player is a spy and is currently feigning death */ | ||
138 : | native tfc_is_user_feigning(index); | ||
139 : | |||
140 : | /* Returns 1 if the two teams are allies, 0 otherwise | ||
141 : | * Note: Team must be 1->4 | ||
142 : | * Team 0 will always return 0 | ||
143 : | * Any other team will result in an error | ||
144 : | */ | ||
145 : | native tfc_is_team_ally(TeamA,TeamB); |
Contact | ViewVC Help |
Powered by ViewVC 1.0.4 |