(Still) Problems with showing player health, armour and IP
#1

I've tried everything, it's just not working.
Could someone help me with this command (name, ID and money works. IP, Health and Armour aren't working).

pawn Код:
dcmd_whois(playerid, params[])
{
  new index = 0;
    new playermoney;
  tmp2 = strtok(params, index);
    if (pInfo[playerid][pAdmin] < 1)
    {
        SystemMessage(playerid, "You are not an Administrator with the required level.");
        return 1;
    }
  if(!strlen(tmp2))
    {
        SystemMessage(playerid, "[USAGE] ''/whois [playername/id]''.");
        return 1;
    }
    new string[MAX_STRING];
    giveplayerid = ReturnUser(tmp2);
    if (IsPlayerConnected(giveplayerid))
    {
        playermoney = GetPlayerMoney(giveplayerid);
        format(string, sizeof(string), "| Name: %s | ID: %d | Money: $%d | Health: | Armour: | IP:", PlayerName(giveplayerid), giveplayerid, playermoney);
        SystemMessage(playerid, string);
    }
    else
  {
        format(string, sizeof(string), "That player is not active.");
        SystemMessage(playerid, string);
    }
    return 1;
}
Reply
#2

Because you need to actually get the armour, health and ip and format it in the string

https://sampwiki.blast.hk/wiki/GetPlayerHealth
https://sampwiki.blast.hk/wiki/GetPlayerIp
https://sampwiki.blast.hk/wiki/GetPlayerArmour
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)