SA-MP Forums Archive
Only 1 player will be shown from loop result - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Only 1 player will be shown from loop result (/showthread.php?tid=543475)



Only 1 player will be shown from loop result - iPrivate - 26.10.2014

pawn Код:
for(new i; i < MAX_PLAYERS; i++)
    {
        new string[500];
        format(string, 500, "%s%s (ID: %d) - Kills %d - Deaths X\n", string, GetName(i), i, PlayerInfo[i][pRKills]);
        ShowPlayerDialog(i, DIALOG_ROUNDEND, DIALOG_STYLE_LIST, "Round end - Player stats", string, "Continue", "");
        PlayerInfo[i][pRKills] = 0;
    }
That's my code. The loop will get player result and put them into the dialog, but for some reasons, the dialog is not going to show everyone's name. It is going to show only one player's name, mine.

So, if there are 2 people in the server, for example, iPrivate and Gregory, it will show me name, while for Gregory, it will show his name.

I hope you understand, thanks,


Re : Only 1 player will be shown from loop result - MCZOFT - 26.10.2014

can you give us Dialog : DIALOG_ROUNDEND


Re: Only 1 player will be shown from loop result - Private200 - 26.10.2014

Are you actually using a response for it?


Re: Only 1 player will be shown from loop result - iPrivate - 26.10.2014

I am not using a response for dialog, so I don't have an DIALOG_ROUNDEND under OnDialogResponse.


Re : Only 1 player will be shown from loop result - MCZOFT - 26.10.2014

i think i dident understand your Request then , can you explain again ( good explaination = Good help)


Re: Only 1 player will be shown from loop result - iPrivate - 26.10.2014

There are 2 players in the server. Me and my friend, Gregory.

Every 15 seconds, the dialog will appear. The dialog will show my name and my score. This happens for me ONLY.

The dialog for Gregory will show his name and his score.

So the dialog wont show us both, but only our selves. If you join, the dialog will show your name and your score, not all of us.


Re : Only 1 player will be shown from loop result - MCZOFT - 26.10.2014

You want evry one will see your score and you info ? and you'll see georgy's infos and score like this ?


Re: Only 1 player will be shown from loop result - iPrivate - 26.10.2014

Yes, as I see my information, it has to be seen for everyone.


Re : Only 1 player will be shown from loop result - MCZOFT - 26.10.2014

can you give me DIALOG DIALOG_ROUNDEND ?


Re: Only 1 player will be shown from loop result - Threshold - 26.10.2014

If you use ShowPlayerDialog in the loop, it will just open a new dialog every time it moves to the next player...
pawn Код:
new string[500];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        format(string, sizeof(string), "%s%s (ID: %d) - Kills %d - Deaths X\n", string, GetName(i), i, PlayerInfo[i][pRKills]);
        PlayerInfo[i][pRKills] = 0;
    }
    ShowPlayerDialog(i, DIALOG_ROUNDEND, DIALOG_STYLE_LIST, "Round end - Player stats", string, "Continue", "");