KiLL3R

Spawn( <classname>, <origin>, <flags>, <radius>, <height> )


Module: Spawn

Summary:

Spawns a new entity and returns a reference to the entity



Example:

spawnatrigger()
{
	trigger = spawn("trigger_radius",self.origin,0,200,100);
	while(1)
	{
		trigger waittill("trigger",player);
		if(player.sessionstate != "playing")
			continue;
		player suicide();
	}
}



Required Args:

  • 1 : <classname> The name of the class to spawn (constant string)
  • 2 : <origin> The position where the entity is to be spawned (vector)


Optional Args

  • 1 : <flags> spawn flags (integer)
  • 2 : <radius> If the entity is a 'trigger_radius' entity then this is the radius of the trigger. Otherwise this parameter is invalid.
  • 3 : <height> If the entity is a 'trigger_radius' entity then this is the height of the trigger. Otherwise this parameter is invalid.