AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Status of a hostage (https://forums.alliedmods.net/showthread.php?t=22258)

Wolle 12-22-2005 11:35

Status of a hostage
 
Small question.
Is it possible to ask of a hostage's status?
Like...

hostage_status = get_hostage_status(hostage_id)
if( hostage_status == dead )
forget about it

and so on..
??

XxAvalanchexX 12-22-2005 13:48

You could try checking its health.

Wolle 12-22-2005 14:32

How would I do that?

VEN 12-22-2005 15:07

<EDIT>
Code:
new Float:floatHealth =  entity_get_float(hostageID, EV_FL_health)

Wolle 12-22-2005 15:23

Ahh, now I see how to approach the problem.

Ok next question.
Looking for func_rescue_zone and func_buyzone in CS 1.6 doesn't always work.
I need to get the distance between the hostage entity and a rescue or buyzone.
So far I'm able to get the distance between hostages and a certain player.
Any clue on why the rescue zone can be found on cs_office but not on upc? Ok maybe the "mapper" didn't put that zone in but he/she certainly put the buyzone in. But the buyzone can't be found either.

This is how I loop through all entities.
Code:
for( i = 0; i <= entity_count(); i++ )     {         if( is_valid_ent( i ))         {             new ClassName[33]             entity_get_string(i, EV_SZ_classname,ClassName, 32)                         if(equali(ClassName, "hostage_entity"))             { . . . . and so on

VEN 12-22-2005 23:24

This way is better
Code:
new ent  while ((ent = find_ent_by_class(ent, classname))) {      // ...  }

Wolle 12-23-2005 07:30

Thanks VEN, I'll give it a shot.
Also, looking at the upc *.map file, the "mapper" obviously didn't put neither buyzone nor rescue zone in.
Sorry for the confusion.


All times are GMT -4. The time now is 15:46.

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