If player is alive, it means, that he is connected to server?
Hello, I found this, and now I wonder, if player is not alive, it means, that he is connected to server or not?
@edit - wrong named topic - I meant IS NOT ALIVE, not ALIVE PHP Code:
|
Re: If player is alive, it means, that he is connected to server?
Player still connecting to the server.
|
Re: If player is alive, it means, that he is connected to server?
Quote:
|
Re: If player is alive, it means, that he is connected to server?
if player is not alive you have to check is_user_connected to find out if he is in the server
is_user_alive returns true if player is alive and false when player is not alive or not connected to the server |
Re: If player is alive, it means, that he is connected to server?
If a player is alive how he could not be connected to server ? So:
1. is_user_alive check if player is connected and if player is alive. 2. is_user_connected checks only if player is connected, it can be alive or dead. 3. checking just is_user_alive to know if player is connected or not is not accurate, because it can be dead but still connected(like he was killed during the round and wait for respawn). |
Re: If player is alive, it means, that he is connected to server?
Quote:
Code:
return((pPlayer->ingame && pPlayer->IsAlive()) ? 1 : 0);player in game ( returns 1 ) && player is not alive ( returns 0 ) function returns 0 player in game ( returns 0 ) && player is not alive ( returns 0 ) function returns 0 So, if player is not alive i have to check, that if he is connected to server. |
Re: If player is alive, it means, that he is connected to server?
Yes, if not alive then you need to check if he is connected, but this depend on the context.
|
Re: If player is alive, it means, that he is connected to server?
very interesting question
the conclusion is that if is_user_alive returns 0 it does not necessarily mean he's connected to the server you can go ahead and continue a function if(is_user_alive) but in the else{ you'll have to do an is_user_connected check} by means of optimization, theoretically , this is the best way, other than first checking if he's connected or not and then the alive or not |
Re: If player is alive, it means, that he is connected to server?
Quote:
|
Re: If player is alive, it means, that he is connected to server?
It is better if you tell what you want to do. Then, it is more easier for us to help you.
|
| All times are GMT -4. The time now is 15:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.