Crashdetect - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Crashdetect (
/showthread.php?tid=555045)
Crashdetect -
CloW - 06.01.2015
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;
}
Re: Crashdetect -
ball - 06.01.2015
Код:
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;
}
}
//Here, player isn't connected but you use something like Mobile[MAX_PLAYERS + 1] = MAX_PLAYERS + 1; - edit it
SendClientMessage(caller, COLOR_GRAD2, "Prekinuo je.");
Mobile[caller] = MAX_PLAYERS+1;
JBC_SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
}
return 1;
}
Edit where i wrote.
Re: Crashdetect -
CloW - 06.01.2015
Thank you,i fix this.