24.11.2013, 15:21
Something is wrong. I hope someone solve this.
Line 6113
Код:
[20:20:36] [debug] Run time error 4: "Array index out of bounds" [20:20:36] [debug] Accessing element at index 65535 past array upper bound 499 [20:20:36] [debug] AMX backtrace: [20:20:36] [debug] #0 0004bac4 in public cmd_report (playerid=0, params[]=@0x0004dadc "1 23") at 6113 [20:20:36] [debug] #1 native CallLocalFunction () [00471ef0] from samp-server.exe [20:20:36] [debug] #2 00007228 in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x0004daa8 "/report 1 23") at pawno\include\zcmd.inc:110
Quote:
PlayerInfo[player][ReportCount]++; |
Код:
COMMAND:report(playerid,params[]) //level0 { new player, reason[128]; if(sscanf(params, "rs[128]", player, reason)) { return GameTextForPlayer(playerid, "~g~/report ~w~<id/name> <reason>", 3000, 3); } PlayerInfo[player][ReportCount]++; if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID && player != playerid && PlayerInfo[player][AdminLevel] == 0) { if(strlen(reason) < 2) { GameTextForPlayer(playerid, "~r~Write a valid reason", 3000, 3); return 1; } new hour,minute,second, string[128]; gettime(hour,minute,second); format(string, sizeof(string), "[REPORT]: %s(%d) has reported %s(%d) (Reason: %s) |@%d:%d:%d|", GetName(playerid), playerid, GetName(player), player, reason, hour, minute, second); AdminMSG(RED,string); format(string, sizeof(string), "Report(%d:%d:%d): %s(%d) reported %s(%d) Reason: %s", hour, minute, second, GetName(playerid), playerid, GetName(player), player, reason); for(new i = 1; i < MAX_REPORTS-1; i++) Reports[i] = Reports[i+1]; Reports[MAX_REPORTS-1] = string; GameTextForPlayer(playerid, "~g~Report has been sent", 3000, 3); } else { GameTextForPlayer(playerid, "~r~Player is unavailable", 3000, 3); } return 1; }