15.12.2017, 15:54
I have this problem on my command: /attack
Line:
getweekday function:
error:
Line:
Код:
if(GetWeekDay() == 1 || GetWeekDay() == 4 || GetWeekDay() == 6) return SCM(playerid, COLOR_WHITE,, "You can use this command only Monday, Wednesday, Friday and Sunday.");
Код:
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;
}
Код:
[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


