ItsMods
[Tutorial] GetEntArray - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Tutorial] GetEntArray (/Thread-Tutorial-GetEntArray.html)



GetEntArray - Yamato - 09-19-2011

Hello

Ill explain now the GetEntArray command. What it does is to make an array with all the entities that are in a map that have something you searched for(a key or something like that). Works like this:

Code:
arrayname = GetEntArray("what you want","key you use");

Examples:

Code:
grenades = GetEntArray("grenade","classname"); destructibles = GetEntArray("destructible","targetname");

First will take all grenades and second all destructibles, now an example of use(a bit more complete):

Code:
grenades = GetEntArray("grenade","classname"); foreach(grenade in grenades) grenade detonate();

This will detonate all grenades in map. Another way of use, this time with turrets:

Code:
turrets = GetEntArray("misc_turret","classname"); for(i=0;i<turrets.size;i++) turrets[i] ShootTurret();

Thats it, have fun and OMA


RE: GetEntArray - iAegle - 09-19-2011

You can use your own stuff with this aswell, just use

Code:
thing.targetname = "AWESUM"; thing.classname = "AWESUMZ"; bla = getEntArray( "AWESUM", "targetname" ); bla2 = getEntArray( "AWESUMZ", "classname" );



RE: GetEntArray - Rendflex - 09-19-2011

Omg stop making tutorials about what we all know
Fuu


RE: GetEntArray - Nekochan - 09-19-2011

(09-19-2011, 17:33)Rendflex Wrote: Omg stop making tutorials about what we all know
Fuu

orly Angry


RE: GetEntArray - d0h! - 09-19-2011

@Yamato very useful for beginners, his Tutorials helps