Help health
#1

Hello guy's, i just wanted to know how to make a command, which show the player health to admin's to detect if he is a hacker.
Like this if /checkhp 0 = Player 'example' has health 93.5 for example
Help me please
Reply
#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
#3

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
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;
}
Код:
GetPlayerName(targetid, pName, sizeof(pName));
Should be used after the sscanf.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)