Why do i get this?
#1

Код:
[01:32:29] [debug] Run time error 4: "Array index out of bounds"
[01:32:29] [debug]  Accessing element at negative index -1
[01:32:29] [debug] AMX backtrace:
[01:32:29] [debug] #0 0000d3cc in ?? (0xffffffff) from Test.amx
[01:32:29] [debug] #1 00028ec4 in ?? (0x00000000) from Test.amx
[01:32:29] [debug] #2 0002243c in public Streamer_OnPlayerDisconnect (0x00000000, 0x00000001) from Test.amx
[01:32:29] [debug] #3 00015c00 in public SSCANF_OnPlayerDisconnect (0x00000000, 0x00000001) from Test.amx
[01:32:29] [debug] #4 0001009c in ?? (0x00000000, 0x00000001) from Test.amx
[01:32:29] [debug] #5 000052e4 in public OnPlayerDisconnect (0x00000000, 0x00000001) from Test.amx
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{

    SavePlayerData(playerid);
    new string[80],string0[80],pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    new DisconnectReason[3][] = {"Klaida","Isejo","Kick/Ban"};
    format(string, sizeof string, ""TCYELLOW"%s "TCCYAN"isejo is serverio["TCRED"%s""TCCYAN]", pName, DisconnectReason[reason]);
    format(string0, sizeof string0, "%s paliko serveri [%s]", pName, DisconnectReason[reason]);
    SendClientMessageToAll(COL_RED, string);
    print(string0);
    return 1;
}
Reply
#2

Update your streamer plugin and include
Reply
#3

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    SavePlayerData(playerid);
    new string[90], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    new DisconnectReason[10];
    DisconnectReason = (!reason) ? ("Klaida") : ((reason == 1) ? ("Isejo") : ("Kick/Ban"));
    format(string, sizeof(string), ""TCYELLOW"%s "TCCYAN"isejo is serverio["TCRED"%s"TCCYAN"]", pName, DisconnectReason);
    SendClientMessageToAll(COL_RED, string);
    format(string, sizeof(string), "%s paliko serveri [%s]", pName, DisconnectReason);
    print(string);
    return 1;
}
If this doesn't solve it, the issue may be in SavePlayerData.
Reply


Forum Jump:


Users browsing this thread: