SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 17/04/2012, 01:29 AM   #1
Victor_Souz4
Big Clucker
 
Victor_Souz4's Avatar
 
Join Date: Oct 2011
Posts: 111
Reputation: 2
Default [ajuda] /admins

o bug é que mesmo que tenha 2 admins so aparece 1 na dialog:

pawn Code:
if(strcmp(cmd, "/admins", true) == 0)
{
    new count = 0;
    new str[150],strin[150];
    new pname[MAX_PLAYER_NAME];
    foreach(Player, i) {
        if(logged[i] == 1) {
            if(PlayerInfo[i][pAdmin] >= 1) {
                PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
                GetPlayerName(i, pname, MAX_PLAYER_NAME);
                format(str, sizeof(str), "Administrador: %s id:%d - Nível: %d\n",pname,i,PlayerInfo[i][pAdmin]);
                strcat(strin, str, sizeof(strin));
                count++;
            }
        }
    }
    ShowPlayerDialog(playerid, 7327, DIALOG_STYLE_MSGBOX, "Administradores\n\n", strin, "Fechar", "");
    if(count == 0) {
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        strcat(str,"{FFA500}Nenhum administrador ativo.");
        ShowPlayerDialog(playerid, 1973, DIALOG_STYLE_MSGBOX, "Administradores\n\n", str, "Fechar", "");
    }
    return 1;
}
Victor_Souz4 is offline   Reply With Quote
Old 17/04/2012, 01:32 AM   #2
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,013
Reputation: 629
Default Re: [ajuda] /admins

pawn Code:
new str[150],strin[150];

strcat(strin, str, sizeof(strin));
Não faz sentido ter uma "string-origem" do tamanho de uma "string-destino".
__________________
ViniBorn is offline   Reply With Quote
Old 17/04/2012, 01:35 AM   #3
Victor_Souz4
Big Clucker
 
Victor_Souz4's Avatar
 
Join Date: Oct 2011
Posts: 111
Reputation: 2
Default Re: [ajuda] /admins

pawn Code:
if(strcmp(cmd, "/admins", true) == 0)
{
    new count = 0;
    new str[100];
    new pname[MAX_PLAYER_NAME];
    foreach(Player, i) {
        if(logged[i] == 1) {
            if(PlayerInfo[i][pAdmin] >= 1) {
                PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
                GetPlayerName(i, pname, MAX_PLAYER_NAME);
                format(str, sizeof(str), "Administrador: %s id:%d - Nível: %d\n",pname,i,PlayerInfo[i][pAdmin]);
                strcat(str, str, sizeof(str));
                count++;
            }
        }
    }
    ShowPlayerDialog(playerid, 7327, DIALOG_STYLE_MSGBOX, "Administradores\n\n", str, "Fechar", "");
    if(count == 0) {
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        strcat(str,"{FFA500}Nenhum administrador ativo.");
        ShowPlayerDialog(playerid, 1973, DIALOG_STYLE_MSGBOX, "Administradores\n\n", str, "Fechar", "");
    }
    return 1;
}

Certo entaum seria assim? mas do mesmo geito n pega
Victor_Souz4 is offline   Reply With Quote
Old 17/04/2012, 01:39 AM   #4
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,013
Reputation: 629
Default Re: [ajuda] /admins

Essa não é a solução do problema, é só uma observação.
__________________
ViniBorn is offline   Reply With Quote
Old 17/04/2012, 01:40 AM   #5
Victor_Souz4
Big Clucker
 
Victor_Souz4's Avatar
 
Join Date: Oct 2011
Posts: 111
Reputation: 2
Default Re: [ajuda] /admins

Poderia me ajudar a solucionar ?
Victor_Souz4 is offline   Reply With Quote
Old 17/04/2012, 01:42 AM   #6
zSuYaNw
Godfather
 
zSuYaNw's Avatar
 
Join Date: Apr 2010
Location: Santa Catarina
Posts: 5,709
Reputation: 428
Default Re: [ajuda] /admins

Tente isto:
pawn Code:
if(strcmp(cmd, "/admins", true) == 0)
{
    new count = 0;
    new ,strin[150];
    new pname[MAX_PLAYER_NAME];
    foreach(Player, i){
        if(logged[i] == 1) {
            if(PlayerInfo[i][pAdmin] >= 1) {
             //   PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
                GetPlayerName(i, pname, MAX_PLAYER_NAME);
                new tstr[100];
                format(tstr, sizeof(tstr), "Administrador: %s id:%d - Nível: %d\n",pname,i,PlayerInfo[i][pAdmin]);
                strcat(strin, tstr);
                count++;
            }
        }
    }
    ShowPlayerDialog(playerid, 7327, DIALOG_STYLE_MSGBOX, "Administradores\n\n", strin, "Fechar", "");
    if(count == 0) {
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        strcat(str,"{FFA500}Nenhum administrador ativo.");
        ShowPlayerDialog(playerid, 1973, DIALOG_STYLE_MSGBOX, "Administradores\n\n", str, "Fechar", "");
    }
    return 1;
}
__________________
SuYaNw
Suyann12
G. SuYaNw Dácio
História
Garfield
Grupo do Fórum SA-MP no WhatsApp PM*
zSuYaNw is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ajuda] bug admins Cristhian Português/Portuguese 13 12/10/2011 10:27 PM
[AJUDA] /admins ReDKiiL Português/Portuguese 10 26/09/2011 02:56 PM
[AJUDA] /admins DeyBlack² Português/Portuguese 10 08/09/2011 10:09 PM
[AJUDA] /admins [AF]Junior Português/Portuguese 3 30/07/2011 05:27 PM
[AJUDA] /Admins Allanrokeiro Português/Portuguese 12 25/04/2011 12:03 AM


All times are GMT. The time now is 11:57 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.