How to List this.
#1

okay i have been working on a TDM script , its almost finished
Now i created textdraws for results
And trying to get Name of Player in format
Quote:

Name Kills Deaths


But the code isnt getting name of more than one player from a team.
pawn Код:
for(new slots = GetMaxPlayers(),i ;i < slots; i++)
        {
            if(IsPlayerConnected(i))
            {
                if((Player[i][pTeam] == gTeam_A) || (Player[i][pTeam] == gTeam_B))
                {
                 
                    if(isStarted == 1) { isStarted = 0; }

                    new str1[128],str2[128];
                    if(Player[i][pTeam] == gTeam_A)
                    {
                        format(str1,sizeof(str1),"%s  %i  %i~n~",GetName(i),Player[i][pKills],Player[i][pDeaths]);
                        strcat(str1,str1,sizeof(str1)*i);
                        TextDrawSetString(teama_stats,str1);
                    }
                    else
                    if(Player[i][pTeam] == gTeam_B)
                    {
                        format(str2,sizeof(str2),"%s  %i  %i~n~",GetName(i),Player[i][pKills],Player[i][pDeaths]);
                        strcat(str2,str2,sizeof(str2)*i);
                        TextDrawSetString(teamb_stats,str2);
                    }
                    TextDrawShowForPlayer(i,box1);  TextDrawShowForPlayer(i,box2);  TextDrawShowForPlayer(i,box3);
                    TextDrawShowForPlayer(i,winnername);  TextDrawShowForPlayer(i,teama_stats);  TextDrawShowForPlayer(i,teamb_stats);
                    SetTimer("HideResults",6000,false);
                }
            }
        }
the thing is i dont understand what method should be applied here
so as it get list like this.
TeamA TeamB
teama_Player1 Name teamb_Player1 Name
TeamB_player2 Name teamb_Player2 Name
TeamB_player3 Name teamb_Player3 Name
in the TextDraw
Reply
#2

pawn Код:
new str1[128],str2[128]; // outside the loop
for(new slots = GetMaxPlayers(),i ;i < slots; i++)
{
    if(IsPlayerConnected(i))
    {
        if(Player[i][pTeam] == gTeam_A || Player[i][pTeam] == gTeam_B)
        {

            if(isStarted == 1) isStarted = 0;
           
            if(Player[i][pTeam] == gTeam_A)
            {
                format(str1,sizeof(str1),"%s  %i  %i~n~",str1,GetName(i),Player[i][pKills],Player[i][pDeaths]);
                TextDrawSetString(teama_stats,str1);
            }
            else
            {
                format(str2,sizeof(str2),"%s  %i  %i~n~",str2,GetName(i),Player[i][pKills],Player[i][pDeaths]);
                TextDrawSetString(teamb_stats,str2);
            }
            TextDrawShowForPlayer(i,box1);  TextDrawShowForPlayer(i,box2);  TextDrawShowForPlayer(i,box3);
            TextDrawShowForPlayer(i,winnername);  TextDrawShowForPlayer(i,teama_stats);  TextDrawShowForPlayer(i,teamb_stats);
            SetTimer("HideResults",6000,false);
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)