SA-MP Forums Archive
[Ajuda] Erros ;( - 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] Erros ;( (/showthread.php?tid=382473)



Erros ;( - Owtsiixx_Twd - 03.10.2012

pawn Код:
CMD:admins(playerid,params[])
{
    new Nome[24];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    if(PlayerInfo[playerid][pAdmin] < 1) return 1;
    new String2[500]; new String[500]; new Nomear[50];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] < 1)
        {
            if(PlayerInfo[i][pAdmin] == 1) Nomear = "Moderador Global";
            if(PlayerInfo[i][pAdmin] == 2) Nomear = "Administrador";
            if(PlayerInfo[i][pAdmin] == 3) Nomear = "Admin De Confianзa";
            if(PlayerInfo[i][pAdmin] == 4) Nomear = "Master";
            if(PlayerInfo[i][pAdmin] == 5) Nomear = "Dono";
            format(String,sizeof(String),"{FF0000}Nick: {FFFFFF}%s {FF0000}ID: {FFFFFF}%d {FF0000}Rank: {FFFFFF}%s\n",Nome(i),i,Nomear); // erro aqui ;( todos ;(
            strcat(String2,String,sizeof(String2));
        }
    }
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        format(String,sizeof(String),"{FF0000}Nenhum(a) Administrador(a) Online!");
        Msg(playerid, ROSA,String);
    }
  return 1;
}
pawn Код:
(929) : error 012: invalid function call, not a valid address
(929) : warning 215: expression has no effect
(929) : error 001: expected token: ";", but found ")"
(929) : error 029: invalid expression, assumed zero
(929) : fatal error 107: too many error messages on one line



Re: Erros ;( - arakuta - 03.10.2012

Linha?


Re: Erros ;( - Owtsiixx_Twd - 03.10.2012

Quote:
Originally Posted by arakuta
Посмотреть сообщение
Linha?
ERA SУ TE LIDO
format(String,sizeof(String),"{FF0000}Nick: {FFFFFF}%s {FF0000}ID: {FFFFFF}%d {FF0000}Rank: {FFFFFF}%s\n",Nome(i),i,Nomear); // erro aqui ;( todos ;(


Re: Erros ;( - arakuta - 03.10.2012

pawn Код:
new adminnome[24];
GetPlayerName(i,adminnome,sizeof adminnome);
pawn Код:
format(String,sizeof(String),"{FF0000}Nick: {FFFFFF}%s {FF0000}ID: {FFFFFF}%d {FF0000}Rank: {FFFFFF}%s\n",adminnome,i,Nomear);



Re: Erros ;( - Owtsiixx_Twd - 03.10.2012

Quote:
Originally Posted by arakuta
Посмотреть сообщение
pawn Код:
new adminnome[24];
GetPlayerName(i,adminnome,sizeof adminnome);
pawn Код:
format(String,sizeof(String),"{FF0000}Nick: {FFFFFF}%s {FF0000}ID: {FFFFFF}%d {FF0000}Rank: {FFFFFF}%s\n",adminnome,i,Nomear);
Continua ;(


Re: Erros ;( - mau.tito - 03.10.2012

Nгo tenhu certessa.

pawn Код:
if(PlayerInfo[i][pAdmin] == 1) Nomear = "Moderador Global";
            else if(PlayerInfo[i][pAdmin] == 2) Nomear = "Administrador";
            else if(PlayerInfo[i][pAdmin] == 3) Nomear = "Admin De Confianзa";
            else if(PlayerInfo[i][pAdmin] == 4) Nomear = "Master";
            else if(PlayerInfo[i][pAdmin] == 5) Nomear = "Dono";



GetPlayerName(i, Nome,sizeof(Nome));


@edit
pawn Код:
strcat(String2,String,sizeof(String2));
Pra que server?


Re: Erros ;( - Jason` - 03.10.2012

Vocк quer exibir os administradores em um dialog?


Re: Erros ;( - ViniBorn - 03.10.2012

Tenta aн
pawn Код:
CMD:admins(playerid,params[])
{
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome,MAX_PLAYER_NAME);
    new String[128], String2[512], Nomear[24], bool:Found;

    for(new i; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] > 0)
        {
            switch(PlayerInfo[i][pAdmin])
            {
                case 1: Nomear = "Moderador Global";
                case 2: Nomear = "Administrador";
                case 3: Nomear = "Admin De Confianзa";
                case 4: Nomear = "Master";
                case 5: Nomear = "Dono";
            }
            format(String,sizeof(String),"{FF0000}Nick: {FFFFFF}%s {FF0000}ID: {FFFFFF}%d {FF0000}Rank: {FFFFFF}%s\n",Nome(i),i,Nomear);
            strcat(String2,String,sizeof(String2));
            Found = true;            
        }
    }
    if(!Found)
    {
        format(String,sizeof(String),"{FF0000}Nenhum(a) Administrador(a) Online!");
        Msg(playerid, ROSA,String);
    }
    //else
        //ShowPlayerDialog
    return 1;
}



Re: Erros ;( - Jason` - 03.10.2012

pawn Код:
cmd(admins, playerid, params[]) {

    static a, bool:b, r[128], s[512], n[24];

    a = GetMaxPlayers();
    b = false;
   
    s[0] = EOS;
    for( ; a > -1; --a ) {
   
        if(PlayerInfo[a][pAdmin] >= 1) {
       
            b = true;
            if(PlayerInfo[a][pAdmin] == 1) r = "Moderador Global";
            else if(PlayerInfo[a][pAdmin] == 2) r = "Administrador";
            else if(PlayerInfo[a][pAdmin] == 3) r = "Admin De Confianзa";
            else if(PlayerInfo[a][pAdmin] == 4) r = "Master";
            else if(PlayerInfo[a][pAdmin] == 5) r = "Dono";
           
            format(r, sizeof(r), "{FF0000}Nick: {FFFFFF}%s {FF0000}ID: {FFFFFF}%d {FF0000}Rank: {FFFFFF}%s\n",
                (GetPlayerName(a, n, 24), n), a, r);
            strcat(s, r);
        }
    }
    if(!b) return SendClientMessage(playerid, 0x1E90FFFF, ">> Nenhum administrador online.");
   
    ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, #Administradores, s, #Fechar, #);
    return 1;
}

#edit

Perdi tempo fazendo o comando -.-


Re: Erros ;( - Owtsiixx_Twd - 03.10.2012

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Tenta aн
pawn Код:
CMD:admins(playerid,params[])
{
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome,MAX_PLAYER_NAME);
    new String[128], String2[512], Nomear[24], bool:Found;

    for(new i; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] > 0)
        {
            switch(PlayerInfo[i][pAdmin])
            {
                case 1: Nomear = "Moderador Global";
                case 2: Nomear = "Administrador";
                case 3: Nomear = "Admin De Confianзa";
                case 4: Nomear = "Master";
                case 5: Nomear = "Dono";
            }
            format(String,sizeof(String),"{FF0000}Nick: {FFFFFF}%s {FF0000}ID: {FFFFFF}%d {FF0000}Rank: {FFFFFF}%s\n",Nome(i),i,Nomear);
            strcat(String2,String,sizeof(String2));
            Found = true;            
        }
    }
    if(!Found)
    {
        format(String,sizeof(String),"{FF0000}Nenhum(a) Administrador(a) Online!");
        Msg(playerid, ROSA,String);
    }
    //else
        //ShowPlayerDialog
    return 1;
}
Nossa Velho Como Que Agr que eu fui percebi que apaguei o dialog e nem vi pqp ;(