Enumeration... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Enumeration... (
/showthread.php?tid=94435)
Enumeration... -
Tannz0rz - 29.08.2009
Hey everyone, I'm rather used to scripting in C++ at the moment, and I haven't scripted pawn in awhile, so I'm not sure as to what the issue is. Some reason, I keep getting this error:
Код:
C:\Users\Casey\Desktop\samp02Xserver.win32\filterscripts\specialshots.pwn(10) : error 001: expected token: "-identifier-", but found "sleep"
Here:
Код:
enum ShotTypes
{
stun,
sleep,
burn
}
new Shots[MAX_PLAYERS][ShotTypes];
When I get rid of both "sleep" and "burn" from the enumeration, everything compiles fine. When I change the names of the variables in the enumeration, it compiles fine, but with these names, it won't compile. I've tried placing a semi-colon after the closing bracket of the enumeration, but that fails to do anything. Any clue?
Re: Enumeration... -
cyber_punk - 29.08.2009
Don't use the word sleep, can't give you the reason why. Maybe sleep in pawn means something. I just messed around with this and changing sleep to anything else had this compile.
Re: Enumeration... -
Tannz0rz - 29.08.2009
Quote:
Originally Posted by cyber_punk
Don't use the word sleep, can't give you the reason why. Maybe sleep in pawn means something. I just messed around with this and changing sleep to anything else had this compile.
|
Oh, wow. That seriously worked. That's strange...
Re: Enumeration... -
Correlli - 29.08.2009
Because 'sleep()' is the function which doesn't work in PAWN.
Re: Enumeration... -
cyber_punk - 29.08.2009
This is the reason comes from Pawn's Time Functions. On some platforms, the sleep instruction also delays for a given number of milliseconds.
Re: Enumeration... -
Correlli - 29.08.2009
Quote:
Originally Posted by cyber_punk
This is the reason comes from Pawn's Time Functions. On some platforms, the sleep instruction also delays for a given number of milliseconds.
|
Yes. It works in C++ if i'm correct.