Help health
#2

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;
}
Reply


Messages In This Thread
Help health - by Chanty420 - 12.10.2018, 16:39
Re: Help health - by KinderClans - 12.10.2018, 16:57
Re: Help health - by UFF - 12.10.2018, 18:23

Forum Jump:


Users browsing this thread: 1 Guest(s)