View Single Post
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 02-25-2019 , 00:27   Re: how to set player health
Reply With Quote #2

Quote:
Originally Posted by Naleksuh View Post
hello, i'm try to find way to set player health without problems. Previous i was using
PHP Code:
SetEntityHealth(clientnumber); 
but this has problems that it say it's not valid entity, even if client i give it is right. Is there better approach to this? it's the only thing i've been able to find in searches
You probably just need to check if the client is a valid index, is in-game, and is alive.

PHP Code:
if (client <= MaxClients && IsClientInGame(client) && IsPlayerAlive(client))
{
    
SetEntityHealth(clientnumber);

__________________
Psyk0tik is offline