Enumeration...
#1

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?
Reply
#2

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.
Reply
#3

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...
Reply
#4

Because 'sleep()' is the function which doesn't work in PAWN.
Reply
#5

This is the reason comes from Pawn's Time Functions. On some platforms, the sleep instruction also delays for a given number of milliseconds.
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)