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=496266)



Weird errors - seanny - 21.02.2014

This error always pops up when I attempt to create a function to apply animations in my own way.

pawn Код:
stock ApplyAnim(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)//Line 169
{
    SetPVarInt(playerid, "AnimationApplied", 1);
    return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
}
Quote:

E:\Scripting\pawno\include\progress.inc(170) : warning 217: loose indentation
E:\Scripting\pawno\include\progress.inc(172) : warning 217: loose indentation
../src/defines.pwn(169) : error 001: expected token: "-string end-", but found "-identifier-"
../src/defines.pwn(169) : error 010: invalid function or declaration
../src/defines.pwn(169 -- 172) : error 010: invalid function or declaration
../src/defines.pwn(169 -- 172) : fatal error 107: too many error messages on one line

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


4 Errors.

Defines.pwn pastebin


Re: Weird errors - Konstantinos - 21.02.2014

Post the lines 165-169. The error comes from the line above the stock.


Re: Weird errors - seanny - 21.02.2014

I've added a link to my whole defines.pwn file.


Re: Weird errors - Konstantinos - 21.02.2014

I can't find anything wrong with it. It's really an odd error. Try adding the stock to your gamemode directly, does it give the same errors again?


Re: Weird errors - seanny - 21.02.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I can't find anything wrong with it. It's really an odd error. Try adding the stock to your gamemode directly, does it give the same errors again?
It'll bring the same error if I add it to the Gamemode, which is why I added it to the defines.pwn and the strange thing is, if I delete the stock, the GM will compile w/o error.


Re: Weird errors - Konstantinos - 21.02.2014

Even if you use it as definition?
pawn Код:
#define ApplyAnim(%0,%1,%3,%4,%5,%6,%7,%8,%9) \
    SetPVarInt(%0, "AnimationApplied", 1); \
    ApplyAnimation(%0, %1, %2, %3, %4, %5, %6, %7, %8, %9);



Re: Weird errors - Necip - 21.02.2014

I am not sure but, maybe you could try this and tell us if errors appear:
pawn Код:
stock ApplyAnim(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync)
{
    SetPVarInt(playerid, "AnimationApplied", 1);
    return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
}



Re: Weird errors - seanny - 21.02.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Even if you use it as definition?
pawn Код:
#define ApplyAnim(%0,%1,%3,%4,%5,%6,%7,%8,%9) \
    SetPVarInt(%0, "AnimationApplied", 1); \
    ApplyAnimation(%0, %1, %2, %3, %4, %5, %6, %7, %8, %9);
Actually, this has fixed it, thank you!