Post: [Script] - Smaller way to spawn things.
09-06-2011, 03:18 AM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); first of all, credits to -Algorithm- from se7ensins for this.
i'm just sharing it to our community so i don't want credit for this.

    
Spawn_models(name, class, model_name, local, angle, flag, radius, height, solid)
{
if(!isDefined(solid))
{
self.spawn[name] = spawn(class, local);
self.spawn[name] setmodel(model_name);
self.spawn[name].angles = (angle);
return;
}
if(isDefined(solid))
{
self.spawn[name] = spawn(class, local, flag, radius, height);
self.spawn[name] setmodel(model_name);
self.spawn[name].angles = (angle);
self.spawn[name] setContents( 1 );
return;
}
}


an example for this..
    
spawn_random_models()
{
spawn_models("main1", "script_model", "your_model_goes_here", (50,99,92.125), (0,90,90));
spawn_models("main2", "script_model", "your_model_goes_here", (50,150,92.125), (0,90,90));
spawn_models("model", "trigger_radius", "", (50,99,92.125), (0,90,90), 0, 65, 30, "solid"); //spawns a soild
spawn_models("what every", "script_origin", "", self.origin, self.angles);

// more advanced example

for(i = 0; i < 20; i++)
{
spawn_models("hihi", "script_model", "your_model_name_here", (500,500,92.125), (0,0,90));
}
}


and to delete the models or move them to somewhere..
    
self.spawn["NAVE U GAVE"] delete();
self.spawn["NAVE U GAVE"] delete();

self.spawn["NAVE U GAVE"] MoveTo((50,-350,92.125), 5);
self.spawn["NAVE U GAVE"] moveto((50,-250,92.125), 3);


remember, made by -Algorithm- from se7ensins.
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked Correy for this useful post:

Woof
09-06-2011, 12:28 PM #2
little_legz
SleepinIsCheatin
Shame it won't actually spawn a solid model seeing as though setContents( 1 ); only adds a tiny bit of collision to the centre of the spawned entity in like a ball shape. Nice script none-the-less.
09-06-2011, 01:31 PM #3
Correy
I'm the Original
Originally posted by legz View Post
Shame it won't actually spawn a solid model seeing as though setContents( 1 ); only adds a tiny bit of collision to the centre of the spawned entity in like a ball shape. Nice script none-the-less.


it spawns a solid depending on what model you use, like if it's in the map or not.. and you don't need to prachea it to the spawn..
but i'm going to change it a little to make it spawn solids Smile
09-06-2011, 02:28 PM #4
little_legz
SleepinIsCheatin
Originally posted by Correy View Post
it spawns a solid depending on what model you use, like if it's in the map or not.. and you don't need to prachea it to the spawn..
but i'm going to change it a little to make it spawn solids Smile



Hmm I see, I don't recommend the trigger_radius way of spawning solid models, It's ****ing AWFUL to walk on :L BTW what's your MSN again as I need a little bit of help with something.
09-06-2011, 03:18 PM #5
Correy
I'm the Original
Originally posted by legz View Post
Hmm I see, I don't recommend the trigger_radius way of spawning solid models, It's ****ing AWFUL to walk on :L BTW what's your MSN again as I need a little bit of help with something.


Skype - xCorrey.
Msn - [email][email protected][/email]
09-06-2011, 03:53 PM #6
little_legz
SleepinIsCheatin
Originally posted by Correy View Post
Skype - xCorrey.
Msn - [email][email protected][/email]


Standard, Added you on MSN.

The following user thanked little_legz for this useful post:

Correy
09-07-2011, 12:25 AM #7
Originally posted by Correy View Post
first of all, credits to -Algorithm- from se7ensins for this.
i'm just sharing it to our community so i don't want credit for this.

    
Spawn_models(name, class, model_name, local, angle, flag, radius, height, solid)
{
if(!isDefined(solid))
{
self.spawn[name] = spawn(class, local);
self.spawn[name] setmodel(model_name);
self.spawn[name].angles = (angle);
return;
}
if(isDefined(solid))
{
self.spawn[name] = spawn(class, local, flag, radius, height);
self.spawn[name] setmodel(model_name);
self.spawn[name].angles = (angle);
self.spawn[name] setContents( 1 );
return;
}
}


an example for this..
    
spawn_random_models()
{
spawn_models("main1", "script_model", "your_model_goes_here", (50,99,92.125), (0,90,90));
spawn_models("main2", "script_model", "your_model_goes_here", (50,150,92.125), (0,90,90));
spawn_models("model", "trigger_radius", "", (50,99,92.125), (0,90,90), 0, 65, 30, "solid"); //spawns a soild
spawn_models("what every", "script_origin", "", self.origin, self.angles);

// more advanced example

for(i = 0; i < 20; i++)
{
spawn_models("hihi", "script_model", "your_model_name_here", (500,500,92.125), (0,0,90));
}


and to delete the models or move them to somewhere..
    
self.spawn["NAVE U GAVE"] delete();
self.spawn["NAVE U GAVE"] delete();

self.spawn["NAVE U GAVE"] MoveTo((50,-350,92.125), 5);
self.spawn["NAVE U GAVE"] moveto((50,-250,92.125), 3);


remember, made by -Algorithm- from se7ensins.



COPY PASTE NOOB! you getting ban! go away noob

The following user groaned Adam749 for this awful post:

SiLLiKaLaX

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo