16.03.2013, 18:40
Hi. So I have a few commands that just aren't working. The first one is /stats which shows the players statistics, and the second is /check, which will get the selected players statistics. Kills, Deaths, any of that, that required PlayerInfo is not updating for some reason. I'm really confused.
Here's my current enumerator.
And my /check command for administrators.
Do I need to add a timer or something, that will re-read the stats, or what? I completely have no idea.
I also have this under onplayerdeath.
Any help would be appreciated. Thank you.
Here's my current enumerator.
pawn Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pVip,
pKills,
pDeaths,
pBan,
pScore,
pTalent
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
CMD:check(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >=1 )
{
new target;
if(sscanf(params, "u",target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /check [ID].");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid,COLOR_RED, "Player is not connected.");
new Float:health;
GetPlayerHealth(target, health);
new Float:armour;
GetPlayerArmour(target, armour);
new money;
money = GetPlayerMoney(target);
new score;
score = GetPlayerScore(target);
new stats[1280];
format(stats, sizeof(stats), "{44A1D0}Score: %d\nHealth: %f\nArmour: %f\nMoney: %d\nVIP: %s\nAdmin Level: %s\nKills: %d\nDeaths: %d\n",
score, health, armour, money, GetVipLvlName(target), GetAdminLvlName(target), PlayerInfo[target][pKills], PlayerInfo[target][pDeaths]);
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Information",stats,"Ok","");
}
else return SendClientMessage(playerid,COLOR_GREY, ERROR);
return 1;
I also have this under onplayerdeath.
pawn Код:
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;