pausers list little help
#1

Hello, i made this command just for admins to list all paused players, but for some reason, even if player pause, the list is empty.

pawn Код:
CMD:pausers(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
    new count = 1, name[24], string[200];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        if(IsPaused[i] == 1)
        {
            GetPlayerName(i, name, sizeof(name));
            format(string, sizeof(string), "%s%s (%d\n", string, name,i);
            count ++;
        }
    }

    if(count != 1)
    {
        ShowPlayerDialog(playerid, 24, DIALOG_PAUSED, "Paused Players", string, "OK", "");
    }
    else ShowPlayerDialog(playerid, 24, DIALOG_PAUSED, "Paused Players", "No paused players.", "OK", "");
    }
    return 1;
}
On other "news"
pawn Код:
new IsPaused[MAX_PLAYERS];
When a player pause:

pawn Код:
IsPaused[playerid] =1;
Unpause:

pawn Код:
IsPaused[playerid] =0;
Reply
#2

Change if(count != 1)
To
if(count > 0)
Reply
#3

pawn Код:
CMD:pausers(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new bool:count, name[24], string[200];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(!IsPlayerConnected(i)) continue;
            if(IsPaused[i] == 1)
            {
                GetPlayerName(i, name, sizeof(name));
                format(string, sizeof(string), "%s%s (%d\n", string, name,i);
                count = true;
            }
        }

        if(count) ShowPlayerDialog(playerid, 24, DIALOG_PAUSED, "Paused Players", string, "OK", "");
        else ShowPlayerDialog(playerid, 24, DIALOG_PAUSED, "Paused Players", "No paused players.", "OK", "");
    }
    return 1;
}
Reply
#4

Nothing, still doesn't work.
Reply
#5

PHP код:
CMD:pausers(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 1)
    {
    new 
count 1name[24], string[200];
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        if(
IsPaused[i] = 1)
        {
            
GetPlayerName(inamesizeof(name));
            
format(stringsizeof(string), "%s%s (%d\n"stringname,i);
            
count ++;
        }
    }

    if(
count != 1)
    {
        
ShowPlayerDialog(playerid24DIALOG_PAUSED"Paused Players"string"OK""");
    }
    else 
ShowPlayerDialog(playerid24DIALOG_PAUSED"Paused Players""No paused players.""OK""");
    }
    return 
1;

Reply
#6

Same...
Reply
#7

not working :/
Reply
#8

What? You know what you bumped? 2012 -.-
Reply
#9

Your problem is not related to how you did the command, is related on how you did the Pause check.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)