Casting to entity

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Casting to entity

Post by Rookie One.pl »

Has anyone successfully attempted casting a variable to entity? In theory, this should allow to get ahold of any entity from within the script by its entnum. I've never made it work, though, all I get is a console error that says "cannot cast integer to entity". :?

Anyone?
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

The 'entity' command works via targetname, exactly the same as using $.

So instead of $player you could write (entity player). Casting via entnums can't be done in mohaa afaik :( (although in fakk you could do this with * (like *1) .. this doesn't work in moh though :().
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Eeek. :shock: That's useless, then. :roll:

Anyway, thanks. ;)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply