[Pomoc] Novi problem za padanje

Započeo FarkiAs, Avgust 08, 2013, 14:34:45 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

FarkiAs

Skripta moja od 0
opis problema: ovo mi sada izbacuje crashdetector u server.log-u

[14:18:16] [debug]  Accessing element at index 65535 past array upper bound 69
[14:18:16] [debug] AMX backtrace:
[14:18:16] [debug] #0 00159598 in public OnPlayerDeath () from SSRP.amx
[14:18:16] [death] Edward_Shelleti died 255
[14:18:32] [debug] Run time error 4: "Array index out of bounds"


Dio skripte: dam sta vam treba

U OnPlayerDeath callbacku pristupaÅ¡  nepostojećem elementu u arrayu. Recimo koristiÅ¡ -1 za pristupanje nekom elementu u arrayu.

Last nick: Paradox

FarkiAs

evo, gdje je ovdje taj problem.

/////////////////////////////////////////////////////////////////////////////////////////////
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pUbistava]++; PlayerInfo[playerid][pSmrti]++;
    ResetPlayerWeapons(playerid); ResetujVar(playerid);
    ////////////////////////////////////////////////////////////
    /*if(IgracPolicajac(killerid) || IgracUWaru[killerid] == 1)
    {
      PlayerInfo[killerid][pTrazeniLevel] = 0;
      SetPlayerWantedLevel(killerid,0);
    }
*/
////////////////////////////////////////////////////////////
if(ecp[playerid] != 0)
{
Prisustvuje[playerid] = false;
vorcp[playerid] = 0;
}
////////////////////////////////////////////////////////////
    /*if(!IgracPolicajac(killerid) || IgracUWaru[killerid] == 0 && IsPlayerConnected(playerid))
{
PostaviWanted(killerid, "Ubistvo", "Nepoznat");
}

////////////////////////////////////////////////////////////
if(GetPlayerWantedLevel(killerid) > 6)
{
SetPlayerWantedLevel(killerid, 6);
PlayerInfo[killerid][pTrazeniLevel] = 6;
}
    ////////////////////////////////////////////////////////////
    if(IgracUWaru[killerid] == 0)
    {
    if(GetPlayerWantedLevel(playerid) > 0)
{
    new string[256];
g_NovacMinus(playerid, GetPlayerWantedLevel(playerid)*400);
SCMF(playerid, -1, ""ZUTA"[INFO] "CRVENA"Izgubili ste %d$ zbog umiranja sa wanted level-om "ZUTA"%d!", GetPlayerWantedLevel(playerid)*400, GetPlayerWantedLevel(playerid));
SetPlayerWantedLevel(playerid, 0); PlayerInfo[playerid][pTrazeniLevel] = 0;
    format(string,sizeof(string),""CRVENA"[AC] "SIVA"Igrac %s je ubijen/se ubio sa wanted level-om!",GetName(playerid));
AdminGameMaster(-1,string);
    }
    }
    */
    ////////////////////////////////////////////////////////////
/*if(IsPlayerConnected(killerid) && GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
    new string[256];
format(string,sizeof(string), ""CRVENA"[AC Anti DB] "SIVA"Igrac %s (ID:%d) je uradio Drive By nad igracem %s (ID:%d)!", GetName(killerid), killerid, GetName(playerid), playerid);
    AdminGameMaster(-1, string);
}
////////////////////////////////////////////////////////////
if(IsPlayerConnected(killerid) && PlayerInfo[playerid][pLevel] >= 1)
{
    new string[256];
format(string,sizeof(string), ""CRVENA"[AC AK] "SIVA"Igrac %s (ID:%d) je ubio igraca %s (ID:%d)", GetName(killerid), killerid, GetName(playerid), playerid);
AdminGameMaster(-1, string);
}
*/
////////////////////////////////////////////////////////////
if(gPlayerUsingLoopingAnim[playerid])
{
gPlayerUsingLoopingAnim[playerid] = 0;
}
/////////////////////////////////////////////////////////////
if(IsPlayerConnected(killerid) && WarAktivan == true && IgracUWaru[playerid] == 1 && IgracUWaru[killerid] == 1)
{
WarUbistava[killerid]++;
WarSmrti[playerid]++;
    new ss[5],xs[128];
    if(PlayerInfo[playerid][pClan] == PlayerInfo[killerid][pClan])
    {
        if(PlayerInfo[killerid][pClan] == WarTim1)
        {
        Tim1Skor -= 1;
format(ss, sizeof ss, "%d", Tim1Skor);
        TextDrawSetString(WarTD4, ss);
}
else
{
        Tim2Skor -= 1;
        format(ss, sizeof ss, "%d", Tim2Skor);
        TextDrawSetString(WarTD5, ss);
}
        format(xs, sizeof(xs), "(war) %s je ubio svog saigraca %s, te je njegov tim dobio -1 poen.", GetName(killerid), GetName(playerid));
        WarPoruka(0x800080FF, xs);
}
    if(PlayerInfo[killerid][pClan] == WarTim1 && PlayerInfo[playerid][pClan] == WarTim2)
    {
        Tim1Skor++;
        format(ss, sizeof ss, "%d", Tim1Skor);
        TextDrawSetString(WarTD4, ss);
        format(xs, sizeof(xs), "(war) %s je ubio protivnika %s.", GetName(killerid), GetName(playerid));
        WarPoruka(0x800080FF, xs);
}
    else if(PlayerInfo[killerid][pClan] == WarTim2 && PlayerInfo[playerid][pClan] == WarTim1)
    {
        Tim2Skor++;
        format(ss, sizeof ss, "%d", Tim2Skor);
        TextDrawSetString(WarTD5, ss);
        format(xs, sizeof(xs), "(war) %s je ubio protivnika %s.", GetName(killerid), GetName(playerid));
        WarPoruka(0x800080FF, xs);
}
}
SpawnIgraca(playerid);
////////////////////////////////////////////////////////////
    return 1;
}

FarkiAs

sory za dp ovo mi je isto izbacilo u server.log

[23:13:41] [debug] #8 080ad242 in ?? () from ./samp03svr
[23:13:41] [debug] #9 080b8281 in ?? () from ./samp03svr
[23:13:41] [debug] #10 08071ae8 in ?? () from ./samp03svr
[23:13:41] [debug] #11 08071be2 in ?? () from ./samp03svr
[23:13:41] [debug] #12 0807ba00 in ?? () from ./samp03svr
[23:13:41] [debug] #13 080b59ad in ?? () from ./samp03svr
[23:13:41] [debug] #14 080b5b42 in ?? () from ./samp03svr
[23:13:41] [debug] #15 080b1453 in ?? () from ./samp03svr
[23:13:41] [debug] #16 b7505e9c in __libc_start_main () from /lib/libc.so.6
[23:13:41] [debug] #17 0804b521 in ?? () from ./samp03svr

Citat: punisheR 7474 poslato Avgust 08, 2013, 22:48:49 POSLE PODNE
evo, gdje je ovdje taj problem.

/////////////////////////////////////////////////////////////////////////////////////////////
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pUbistava]++; PlayerInfo[playerid][pSmrti]++;
    ResetPlayerWeapons(playerid); ResetujVar(playerid);
    ////////////////////////////////////////////////////////////
    /*if(IgracPolicajac(killerid) || IgracUWaru[killerid] == 1)
    {
      PlayerInfo[killerid][pTrazeniLevel] = 0;
      SetPlayerWantedLevel(killerid,0);
    }
*/
////////////////////////////////////////////////////////////
if(ecp[playerid] != 0)
{
Prisustvuje[playerid] = false;
vorcp[playerid] = 0;
}
////////////////////////////////////////////////////////////
    /*if(!IgracPolicajac(killerid) || IgracUWaru[killerid] == 0 && IsPlayerConnected(playerid))
{
PostaviWanted(killerid, "Ubistvo", "Nepoznat");
}

////////////////////////////////////////////////////////////
if(GetPlayerWantedLevel(killerid) > 6)
{
SetPlayerWantedLevel(killerid, 6);
PlayerInfo[killerid][pTrazeniLevel] = 6;
}
    ////////////////////////////////////////////////////////////
    if(IgracUWaru[killerid] == 0)
    {
    if(GetPlayerWantedLevel(playerid) > 0)
{
    new string[256];
g_NovacMinus(playerid, GetPlayerWantedLevel(playerid)*400);
SCMF(playerid, -1, ""ZUTA"[INFO] "CRVENA"Izgubili ste %d$ zbog umiranja sa wanted level-om "ZUTA"%d!", GetPlayerWantedLevel(playerid)*400, GetPlayerWantedLevel(playerid));
SetPlayerWantedLevel(playerid, 0); PlayerInfo[playerid][pTrazeniLevel] = 0;
    format(string,sizeof(string),""CRVENA"[AC] "SIVA"Igrac %s je ubijen/se ubio sa wanted level-om!",GetName(playerid));
AdminGameMaster(-1,string);
    }
    }
    */
    ////////////////////////////////////////////////////////////
/*if(IsPlayerConnected(killerid) && GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
    new string[256];
format(string,sizeof(string), ""CRVENA"[AC Anti DB] "SIVA"Igrac %s (ID:%d) je uradio Drive By nad igracem %s (ID:%d)!", GetName(killerid), killerid, GetName(playerid), playerid);
    AdminGameMaster(-1, string);
}
////////////////////////////////////////////////////////////
if(IsPlayerConnected(killerid) && PlayerInfo[playerid][pLevel] >= 1)
{
    new string[256];
format(string,sizeof(string), ""CRVENA"[AC AK] "SIVA"Igrac %s (ID:%d) je ubio igraca %s (ID:%d)", GetName(killerid), killerid, GetName(playerid), playerid);
AdminGameMaster(-1, string);
}
*/
////////////////////////////////////////////////////////////
if(gPlayerUsingLoopingAnim[playerid])
{
gPlayerUsingLoopingAnim[playerid] = 0;
}
/////////////////////////////////////////////////////////////
if(IsPlayerConnected(killerid) && WarAktivan == true && IgracUWaru[playerid] == 1 && IgracUWaru[killerid] == 1)
{
WarUbistava[killerid]++;
WarSmrti[playerid]++;
    new ss[5],xs[128];
    if(PlayerInfo[playerid][pClan] == PlayerInfo[killerid][pClan])
    {
        if(PlayerInfo[killerid][pClan] == WarTim1)
        {
        Tim1Skor -= 1;
format(ss, sizeof ss, "%d", Tim1Skor);
        TextDrawSetString(WarTD4, ss);
}
else
{
        Tim2Skor -= 1;
        format(ss, sizeof ss, "%d", Tim2Skor);
        TextDrawSetString(WarTD5, ss);
}
        format(xs, sizeof(xs), "(war) %s je ubio svog saigraca %s, te je njegov tim dobio -1 poen.", GetName(killerid), GetName(playerid));
        WarPoruka(0x800080FF, xs);
}
    if(PlayerInfo[killerid][pClan] == WarTim1 && PlayerInfo[playerid][pClan] == WarTim2)
    {
        Tim1Skor++;
        format(ss, sizeof ss, "%d", Tim1Skor);
        TextDrawSetString(WarTD4, ss);
        format(xs, sizeof(xs), "(war) %s je ubio protivnika %s.", GetName(killerid), GetName(playerid));
        WarPoruka(0x800080FF, xs);
}
    else if(PlayerInfo[killerid][pClan] == WarTim2 && PlayerInfo[playerid][pClan] == WarTim1)
    {
        Tim2Skor++;
        format(ss, sizeof ss, "%d", Tim2Skor);
        TextDrawSetString(WarTD5, ss);
        format(xs, sizeof(xs), "(war) %s je ubio protivnika %s.", GetName(killerid), GetName(playerid));
        WarPoruka(0x800080FF, xs);
}
}
SpawnIgraca(playerid);
////////////////////////////////////////////////////////////
    return 1;
}


zasto koristis string od 256 a ne iskoristis ni pola, a 128 je najvece tako da djabe ti zauzima memoriu
Other Dimension RolePlay | Uskoro
Ukoliko zelite pomoci u razvoju servera, mozete se meni javit na PP/PM!