21.05.2012, 11:50
Hello,i've this command for admins to show the selected player stats in a dialog:
I don't get any errors when i compile it,but ingame,if i use it,only the "Life Insurance" box stats is showing,what's wrong?
I need to show them all.
pawn Код:
CMD:info(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
new giveplayerid;
new Float:gihp, Float:giar;
new name[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, name, sizeof(name));
GetPlayerHealth(giveplayerid, gihp);
GetPlayerArmour(giveplayerid, giar);
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /info [ID/PartOfName]");
if(IsPlayerConnected(giveplayerid))
{
new temp[128];
new info[128];
format(info, sizeof(info), "{0FA0D1}Name: %s\n",name);
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}Cash: %i$\n",GetPlayerMoney(playerid));
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}Wanted Level: %d\n",PlayerInfo[playerid][pWantedLevel]);
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}Admin Level: %s\n",PlayerInfo[playerid][pAdmin]);
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}Kills: %i\n",PlayerInfo[playerid][pKills]);
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}Deaths: %i\n",PlayerInfo[playerid][pDeaths]);
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}Health: %0.1f\n",gihp);
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}Armour: %0.1f\n",giar);
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}VIP: %d (1 = YES - 0 = NO)\n",PlayerInfo[playerid][pVip]);
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}Score: %i\n",GetPlayerScore(playerid));
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}Condoms: %d\n",PlayerInfo[playerid][pCondoms]);
strcat(info, temp);
format(info, sizeof(info), "{0FA0D1}Life Insurance: %d (1 = YES - 0 = NO)\n",PlayerInfo[playerid][pLifeIns]);
strcat(info, temp);
ShowPlayerDialog(playerid, 17, DIALOG_STYLE_MSGBOX,"{53C506}Player Info",info,"Close","");
}
else
{
SendClientMessage(playerid, red, "Invalid player specified.");
}
return true;
}
else return 0;
}
I need to show them all.