12.10.2018, 16:57
pawn Код:
ReturnHealth(playerid)
{
static Float:amount;
GetPlayerHealth(playerid, amount);
return floatround(amount, floatround_round);
}
CMD:health(playerid, params[])
{
new targetid, pName[MAX_PLAYER_NAME];
GetPlayerName(targetid, pName, sizeof(pName));
if(sscanf(params, "r", targetid)) return SendClientMessage(playerid, -1, "* [USAGE]: /health [playerid/name]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, .1, "* The player you specified isn't connected or is invalid.");
new str[100];
format(str,sizeof str,"* %s's (%d) health is %f", pName, targetid, ReturnHealth(targetid));
SendClientMessage(playerid, str, -1);
return 1;
}