Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial GetEntArray
#1
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
Reply

#2
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" );
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#3
Omg stop making tutorials about what we all know
Fuu
Reply

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

orly Angry
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#5
@Yamato very useful for beginners, his Tutorials helps
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.