SA-MP Forums Archive
[ajuda]/admins por dialog - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [ajuda]/admins por dialog (/showthread.php?tid=340348)



[ajuda]/admins por dialog - .ThePro - 06.05.2012

eu dou /admins mais sу estб aparecendo 1 admin na dialog ;s
sempre fica na dialog o ultimo adm que entra no server.

Код:
COMMAND:admins(playerid, params[])
{
    new s[128];
    new ss[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] > 0)
        {
            GetPlayerName(i, Jogador, sizeof(Jogador));
            format(s, 128, "{FFFFFF}%s {FF00FF}[%s]", Jogador, admins(i));
            strcat(s, ss, sizeof(s));
        }
    }
    ShowPlayerDialog(playerid, DIALOG_Admins, DIALOG_STYLE_MSGBOX, " {FF00FF}*** {FFFFFF}ADMIN'S ONLINE {FF00FF}***", s, "fechar", "");
    return true;
}
Код:
admins(playerid)
{
    new String[64];
    if(PlayerInfo[id][pAdmin] == 1)
        String = "Moderador";
    else if(PlayerInfo[playerid][pAdmin] == 2)
        String = "NНVEL 2";
    else if(PlayerInfo[playerid][pAdmin] == 3)
        String = "NНVEL 3";
    else if(PlayerInfo[playerid][pAdmin] == 4)
        String = "NНVEL 4";
    else if(PlayerInfo[playerid][pAdmin] == 5)
        String = "NНVEL 5";
    return String;
}



Re: [ajuda]/admins por dialog - kinhobryant - 06.05.2012

aumenta o nuero da tring coloca 256


Re: [ajuda]/admins por dialog - .ThePro - 06.05.2012

Quote:
Originally Posted by kinhobryant
Посмотреть сообщение
aumenta o nuero da tring coloca 256
Feito e nгo resolvido, valeu por tentar ajudar!


Re: [ajuda]/admins por dialog - Hiuship - 06.05.2012

PHP код:
COMMAND:admins(playeridparams[])
{
    new 
sprimaria[128];
    new 
ssecundaria[400];
    for(new 
0MAX_PLAYERSi++)
    {
        if(
PlayerInfo[i][pAdmin] > 0)
        {
            
GetPlayerName(iJogadorsizeof(Jogador));
            
format(sprimaria128"{FFFFFF}%s {FF00FF}[%s]"Jogadoradmins(i));//24 + 10 +- 34 por admin supondo 10 adimns on 340
        
}
    }
    
ShowPlayerDialog(playeridDIALOG_AdminsDIALOG_STYLE_MSGBOX" {FF00FF}*** {FFFFFF}ADMIN'S ONLINE {FF00FF}***"ssecundaria"fechar""");
    return 
true;




Re: [ajuda]/admins por dialog - kinhobryant - 06.05.2012

Tenta
pawn Код:
if(PlayerInfo[i][pAdmin] >= 1)



Re: [ajuda]/admins por dialog - paulor - 06.05.2012

strcat o primeiro parametro й o destino!
pawn Код:
COMMAND:admins(playerid, params[])
{
    new s[128], ss[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] > 0)
        {
            GetPlayerName(i, Jogador, sizeof(Jogador));
            format(ss, 128, "{FFFFFF}%s {FF00FF}[%s]", Jogador, admins(i));
            strcat(s, ss);
        }
    }
    ShowPlayerDialog(playerid, DIALOG_Admins, DIALOG_STYLE_MSGBOX, " {FF00FF}*** {FFFFFF}ADMIN'S ONLINE {FF00FF}***", s, "fechar", "");
    return true;
}



Re: [ajuda]/admins por dialog - .ThePro - 06.05.2012

Quote:
Originally Posted by paulor
Посмотреть сообщение
strcat o primeiro parametro й o destino!
pawn Код:
COMMAND:admins(playerid, params[])
{
    new s[128], ss[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] > 0)
        {
            GetPlayerName(i, Jogador, sizeof(Jogador));
            format(ss, 128, "{FFFFFF}%s {FF00FF}[%s]", Jogador, admins(i));
            strcat(s, ss);
        }
    }
    ShowPlayerDialog(playerid, DIALOG_Admins, DIALOG_STYLE_MSGBOX, " {FF00FF}*** {FFFFFF}ADMIN'S ONLINE {FF00FF}***", s, "fechar", "");
    return true;
}
Obg Paulor, +rep


Re: [ajuda]/admins por dialog - paulor - 06.05.2012

Nds...