AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Finding Hostage Entity || Index (https://forums.alliedmods.net/showthread.php?t=237322)

Blizzard_87 03-22-2014 11:03

Finding Hostage Entity || Index
 
is it possible to find the hostages entity index in the

"Rescued_A_Hostage" trigger ?

trying to set specific bitsums for hostage indexs.. but can seem to find a way to get there index in the trigger event... can only get it from the Ham_Use event with "hostage_entity" set.

is it possible?

Black Rose 03-23-2014 08:33

Re: Finding Hostage Entity || Index
 
The hostages are removed when rescued, right? So what do you actually want?

Blizzard_87 03-23-2014 08:36

Re: Finding Hostage Entity || Index
 
Quote:

Originally Posted by Black Rose (Post 2114865)
The hostages are removed when rescued, right? So what do you actually want?

i would like to check how many hostages are left alive and then single out the one which is not there anymore and set bitsum rescued for that one thats been removed...

Black Rose 03-23-2014 08:45

Re: Finding Hostage Entity || Index
 
You can't set bitsum to something that doesn't exist.
I still don't understand.
It's a code that runs, tops, 4 times in one round. Just loop entities for classnames.

Blizzard_87 03-23-2014 08:51

Re: Finding Hostage Entity || Index
 
Quote:

Originally Posted by Black Rose (Post 2114869)
You can't set bitsum to something that doesn't exist.
I still don't understand.
It's a code that runs, tops, 4 times in one round. Just loop entities for classnames.

the bitsum is for the player who rescued the hostage...

Black Rose 03-23-2014 08:56

Re: Finding Hostage Entity || Index
 
Ok.
So just buffer the 4(is more possible?) hostages inside an array that contains their entity index when the round starts.
Loop that array upon rescue and check pev_valid() or similar.
Code:
for ( new i ; i < sizeof hostagearray ; i++ ) {     if ( hostagearray[i] && ! pev_valid(hostagearray[i]) ) {         playerbitsum |= (1<<i)         return;     } }

swapped 03-30-2014 06:24

Re: Finding Hostage Entity || Index
 
Search here


All times are GMT -4. The time now is 06:00.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.