Raised This Month: $ Target: $400
 0% 

Finding Hostage Entity || Index


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 03-22-2014 , 11:03   Finding Hostage Entity || Index
Reply With Quote #1

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?
__________________
Blizzard_87 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 03-23-2014 , 08:33   Re: Finding Hostage Entity || Index
Reply With Quote #2

The hostages are removed when rescued, right? So what do you actually want?
__________________
Black Rose is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 03-23-2014 , 08:36   Re: Finding Hostage Entity || Index
Reply With Quote #3

Quote:
Originally Posted by Black Rose View Post
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...
__________________
Blizzard_87 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 03-23-2014 , 08:45   Re: Finding Hostage Entity || Index
Reply With Quote #4

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.
__________________
Black Rose is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 03-23-2014 , 08:51   Re: Finding Hostage Entity || Index
Reply With Quote #5

Quote:
Originally Posted by Black Rose View Post
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...
__________________
Blizzard_87 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 03-23-2014 , 08:56   Re: Finding Hostage Entity || Index
Reply With Quote #6

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;     } }
__________________

Last edited by Black Rose; 03-23-2014 at 09:01.
Black Rose is offline
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 03-30-2014 , 06:24   Re: Finding Hostage Entity || Index
Reply With Quote #7

Search here
swapped is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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