Erro na public ! -
Carlos_barbosa - 18.08.2012
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 :/
Re: Erro na public ! -
darkxdll - 18.08.2012
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 ...
Re: Erro na public ! -
FeelLikeASir_ - 18.08.2012
if(IsACop(i))
Re: Erro na public ! -
Bruno Alves - 18.08.2012
@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"
Re: Erro na public ! -
Carlos_barbosa - 18.08.2012
continua o mesmo erro !
Re: Erro na public ! -
Carlos_barbosa - 18.08.2012
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.
Re: Erro na public ! -
Bruno Alves - 18.08.2012
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 '-'
Re: Erro na public ! -
Carlos_barbosa - 18.08.2012
qual o erro ? cara
Re: Erro na public ! -
Abravanel - 18.08.2012
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;
}
Re: Erro na public ! -
Bruno Alves - 18.08.2012
era mal identaзгo deu certo agr?