Servers is Crashing [Crash detect included]
#1

This is the eror:
Код:
[15:35:30] [debug] Run time error 4: "Array index out of bounds"
[15:35:30] [debug]  Accessing element at index 65535 past array upper bound 500
[15:35:30] [debug] AMX backtrace:
[15:35:30] [debug] #0 0007f03c in public S@@_OnPlayerDeath (playerid=0, killerid=65535, reason=54) at D:\Players\Developent\UGRP.pwn:10617
[15:35:30] [death] Cristiano_El_Caprio died 54
[15:35:37] [debug] Server crashed while executing UGRP.amx
[15:35:37] [debug] AMX backtrace:
[15:35:37] [debug] #0 ???????? in ?? ()
[15:35:37] [debug] System backtrace:
Reply
#2

show us/me your GM line 65545

to do this click edit on the top left corner > goto ? line number
Reply
#3

Quote:
Originally Posted by Jacob756
Посмотреть сообщение
show us/me your GM line 65545

to do this click edit on the top left corner > goto ? line number
This
pawn Код:
else if(strcmp(choice,"pot",true) == 0)
        {
            if(IsPlayerConnected(giveplayerid))
            {
                if (ProxDetectorS(8.0, playerid, giveplayerid))
                {
                    format(string, sizeof(string), "* You have taken away %s's pot.", GetPlayerNameEx(giveplayerid));
                    SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "* Officer %s has taken away your pot.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                    SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "* Officer %s has taken away %s's pot.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    PlayerInfo[giveplayerid][pPot] = 0;
                }
                else
                {
                    SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
                    return 1;
                }
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
                return 1;
            }
        }
Reply
#4

Ignore the above comment.

The problem is in OnPlayerDeath callback. The killerid is INVALID_PLAYER_ID (65535) so that means that the player died himself and you used "killerid" in array(s) which is out of bounds (that index). The line is 10617 but you can fix it easier by doing this:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if (killerid != INVALID_PLAYER_ID)
    {
        // code..
        // here you can use "killerid" in arrays and to send them messages/gametext, give money/score or whatever
    }
    return 1;
}
Reply
#5

Now its doing only this:

Quote:

[16:09:10] [debug] Server crashed while executing UGRP.amx
[16:09:10] [debug] AMX backtrace:
[16:09:10] [debug] #0 ?? in ?? ()
[16:09:10] [debug] System backtrace:

Reply
#6

help?
Reply
#7

helpo
Reply
#8

Compile your scripts with debug info and make sure the version of crashdetect plugin is the latest one (4.13.1). After another server crash, it should also print the last function was called and probably the line too.
Reply
#9

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Compile your scripts with debug info and make sure the version of crashdetect plugin is the latest one (4.13.1). After another server crash, it should also print the last function was called and probably the line too.
Its with -d3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)