Expected token: ";", but found ")"
#1

Код:
C:\Users\NTVbeleza\Desktop\robots.pwn(36) : error 012: invalid function call, not a valid address
C:\Users\NTVbeleza\Desktop\robots.pwn(36) : warning 215: expression has no effect
C:\Users\NTVbeleza\Desktop\robots.pwn(36) : error 001: expected token: ";", but found ")"
C:\Users\NTVbeleza\Desktop\robots.pwn(36) : error 029: invalid expression, assumed zero
C:\Users\NTVbeleza\Desktop\robots.pwn(36) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
33
34 public OnGameModeInit()
35 {
36 ConectarNPCS(0);
37
38 Crysbus = AddStaticVehicle(431,2044.8854,1473.2106,10.4494,1 81.3339,6,1); //






is on a timer for my npcs


Код:
new ConectarNPCS;


new const NPC_LIST[][] =
{ //recuerden reemplazar los nombres de los scripts... tal y como si estuvieran creando un ConnectNPC... de esta forma...
"rt","nero",
"yt","LV",
"yum","crys",
"robo","bussf" ,
"yum","camio",
"uy","hu",
"iou","vir",
"eee","bi",
"qas","ele",
"utt","arre",
"oiu","arrt",
"pyrr","cad"
};



ConectarNPCS (0);


end of GM
/////

forward ConectarNPCS(pos); //lo recuerdan de arriba en el ongamemodeinit?? xD
public ConectarNPCS(pos) {
if(pos >= sizeof(NPC_LIST)) { printf("LISTA DE NPCS COMPLETADA"); return; }//este mensaje aparecera en tu log cuando todos los NPCs hayan sido cargados...
printf("CONECTANDO NPC: %s | SCRIPT: %s",NPC_LIST[pos],NPC_LIST[pos+1]);
ConnectNPC(NPC_LIST[pos],NPC_LIST[pos+1]);//vean aqui la funcion de connectNPCs para que no se pierdan...
SetTimerEx("ConectarNPCS",5000,false,"i",pos+=2);//en este caso, el 5000 representa un delay de 5 segundos, incluso pueden ser mas.. los NPCs cargaran exitosamente... iran cargando de a uno en uno...



    }
Reply
#2

Give us lines 35-37, you wrote ";" where you don't have to or you should write ";" but you didn't
Reply
#3

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
This should be:

[/pawn]public OnGameModeInit()
{
ConectarNPCS(0);
[/pawn]

You forget the ;
If I so well and gives me the error


Код:
};

public OnGameModeInit()
{
    ConectarNPCS (0);    (----------
Код:
C:\Users\NTVbeleza\Desktop\robots.pwn(36) : error 012: invalid function call, not a valid address
C:\Users\NTVbeleza\Desktop\robots.pwn(36) : warning 215: expression has no effect
C:\Users\NTVbeleza\Desktop\robots.pwn(36) : error 001: expected token: ";", but found ")"
C:\Users\NTVbeleza\Desktop\robots.pwn(36) : error 029: invalid expression, assumed zero
C:\Users\NTVbeleza\Desktop\robots.pwn(36) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

Have you declared ConectarNPCS as variable instead of a function?

I ran:
pawn Код:
new ConectarNPCS;

public OnGameModeInit()
{
    ConectarNPCS(0);
    return 1;
}
and I got the same errors as you got so you declared it as a variable which is incorrect.
Reply
#5

Help
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Have you declared ConectarNPCS as variable instead of a function?

I ran:
pawn Код:
new ConectarNPCS;

public OnGameModeInit()
{
    ConectarNPCS(0);
    return 1;
}
and I got the same errors as you got so you declared it as a variable which is incorrect.

Here:

pawn Код:
new ConectarNPCS;

public OnGameModeInit();
{
    ConectarNPCS(0);
    return 1;
}

You forgot the ; on public "OnGameModeInit();"
Reply
#7

callback are not suppose to have ";" in the end of them

put this on top of your script

pawn Код:
forward ConectarNPCS(pos);
and remove this from the top of the script
pawn Код:
new ConectarNPCS;
Reply
#8

Solved thanks
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)