AMX backtrace
#1

Hallo Guys I have problem with "Array index out of bounds" I don't know how to repair this problem.

My Server_log:

PHP Code:
[12:59:30] [debugRun time error 4"Array index out of bounds"
[12:59:30] [debug]  Accessing element at negative index -1
[12:59:30] [debugAMX backtrace:
[
12:59:30] [debug#0 00025cc8 in ?? (0) from gamemode.amx
[12:59:30] [debug#1 0004cb28 in public OnPlayerTakeDamage (0, 65535, 1079194420, 54, 3) from gamemode.amx
[12:59:30] [debugRun time error 4"Array index out of bounds"
[12:59:30] [debug]  Accessing element at negative index -1
[12:59:30] [debugAMX backtrace:
[
12:59:30] [debug#0 00025cc8 in ?? (0) from gamemode.amx
[12:59:30] [debug#1 000f5790 in public TimerCoSekunde () from gamemode.amx
[12:59:31] [debugRun time error 4"Array index out of bounds"
[12:59:31] [debug]  Accessing element at negative index -1
[12:59:31] [debugAMX backtrace:
[
12:59:31] [debug#0 00025cc8 in ?? (0) from gamemode.amx
[12:59:31] [debug#1 000f5790 in public TimerCoSekunde () from gamemode.amx
[12:59:32] [cmdl][admRyan Conin: /bw
[12:59:32] [debugRun time error 4"Array index out of bounds"
[12:59:32] [debug]  Accessing element at negative index -1
[12:59:32] [debugAMX backtrace:
[
12:59:32] [debug#0 00025cc8 in ?? (0) from gamemode.amx
[12:59:32] [debug#1 000f5790 in public TimerCoSekunde () from gamemode.amx
[12:59:34] [debugRun time error 4"Array index out of bounds"
[12:59:34] [debug]  Accessing element at negative index -1
[12:59:34] [debugAMX backtrace:
[
12:59:34] [debug#0 00025cc8 in ?? (0) from gamemode.amx
[12:59:34] [debug#1 000f5790 in public TimerCoSekunde () from gamemode.amx
[12:59:35] [debugRun time error 4"Array index out of bounds"
[12:59:35] [debug]  Accessing element at negative index -1
[12:59:35] [debugAMX backtrace:
[
12:59:35] [debug#0 00025cc8 in ?? (0) from gamemode.amx
[12:59:35] [debug#1 000f5790 in public TimerCoSekunde () from gamemode.amx 
And to my public function:

public OnPlayerTakeDamage

PHP Code:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    new 
Float:armouranimka;
    
GetPlayerArmour(playeridarmouranimka);
    if(
amount>=0)
    {
        if(
Zalogowany[playerid]==true)
        {
            
Update3DTextLabelText(pNick[playerid], CLR_REDpName(playerid));
            
SetTimerEx("TextDraw"40000"u"playerid);
        }
    }
    if(
IsPlayerConnected(playerid) && PlayerInfo[playerid][pBW]>= 1)
    {
        
dDodajHP(playerid,amount);
        return 
1;
    }
    new 
Float:health;
    
GetPlayerHealth(playerid,health);
    if(
weaponid==0&&PlayerInfo[issuerid][pGodziny]<2)
    {
        
dDodajHP(playerid,amount);
        
format(Stringsizeof(String), "~w~Nie zrobisz krzywdy ~r~%s~w~, poniewaz nie masz przegranych 2 godzin.",Nick(playerid));
        
InfoBox(issuerid,String,4000);
        
format(Stringsizeof(String), "~r~%s~w~ nie zrobi Ci krzywdy, poniewaz jego postac nie ma 2 godzin online.",Nick(issuerid));
        
InfoBox(playerid,String,4000);//TD
        
return 1;
    }
    
//Obrażenia
    
if(weaponid==1){dDodajHP(playerid,-2);}
    if(
weaponid==2){dDodajHP(playerid,-10);}
    if(
weaponid==3){dDodajHP(playerid,-15);}
    if(
weaponid==4){dDodajHP(playerid,-20);}
    if(
weaponid==5){dDodajHP(playerid,-15);}
    if(
weaponid==6){dDodajHP(playerid,-10);}
    if(
weaponid==7){dDodajHP(playerid,-10);}
    if(
weaponid==8){dDodajHP(playerid,-25);}
    if(
weaponid==22){dDodajHP(playerid,-17);}
    if(
weaponid==23){dDodajHP(playerid,-15);}
    if(
weaponid==24){dDodajHP(playerid,-25);}
    if(
weaponid==25){dDodajHP(playerid,-35);}
    if(
weaponid==26){dDodajHP(playerid,-30);}
    if(
weaponid==27){dDodajHP(playerid,-30);}
    if(
weaponid==28){dDodajHP(playerid,-13);}
    if(
weaponid==29){dDodajHP(playerid,-18);}
    if(
weaponid==30){dDodajHP(playerid,-25);}
    if(
weaponid==31){dDodajHP(playerid,-22);}
    if(
weaponid==32){dDodajHP(playerid,-13);}
    if(
weaponid==33){dDodajHP(playerid,-45);}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 3100&&PlayerInfo[issuerid][pSila] <= 3199){dDodajHP(playerid,-1);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 3200&&PlayerInfo[issuerid][pSila] <= 3299){dDodajHP(playerid,-2);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 3300&&PlayerInfo[issuerid][pSila] <= 3399){dDodajHP(playerid,-4);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 3400&&PlayerInfo[issuerid][pSila] <= 3499){dDodajHP(playerid,-6);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 3500&&PlayerInfo[issuerid][pSila] <= 3599){dDodajHP(playerid,-7);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 3600&&PlayerInfo[issuerid][pSila] <= 3699){dDodajHP(playerid,-8);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 3700&&PlayerInfo[issuerid][pSila] <= 3799){dDodajHP(playerid,-11);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 3800&&PlayerInfo[issuerid][pSila] <= 3899){dDodajHP(playerid,-14);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 3900&&PlayerInfo[issuerid][pSila] <= 3999){dDodajHP(playerid,-17);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 4000&&PlayerInfo[issuerid][pSila] <= 4099){dDodajHP(playerid,-19);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 4100&&PlayerInfo[issuerid][pSila] <= 4199){dDodajHP(playerid,-19);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 4200&&PlayerInfo[issuerid][pSila] <= 4299){dDodajHP(playerid,-20);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 4300&&PlayerInfo[issuerid][pSila] <= 4399){dDodajHP(playerid,-21);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 4400&&PlayerInfo[issuerid][pSila] <= 4499){dDodajHP(playerid,-22);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 4500&&PlayerInfo[issuerid][pSila] <= 4599){dDodajHP(playerid,-23);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 4600&&PlayerInfo[issuerid][pSila] <= 4699){dDodajHP(playerid,-24);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 4700&&PlayerInfo[issuerid][pSila] <= 4799){dDodajHP(playerid,-25);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 4800&&PlayerInfo[issuerid][pSila] <= 4899){dDodajHP(playerid,-26);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 4900&&PlayerInfo[issuerid][pSila] <= 4999){dDodajHP(playerid,-27);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 5000&&PlayerInfo[issuerid][pSila] <= 5099){dDodajHP(playerid,-28);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 5100&&PlayerInfo[issuerid][pSila] <= 5199){dDodajHP(playerid,-29);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 5200&&PlayerInfo[issuerid][pSila] <= 5299){dDodajHP(playerid,-30);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 5300&&PlayerInfo[issuerid][pSila] <= 5399){dDodajHP(playerid,-31);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 5400&&PlayerInfo[issuerid][pSila] <= 5499){dDodajHP(playerid,-32);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 5500&&PlayerInfo[issuerid][pSila] <= 5599){dDodajHP(playerid,-32);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 5600&&PlayerInfo[issuerid][pSila] <= 5699){dDodajHP(playerid,-33);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 5700&&PlayerInfo[issuerid][pSila] <= 5799){dDodajHP(playerid,-34);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 5800&&PlayerInfo[issuerid][pSila] <= 5899){dDodajHP(playerid,-35);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 5900&&PlayerInfo[issuerid][pSila] <= 5999){dDodajHP(playerid,-36);}}
    if(
weaponid==0){if(PlayerInfo[issuerid][pSila] >= 6000){dDodajHP(playerid,-37);}}
    if(
weaponid == 23)
    {
        if(
Zalogowany[playerid])
        {
            if(
GrupaTypPracownik(issuerid0)==-1) return 1;
            
dDodajHP(playerid,amount);
            if(
GetPVarInt(playerid"AnimkaPostrzal") == 1) return 1;
            if(!
OdlegloscGracze(10.0playeridissuerid)) return 1;
            
SetTimerEx("tazer",200000"d"playerid);
            
PlayerPlaySound(playerid11900.00.00.0);
            
SetTimerEx("TextDraw"15000"u"playerid);
            
Unfreeze(playerid,20);
            
ApplyAnimation(playerid,"ped","KO_shot_stom",4.1,0,0,0,1,0);
            
format(Stringsizeof(String), "~y~~h~Sparalizowales %s"NickA(playerid));
            
GameInfo(issuerid,String,5);
            return 
1;
        }
    }
    if(
weaponid >=20&&weaponid <=33)
    {
        if(
issuerid != INVALID_PLAYER_ID && bodypart==BODY_PART_HEAD)
        {
            if(!
OdlegloscGracze(35.0playeridissuerid)) return 1;
            if(
GetPVarInt(playerid"AnimkaPostrzalGlowa") == 1) return 1;
            
ApplyAnimation(playerid,"ped","KO_shot_stom",4.1,0,0,0,1,0);
            
SetPVarInt(playerid"AnimkaPostrzalGlowa"1);
            
SetPVarInt(playerid"AnimkaPostrzal"1);
            
TextDrawShowForPlayer(playeridKrew);
            
SetTimerEx("Postrzal"400000"u"playerid);
            
SetTimerEx("TextDraw"40000"u"playerid);
            
format(Stringsizeof(String),"%s otrzymał pocisk w głowe z broni palnej. Z okolic głowy można dostrzec silne krwawienie.",NickA(playerid));
            
WyswietlText(playerid,KOLOR_DO,10.0,String);
            
//TextInfoDrzwi(playerid,"Twoj /opis ulegl ~r~zmianie ~w~- od teraz wyswietli sie tam informacja, ze ~r~otrzymales ~w~obrazenia w glowe.",9000);
            
return 1;
        }
    }
    if(
weaponid >=20&&weaponid <=33)
    {
        if(
armouranimka <=19)
        {
            if(!
OdlegloscGracze(20.0playeridissuerid)) return 1;
            if(
GetPVarInt(playerid"AnimkaPostrzal") == 1) return 1;
            if(
GetPVarInt(playerid"AnimkaPostrzalGlowa") == 1) return 1;
            
ApplyAnimation(playerid"CRACK""crckidle1",4.1,0,0,0,1,0);
            
SetPVarInt(playerid"AnimkaPostrzal"1);
            
TextDrawShowForPlayer(playeridKrew);
            
SetTimerEx("Postrzal"200000"u"playerid);
            
SetTimerEx("TextDraw"40000"u"playerid);
            return 
1;
            }else{
            if(
armouranimka >=19)
            {
                switch(
random(2)+1)
                {
                    case 
1:
                    {
                        if(!
OdlegloscGracze(20.0playeridissuerid)) return 1;
                        if(
GetPVarInt(playerid"AnimkaPostrzal") == 1) return 1;
                        
ApplyAnimation(playerid"CRACK""crckidle1",4.1,0,0,0,1,0);
                        
SetPVarInt(playerid"AnimkaPostrzal"1);
                        
TextDrawShowForPlayer(playeridKrew);
                        
SetTimerEx("Postrzal"200000"u"playerid);
                        
SetTimerEx("TextDraw"40000"u"playerid);
                        return 
1;
                    }
                    case 
2:
                    {
                        return 
TextInfoDrzwi(playerid,"Pocisk nie przebil kamizelki!",4500);
                    }
                }
            }
        }
    }
    return 
1;

public TimerCoSekunde

PHP Code:
public TimerCoSekunde()
    {
        new 
h,m,s,Float:HP;
        
gettime(h,m,s);
        
Data();
        
        if(
== && == && == 0)
        {
            
format(Stringsizeof(String), "[ Sesja %02d:%02d:%02d ] Maks. graczy: %02d/%d | Aktualna ilosc graczy: %02d/%d | Ilosc logowan: %d",Dzien,Miesiac,Rok,DayPlayers,MAX_PLAYERSGraczeOnline(),MAX_PLAYERSDayLogin);
            
SerwerLog(String);
            
DayLogin 0;
            
DayPlayers 0;
        }
        
/////////////////////////////////////////////////
        
foreach(Playeri)
        
/////////////////////////////////////////////////////
        
if(== && == 0)
        {
            
SerwerLog("Godzina 4:00 - Restart maszyny.");
            
SetTimer("WykonajGMX",3000,false);
            
GameTextForAll("~w~Godzina ~r~4~n~~w~Restart ~r~serwera",4000,6);
        }
        for(new 
nr 1nr LIMIT_POJAZDOWnr++){
            if(
SamochodInfo[nr][sAktywny]==true&&VehSpawn[nr]==1)
            {
                
GetVehicleDamageStatus(nr,SamochodInfo[nr][sUszkodzenia],SamochodInfo[nr][sUszkodzenia2],SamochodInfo[nr][sUszkodzenia3],SamochodInfo[nr][sUszkodzenia4]);
                
GetVehicleHealth(nrHP);
                
SamochodInfo[nr][sHP]=HP;
                
ZapiszPojazd(nr);
            }
        }
        if(
m==0&&s==0)
        {
            
format(Stringsizeof(String), "** W oddali słychać bicie dzwonуw w ratuszu %d razy. **",h);
            
SendClientMessageToAll(KOLOR_DOString);
            for(new 
nr 0nr LIMIT_OBIEKTOWnr++)
            {
                if(
BramaInfo[nr][bAktywny]==true && BramaInfo[nr][bObiekt] == 19473 && BramaInfo[nr][bN1] == 1)
                {
                    
BramaInfo[nr][bN2]++;
                    if(
BramaInfo[nr][bN2] == 24)
                    {
                        
DodajProdukt(9999,"Marihuana (1g)""-"620054521);
                        
BramaInfo[nr][bN2]=0;
                    }
                }
            }
        }
        
TextDrawSetString(Datowy"~r~WindCity~w~ "wersja"");
        
TextDrawShowForAll(Datowy);
        foreach(
Playeri)
        {
            
/*new string[64];
            if(GetPVarInt(i, "Sluzba")==1)
            {
                format(string, sizeof(string), "Duty: %s", GrupaNazwa(i, 1));
                TextDrawSetString(TextdrawDuty[i], string);
            }
            if(GetPVarInt(i, "Sluzba")==2)
            {
                format(string, sizeof(string), "Duty: %s", GrupaNazwa(i, 2));
                TextDrawSetString(TextdrawDuty[i], string);
            }
            if(GetPVarInt(i, "Sluzba")==3)
            {
                format(string, sizeof(string), "Duty: %s", GrupaNazwa(i, 3));
                TextDrawSetString(TextdrawDuty[i], string);
            }*/
            
new vehicleid=GetPlayerVehicleID(i);
            new 
vehid=GetPlayerVehicleID(i);
            
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            
SetPlayerScore(i,Global[i][gGS]);
            
GetVehicleHealth(vehicleidHP);
            if(
IsPlayerInAnyVehicle(i)&&GetPlayerState(i)==PLAYER_STATE_DRIVER){
                
Okupuje[i]=vehid;
                
Okupowany[vehid]=i;
            }
            
//Ograniczenia(i);
            
if(Zalogowany[i]==true)
            {
                
Update3DTextLabelText(pNick[i], CLR_NICKpName(i));
            }
            for(new 
nr 1nr LIMIT_POJAZDOWnr++){
                if(
Okupowany[vehid]!=MAX_PLAYERS&&Okupuje[i]!=vehid)
                {
                    
Okupowany[vehid]=0;
                }
                if(
engine==1&&HP<300)
                {
                    
SetVehicleHealth(vehicleid275.0);
                }
            }
            if(
PlayerInfo[i][pStamina]>100)
            {
                
PlayerInfo[i][pStamina]=100;
            }
            if(
GetPVarInt(i"kondycja") > 20)
            {
                
SetPVarInt(i"kondycja"0);
                
PlayerInfo[i][pKondycja]+=1;
                
            }
            
// Anty Cheat System
            
            // Anty money hack
            
            //    if(GetPlayerMoney(i)!=dKasa[i])
                //    {
                //        AC_BS_SetPlayerMoney(i);
                //        AC_BS_GivePlayerMoney(i,dKasa[i]);
                //    }
            // Anty dodawanie HP
            // Naliczanie przebiegu
            
            
if(GetPlayerState(i)==PLAYER_STATE_DRIVER)
            {
                
VehID=GetPlayerVehicleID(i);
                if(
GetVehicleModel(VehID)==481||GetVehicleModel(VehID)==509||GetVehicleModel(VehID)==510) return TextDrawHideForPlayer(iLicznik[i]);
                if(
engine)
                {
                    if(
GetPlayerSpeed(i) > 30){ VPrzebieg[VehID]+=0.012;}
                    
GetVehiclePos(VehID,dOstatniX[i],dOstatniY[i],dOstatniZ[i]);
                    
TextDrawHideForPlayer(iLicznik[i]);
                }
            }
            
// Kajdanki - przyciąganie gracza
            /*
            // Przyspieszenie przy wylacoznym silniku
            
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            if(IsPlayerInAnyVehicle(i) && !engine && GetPlayerSpeed(i)>=55)
            {
                format(String, sizeof(String),"Przyspieszenie przy wylaczonym silniku(%d km/h)(1h)",NickA(i),GetPlayerSpeed(i));
                Kara(0,i,-1,"Przyspieszenie przy wylaczonym silniku",0);
                return 1;
            }*/
            
if(GetPVarInt(i"grzyby")==1)
            {
                new 
Float:XFloat:YFloat:ZFloat:Angle;
                
GetPlayerPos(iXYZ);
                
GetPlayerFacingAngle(iAngle);
                
MovePlayerObject(ihalucynka1X-4YZ+1.5500Angle+90);
                
halucynka2 CreatePlayerObject(i18683X-5Y-3Z+1.50000);
                
dDodajHP(i,1);
            }
            if(
GetPVarInt(i"haj")==1)
            {
                
SetPlayerDrunkLevel (i2200);
            }
            if(
GetPVarInt(i"koka")==1)
            {
                
SetPlayerDrunkLevel (i2200);
            }
            if(
GetPVarInt(i"koka")>=5&&PlayerInfo[i][pUzaleznienie]<30 || GetPVarInt(i"koka")>=15)
            {
                
SetPVarInt(i"koka"0);
                
format(Stringsizeof(String), "%s",Nick(i));
                
StworzZwloki(i,String);
                
format(Stringsizeof(String),"** %s upada na ziemię po zażyciu narkotyku. U leżącego nie można wyczuć już funkcji życiowych. **",NickA(i));
                
WyswietlText(i,KOLOR_DO,12.0,String);
                
PlayerInfo[i][pKonto]=3;
                
ZapiszKonto(i);
                
SetTimerEx("Kara1"1000false"i"i);
                return 
1;
            }
            if(
GetPVarInt(i"koka")>=3&&PlayerInfo[i][pUzaleznienie]<10)
            {
                
SetPVarInt(i"koka"0);
                
ApplyAnimation(i,"CRACK","crckdeth2"4.101110);
                
format(Stringsizeof(String), "* %s upada nagle na ziemie zasłabiając.",NickA(i));
                
WyswietlText(i,KOLOR_JA,10.0,String);
                
PlayerInfo[i][pBW]=2;
                
TextInfoDrzwi(i"~w~Twoja postac zaslabla.~n~Powodem bylo przedawkowanie ~y~kokainy~w~.~n~"4500);
                return 
1;
            }
            if(
GetPlayerWeapon(i)==26)
            {
                
ResetPlayerWeapons(i);
            }
            if(
wyciski[i] >49)
            {
                
Info(i,"Trenining zakończony sukcesem.\nOtrzymujesz 10 punktow sily! Aby wstać z ławeczki wpisz /as.");
                
PlayerInfo[i][pSila]+=10;
                
ZapiszKonto(i);
                
SetTimerEx("LuxuriaOff",10"d"i);
                
wyciski[i]=0;
                for(new 
playerid 0playerid MAX_PLAYERSplayerid++)
                {
                    
TextDrawHideForPlayer(playeridDoors[playerid]);
                    
TextDrawHideForPlayer(playeridLuxuria[playerid]);
                }
                
Cwiczy[i]=0;
                
SetPVarInt(i"mozesilke"0);
                
RemovePlayerAttachedObject(i,6);
            }
            if(
SluzbaADM[i]==1){
                
SluzbaBIZ[i]=0;
                
SluzbaORG[i]=0;
                
MaskaON[i]=0;
            }
            if(
SluzbaBIZ[i]==1){
                
SluzbaADM[i]=0;
                
SluzbaORG[i]=0;
            }
            if(
SluzbaORG[i]==1){
                
SluzbaADM[i]=0;
                
SluzbaBIZ[i]=0;
            }
            if(
MaskaON[i]==1){
                
SluzbaADM[i]=0;
            }
            if(Global[
i][gAJ]>0){
                
AC_BS_SetPlayerVirtualWorld(iPlayerInfo[i][pUID]+150);
            }
            
AFK[i]++;
            if(
GetVehicleModel(vehicleid)==481||GetVehicleModel(vehicleid)==509||GetVehicleModel(vehicleid)==510){
                
SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
            }
            if(
IsPlayerInAnyVehicle(i))
            {
                if(
engine==1&&HP<325)
                {
                    
OstatniStatus[vehicleid]=325.0;
                    
SamochodInfo[vehicleid][sHP]=325.0;
                    
SetVehicleHealth(vehicleid325.0);
                    
TextInfoDrzwi(i,"Silnik w pojezdzie gasnie ze wzgledu na zly stan pojazdu.",4500);
                    
SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
                }
            }
        }
        return 
1;
    } 
Please help me with this a problem. I give REP ++
Reply
#2

Check that issuerid is valid before using it as an array index anywhere.
Reply
#3

Quote:
Originally Posted by Vince
View Post
Check that issuerid is valid before using it as an array index anywhere.
It seems to me that it is good.
Reply
#4

Quote:
Originally Posted by Auri
View Post
It seems to me that it is good.
It's not good. You never check if the issuerid is an INVALID_PLAYER_ID, therefore if the player for example will fall from somewhere he will receive damage with the issuerid to be an INVALID_PLAYER_ID which probably causes the crash.

You should do the above check

pawn Code:
if ( issuerid != INVALID_PLAYER_ID )
before you use the issuerid parameter

as an example

pawn Code:
if( ( issuerid != INVALID_PLAYER_ID && ( weaponid==0 && PlayerInfo[issuerid][pGodziny]<2 ) ) )
always check the wiki

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)