AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   entitys help (https://forums.alliedmods.net/showthread.php?t=20244)

[ --<-@ ] Black Rose 11-04-2005 12:01

entitys help
 
Ok... I want to make 24 entitys with a model that spawn at random places each round, and I don't want to make files for spawns like csdm...
so maby if you can do it like random spawns and that they still are on the map ( if possible ) or else maby drom them from the sky... :lol: i know NOTHING bout entitys... plz help :roll:

[ --<-@ ] Black Rose 11-04-2005 17:12

c'mon... i need this :D

Hawk552 11-04-2005 17:26

Not that great at this either, but try this:

Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("w/e","w/e","w/e");         set_task(5.0,"do_stuff"); } public do_stuff() {     for(new i = 0;i <= 24;i++)     {         new Float:origin[3];         origin[0] = random_float(0.0,1000.0);         origin[1] = random_float(0.0,1000.0);         origin[2] = random_float(0.0,1000.0);         new ent = create_entity("info_target");         entity_set_origin(ent,origin);         entity_set_string(ent,EV_SZ_model,"whatever_model");     } }

Of course, change some stuff. It'll crash if you load it as-is.

[ --<-@ ] Black Rose 11-04-2005 17:42

thx hawk will try...

[ --<-@ ] Black Rose 11-04-2005 18:43

well... didnt spawn anything...
what is "info_target"? should i replace that?
i used an player mdl... don't think would make a difference.. but i dunno so does it?
:roll::D

Hawk552 11-04-2005 18:52

It probably did spawn them, you just didn't see them. By default, info_target would be invisible. That's one of the things you should have changed, the classname, although it really doesn't matter.

[ --<-@ ] Black Rose 11-04-2005 19:07

okay okay... so how do you make em visible? :P
Code:
#include <amxmodx> #include <engine> public plugin_init()     {     register_plugin("w/e","w/e","w/e");     set_task(5.0,"do_stuff"); } public plugin_precache() {     precache_model("models/player/santa/santa.mdl") } public do_stuff() {     for(new i = 0;i <= 24;i++)         {         new Float:origin[3];         origin[0] = random_float(0.0,1000.0);         origin[1] = random_float(0.0,1000.0);         origin[2] = random_float(0.0,1000.0);         new ent = create_entity("info_target");         entity_set_origin(ent,origin);         entity_set_string(ent,EV_SZ_model,"santa");     } }

Hawk552 11-04-2005 19:09

Code:
entity_set_string(ent,EV_SZ_model,"santa");

Well that's your problem right there.

Set it to "player/santa/santa.mdl" and try again

[ --<-@ ] Black Rose 11-04-2005 19:20

ok thx...

.slimE 11-04-2005 19:45

n1 black rose :)


All times are GMT -4. The time now is 23:42.

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