16.04.2012, 15:12
Can you make me this command to show player stats in dialog
PHP код:
if (strcmp(cmd, "/stats", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] != 0)
{
ShowStats(playerid, playerid);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not Logged in !");
}
}
return 1;
}
PHP код:
public ShowStats(playerid,targetid)
{
if(IsPlayerConnected(playerid) && IsPlayerConnected(targetid))
{
new string[256];
new drank[20];
new Float:health;
if(PlayerInfo[targetid][pDonateRank] == 1) { drank = "Нормален"; }
else if(PlayerInfo[targetid][pDonateRank] >= 2) { drank = "Супер Вип"; }
else { drank = "Нямаш Вип"; }
new admin = PlayerInfo[targetid][pAdmin];
new cash = GetPlayerCash(targetid);
new kills = PlayerInfo[targetid][pKills];
new deaths = PlayerInfo[targetid][pDeaths];
new intir = GetPlayerInterior(targetid);
new vw = GetPlayerVirtualWorld(targetid);
new warns = PlayerInfo[targetid][pWarns];
new hp = GetPlayerHealth(targetid, health);
new armor = GetPlayerArmour(targetid, health);
new jtime = PlayerInfo[targetid][pJailTime];
new spree = PlayerInfo[targetid][pSpree];
new bounty = Bounty[targetid];
new lotto = PlayerInfo[targetid][pLotto];
new faction = TeamInfo[PlayerInfo[targetid][pMember]][TeamName];
new prank = PlayerInfo[targetid][pRank];
new ranktext[256];
switch(prank)
{
case 1: format(ranktext, sizeof(ranktext), "%s", TeamInfo[PlayerInfo[targetid][pMember]][fRank1]);
case 2: format(ranktext, sizeof(ranktext), "%s", TeamInfo[PlayerInfo[targetid][pMember]][fRank2]);
case 3: format(ranktext, sizeof(ranktext), "%s", TeamInfo[PlayerInfo[targetid][pMember]][fRank3]);
case 4: format(ranktext, sizeof(ranktext), "%s", TeamInfo[PlayerInfo[targetid][pMember]][fRank4]);
case 5: format(ranktext, sizeof(ranktext), "%s", TeamInfo[PlayerInfo[targetid][pMember]][fRank5]);
case 6: format(ranktext, sizeof(ranktext), "%s", TeamInfo[PlayerInfo[targetid][pMember]][fRank6]);
}
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
format(string, sizeof(string),"Статистика на %s:", PlayerName(targetid));
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "Админ Левел: %d Вип Ранк: %s", admin, drank);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), "Най-много Убийства без умиране: %d Убийства: %d Умирания: %d", spree, kills, deaths);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), "Кръв: %d Армор: %d Пари: $%d", hp, armor, cash);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), "Цена за главата му: %d Число от лотото: %d", bounty, lotto);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), "Банда/Мафия: %s Ранк: %d(%s)", faction, prank, ranktext);
SendClientMessage(playerid, COLOR_GRAD2, string);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "Интериор:[%d] Виртуален свят:[%d] Предопреждения:[%d] Време в затвора:[%d]", vw, intir, warns, jtime);
SendClientMessage(playerid, COLOR_WHITE, string);
}
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
}
}