[AJUDA] O que esta errado nessa linha?
#1

Galera, to tentando aprender a mexer com SII , sistema de registro e login , e alguns comandos eu consigo fazer, mais nгo to consiguindo , pelo mais fбcil que seje(ou mais dificil) usar o comando /admins
Utilizo pInfo [playerid] [pAdmin] para verificar se o player й admin , ou PlayerInfo[playerid][pAdmin] >=1

Cуdigo:
pawn Код:
if(strcmp(cmdtext, "/admins", true) == 0){
        SendClientMessage(playerid,0x0080C0AA, "» Admins Online logados :");
        new Jogador[24];
            new count = 0;
                new msg[120];
                    for(new i=0; i<MAX_PLAYERS; i++){
        if(IsPlayerConnected(i) && pInfo[playerid][pAdmin] >= 1(i)){
            GetPlayerName(i,Jogador,24);
                format(msg,sizeof(msg),"%s (%d)", Jogador,i);
        SendClientMessage(playerid, 0xFFFFFFAA, msg);
                count++;
    }
}
        if(count == 0){
}
return 1;
}
Erros que ta dando:

pawn Код:
D:\Pastas\Servidor SAMP\gamemodes\SII.pwn(131) : warning 217: loose indentation
D:\Pastas\Servidor SAMP\gamemodes\SII.pwn(132) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
D:\Pastas\Servidor SAMP\gamemodes\SII.pwn(132) : warning 215: expression has no effect
D:\Pastas\Servidor SAMP\gamemodes\SII.pwn(132): error 001: expected token: ";", but found "]"
D:\Pastas\Servidor SAMP\gamemodes\SII.pwn(132) : error 029: invalid expression, assumed zero
D:\Pastas\Servidor SAMP\gamemodes\SII.pwn(132) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Linha 132:

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++){
        if(IsPlayerConnected(i) && pInfo[playerid][pAdmin] >= 1(i)){ //Linha 132 <<
            GetPlayerName(i,Jogador,24);
Alguem pode me ajudar?
Reply
#2

pawn Код:
if(IsPlayerConnected(i) && PlayerInfo[playerid][pAdmin] >= 1(i)){
Reply
#3

Quote:
Originally Posted by Adrian Fahrenheit Tepes
Посмотреть сообщение
pawn Код:
if(IsPlayerConnected(i) && PlayerInfo[playerid][pAdmin] >= 1(i)){
Ja tentei desse jeito tambem, mais nгo vai '-' , continua dando erro
Reply
#4

pawn Код:
if(strcmp(cmdtext, "/admins", true) == 0)
{
        SendClientMessage(playerid,0x0080C0AA, "» Admins Online logados :");
        new Jogador[24];
        new count = 0;
        new msg[120];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
             if(IsPlayerConnected(i) && pInfo[i][pAdmin] >= 1)
             {
                  GetPlayerName(i,Jogador,24);
                format(msg,sizeof(msg),"%s (%d)", Jogador,i);
                SendClientMessage(playerid, 0xFFFFFFAA, msg);
                count++;
            }
        }
     }
     if(count == 0) return 1;
     return 1;
}
Reply
#5

Quote:
Originally Posted by Sergio_MOW
Посмотреть сообщение
pawn Код:
if(strcmp(cmdtext, "/admins", true) == 0)
{
        SendClientMessage(playerid,0x0080C0AA, "» Admins Online logados :");
        new Jogador[24];
        new count = 0;
        new msg[120];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
             if(IsPlayerConnected(i) && pInfo[playerid][pAdmin] >= 1)
            {
                  GetPlayerName(i,Jogador,24);
                format(msg,sizeof(msg),"%s (%d)", Jogador,i);
                SendClientMessage(playerid, 0xFFFFFFAA, msg);
                count++;
         }
     }
     if(count == 0) return 1;
     return 1;
}
Nгo deu tb =/
Reply
#6

O mesmo erro?
EDIT: FALTA UMA CHAVE NO MEU CODE, EDITANDO.
Reply
#7

pawn Код:
if(IsPlayerConnected(i) && pInfo[i][pAdmin] >= 1(i)){
Que falta de atenзгo a minha...Agora vai funcionar!
Reply
#8

Quote:
Originally Posted by Sergio_MOW
Посмотреть сообщение
O mesmo erro?
EDIT: FALTA UMA CHAVE NO MEU CODE, EDITANDO.
Quote:
Originally Posted by Adrian Fahrenheit Tepes
Посмотреть сообщение
pawn Код:
if(IsPlayerConnected(i) && pInfo[i][pAdmin] >= 1(i)){
Que falta de atenзгo a minha...Agora vai funcionar!
Quote:
Originally Posted by Viniborn
Посмотреть сообщение
pawn Код:
if(IsPlayerConnected(i) && pInfo[playerid][pAdmin] >= 1){
//Linha 132 <<

Continua dando os mesmos erros
Reply
#9

Quote:
Originally Posted by Adrian Fahrenheit Tepes
Посмотреть сообщение
pawn Код:
if(IsPlayerConnected(i) && pInfo[i][pAdmin] >= 1(i)){
Que falta de atenзгo a minha...Agora vai funcionar!
Cara, o certo й:

pawn Код:
if(IsPlayerConnected(i) && pInfo[i][pAdmin] >= 1){
porque o vocк nгo precisa dizer duas vezes que й o playerid, ou qualquer array substituida ou colocacada no loop


EDIT:Editei de novo vк lб... tinha 2 erros, fiz na pressa o "conserto" do code, ve meu post de novo.


EDITІ: Duvido que nгo funcione:
pawn Код:
if(strcmp(cmdtext, "/admins", true) == 0)
{
        SendClientMessage(playerid,0x0080C0AA, "» Admins Online logados :");
        new Jogador[24];
        new count = 0;
        new msg[120];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
             if(IsPlayerConnected(i) && pInfo[i][pAdmin] >= 1)
             {
                  GetPlayerName(i,Jogador,24);
                format(msg,sizeof(msg),"%s (%d)", Jogador,i);
                SendClientMessage(playerid, 0xFFFFFFAA, msg);
                count++;
            }
        }
     }
     if(count == 0) return 1;
     return 1;
}
Reply
#10

Quote:
Originally Posted by Sergio_MOW
Посмотреть сообщение
Cara, o certo й:

pawn Код:
if(IsPlayerConnected(i) && pInfo[i][pAdmin] >= 1){
porque o vocк nгo precisa dizer duas vezes que й o playerid, ou qualquer array substituida ou colocacada no loop


EDIT:Editei de novo vк lб... tinha 2 erros, fiz na pressa o "conserto" do code, ve meu post de novo.


EDITІ: Duvido que nгo funcione:
pawn Код:
if(strcmp(cmdtext, "/admins", true) == 0)
{
        SendClientMessage(playerid,0x0080C0AA, "» Admins Online logados :");
        new Jogador[24];
        new count = 0;
        new msg[120];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
             if(IsPlayerConnected(i) && pInfo[i][pAdmin] >= 1)
             {
                  GetPlayerName(i,Jogador,24);
                format(msg,sizeof(msg),"%s (%d)", Jogador,i);
                SendClientMessage(playerid, 0xFFFFFFAA, msg);
                count++;
            }
        }
     }
     if(count == 0) return 1;
     return 1;
}
Aff ta dando os mesmos erros ):

Quote:
Originally Posted by Adrian Fahrenheit Tepes
Посмотреть сообщение
Opa, foi mal!

pawn Код:
if(IsPlayerConnected(i) && pInfo[i][pAdmin] >= 1){
Agora sim.

@EDIT

Se nгo funcionar:

pawn Код:
if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] >= 1){
ae agora foi , com 6 warning mais foi obrigadгo !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)