Command dialog (rep+)
#1

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(playeridplayerid);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_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(targetidhealth);
        new 
armor GetPlayerArmour(targetidhealth);
        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 
1format(ranktextsizeof(ranktext), "%s"TeamInfo[PlayerInfo[targetid][pMember]][fRank1]);
            case 
2format(ranktextsizeof(ranktext), "%s"TeamInfo[PlayerInfo[targetid][pMember]][fRank2]);
              case 
3format(ranktextsizeof(ranktext), "%s"TeamInfo[PlayerInfo[targetid][pMember]][fRank3]);
              case 
4format(ranktextsizeof(ranktext), "%s"TeamInfo[PlayerInfo[targetid][pMember]][fRank4]);
            case 
5format(ranktextsizeof(ranktext), "%s"TeamInfo[PlayerInfo[targetid][pMember]][fRank5]);
            case 
6format(ranktextsizeof(ranktext), "%s"TeamInfo[PlayerInfo[targetid][pMember]][fRank6]);
        }
        
SendClientMessage(playeridCOLOR_GREEN,"_______________________________________");
        
format(stringsizeof(string),"Статистика на %s:"PlayerName(targetid));
        
SendClientMessage(playeridCOLOR_GREENstring);
        
format(stringsizeof(string), "Админ Левел: %d Вип Ранк: %s"admindrank);
        
SendClientMessage(playeridCOLOR_GRAD2string);
        
format(stringsizeof(string), "Най-много Убийства без умиране: %d Убийства: %d Умирания: %d"spreekillsdeaths);
        
SendClientMessage(playeridCOLOR_GRAD2string);
        
format(stringsizeof(string), "Кръв: %d Армор: %d Пари: $%d"hparmorcash);
        
SendClientMessage(playeridCOLOR_GRAD2string);
        
format(stringsizeof(string), "Цена за главата му: %d Число от лотото: %d"bountylotto);
        
SendClientMessage(playeridCOLOR_GRAD2string);
        
format(stringsizeof(string), "Банда/Мафия: %s Ранк: %d(%s)"factionprankranktext);
        
SendClientMessage(playeridCOLOR_GRAD2string);
        if (
PlayerInfo[playerid][pAdmin] >= 1)
        {
            
format(stringsizeof(string), "Интериор:[%d] Виртуален свят:[%d] Предопреждения:[%d] Време в затвора:[%d]"vwintirwarnsjtime);
            
SendClientMessage(playeridCOLOR_WHITEstring);
        }
        
SendClientMessage(playeridCOLOR_GREEN,"_______________________________________");
    }

Reply
#2

pawn Код:
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]);
        }
        ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX,"_______________________________________");
        format(string, sizeof(string),"Статистика на %s:", PlayerName(targetid));
        ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, string);
        format(string, sizeof(string), "Админ Левел: %d Вип Ранк: %s", admin, drank);
        ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, string);
        format(string, sizeof(string), "Най-много Убийства без умиране: %d Убийства: %d Умирания: %d", spree, kills, deaths);
        ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, string);
        format(string, sizeof(string), "Кръв: %d Армор: %d Пари: $%d", hp, armor, cash);
        ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, string);
        format(string, sizeof(string), "Цена за главата му: %d Число от лотото: %d", bounty, lotto);
        ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, string);
        format(string, sizeof(string), "Банда/Мафия: %s Ранк: %d(%s)", faction, prank, ranktext);
        ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, string);
        if (PlayerInfo[playerid][pAdmin] >= 1)
        {
            format(string, sizeof(string), "Интериор:[%d] Виртуален свят:[%d] Предопреждения:[%d] Време в затвора:[%d]", vw, intir, warns, jtime);
            ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, string);
        }
        ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX,"_______________________________________");
    }
}
And

pawn Код:
if (strcmp(cmd, "/stats", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
             if (gPlayerLogged[playerid] != 0)
            {
                ShowStats(playerid, playerid);
            }
            else
            {
                ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "   You are not Logged in !");
            }
        }
        return 1;
    }
Reply
#3

LOL I think I did it wrong I did like everything in each dialog.
Reply
#4

I wont in one dialog
Reply
#5

someone
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)