16.03.2013, 07:18
So a few of my Administrators have been saying this command isn't checking peoples stats correctly. So I'm just asking here, if the code looks fine or not? Is there a reason it's not detecting the player's statistics correctly?
EDIT: I just checked the command myself, and it's displaying all of my stats as 0. Same with other players on my server.
EDIT: I just checked the command myself, and it's displaying all of my stats as 0. Same with other players on my server.
pawn Код:
CMD:check(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >=2)
{
new target;
new cash, vip, kills, deaths, score;
cash = PlayerInfo[target][pCash];
vip = PlayerInfo[target][pVip];
kills = PlayerInfo[target][pKills];
deaths = PlayerInfo[target][pDeaths];
score = PlayerInfo[target][pScore];
if(sscanf(params, "u",target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /check [playerid]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid,COLOR_RED, "ERROR: Player ID is not connected.");
{
new string[200];
format(string,sizeof(string), "%s's current statistics: Money: %d || VIP: %d || Kills: %d || Deaths: %d || Score: %d || Admin: %s || Talent: %s",GetName(target),cash,vip,kills,deaths,score,GetAdminLvlName(target),GetTalentName(target));
SendClientMessage(playerid,COLOR_GREEN, string);
}
}
else return SendClientMessage(playerid,COLOR_GREY, ERROR);
return 1;
}