AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   NS masks, structures and impulses. (https://forums.alliedmods.net/showthread.php?t=41340)

haimmaik 07-13-2006 08:28

NS masks, structures and impulses.
 
Masks:

i did a function that gives an alien carapace

Code:
if(ranks[id]==2){   ns_set_mask(id,MASK_CARAPACE,1)   adv[id]=1  }

but in game he has max of 16 armor... insted of 30...
and when i used silance i could still hear him :( but i saw the silance
and carapace icon like i have them

i have another problem.. when playing NS maps.. its like i get the upgrades and lose them right away... how can i fix that?

Structures and Impulse:
how can i use the command client_build( index, structure, type, impulse )
how do i get structure types to put in the structure argument and what is impulse?


Can some1 please make a tutorial that explains how to use all the NS.inc commands and tells us about the NS Module...:
Player Mask Constants
Class Constants
Weapon Constants
Hive Trait Constants

what everything's doing and how?

thanks :)

schnitzelmaker 07-13-2006 11:01

Re: NS masks, structures and impulses.
 
Ok np:
Player Mask Constants:
The mask list can be found in ns_const.inc

In classic the mask only work if there enought chamber,if you have MASK_CARAPACE and 1 chamber ,you have 16 armor,if you have 3 chamber you have 30 armor.if you have 0 chamber you lose the mask.
The same as the other masks.
the best is you test if he has really the mask:
Code:
client_print(id,print_chat,"has mask:%d",ns_get_mask(id,MASK_CARAPACE))

Class Constants:
the classes also stand in ns_const.inc,the fist class CLASS_UNKNOWN has classid 0,CLASS_SKULK has classid 1,...

You can read the clasnumber with
Code:
ns_get_class(id)
You can hook if someone change the class with
Code:
client_changeclass(id,newclass,oldclass)

Weapon Constants:
You know ns_const.inc,same as the class,WEAPON_NONE = 0,WEAPON_CLAWS = 1,...

To give someone a weapon use
Code:
give_item(id,"weaponname")
To test if someone have this weapon use
Code:
ns_has_weapon(id,weapon)

Hive Trait Constants:
This mean which Hive have which chamber
To find it out
Code:
new ent = find_ent(-1,"team_hive") ns_get_hive_trait(ent)

Quote:

Structures and Impulse:
how can i use the command client_build( index, structure, type, impulse )
how do i get structure types to put in the structure argument and what is impulse?
client_built ( index, structure, type, impulse )
index = id of player
If type is 1, it's a Marine structure. If type is 2, it's an Alien structure.
impulse = the impulse number,every building,command,.. have a number:
Code:
Alien resourcower = 90, Alien Offenschamber = 91, Alien Defenschember = 92, Alien Sensorychamber= 93, Alien movementchamber = 94, Alien hive = 95, ...
this numbre can be found in ns_sdk,or here: http://www.nsmod.org/forums/index.php?showtopic=1751

You can get many many more infos and plugins on www.nsmod.org (the big NS Modder community)
And the best and usefull sites ever :http://www.amxmodx.org/doc/ http://wiki.amxmodx.org/index.php/Main_Page

haimmaik 07-14-2006 01:29

Re: NS masks, structures and impulses.
 
thanks thats very usefull :) +karma
also i think u forgot the "structure" argument of the client_built function..
where do i get the names of the buildings?
when i write my own stuff there i get compile error:
Code:

Error: Function "client_built" is not implemented on line 67
[edit] hoo sorry, now i took another look of the function and saw that it only hook when a client builds a building... so how do i place a building with amxx? i mean i want to give a player some turrets so he can build by himself

schnitzelmaker 07-14-2006 08:05

Re: NS masks, structures and impulses.
 
I think yes for structure

here how to use it(untested)
Code:
public client_built(id,structure,type,impulse){     //here your code... }

Amxx has no support for build a building.So it must create an ent.
Code:
public anyfunction(id) { ... make_building(id, "sensorychamber") ... } public make_building(id,name[]){ new team = pev(id, pev_team) //to give the building the same team as yours new ent = create_entity(name)//buildingsnames:offenschamber,defensechamber,... new Float:origin[3] entity_get_vector(id, EV_VEC_origin,origin) entity_set_origin(ent,origin) DispatchSpawn(ent) set_pev(ent,pev_fuser1,0) set_pev(ent,pev_fuser2,500) set_pev(ent,pev_team,team) // Use pev(id, pev_team) to get the team and not get_team(id) so MvM works. ns_set_struct_owner(ent, id) //this make the id as owner of structur }

Buildingnames list:defensechamber,movementchamber,sensorych amber,offensechamber,team_hive
team_command,team_armory,team_advarmory,team_ observatory,phasegate,team_turretfactory,team _advturretfactory,turret,siegeturret,team_pro tolab,team_armslab,team_infantryportal

It give some more names,to find out which name it has use:
Code:
new Classname[32] entity_get_string(ent,EV_SZ_classname,Classname) client_print(0,print_chat,"name:%s",Classname)


All times are GMT -4. The time now is 08:07.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.