15.11.2017, 04:34
Hello everyone,
I am having a bit of trouble of making a small list on the side of everyone who is currently in the event they are playing. When the event starts, a timer is set off that then uses a function to give an updated textdraw of whoever is in the event. However, it shows up, but only the last player who entered.
Example: Player1 enters or starts it first, his name would be on the list first, then player2 enters and his name would remove player1 off the list. I don't know why this is happening.
Here is my function code that is activated after the timer. The timer is repeating until the derby ends.
Any help is always appreciated.
I am having a bit of trouble of making a small list on the side of everyone who is currently in the event they are playing. When the event starts, a timer is set off that then uses a function to give an updated textdraw of whoever is in the event. However, it shows up, but only the last player who entered.
Example: Player1 enters or starts it first, his name would be on the list first, then player2 enters and his name would remove player1 off the list. I don't know why this is happening.
Here is my function code that is activated after the timer. The timer is repeating until the derby ends.
pawn Код:
function players()
{
new pname[24], pname2[24], szTemp[55], szStr[55 char], string1[1024 char];
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(playerinderby[i] == 1)
{
GetPlayerName(i, pname, sizeof(pname));
format(szTemp, sizeof(szTemp), "%s~n~",pname);
strpack(szStr,szTemp);
strcat(string1,szStr);
TextDrawSetString(RaceInfo[i], string1);
TextDrawShowForPlayer(i, RaceInfo[i]);
}
}
}
return 1;
}
