Stock problem
#1

Код:
C:\Users\gora_\Desktop\Samp\gamemes\OldStyle.pwn(496) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\gora_\Desktop\Samp\gamemodes\OldStyle.pwn(499) : error 001: expected token: "-string end-", but found "-identifier-"
Код:
stock IsMonth29(year)
{
496:	new y = 2000;
	for(new i = 4; i < 3000; i += 4) 
	{
499:		if((y+i) == year) return 1;
	}
	return 0;
}
Reply
#2

where did u IsMonth29 used?
Reply
#3

Код:
			if(IsMonth31(month))
			{
				if(day > 31)
				{
					month++;
					if(month > 12)
					{
						year++;
						while(day > 31) day -= 31;
					}
					else while(day > 31) day -= 31;
				}
			}
			else if(!IsMonth31(month))
			{
				if(day > 30)
				{
					month++;
					if(month > 12)
					{
						year++;
						while(day > 30) day -= 30;
					}
					else while(day > 30) day -= 30;
				}
			}
			else if(!IsMonth31(month) && IsMonth29(year) && month == 2)
			{
				if(day > 29)
				{
					month++;
					if(month > 12)
					{
						year++;
						while(day > 29) day -= 29;
					}
					else while(day < 29) day -= 29;
				}
			}
			else if(!IsMonth31(month) && !IsMonth29(year) && month == 2)
			{
				if(day > 28)
				{
					month++;
					if(month > 12)
					{
						year++;
						while(day > 28) day -= 28;
					}
					else while(day > 28) day -= 28;
				}
			}
i used in a ban command
Reply
#4

The code seems fine, albeit unnecessary as there are better ways of turning, what I assume to be, timestamps to actual dates (there are includes written that get the job done).

But back on topic, I thought only strings can receive this error. But you're obviously working with ints, right?
I, personally, don't see what could be causing that problem in the code you provided, as it currently says that you are trying to format a string when you can't actually do that, if I'm not mistaken.

I'd be great to see more code, maybe both the /ban command and this entire conversion part that you showed so far.
Reply
#5

where is your "new year" ?
Reply
#6

Ok, so with timestamps is more good, you can give me an example how to do, or a tutorial?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)