[Ajuda] Erro na public !
#1

entгo pessoal eu estava fazendo uma publica para usar no meu /190 atй ai bls,dai na hora que eu criei a public deu esse erro


Code :
pawn Код:
public ABroadCastPolicia(COLOR,const string[],level)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {

        if(IsPlayerConnected(i))
        {

            if(IsACop[i])
            {
                SendClientMessage(i, COLOR, string);
                printf("%s", string);
            }
        }
    }
    return true;
}
Erro :
pawn Код:
C:\Users\Famнlia\Desktop\ghogo\gamemodes\BUL.pwn(14239) : error 028: invalid subscript (not an array or too many subscripts): "IsACop"
C:\Users\Famнlia\Desktop\ghogo\gamemodes\BUL.pwn(14239) : warning 215: expression has no effect
C:\Users\Famнlia\Desktop\ghogo\gamemodes\BUL.pwn(14239) : error 001: expected token: ";", but found "]"
C:\Users\Famнlia\Desktop\ghogo\gamemodes\BUL.pwn(14239) : error 029: invalid expression, assumed zero
C:\Users\Famнlia\Desktop\ghogo\gamemodes\BUL.pwn(14239) : 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.
ajudando ai do +,se nгo conseguir nгo tem problema :/
Reply
#2

pawn Код:
public ABroadCastPolicia(COLOR,const string[],level)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {

        if(IsPlayerConnected(i))
        {

            if(IsACop(i))
            {
                SendClientMessage(i, COLOR, string);
                printf("%s", string);
            }
        }
    }
    return true;
}
Testa ai ...
Reply
#3

if(IsACop(i))
Reply
#4

@edit
pawn Код:
public ABroadCastPolicia(COLOR,const string[],level)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {

        if(IsPlayerConnected(i))
        {

            if(IsACop(i))
            {
                SendClientMessage(i, COLOR, string);
                printf("%s", string);
            }
        }
    }
    return true;
}
aqui deu certo sу n deu uma coisa, n tenho isacop defnido podia passar?
Vc deve ter poste ae e se tiver й pra da certo '-'
Код:
error 017: undefined symbol "IsACop"
Reply
#5

continua o mesmo erro !
Reply
#6

mais deu um warning no comando /190,olha ai Code !

pawn Код:
if(strcmp(cmd, "/190", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
        if(gPlayerLogged[playerid] == 0)
        {

            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб logado!");
            return 1;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' '))
        {

            idx++;
        }
        new offset = idx;
        new result[100];
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
        {

            result[idx - offset] = cmdtext[idx];
            idx++;
        }
        result[idx - offset] = EOS;
        if(!strlen(result))
        {

            SendClientMessage(playerid, COLOR_GRAD2, "USE: /190 [Denuncia]");
            return 1;
        }
        format(string, sizeof(string), "==> Denuncia de %s(%d): %s <==", sendername, playerid, (result));
        ABroadCastPolicia(0xFFFF66FF,string,1);
        SendClientMessage(playerid, COLOR_YELLOW, "Sua Denuncia Foi Enviado Aos Policias !");
    }
    return 1; <<-- erro nesse linha
}
Erro :
pawn Код:
C:\Users\Famнlia\Desktop\ghogo\gamemodes\BUL.pwn(33426) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          11740 bytes
Code size:          2194108 bytes
Data size:          1988264 bytes
Stack/heap size:      16384 bytes; estimated max. usage=6297 cells (25188 bytes)
Total requirements: 4210496 bytes

1 Warning.
Reply
#7

pawn Код:
if(strcmp(cmd, "/190", true) == 0)
{
    if(IsPlayerConnected(playerid)) {
        if(gPlayerLogged[playerid] == 0) {

            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб logado!");
            return 1;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' ')) {

            idx++;
        }
        new offset = idx;
        new result[100];
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {

            result[idx - offset] = cmdtext[idx];
            idx++;
        }
        result[idx - offset] = EOS;
        if(!strlen(result)) {

            SendClientMessage(playerid, COLOR_GRAD2, "USE: /190 [Denuncia]");
            return 1;
        }
        format(string, sizeof(string), "==> Denuncia de %s(%d): %s <==", sendername, playerid, (result));
        ABroadCastPolicia(0xFFFF66FF,string,1);
        SendClientMessage(playerid, COLOR_YELLOW, "Sua Denuncia Foi Enviado Aos Policias !");
    }
    return 1; //<<-- erro nesse linha
}
Aquele warning significa ma identaзгo no code '-'
Reply
#8

qual o erro ? cara
Reply
#9

pawn Код:
ABroadCastPolicia(color, const string[])
{
    for(new x; x < MAX_PLAYERS; ++x)
        if(IsPlayerConnected(x))
            if(IsACop(x))
                SendClientMessage(x, color, string);

    print(string);

    return 1;
}
Reply
#10

era mal identaзгo deu certo agr?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)