Thread: Optimize Plugin
View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-18-2018 , 06:49   Re: Optimize Plugin
Reply With Quote #25

Quote:
Originally Posted by PurposeLessx View Post
I have thought like this.

Code:
is_user_alive  = pPlayer->ingame && pPlayer->IsAlive()

!is_user_alive = !(pPlayer->ingame && pPlayer->IsAlive())
So, Even if player is not in game, is_user_alive will be false. !is_user_alive will be true.
?
Well, if you're checking

is_user_alive, the game will return
true - if player is in game (connected) and alive.
false - if either player is not connected or not alive.


!is_user_alive, will return the same as is_user_alive just that now you're checking for the negative value.

This
if(!is_user_alive(id))

will return the same but you'll be checking (!) not

So:
if(!is_user_alive(id))

Player not alive or not connected.

Last edited by edon1337; 07-18-2018 at 06:51.
edon1337 is offline