A little 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: A little error (
/showthread.php?tid=493990)
A little error -
Teemo - 11.02.2014
Line:
Quote:
if(!sscanf(params, "s[" #MAX_PLAYER_NAME "]", name)) {
|
Errors:
error 001: expected token: ")", but found "-string-"
warning 215: expression has no effect
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
[/QUOTE]
I hope you help me fast
Re: A little error -
Kirollos - 11.02.2014
As i realise in a_samp.inc:
pawn Код:
#define MAX_PLAYER_NAME (24)
i tried testing till it worked, and i found that you can't do something like this:
pawn Код:
print("Hi, my ID is "#(15)"!");
While this worked:
pawn Код:
print("Hi, my ID is "#15"!");
Try in your script #undef MAX_PLAYER_NAME then re-define it.
example:
pawn Код:
//@Top after includes:
#if defined MAX_PLAYER_NAME
#undef MAX_PLAYER_NAME
#endif
#define MAX_PLAYER_NAME 24
// Anywhere
if(!sscanf(params, "s[" #MAX_PLAYER_NAME "]", name))
{
// rest of your code
}
I hope you got that the compiler doesn't recognize #(15) while it recognizes #15