[POMOC]CRASH

Započeo xLanmi
27. Mar. 2016. Zaključano
404
pregleda
2
postova
marko077
6
Underboss
27. Mar. 2016.
Skripta koju koristim:Steel Series ili kako ja to volim da kazem:Moj edit UP-a Posto je dosta editovan
Detaljno objasnjenje problema:Ovako,imamm jedan problem kada pored neke mape prodjem prodje malo vremena dobijem crash,znaci tako pored spawna ili kad se killam ono cmd:kill pa kad umrem odma crash izaslo mi je u crashdetect samo ovo jedanput.
Sta mi je ispisalo:
[08:27:59] Run time error 4: "Array index out of bounds"
[08:27:59]   Accessing element at index 65535 past array upper bound 149
[08:27:59] AMX backtrace:
[08:27:59] #0 00375430 in ?? (65535) from SPuerto.amx
[08:27:59] #1 001c7868 in public OnPlayerDeath (0, 65535, 54) from SPuerto.amx
[08:29:43] Lanmi has left the server (0:0)

Dole cu vam ostaviti to onplayerdeath
Deo skripte:
public OnPlayerDeath(playerid, killerid, reason)
{
    antifakekill ++;
    SetTimerEx("antifakekill2", 1000,false,"i",playerid);
RemovePlayerAttachedObject(playerid,0);
RemovePlayerAttachedObject(playerid,1);
RemovePlayerAttachedObject(playerid,2);
RemovePlayerAttachedObject(playerid,3);
RemovePlayerAttachedObject(playerid,4);
RemovePlayerAttachedObject(playerid,5);
RemovePlayerAttachedObject(playerid,6);
RemovePlayerAttachedObject(playerid,7);
RemovePlayerAttachedObject(playerid,8);
RemovePlayerAttachedObject(playerid,9);
    SetPlayerArmour(playerid, 0);
    DisablePlayerCheckpoint(playerid);
PosaoGPS = 0;
    if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
    {
    PlayerInfo++; PlayerInfo++;
    ResetPlayerWeapons(playerid); ResetujVar(playerid);
    }
    ////////////////////////////////////////////////////////////
    if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
    {
if(IgracPolicajac(killerid))
{
PlayerInfo = 0;
SetPlayerWantedLevel(killerid,0);
SetPlayerColor(killerid,0xFFFFFF00);
}
if(IgracPolicajac(killerid))
{
PlayerInfo = 0;
SetPlayerWantedLevel(killerid,0);
SetPlayerColor(killerid,0xFFFFFF00);
}
    }
////////////////////////////////////////////////////////////
if(!IgracPolicajac(killerid) && IsPlayerConnected(playerid))
{
if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
    {
PostaviWanted(killerid, "Ubistvo", "Nepoznat");
}
    }
////////////////////////////////////////////////////////////
if(GetPlayerWantedLevel(killerid) > 6)
{
SetPlayerWantedLevel(killerid, 6);
PlayerInfo = 6;
}
////////////////////////////////////////////////////////////
if(GetPlayerWantedLevel(playerid) > 0)
{
    new string;
g_NovacMinus(playerid, GetPlayerWantedLevel(playerid)*3000);
SCMF(playerid, -1, ""ZUTA" "CRVENA"Izgubili ste %d$ zbog umiranja sa wanted level-om "ZUTA"%d!", GetPlayerWantedLevel(playerid)*3000, GetPlayerWantedLevel(playerid));
SetPlayerWantedLevel(playerid, 0); PlayerInfo = 0;
    format(string,sizeof(string),""ORANGE"(SF) "SIVA"Igrac %s je ubijen/se ubio sa wanted level-om!",GetName(playerid));
AdminHelper(-1,string);
format(string,sizeof(string),""ORANGE"(SF) "SIVA"Igrac %s je ubijen/se ubio sa wanted level-om!",GetName(playerid));
ChatPD(-1, string);
SetPlayerColor(playerid, BELA2);
    }
    ////////////////////////////////////////////////////////////
if(IsPlayerConnected(killerid) && GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
    new string;
format(string,sizeof(string), ""ORANGE"[RE Anti DB] "SIVA"Igrac %s (ID:%d) je uradio Drive By nad igracem %s (ID:%d)!", GetName(killerid), killerid, GetName(playerid), playerid);
    AdminHelper(-1, string);
    SetPlayerColor(killerid, COLOR_RED);
}
////////////////////////////////////////////////////////////
if(IsPlayerConnected(killerid) && PlayerInfo >= 1)
{
    new string;
format(string,sizeof(string), ""ORANGE"[RE AK] "SIVA"Igrac %s (ID:%d) je ubio igraca %s (ID:%d)", GetName(killerid), killerid, GetName(playerid), playerid);
AdminHelper(-1, string);
if(PlayerInfo >= 2 || PlayerInfo >= 2)
{
SetPlayerColor(killerid, COLOR_RED);
}
else if(PlayerInfo == 1 || PlayerInfo == 1)
{
SetPlayerColor(killerid, BELA2);
}
else if(PlayerInfo == 10 || PlayerInfo == 10)
{
SetPlayerColor(killerid, BELA2);
}
else if(PlayerInfo > 0 || PlayerInfo < 6)
{
SetPlayerColor(killerid, BELA2);
}
}
////////////////////////////////////////////////////////////
if(gPlayerUsingLoopingAnim)
{
gPlayerUsingLoopingAnim = 0;
}
////////////////////////////////////////////////////////////
    return 1;
}

Sta mi preporucujete,znaci kod vecina mapa se to desava.
Slika nesto://
Vuzimir
5
Kingpin
27. Mar. 2016.
Ovako, to sto za spawn kresuje moze biti do bilo kojeg objekta... a ovo pod onplayerdeath ovako dodaj:
public OnPlayerDeath(playerid, killerid, reason)
{
    antifakekill ++;
    SetTimerEx("antifakekill2", 1000,false,"i",playerid);
for(new i=0; i        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
        }
    SetPlayerArmour(playerid, 0);
    DisablePlayerCheckpoint(playerid);
PosaoGPS = 0;
    if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
    {
    PlayerInfo++; PlayerInfo++;
    ResetPlayerWeapons(playerid); ResetujVar(playerid);
    }
    ////////////////////////////////////////////////////////////
    if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
    {
if(IgracPolicajac(killerid))
{
PlayerInfo = 0;
SetPlayerWantedLevel(killerid,0);
SetPlayerColor(killerid,0xFFFFFF00);
}
if(IgracPolicajac(killerid))
{
PlayerInfo = 0;
SetPlayerWantedLevel(killerid,0);
SetPlayerColor(killerid,0xFFFFFF00);
}
    }
////////////////////////////////////////////////////////////
if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
    {
if(IsPlayerConnected(playerid))
{
PostaviWanted(killerid, "Ubistvo", "Nepoznat");
}
    }
////////////////////////////////////////////////////////////
if(killerid != INVALID_PLAYER_ID)
{
if(GetPlayerWantedLevel(killerid) > 6)
{
SetPlayerWantedLevel(killerid, 6);
PlayerInfo = 6;
}
}
////////////////////////////////////////////////////////////
if(GetPlayerWantedLevel(playerid) > 0)
{
    new string;
g_NovacMinus(playerid, GetPlayerWantedLevel(playerid)*3000);
SCMF(playerid, -1, ""ZUTA" "CRVENA"Izgubili ste %d$ zbog umiranja sa wanted level-om "ZUTA"%d!", GetPlayerWantedLevel(playerid)*3000, GetPlayerWantedLevel(playerid));
SetPlayerWantedLevel(playerid, 0); PlayerInfo = 0;
    format(string,sizeof(string),""ORANGE"(SF) "SIVA"Igrac %s je ubijen/se ubio sa wanted level-om!",GetName(playerid));
AdminHelper(-1,string);
format(string,sizeof(string),""ORANGE"(SF) "SIVA"Igrac %s je ubijen/se ubio sa wanted level-om!",GetName(playerid));
ChatPD(-1, string);
SetPlayerColor(playerid, BELA2);
    }
    ////////////////////////////////////////////////////////////
if(IsPlayerConnected(killerid) && GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
{
    new string;
format(string,sizeof(string), ""ORANGE"[RE Anti DB] "SIVA"Igrac %s (ID:%d) je uradio Drive By nad igracem %s (ID:%d)!", GetName(killerid), killerid, GetName(playerid), playerid);
    AdminHelper(-1, string);
    SetPlayerColor(killerid, COLOR_RED);
}
////////////////////////////////////////////////////////////
if(IsPlayerConnected(killerid) && PlayerInfo >= 1)
{
    new string;
format(string,sizeof(string), ""ORANGE"[RE AK] "SIVA"Igrac %s (ID:%d) je ubio igraca %s (ID:%d)", GetName(killerid), killerid, GetName(playerid), playerid);
AdminHelper(-1, string);
if(PlayerInfo >= 2 || PlayerInfo >= 2)
{
SetPlayerColor(killerid, COLOR_RED);
}
else if(PlayerInfo == 1 || PlayerInfo == 1)
{
SetPlayerColor(killerid, BELA2);
}
else if(PlayerInfo == 10 || PlayerInfo == 10)
{
SetPlayerColor(killerid, BELA2);
}
else if(PlayerInfo > 0 || PlayerInfo < 6)
{
SetPlayerColor(killerid, BELA2);
}
}
////////////////////////////////////////////////////////////
if(gPlayerUsingLoopingAnim)
{
gPlayerUsingLoopingAnim = 0;
}
////////////////////////////////////////////////////////////
    return 1;
}


1.) Moguc crash zato sto si koristio RemovePlayerAttachedObject a nisi provjerio dali ima cakacen objekt tu
2.) Ako koristis killerid u variabli svojoj, ne smijes prvo to zvati, nego prvo dali je killerid sve osim INVADLI_PLAYER_ID...

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha