Functions

ns.inc

Function Type Description
client_built forward Called whenever the client builds a structure.
client_changeclass forward Called whenever the client's class is changed.
client_changeteam forward Triggered whenever a client's pev->team changes.
client_spawn forward Triggered whenever a client's pev->deadflag changes from >0 to 0.
map_reset forward This function has no description.
round_end forward Called immediately when a round ends
round_start forward Called at the approximate time that a round is started.
ns_add_deaths native Adds to a player's death count
Returns the new death count on success
ns_add_energy native Adds to the player's energy percentage.
ns_add_exp native Adds to the player's experience.
ns_add_jpfuel native Adds to the player's jetpack fuel reserve.
ns_add_obs_energy native This function has no description.
ns_add_points native Adds to the player's points spent count in combat.
ns_add_res native Adds an amount of resources to the player.
ns_add_score native Adds to a player's score
Returns the new score on success
ns_add_teamres native Adds to the team's resources in the resource pool.
ns_add_weld_done native Adds to the total time this func_weldable
has been welded. Returns the new value.
Note this native clamps the low value to 0.0
ns_add_weld_time native Adds to the weldable's time required to open.
Returns the new required time on success.
Note this native clamps the low value to 0.
ns_build_structure native Forces the structure to fully build
Removes the ghost state from marine structures.
Do not use this on hives! It wont work.
ns_create_ps native Creates a handle to the a particle system to configure
-
Note! this is not a particle system you can pass to
ns_fire_ps()!
ns_finish_weldable native Forces the weldable to trigger
Passing an index other than a weldable
will have undefined results!
-
NS renames func_weldable to avhweldable
at map load.
-
Note: This calls a private NS function!
Be careful when using this!
ns_fire_ps native Draws a particle system at the given origin (and angles)
Flags are the FEV_* defines from hlsdk_const.inc
Only use handles returned by ns_spawn_ps or ns_get_ps_id here!
ns_get_build native Returns built/unbuilt structures.
If:
builtOnly is 1 (default):
Only fully built structures are counted.
builtOnly is 0:
Any structure meeting the classname is counted.

Number is 0 (default):
The total number of matching structures is returned.
Number is any other value:
The index of the #th matching structure is returned.
ns_get_class native Returns the class of the player. Look in the classes enum in ns_const.inc for the value's meaning.
ns_get_deaths native Gets a player's death count.
ns_get_energy native Gets the player's energy percentage.
ns_get_exp native Returns the player's experience.
ns_get_gameplay native Returns the gameplay type for the currently active map.
Refer to ns_const.inc's NSGameplay enum for details.
ns_get_hive_ability native Returns 1 if a player has the hive ability number.
If ability is 0, it will return the number of active hives.
ns_get_hive_trait native Gets the trait type tied to the hive. Look at the hivetrait enum for the values.
ns_get_jpfuel native Gets the player's jetpack fuel reserve.
ns_get_locationname native Returns the location name of the provided x/y position
(z origin is ignored; can't have location over location)
-
Note that as of NS 3.2 beta 2, on the following maps
the returned string should be passed through ns_lookup_title
to be human readable:
ns_bast, ns_hera, ns_nothing, ns_tanith,
ns_nancy, ns_caged, ns_eclipse, ns_veil

Passing the 5th parameter as non zero will auto look up
the title if it exists.
ns_get_mask native Returns whether or not this mask is set from the entity's iuser4 field. Use the "mask" enum for reference.
ns_get_maxspeed native Returns a client's maxspeed before the speed change modifier is factored in.
ns_get_obs_energy native Gets/sets/adds to the energy pool of this observatory.
ns_get_points native Gets the player's points spent count in combat.
ns_get_ps_id native Looks up a particle system by name
Returns a usable particle system handle.
ns_get_res native Returns a player's resources.
ns_get_score native Gets the player's score.
ns_get_spawn native Gets spawn point for specified team (type).
If:
Team is equal to 0:
Ready room spawns are returned.
Team is greater than 0:
Spawns for the team are returned.

Number is equal to 0:
Total number of spawns is returned.
Number is greater than 0:
The location of the specified spawn is returned.
ns_get_speedchange native Returns a client's current speed modifier.
ns_get_struct_owner native Gets the index of the owner of a structure. -1 for no owner.
ns_get_teamres native Returns the team's resources.
ns_get_user_team native Exact syntax as get_user_team, but should be more accurate.
ns_get_weap_clip native Gets the weapon's clip ammo.
ns_get_weap_dmg native Gets the damage for this weapon.
ns_get_weap_range native Gets the maximum range for this weapon.
ns_get_weap_reserve native Gets the player's weapon reserve (backpack ammo) for the specified
type of weapon.
ns_get_weapon native This function has no description.
ns_get_weld_done native Gets the total time this func_weldable
has been welded.
ns_get_weld_time native Gets the total time needed to weld this
func_weldable shut.
Note: NS renames "func_weldable"s to "avhweldable"s
at run time!
ns_give_item native Give the player an item.
ns_has_weapon native Returns if the player has the weapon or not in their pev->weapons field.
set "setweapon" to 0 to turn the bit off, set to 1 to turn it on. Or omit it to just return the value.
ns_is_combat native Tell whether or not the map is combat.
ns_lookup_title native Looks up a key from titles.txt
Returns -1 if the key is not found
Otherwise it returns the length of the output
ns_popup native Send an NS-style popup message.
ns_recycle native Forces the structure to begin recycling
Passing an index other than a marine structure will
have undefined results!
-
Note: This calls a private NS function!
Be careful when using this!
ns_remove_upgrade native Removes an upgrade from the player's bought and active upgrade lists.
This will not refund the points spent on the upgrade, nor will it
immediately strip the upgrade if the player is alive. Rather, it will
make it so the player no longer receives the upgrade on spawn.
ns_round_in_progress native Whether or not there is a game in progress.
ns_set_deaths native Sets a player's death count.
ns_set_energy native Sets the player's energy percentage.
ns_set_exp native Sets the player's experience.
ns_set_fov native 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
ns_set_hive_trait native Sets the trait type tied to the hive. Look at the hivetrait enum for the values.
ns_set_jpfuel native Sets the player's jetpack fuel reserve.
ns_set_mask native 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.
ns_set_obs_energy native This function has no description.
ns_set_player_body native Sets a player body. Omit the second parameter to return to default
ns_set_player_model native Sets a player model. Omit the second parameter to return to default
ns_set_player_skin native Sets a player skin. Omit the second parameter to return to default
ns_set_points native Sets the player's points spent count in combat.
ns_set_ps_anim_speed native This function has no description.
ns_set_ps_base_color native This function has no description.
ns_set_ps_genrate native The following are the parameters for configuring the
particle system. Look through the fgd and NSPSEdit
for details!
ns_set_ps_genshape native This function has no description.
ns_set_ps_genshape_params native This function has no description.
ns_set_ps_max_alpha native This function has no description.
ns_set_ps_name native Sets the name of the particle system.
-
This is used for things like ns_get_ps_id()
and through calling another particle system
through the "ps_to_gen" field
ns_set_ps_numparticles native This function has no description.
ns_set_ps_particle_life native This function has no description.
ns_set_ps_rendermode native This function has no description.
ns_set_ps_scale native This function has no description.
ns_set_ps_size native This function has no description.
ns_set_ps_spawn_flags native This function has no description.
ns_set_ps_sprite native Sets the sprite to use for the particle system
-
You do NOT have to precache the sprite, BUT
the sprite must obviously be on the client to
display.
ns_set_ps_spriteframes native This function has no description.
ns_set_ps_sys_life native This function has no description.
ns_set_ps_to_gen native This function has no description.
ns_set_ps_vel_params native This function has no description.
ns_set_ps_vel_shape native This function has no description.
ns_set_res native Sets a player's resources.
ns_set_score native Sets the player's score.
ns_set_speedchange native Set this to modify the player's speed by a certain amount.
ns_set_struct_owner native Sets the index of the owner of a structure. -1 for no owner.
ns_set_teamres native Sets the team's resources in the resource pool.
ns_set_weap_clip native Sets the weapon's ammo in the clip.
ns_set_weap_dmg native Sets the damage for this weapon.
ns_set_weap_range native Sets the maximum range for this weapon.
ns_set_weap_reserve native Sets the player's weapon reserve (backpack ammo) for the specified
type of weapon.
ns_set_weld_done native Sets the total time this func_weldable
has been welded.
ns_set_weld_time native Sets the total time needed to weld this
func_weldable shut.
ns_spawn_ps native Finalizes the particle system. Do not configure it after this.
A usable particle system handle is returned.
ns_takedamage native This function has no description.
ns_unstick_player native Attempts to unstick a player.