Raised This Month: $ Target: $400
 0% 

is_user_alive


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KamiN
Senior Member
Join Date: Jun 2011
Old 12-10-2011 , 13:08   is_user_alive
Reply With Quote #1

Code:
Is_user_alive(id)
Checks is it player, is he connected and is he alive?
Or just is he connected and is he alive?
KamiN is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-10-2011 , 13:17   Re: is_user_alive
Reply With Quote #2

Quote:
Checks is it player, is he connected and is he alive?
Or just is he connected and is he alive?
You're asking the same thing.

Anyway, if an user is alive... it means he's obviously connected. And this native is_user_alive, to check if someone is alive has to check before if he's connected.
__________________
Arkshine is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 12-10-2011 , 13:18   Re: is_user_alive
Reply With Quote #3

It does check if he's alive and connected true.
Not sure if it checks whether or not the index is a player.
Erox902 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-10-2011 , 13:26   Re: is_user_alive
Reply With Quote #4

If it's not a player, then ofc it's not alive.
__________________
hleV is offline
KamiN
Senior Member
Join Date: Jun 2011
Old 12-10-2011 , 13:33   Re: is_user_alive
Reply With Quote #5

Quote:
Originally Posted by hleV View Post
If it's not a player, then ofc it's not alive.
So if u already check with
Code:
is_user_alive(id)
checking with IsPlayer would be pointless, right?
Code:
#define IsPlayer(%1) (1<=%1<=g_max_clients)

new g_max_clients

public plugin_init() {
    g_max_clients = get_maxplayers()
}

if(IsPlayer(i) && is_user_alive(i))
{    
...
}
KamiN is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-10-2011 , 14:32   Re: is_user_alive
Reply With Quote #6

Yes it is pointless, but anyway your code shouldn't call tha native on a non player entity, else it means your code has something wrong, and in that case an error will be generated.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 12-10-2011 , 13:29   Re: is_user_alive
Reply With Quote #7

Entities and bots can't be alive?
Erox902 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 12:10.


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