Array index out of bonus
#1

I have this problem on my command: /attack

Line:
Код:
if(GetWeekDay() == 1 || GetWeekDay() == 4 || GetWeekDay() == 6) return SCM(playerid, COLOR_WHITE,, "You can use this command only Monday, Wednesday, Friday and Sunday.");
getweekday function:
Код:
public GetWeekDay()
{
	new year,month,day;
    getdate(year, month, day);

	new
		weekday,
		j,
		e;

	if (month <= 2)
	{
		month += 12;
		--year;
	}

	j = year % 100;
	e = year / 100;

	switch ((day + (month+1)*26/10 + j + j/4 + e/4 - 2*e) % 7)
	{
		case 0: weekday = 1;
		case 1: weekday = 2;
		case 2: weekday = 3;
		case 3: weekday = 4;
		case 4: weekday = 5;
		case 5: weekday = 6;
		case 6: weekday = 7;
	}
	return weekday;
}
error:
Код:
[18:10:10] [debug] Run time error 4: "Array index out of bounds"
[18:10:10] [debug] AMX backtrace:
[18:10:10] [debug] #0 001a86d0 in public cmd_attack (playerid=9, params[]=@0155f83c "") at D:\gamemode\gamemodes\exgaming.pwn:25599
[18:10:10] [debug] #1 native CallLocalFunction () from samp03svr
[18:10:10] [debug] #2 0003c25c in public OnPlayerCommandText (playerid=9, cmdtext[]=@0155f81c "/attack") at D:\gamemode\pawno\include\zcmd.inc:102
Reply


Messages In This Thread
Array index out of bonus - by RedGun2015 - 15.12.2017, 15:54
Re: Array index out of bonus - by Konstantinos - 15.12.2017, 16:49
Re: Array index out of bonus - by RedGun2015 - 15.12.2017, 17:37
Re: Array index out of bonus - by Konstantinos - 15.12.2017, 18:42
Re: Array index out of bonus - by None1337 - 15.12.2017, 19:22
Re: Array index out of bonus - by RedGun2015 - 15.12.2017, 19:34
Re: Array index out of bonus - by Konstantinos - 16.12.2017, 08:59
Re: Array index out of bonus - by RedGun2015 - 16.12.2017, 10:35
Re: Array index out of bonus - by raydx - 16.12.2017, 10:59
Re: Array index out of bonus - by RedGun2015 - 16.12.2017, 14:03

Forum Jump:


Users browsing this thread: 1 Guest(s)