AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   other way in checking user alive (https://forums.alliedmods.net/showthread.php?t=84668)

whosyourdaddy 01-29-2009 22:34

other way in checking user alive
 
other than using is_user_alive is there another check i can do?

jim_yang 01-29-2009 22:44

Re: other way in checking user alive
 
any special reason ?

whosyourdaddy 01-29-2009 23:02

Re: other way in checking user alive
 
ya for some reason is_user_alive(id) is returning false when it should be true

zwfgdlc 01-29-2009 23:05

Re: other way in checking user alive
 
try
PHP Code:

// pev(entity, pev_deadflag) values
#define    DEAD_NO                         0           // Alive
#define    DEAD_DYING                      1           // Playing death animation or still falling off of a ledge waiting to hit ground
#define    DEAD_DEAD                       2           // Dead, lying still
#define DEAD_RESPAWNABLE                3
#define DEAD_DISCARDBODY                4 


jim_yang 01-29-2009 23:09

Re: other way in checking user alive
 
amxx use this to check is_user_alive
Code:

inline bool IsAlive()
{
    return ((pEdict->v.deadflag == DEAD_NO) && (pEdict->v.health > 0));
}

you can try get_pdata_int(id, 113)
but is_user_alive(id) is faster in any situation except you cache the flag in your own plugin

whosyourdaddy 01-29-2009 23:21

Re: other way in checking user alive
 
Quote:

Originally Posted by zwfgdlc (Post 752534)
try
PHP Code:

// pev(entity, pev_deadflag) values
#define    DEAD_NO                         0           // Alive
#define    DEAD_DYING                      1           // Playing death animation or still falling off of a ledge waiting to hit ground
#define    DEAD_DEAD                       2           // Dead, lying still
#define DEAD_RESPAWNABLE                3
#define DEAD_DISCARDBODY                4 


would it look like this
Code:

(pev(id,pev_deadflag) & DEAD_DYING)
to check it a player is dead?

zwfgdlc 01-29-2009 23:33

Re: other way in checking user alive
 
Code:
(pev(id,pev_deadflag) == DEAD_DYING)

IneedHelp 01-30-2009 00:09

Re: other way in checking user alive
 
PHP Code:

client_print(idprint_chat"%s"ExecuteHam(Ham_IsAliveid) ? "alive" "dead"

I was using that to test some func on ham

so..

PHP Code:

if (ExecuteHam(Ham_IsAliveindex))
            
// alive 


whosyourdaddy 01-30-2009 01:16

Re: other way in checking user alive
 
which would be prefered ham or fakemeta?

whosyourdaddy 01-30-2009 04:47

Re: other way in checking user alive
 
how can do do a check where this ent touches something and that something isnt a player


All times are GMT -4. The time now is 01:37.

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