Invalid function or declaration errors :(
#1

Hello, i have 2 "Invalid function or declaration errors" and can't compile my script now. Here are the errors:

D:\Games\GTA San Andreas\pawno\include\PPC_Defines.inc(23 : error 010: invalid function or declaration
D:\Games\GTA San Andreas\pawno\include\PPC_Defines.inc(240) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

And here is the script:


// Create some global variables that are used to display large dialogs
{new DialogMsg5000 //Line 238
}
; //Line 240



I am sure it is a bracket missed or added and it has a simple solution but i can't just solve it. Please I know you can help me .I am new at scripting.
Reply
#2

show as full line of code what we cant understand on line 240 ;
Reply
#3

it has ; because i was trying different possibilities with brackets and these..; Here it is how the code continues:

// Create some global variables that are used to display large dialogs
{new DialogMsg5000
}
;

// These variables are only used during the GameModeInit, they are used for debugging purposes
// A variable to hold the ID of every vehicle (used to record the last ID of a vehicle, for debugging)
new LastVehicleID;
// A variable to hold the ID of every object (used to record the last ID of an object, for debugging)
new LastObjectID;
// A variable to hold the total amount of houses that are loaded
new TotalHouses;
// A variable that holds the last speedcam-id
new TotalCameras;
// A variable that holds the total amount of businesses loaded
new TotalBusiness;
Reply
#4

I guess it should be like this.

Код:
{
new DialogMsg[5000];
}
Reply
#5

Now the following errors occured :
D:\Games\GTA San Andreas\pawno\include\PPC_Defines.inc(23 : error 010: invalid function or declaration
D:\Games\GTA San Andreas\pawno\include\PPC_Defines.inc(240) : error 054: unmatched closing brace ("}")

I can't stand what could it be..
Reply
#6

First of all, show me your whole command you created, and then, comment the line where the error appears!
And please use these tags: [ pawn][/pawn]

(Without the spaces)
Reply
#7

This is actually PPC Trucking Mode and what cannot be compiled is the file PPC Defines. I haven't made any changes on it but it shows errors even though i replaced it with the original file from the mode. In this file there are only defined things with no commands:

pawn Код:
....// Define messagecolors
#define ColorRed 0xFF0000FF
#define ColorGreen 0x00FF00FF
#define ColorBlue 0x0000FFFF

// Define Virtual Worlds
#define WORLD_JAIL 10254

// Define options for admins
#define AutoKickAfterWarn           1 // Define if the player gets kicked after a certain amount of warnings
#define AutoKickWarnings            3 // Define the amount of warnings before a player is kicked automatically



// Define spectate modes
#define ADMIN_SPEC_TYPE_NONE 0
#define ADMIN_SPEC_TYPE_PLAYER 1
#define ADMIN_SPEC_TYPE_VEHICLE 2

// Create some global variables that are used to display large dialogs
new DialogMsg5000[5000];                      [COLOR="Red"]this is where the error appears[/COLOR]


// These variables are only used during the GameModeInit, they are used for debugging purposes
// A variable to hold the ID of every vehicle (used to record the last ID of a vehicle, for debugging)
new LastVehicleID;
// A variable to hold the ID of every object (used to record the last ID of an object, for debugging)
new LastObjectID;
// A variable to hold the total amount of houses that are loaded
new TotalHouses;
// A variable that holds the last speedcam-id
new TotalCameras;
// A variable that holds the total amount of businesses loaded
new TotalBusiness;
I am sorry guys but i am new at the forum and still don't know these basic things.
Reply
#8

What is this for, if I may ask?

pawn Код:
[COLOR="Red"]
Delete that, and also the closing tag which is connected with it!
Reply
#9

I used this in order to make the font red and show you more clearly where the error is, but as you see it didn't work.
Reply
#10

Oh, lol, sorry, thought it was from your gamemode! Okay look, the string is too big, it's 5000! The maximum size is 1024, that's why I would set it to 512 or 1024!

If this still didn't work, read the error again: You have got an unmatching closing(opening) bracket in your script, which isn't connected to anywhere! Show me the line 240, that means, the whole code with line 240 included!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)