SA-MP Forums Archive
Pawno Compile Turf Error - 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: Pawno Compile Turf Error (/showthread.php?tid=441564)



Pawno Compile Turf Error - Narwhals - 03.06.2013

Hi dudes, i'm still learning script, but i can't get this to work
Nor did Wiki help me with it, i have to set up turf things for my RP server.

Error:
Code:
C:\Users\Narwhals\Desktop\Server\sup.pwn(96436) : warning 235: public function lacks forward declaration (symbol "TurfTimer")
C:\Users\Narwhals\Desktop\Server\sup.pwn(96438) : error 017: undefined symbol "TurfAttacker"
C:\Users\Narwhals\Desktop\Server\sup.pwn(96438) : warning 215: expression has no effect
C:\Users\Narwhals\Desktop\Server\sup.pwn(96438) : error 001: expected token: ";", but found "]"
C:\Users\Narwhals\Desktop\Server\sup.pwn(96438) : error 029: invalid expression, assumed zero
C:\Users\Narwhals\Desktop\Server\sup.pwn(96438) : 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 script:
Code:
public TurfTimer(turfid)
{
		if(TurfAttacker[turfid] != -1)
		{
		    if( GetPlayersInTurf(turfid, TurfAttacker[turfid]) >= 1 )
            {
                TurfAttackTime[turfid]++;
                if(TurfAttackTime[turfid] == TW_WAITDELAY)
                {
                    GangZoneStopFlashForAll(Turfs[turfid]);
                    TurfInfo[turfid][tOwner] = TurfAttacker[turfid]+1;
                    GangZoneShowForAll(Turfs[turfid], GetFamilyColor(TurfAttacker[turfid]+1) );
                    KillTimer(TurfTime[turfid]);
                    SaveTurfs();
                    new shit[256];
                    format(shit,sizeof(shit)," %s has successfully captured turf %s.", FamilyInfo[TurfAttacker[turfid]][FamilyName], TurfInfo[turfid][tName]);
                    SendClientMessageToAll(COLOR_YELLOW,shit);
                    TurfAttacker[turfid] = -1;
					new texttd[256];
					format(texttd,255, "~r~%s's ~w~territory", FamilyInfo[TurfInfo[turfid][tOwner]-1][FamilyName]);
					switch (turfid)
					{
Hope you guys can fix this, and teach me how to.
Note: This isn't the whole script, this is only the part of the script the error occurs..


Re: Pawno Compile Turf Error - BossZk - 03.06.2013

you need to place a forward for it, so do :
(you can just place the forward just right above the public)
pawn Code:
forward TurfTimer();
also, place this at the top of your script but under your includes and do:

pawn Code:
new TurfAttacker[MAX_PLAYERS];



Re: Pawno Compile Turf Error - Narwhals - 03.06.2013

Quote:
Originally Posted by BossZk
View Post
you need to place a forward for it, so do :
(you can just place the forward just right above the public)
pawn Code:
forward TurfTimer();
also, place this at the top of your script but under your includes and do:

pawn Code:
new TurfAttacker[MAX_PLAYERS];
Thank you, it fixed the errors, but there are some couple more, if you know more about this.
Please add my skype: black.sunn2400
thanks +rep