AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ent Spawning (Solid Problem) (https://forums.alliedmods.net/showthread.php?t=63061)

udsting 11-10-2007 20:56

Ent Spawning (Solid Problem)
 
I'm trying to spawn a solid entity in The Specialists with this code segment, it all compiles fine but the ent isn't showing up in the map. I'm sure I made some novice mistake but I can't figure it out so I was hoping someone could spot it for me.

hlstriker 11-10-2007 21:00

Re: Ent Spawning (lol I dunno)
 
Are you calling the function?

udsting 11-10-2007 21:43

Re: Ent Spawning (lol I dunno)
 
I'm going to assume I'm not. ^^;

hlstriker 11-10-2007 22:01

Re: Ent Spawning (lol I dunno)
 
Show all of your code?

udsting 11-10-2007 22:25

Re: Ent Spawning (lol I dunno)
 
Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> #include <fakemeta> #define PLUGIN "QuickfixPlugs" #define VERSION "1.1" #define AUTHOR "udsting" public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR)         set_lights("a")         model_spawn("models/mecklenburg/piano.mdl")     } public plugin_precache() {     precache_model("models/mecklenburg/piano.mdl") } public model_spawn(model[]) {     new Float:origin[3] = {1354.0,-1895.0,-215.0}     new Float:maxs[3] = {100.0,26.0,52.0}     new Float:mins[3] = {-100.0,-26.0,-52.0}     new Float:angles[3] = {-0.0, -180.0, -0.0}             new ent = create_entity("info_target")     entity_set_string(ent, EV_SZ_classname, "entaddons")     entity_set_model(ent,model)     entity_set_origin(ent,origin)     entity_set_vector(ent,EV_VEC_angles,angles)     entity_set_size(ent,mins,maxs)     entity_set_int(ent,EV_INT_solid,2)     entity_set_int(ent,EV_INT_movetype,0)     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,1);     entity_set_byte(ent,EV_BYTE_controller1,125);     entity_set_byte(ent,EV_BYTE_controller2,125);     entity_set_byte(ent,EV_BYTE_controller3,125);     entity_set_byte(ent,EV_BYTE_controller4,125);     }

hlstriker 11-11-2007 01:21

Re: Ent Spawning (lol I dunno)
 
Try using a task in plugin_init to call the model_spawn() function.

udsting 11-11-2007 02:13

Re: Ent Spawning (lol I dunno)
 
Thanks much hlstriker! (Lunar and Hawk too!)

I'm working on this right now and I'll keep updating rather than making a new topic incase anyone checks it. :x Right now I'm having trouble with setting the solid state. I can tell I'm hitting something, but I'm able to pass through it.

hlstriker 11-11-2007 13:16

Re: Ent Spawning (Solid Problem)
 
I had that problem too until I changed the movetype to fly.

udsting 11-11-2007 18:49

Re: Ent Spawning (Solid Problem)
 
No luck. T_T


All times are GMT -4. The time now is 01:14.

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