#1

ShowPlayerDialog(playerid, DIALOG_DMS, DIALOG_STYLE_TABLIST_HEADERS, "DeathMach",
"Command\tDescription\tPlaying\n\
{ffffff}/minigun\t{F7FF00}Minigun DeathMach\t{0099FF}(%d players)\n\
{ffffff}/minigun\t{F7FF00}Minigun DeathMach\t{0099FF}(players)",
"Select", "Close");

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

{ffffff}/minigun\t{F7FF00}Minigun DeathMach\t{0099FF}(%d players)\n\, GetPlayerScore(playerid)
how i can do to put in %d playerid scores?
Reply
#2

By formatting the string that you're going to show up in your dialog

https://sampwiki.blast.hk/wiki/Format

Example:
pawn Code:
new str[128];
format(str, sizeof(str), "Command\tDescription\tPlaying\n\
{ffffff}/minigun\t{F7FF00}Minigun Deathmatch\t{0099FF}(%d players)"
, GetPlayerScore(playerid));

ShowPlayerDialog(playerid, DIALOG_DMS, DIALOG_STYLE_TABLIST_HEADERS, "Deathmatch", str, "Select", "Close");
However, I think what you mean to do is to show the amount of players currently in the Minigun Deathmatch, you can achieve this by creating a variable, as follows:
pawn Code:
new bool:IsPlayerInDeathmatch[MAX_PLAYERS];
You should also reset the variable to 0 whenever the player leaves the arena through commands/death or disconnects from the server.

pawn Code:
//Resetting the variable
IsPlayerInDeathmatch[playerid] = false;
When the player joins the arena, set their value to 1
pawn Code:
IsPlayerInDeathmatch[playerid] = true;
And where you have your ShowPlayerDialog script, make a loop which checks which players are in the arena and display that player count in the dialog.

pawn Code:
new count = 0, str[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i) && IsPlayerInDeathmatch[i] == 1)
    {
        count++;
    }
}

format(str, sizeof(str), "Command\tDescription\tPlaying\n\
{ffffff}/minigun\t{F7FF00}Minigun Deathmatch\t{0099FF}(%d players)"
, count);
ShowPlayerDialog(playerid, DIALOG_DMS, DIALOG_STYLE_TABLIST_HEADERS, "Deathmatch", str, "Select", "Close");

I hope this helped.
Reply
#3

thx you!
Reply
#4

If it's working then I'm happy to help, I'm also glad you enjoy it.
Reply
#5

Quote:
Originally Posted by [NWA]Hannes
View Post
If it's working then I'm happy to help, I'm also glad you enjoy it.
And if i must add more lines like this how i must do?

format(str, sizeof(str), "Command\tDescription\tPlaying\n\
{ffffff}/minigun\t{F7FF00}Minigun Deathmatch\t{0099FF}(%d players)", count);
{ffffff}/minigun\t{F7FF00}Minigun Deathmatch\t{0099FF}(%d players)", count);
ShowPlayerDialog(playerid, DIALOG_DMS, DIALOG_STYLE_TABLIST_HEADERS, "Deathmatch", str, "Select", "Close");
Reply
#6

someone help pls?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)