Raised This Month: $ Target: $400
 0% 

other way in checking user alive


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-30-2009 , 09:38   Re: other way in checking user alive
Reply With Quote #1

Quote:
Originally Posted by whosyourdaddy View Post
how can do do a check where this ent touches something and that something isnt a player
1. Don't double post.
2. Why are u asking a thing that has nothing to do with the thread?
3. You find the answer by searching.
SnoW is offline
Send a message via MSN to SnoW
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-30-2009 , 14:36   Re: other way in checking user alive
Reply With Quote #2

1.
Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> new bool:g_alive[33]; public plugin_init() {     RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1);     RegisterHam(Ham_Killed, "player", "FwdPlayerDeath", 1); } public client_disconnect(client) {     g_alive[client] = false; } public FwdPlayerSpawn(client) {     if( ExecuteHam(Ham_IsAlive, client) )     {         g_alive[client] = true;     } } public FwdPlayerDeath(client, killer, shouldgib) {     g_alive[client] = false; } public yourFunction(client) {     if( g_alive[client] )     {         // alive     } }

2.
Code:
fm_is_user_alive(client) {     return (pev(client, pev_deadflag) == DEAD_NO && get_user_health(client) > 0) ? 1 : 0; }

3.
Code:
if( ExecuteHam(Ham_IsAlive, client) ) {     // player is alive }

Those are about the only ways I know.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-30-2009 , 18:40   Re: other way in checking user alive
Reply With Quote #3

2. and 3. would be pointless. Both are the same and it's better to use directly is_user_alive().

Last edited by Arkshine; 01-30-2009 at 19:07.
Arkshine is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 01-30-2009 , 21:37   Re: other way in checking user alive
Reply With Quote #4

here is the function that ham_isalive calls
Code:
virtual BOOL IsAlive( void ) { return (pev->deadflag == DEAD_NO) && pev->health > 0; }
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang 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 01:37.


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