06.01.2015, 13:24
Please help me with this.
Код:
[15:04:39] [debug] Accessing element at index 51 past array upper bound 49 [15:04:39] [debug] AMX backtrace: [15:04:39] [debug] #0 001b84b0 in public cmd_zavrsipoziv (0x00000000, 0x0085b1d4) from nr-rp.amx [15:04:39] [debug] #1 001b80c0 in public cmd_hangup (0x00000000, 0x0085b1d4) from nr-rp.amx [15:04:39] [debug] #2 native CallLocalFunction () [00472ad0] from samp-server.exe [15:04:39] [debug] #3 000015a8 in public OnPlayerCommandText (0x00000000, 0x0085b1b4) from nr-rp.amx [15:04:40] [debug] Run time error 4: "Array index out of bounds"
Код:
CMD:hangup(playerid, params[]) return cmd_zavrsipoziv(playerid, params); CMD:zavrsipoziv(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pJailed] == 1) { SCM(playerid,COLOR_GRAD1,"Ne mozete koristiti tu komandu kad ste u zatvoru!"); return 1; } new caller = Mobile[playerid]; if(IsPlayerConnected(caller)) { if(caller != INVALID_PLAYER_ID) { if(caller != MAX_PLAYERS+1) { if(caller < MAX_PLAYERS+1) { SendClientMessage(caller, COLOR_GRAD2, "Prekinuo je."); CellTime[caller] = 0; CellTime[playerid] = 0; SendClientMessage(playerid, COLOR_GRAD2, "Prekinuli ste."); Mobile[caller] = MAX_PLAYERS+1; } Mobile[playerid] = MAX_PLAYERS+1; CellTime[playerid] = 0; RingTone[playerid] = 0; PlayerInfo[playerid][pSpeaker] = 0; UnidentifedCall[playerid] = 0; } } else { SendClientMessage(playerid, COLOR_GRAD2, "Telefon vam je u dzepu."); return 1; } } SendClientMessage(caller, COLOR_GRAD2, "Prekinuo je."); Mobile[caller] = MAX_PLAYERS+1; JBC_SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE); } return 1; }