22.11.2015, 08:36
Detoria's code is well ... flawed to the point of not working, I'll try to optimize and fix it
but credits to him for trying
A couple notes ^
A) when a player does the cmd, he IS connected, there is no need to check
B) natives have a built-in connected check, so just use SetPlayerHealth, if it fails he is not connected
but credits to him for trying

PHP код:
CMD:lifep(playerid, params[])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 5.0, X, Y, Z))
SetPlayerHealth(i, 100.0);
}
return 1;
}
A) when a player does the cmd, he IS connected, there is no need to check
B) natives have a built-in connected check, so just use SetPlayerHealth, if it fails he is not connected

