Parent Directory | Revision Log
Revision 1 - (view) (download)
1 : | ian | 1 | /* NS module functions |
2 : | * - | ||
3 : | * (c) 2004, Steve Dudenhoeffer | ||
4 : | * This file is provided as is (no warranties). | ||
5 : | */ | ||
6 : | |||
7 : | #if defined NS_INC | ||
8 : | #endinput | ||
9 : | #endif | ||
10 : | #define NS_INC | ||
11 : | |||
12 : | #if AMXX_VERSION_NUM >= 175 | ||
13 : | #pragma reqlib ns | ||
14 : | #if !defined AMXMODX_NOAUTOLOAD | ||
15 : | #pragma loadlib ns | ||
16 : | #endif | ||
17 : | #else | ||
18 : | #pragma library ns | ||
19 : | #endif | ||
20 : | |||
21 : | |||
22 : | #include <ns_const> | ||
23 : | |||
24 : | |||
25 : | /* Called whenever the client's class is changed. The classes given match get_class() output */ | ||
26 : | forward client_changeclass(id,newclass,oldclass); | ||
27 : | |||
28 : | /* Called whenever the client build's a structure. If type is 1, it's a marine structure, if type is 2, it's alien. */ | ||
29 : | forward client_built(idPlayer,idStructure,type,impulse); | ||
30 : | |||
31 : | /* Returns if the map's combat or not. */ | ||
32 : | native ns_is_combat(); | ||
33 : | |||
34 : | /* Sends a popup to a player. Set target to 0 to send to everybody. Message length is 180 characters. The last parameter, if set to 1, will only display when the player has cl_autohelp set to 1. */ | ||
35 : | native ns_popup(target,const szMsg[180],ah=0); | ||
36 : | |||
37 : | /* Sets a player model. Omit the second parameter to return to default. | ||
38 : | Note: This does *not* change back on death, team switch, gestations, etc. */ | ||
39 : | native ns_set_player_model(id,const szModel[]=""); | ||
40 : | |||
41 : | /* Sets a player's skin. Omit second parameter to return to default. | ||
42 : | Note: This does *not* change back on death, team switch, gestations, etc. */ | ||
43 : | native ns_set_player_skin(id,skin=-1); | ||
44 : | |||
45 : | /* Sets a player's body. Omit second parameter to return to default. | ||
46 : | Note: This does *not* change back on death, team switch, gestations, etc. */ | ||
47 : | native ns_set_player_body(id,body=-1); | ||
48 : | |||
49 : | /* Sets a player's speedchange. Omit the second parameter to return to default */ | ||
50 : | native ns_set_speedchange(id,speedchange=0); | ||
51 : | |||
52 : | /* Returns a player's current speedchange. */ | ||
53 : | native ns_get_speedchange(id); | ||
54 : | |||
55 : | /* Returns a player's max speed before the speed change is factored in. */ | ||
56 : | native ns_get_maxspeed(id); | ||
57 : | |||
58 : | /* Returns whether or not this mask is set from the entity's iuser4 field. Use the "mask" enum for reference. */ | ||
59 : | native ns_get_mask(id,mask); | ||
60 : | |||
61 : | /* Sets or removes the mask from the entity's iuser4 field. Set "value" to 1 to turn the mask on, 0 to turn it off. */ | ||
62 : | native ns_set_mask(id,mask,value); | ||
63 : | |||
64 : | /* Returns built/unbuilt structures. | ||
65 : | If: | ||
66 : | builtOnly is 1 (default): | ||
67 : | Only fully built structures are counted. | ||
68 : | builtOnly is 0: | ||
69 : | Any structure meeting the classname is counted. | ||
70 : | |||
71 : | Number is 0 (default): | ||
72 : | The total number of matching structures is returned. | ||
73 : | Number is any other value: | ||
74 : | The index of the #th matching structure is returned. | ||
75 : | */ | ||
76 : | native ns_get_build(const classname[],builtOnly=1,Number=0); | ||
77 : | |||
78 : | /* Returns if the player has the weapon or not in their pev->weapons field. | ||
79 : | set "setweapon" to 0 to turn the bit off, set to 1 to turn it on. Or omit it to just return the value. */ | ||
80 : | native ns_has_weapon(id,weapon,setweapon=-1); | ||
81 : | |||
82 : | /* Gets spawn point for specified team (type). | ||
83 : | If: | ||
84 : | Team is equal to 0: | ||
85 : | Ready room spawns are returned. | ||
86 : | Team is greater than 0: | ||
87 : | Spawns for the team are returned. | ||
88 : | |||
89 : | Number is equal to 0: | ||
90 : | Total number of spawns is returned. | ||
91 : | Number is greater than 0: | ||
92 : | The location of the specified spawn is returned. | ||
93 : | */ | ||
94 : | native ns_get_spawn(team,number=0,Float:ret[3]); | ||
95 : | |||
96 : | /* Returns the class of the player. Look in the classes enum in ns_const.inc for the value's meaning. */ | ||
97 : | native ns_get_class(id); | ||
98 : | |||
99 : | /* Returns a player's percentage of JP fuel */ | ||
100 : | native Float:ns_get_jpfuel(id); | ||
101 : | |||
102 : | /* Sets a player's percentage of JP fuel */ | ||
103 : | native ns_set_jpfuel(id,Float:fuel); | ||
104 : | |||
105 : | /* Returns a player's percentage of adrenaline (alien) */ | ||
106 : | native Float:ns_get_energy(id); | ||
107 : | |||
108 : | /* Sets a player's percentage of adrenaline */ | ||
109 : | native ns_set_energy(id,Float:energy); | ||
110 : | |||
111 : | /* Returns a player's resources. (alien only) */ | ||
112 : | native Float:ns_get_res(id); | ||
113 : | |||
114 : | /* Sets a player's resources. (alien only) */ | ||
115 : | native ns_set_res(id,Float:res); | ||
116 : | |||
117 : | /* Returns a player's experience (combat only) */ | ||
118 : | native Float:ns_get_exp(id); | ||
119 : | |||
120 : | /* Sets a player's experience (combat only) */ | ||
121 : | native ns_set_exp(id,Float:exp); | ||
122 : | |||
123 : | /* Gets a player's point spent value in combat */ | ||
124 : | native ns_get_points(id); | ||
125 : | |||
126 : | /* Sets a player's point spent value in combat */ | ||
127 : | native ns_set_points(id,points); | ||
128 : | |||
129 : | /* Gets a weapon's damage (use the weapon index, not the player) */ | ||
130 : | native Float:ns_get_weap_dmg(idWeapon); | ||
131 : | |||
132 : | /* Sets a weapon's damage (use the weapon index, not the player) */ | ||
133 : | native ns_set_weap_dmg(idWeapon,Float:damage); | ||
134 : | |||
135 : | /* Gets a weapon's range (use the weapon index, not the player) */ | ||
136 : | native Float:ns_get_weap_range(idWeapon); | ||
137 : | |||
138 : | /* Sets a weapon's range (use the weapon index, not the player) */ | ||
139 : | native ns_set_weap_range(idWeapon,Float:range); | ||
140 : | |||
141 : | /* Gets a weapon's clip ammo (use the weapon index, not the player) */ | ||
142 : | native ns_get_weap_clip(idWeapon); | ||
143 : | |||
144 : | /* Sets a weapon's clip ammo (use the weapon index, not the player) */ | ||
145 : | native ns_set_weap_clip(idWeapon,clipsize); | ||
146 : | |||
147 : | /* Gets the player's weapon reserve for the specified type of weapon. | ||
148 : | Look in ns_const.inc for the weapon enum. */ | ||
149 : | native ns_get_weap_reserve(id,weapon); | ||
150 : | |||
151 : | /* Sets the player's weapon reserve for the specified type of weapon. | ||
152 : | Look in ns_const.inc for the weapon enum. */ | ||
153 : | native ns_set_weap_reserve(id,weapon,ammo); | ||
154 : | |||
155 : | /* Gets a player's score. Note: score from level is automatically factored into the scoreboard display in combat. */ | ||
156 : | native ns_get_score(idPlayer); | ||
157 : | |||
158 : | /* Sets a player's score. Note: score from level is automatically factored into the scoreboard display in combat. */ | ||
159 : | native ns_set_score(idPlayer,score); | ||
160 : | |||
161 : | /* Gets a player's death count. */ | ||
162 : | native ns_get_deaths(idPlayer); | ||
163 : | |||
164 : | /* Sets a player's death count. */ | ||
165 : | native ns_set_deaths(idPlayer,numdeaths); | ||
166 : | |||
167 : | /* Gets the index of the owner of a structure. -1 for no owner. */ | ||
168 : | native ns_get_struct_owner(idStructsure); | ||
169 : | |||
170 : | /* Sets the index of the owner of a structure. -1 for no owner. */ | ||
171 : | native ns_set_struct_owner(idStructure,indexOwner); | ||
172 : | |||
173 : | /* Gets the trait type tied to the hive. Look at the hivetrait enum for the values. */ | ||
174 : | native ns_get_hive_trait(idHive); | ||
175 : | |||
176 : | /* Sets the trait type tied to the hive. Look at the hivetrait enum for the values. */ | ||
177 : | native ns_set_hive_trait(idHive,trait); | ||
178 : | |||
179 : | /* Sets the players field of view, set "_fov" to 0.0 (or omit it) to return to normal. FOV change will persist until disconnect unless reset by a plugin */ | ||
180 : | native ns_set_fov(idPlayer,Float:_fov=0.0); | ||
181 : | |||
182 : | /* Give a player an item. */ | ||
183 : | native ns_give_item(id,const _szClassName[]); | ||
184 : | |||
185 : | /* Returns if a player has the hive ability number, if ability is 0 it will return the number of active hives */ | ||
186 : | native ns_get_hive_ability(idPlayer, ability=0); | ||
187 : | |||
188 : | /* A player's team entvar has changed */ | ||
189 : | forward client_changeteam(id,newteam,oldteam); | ||
190 : | |||
191 : | /* A player's deadflag entvar has changed from >0 to 0 */ | ||
192 : | forward client_spawn(id); |
Contact | ViewVC Help |
Powered by ViewVC 1.0.4 |