AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Spawning working entities in NS -solved (https://forums.alliedmods.net/showthread.php?t=13429)

Rorthic 05-16-2005 00:28

Spawning working entities in NS -solved
 
i want to spawn a armory in ns that works, but i cant seem to get it right.

i have this

Code:
public cmdArmory(id) {     new ent     ent = create_entity("team_armory")     new Float:origin[3]         entity_set_model(ent,"models/b_armory.mdl")         entity_set_int(ent, EV_INT_movetype, 6)     entity_get_vector(id,EV_VEC_origin,origin);         entity_set_origin ( ent, origin )     origin[2] += 100.0 //moves player out of the way 2 is up     entity_set_origin(id,origin)         entity_set_int(ent, EV_INT_solid, 1)     //entity_set_float(ent,EV_FL_animtime,2.0)     //entity_set_float(ent,EV_FL_framerate,1.0)     //entity_set_int(ent,EV_INT_sequence,0);         return PLUGIN_HANDLED; }

it spawns it but it isnt solid and it dosent do anything but sit there. Any ideas?

sambro 05-16-2005 03:02

I had this problem too, when I tried changing a hostage model in CS.

I fixed it by calling DispatchSpawn(id).

Code:
public cmdArmory(id) {     new ent     ent = create_entity("team_armory")     new Float:origin[3]         entity_set_model(ent,"models/b_armory.mdl")         entity_set_int(ent, EV_INT_movetype, 6)     entity_get_vector(id,EV_VEC_origin,origin);         entity_set_origin ( ent, origin )     origin[2] += 100.0 //moves player out of the way 2 is up     entity_set_origin(id,origin)         entity_set_int(ent, EV_INT_solid, 1)     //entity_set_float(ent,EV_FL_animtime,2.0)     //entity_set_float(ent,EV_FL_framerate,1.0)     //entity_set_int(ent,EV_INT_sequence,0);     DispatchSpawn(ent);     return PLUGIN_HANDLED; }

Rorthic 05-16-2005 21:09

DispatchSpawn(ent); made it solid but it still isnt functioning. it just sits there, cant be built and cant be used. Im wondering if there is a command that allows the ent to be used?

karlos 05-17-2005 06:19

try to set EV_FL_fuser1
it is the status to define if its already build or inbuilt
1000.0 = built
everything below = building it

also set EV_INT_sequence to something bigger 0
and EV_INT_solid set to 2

maybe it helps

Rorthic 05-17-2005 17:50

still no luck, its there and solid but not usable. you would think there would be an easy, its built into the game.

Rorthic 05-20-2005 20:47

this answer comes from the plugin combat buildings by #endgame at modns
http://www.modns.org/forums/index.php?showtopic=1345

Code:
public cmdArmory(id) {     new team = get_team(id);     new name[] = "team_armory" //added for testing     new ent = create_entity(name); //greate the entity?     new Float:origin[3]; //create a value to hold origin     entity_get_vector(id, EV_VEC_origin,origin); //not sure what this does     entity_set_origin(ent,origin); //set the entities origin     DispatchSpawn(ent); //spawn the entity     set_pev(ent,pev_fuser1,0); //set fuser1 to 0 not sure what fuser is     set_pev(ent,pev_fuser2,500); //set fuser2 to 500 not sure what it is     set_pev(ent,pev_team,team); //assign a team to the entity     ns_set_struct_owner(ent, id); //assign an owner to the entity     return PLUGIN_HANDLED; } get_team(id){ //gets the team to assign to an entity, note: not all classes are listed.     new class = ns_get_class(id);     if((class == CLASS_MARINE) || (class == CLASS_JETPACK) || (class == CLASS_HEAVY))         return MARINE;     return ALIEN; }

this will spawn a working armory for what ever team the user is on. the code is probable a bit rough for use with NS classic, it came from a combat plugin.


All times are GMT -4. The time now is 16:48.

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