SA-MP Forums Archive
Weird errors - 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: Weird errors (/showthread.php?tid=303070)



Weird errors (Rep+) - PHudson - 11.12.2011

Hi all:

I'm trying to compile my script, but I get this errors:

Код:
emergency.pwn(75) : error 017: undefined symbol "pDuty"
emergency.pwn(75) : warning 215: expression has no effect
emergency.pwn(75) : error 001: expected token: ";", but found "]"
emergency.pwn(75) : error 029: invalid expression, assumed zero
emergency.pwn(75) : fatal error 107: too many error messages on one line

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


4 Errors.
Line 75 is here:

pawn Код:
public OnPlayerConnect(playerid)                 // LINE 73
{                                                                   // LINE 74
    pDuty[playerid] = 0;                        // LINE 75
    pPosesion[playerid] = 0;                // LINE 76
    return 1;                                        // LINE 77
}                                                            // LINE 78
pDuty is defined here:

pawn Код:
#include <a_samp>
#pragma tabsize 0
#if defined FILTERSCRIPT

new pDuty[MAX_PLAYERS]; // LINE 8
new pPosesion[MAX_PLAYERS];

forward IsAtWork(playerid);
I have tried to fix it by myself. I have done this tasks, but I can't compile it:
Thanks a lot for helping me


Re: Weird errors - adios1 - 12.12.2011

Is this Filterscript? if it is.. It work for me ... aye ??


Re: Weird errors - wildcookie007 - 12.12.2011

If this is not defined as a filterscript it may cause undefined errors due to variables being defined in IF its a filterscript?


Re: Weird errors - suhrab_mujeeb - 12.12.2011

Is this copied from another script?


Re: Weird errors - Ballu Miaa - 12.12.2011

Maybe yes it is Copied from somewhere. Why dont you add pDuty in the PlayerInfo enum or any other for Player Defines?


Re: Weird errors - Phanto90 - 12.12.2011

Код:
#if defined FILTERSCRIPT
You have not defined FILTERSCRIPT.
Remove
Код:
#if defined FILTERSCRIPT
and also the
Код:
#endif



Respuesta: Re: Weird errors - PHudson - 12.12.2011

Quote:
Originally Posted by Phanto90
Посмотреть сообщение
Код:
#if defined FILTERSCRIPT
You have not defined FILTERSCRIPT.
Remove
Код:
#if defined FILTERSCRIPT
and also the
Код:
#endif
I have done exactly that, but I get this:

Код:
emergency.pwn(35) : error 026: no matching "#if..."
emergency.pwn(120) : error 004: function "IsAtWork" is not implemented
emergency.pwn(141) : error 028: invalid subscript (not an array or too many subscripts): "CheckCopCar"
emergency.pwn(141) : warning 215: expression has no effect
emergency.pwn(141) : error 001: expected token: ";", but found "]"
emergency.pwn(141) : error 029: invalid expression, assumed zero
emergency.pwn(141) : fatal error 107: too many error messages on one line

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


6 Errors.
I can remove #endif and it returns the same 4 errors, but when I remove #if defined FILTERSCRIPT, I get the errors I pasted before.
Thank you anyway.

Quote:
Originally Posted by suhrab_mujeeb
Посмотреть сообщение
Is this copied from another script?
Nope. I'm doing this to practice PAWN, so it's illogical to copy it. It might look like a Roleplay Gamemode, because I'm making a script which will be specially used in this sort of GMs.

Quote:
Originally Posted by adios1
Посмотреть сообщение
Is this Filterscript? if it is.. It work for me ... aye ??
No. It isn't a filterscript.

__________________________________________________ ____________________
Now I have compiled it defining my variables with "#define" and "new", but I got exactly the same.
I don't know why the compiler doesn't recognise my variables as defined...

Thanks for answering to all.


Re: Weird errors - THE_KNOWN - 12.12.2011

undo your changes first

place
pawn Код:
new pDuty[MAX_PLAYERS]; // LINE 8
new pPosesion[MAX_PLAYERS];

forward IsAtWork(playerid);
before
pawn Код:
#if defined FILTERSCRIPT



Respuesta: Re: Weird errors - PHudson - 12.12.2011

Quote:
Originally Posted by THE_KNOWN
Посмотреть сообщение
undo your changes first

place
pawn Код:
new pDuty[MAX_PLAYERS]; // LINE 8
new pPosesion[MAX_PLAYERS];

forward IsAtWork(playerid);
before
pawn Код:
#if defined FILTERSCRIPT
I have placed all the forwards and news before that.
Now, variables compile correctly, but forward functions send an error:

Код:
emergency.pwn(119) : error 028: invalid subscript (not an array or too many subscripts): "IsTeamPolice"
emergency.pwn(119) : warning 215: expression has no effect
emergency.pwn(119) : error 001: expected token: ";", but found "]"
emergency.pwn(119) : error 029: invalid expression, assumed zero
emergency.pwn(119) : fatal error 107: too many error messages on one line

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


4 Errors.
IsTeamPolice is the first forward function I use in the script. If I comment that line, I get the same error in the next function and if I comment that one, it's the same for the third one, the fourth...

Well, variables are fixed, but now functions aren't working.


Re: Weird errors - THE_KNOWN - 12.12.2011

hmm remove forward IsAtWork(playerid);

search for public IsAtWork(playerid);

change public in that to stock