SA-MP Forums Archive
error 001: expected token: ";", but found "]" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 001: expected token: ";", but found "]" (/showthread.php?tid=659281)



error 001: expected token: ";", but found "]" - Exlivebs - 29.09.2018

I got these lines
Quote:

CreateGate(gateid) {
if(IsValidDynamicObject(GateInfo[gateid][gGATE])) DestroyDynamicObject(GateInfo[gateid][gGATE]);
GateInfo[gateid][gGATE] = -1;
if(GateInfo[gateid][gPosX] == 0.0) return 1;
switch(GateInfo[gateid][gRenderHQ])
{
case 1: GateInfo[gateid][gGATE] = CreateDynamicObject(GateInfo[gateid][gModel], GateInfo[gateid][gPosX], GateInfo[gateid][gPosY], GateInfo[gateid][gPosZ], GateInfo[gateid][gRotX], GateInfo[gateid][gRotY], GateInfo[gateid][gRotZ], GateInfo[gateid][gVW], GateInfo[gateid][gInt], -1, 100.0);
case 2: GateInfo[gateid][gGATE] = CreateDynamicObject(GateInfo[gateid][gModel], GateInfo[gateid][gPosX], GateInfo[gateid][gPosY], GateInfo[gateid][gPosZ], GateInfo[gateid][gRotX], GateInfo[gateid][gRotY], GateInfo[gateid][gRotZ], GateInfo[gateid][gVW], GateInfo[gateid][gInt], -1, 150.0);
case 3: GateInfo[gateid][gGATE] = CreateDynamicObject(GateInfo[gateid][gModel], GateInfo[gateid][gPosX], GateInfo[gateid][gPosY], GateInfo[gateid][gPosZ], GateInfo[gateid][gRotX], GateInfo[gateid][gRotY], GateInfo[gateid][gRotZ], GateInfo[gateid][gVW], GateInfo[gateid][gInt], -1, 200.0);
default: GateInfo[gateid][gGATE] = CreateDynamicObject(GateInfo[gateid][gModel], GateInfo[gateid][gPosX], GateInfo[gateid][gPosY], GateInfo[gateid][gPosZ], GateInfo[gateid][gRotX], GateInfo[gateid][gRotY], GateInfo[gateid][gRotZ], GateInfo[gateid][gVW], GateInfo[gateid][gInt], -1, 60.0);
}
if(GateInfo[gateid][gTModel] != INVALID_OBJECT_ID) SetDynamicObjectMaterial(GateInfo[gateid][gGATE], GateInfo[gateid][gTIndex], GateInfo[gateid][gTModel], GateInfo[gateid][gTTXD], GateInfo[gateid][gTTexture], GateInfo[gateid][gTColor]);
return 1;
}

It says this :
Quote:

C:\Users\ben_salem\Desktop\Nouveau dossier (7)\includes\dynamic\gates.pwn(965) : error 017: undefined symbol "IsValidDynamicObject"
C:\Users\ben_salem\Desktop\Nouveau dossier (7)\includes\dynamic\gates.pwn(965) : warning 215: expression has no effect
C:\Users\ben_salem\Desktop\Nouveau dossier (7)\includes\dynamic\gates.pwn(965) : error 001: expected token: ";", but found "]"
C:\Users\ben_salem\Desktop\Nouveau dossier (7)\includes\dynamic\gates.pwn(965) : error 029: invalid expression, assumed zero
C:\Users\ben_salem\Desktop\Nouveau dossier (7)\includes\dynamic\gates.pwn(965) : fatal error 107: too many error messages on one line

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


4 Errors.

The line number 965 is
Quote:

if(IsValidDynamicObject(GateInfo[gateid][gGATE])) DestroyDynamicObject(GateInfo[gateid][gGATE]);

How to fix these errors ? like ; is not needed in the line before right ?


Re: error 001: expected token: ";", but found "]" - Exlivebs - 29.09.2018

Any solution


Re: error 001: expected token: ";", but found "]" - SaMuRy - 29.09.2018

Do:
if(!IsValidDynamicObject(GateInfo[gateid][gGATE])) DestroyDynamicObject(GateInfo[gateid][gGATE]);
instead of:
if(IsValidDynamicObject(GateInfo[gateid][gGATE])) DestroyDynamicObject(GateInfo[gateid][gGATE]);


Re: error 001: expected token: ";", but found "]" - Undef1ned - 29.09.2018

You must have the include "streamer" and include it in its game mode.

PHP код:
#include <streamer> 
https://github.com/samp-incognito/sa...lugin/releases


Re: error 001: expected token: ";", but found "]" - Exlivebs - 30.09.2018

After i did use include
Quote:

#include <streamer>

it gave me those errors
Quote:

C:\Users\ben_salem\Desktop\Nouveau dossier (7)\includes\dynamic\gates.pwn(965) : error 017: undefined symbol "GateInfo"
C:\Users\ben_salem\Desktop\Nouveau dossier (7)\includes\dynamic\gates.pwn(965) : warning 215: expression has no effect
C:\Users\ben_salem\Desktop\Nouveau dossier (7)\includes\dynamic\gates.pwn(965) : error 001: expected token: ";", but found "]"
C:\Users\ben_salem\Desktop\Nouveau dossier (7)\includes\dynamic\gates.pwn(965) : error 029: invalid expression, assumed zero
C:\Users\ben_salem\Desktop\Nouveau dossier (7)\includes\dynamic\gates.pwn(965) : fatal error 107: too many error messages on one line




Re: error 001: expected token: ";", but found "]" - UFF - 30.09.2018

Have you defined GateInfo?


Re: error 001: expected token: ";", but found "]" - Exlivebs - 30.09.2018

Quote:
Originally Posted by UFF
Посмотреть сообщение
Have you defined GateInfo?
I'm using ngg script trying to run it , not sure what's the issue , but should be defined the gateinfo


Re: error 001: expected token: ";", but found "]" - UFF - 01.10.2018

Quote:
Originally Posted by Exlivebs
Посмотреть сообщение
I'm using ngg script trying to run it , not sure what's the issue , but should be defined the gateinfo
I didn't ask what script you are using or going to run. so it should be defined like

Код:
enum gate_data
{
gGATE,
gModel,
gInt,
gTModel,
gTTexture,
gTColor,
gTTXD,
gVW,
gPosX,
gPosY,
gPosZ,
gRotX,
gRotY,
gRotZ
}

new GateInfo[MAX_GATES][gate_data];