Crash Detect
#1

So got error in this code when i enabled crash detect

PHP код:
ptask ServerHeartbeatTwo[1000](playerid// It says here is error
{
    new 
Float:oldposxFloat:oldposyFloat:oldposz;
    new 
myweapons[13][2];
    
//new szMessage[128];
    
if(GetPVarInt(playerid"IsInArena") == -1)
    {
        for (new 
013i++)
        {
            
GetPlayerWeaponData(playeridimyweapons[i][0], myweapons[i][1]);
            if(
PlayerInfo[playerid][pGuns][i] == myweapons[i][0])
            {
                
PlayerInfo[playerid][pGunAmmo][i] = myweapons[i][1];
                   
//format(szMessage, sizeof(szMessage), "* %s has ran out of ammo.", GetPlayerNameEx(playerid));//ran out of ammo check
               // ProxDetector(25.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
}
        }
    }
    if(
GetPVarInt(playerid"IsOnFire") && !CanPlayerBurn(playerid1))
    {
        
TogglePlayerBurning(playeridfalse);
    }
    if(
CanPlayerBurn(playerid) && IsAtFire(playerid))
        {
            
TogglePlayerBurning(playeridtrue);
        }
        
#if defined BurnOthers
        
new Float:xFloat:yFloat:z;
        for(new 
iMAX_PLAYERSi++)
          {
              if(
playerid != && IsPlayerConnected(i) && !IsPlayerNPC(i))
              {
                  if(
CanPlayerBurn(i) && GetPVarInt(playerid"IsOnFire") && !GetPVarInt(i"IsOnFire"))
                  {
                      
GetPlayerPos(ixyz);
                    if(
IsPlayerInRangeOfPoint(playeridBURNING_RADIUSxyz))
                    {
                        
TogglePlayerBurning(itrue);
                    }
                }
            }
        }
        
#endif
    
if(IsPlayerInAnyVehicle(playerid)) {
        
SetPlayerArmedWeapon(playerid0);
    }
    if(
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK && JetPack[playerid] == && PlayerInfo[playerid][pAdmin] < 4)
    {
        new 
string[74 MAX_PLAYER_NAME];
        
formatstringsizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) possibly just loaded s0biet and gave himself a fucking jetpack...Faggot"GetPlayerNameEx(playerid), playerid);
        
ABroadCastCOLOR_YELLOWstring);
        
format(stringsizeof(string), "%s (ID %d) may possibly be jetpack hacking."GetPlayerNameEx(playerid), playerid);
        
Log("logs/hack.log"string);
    }
    if(
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) for(new 0sizeof(FamilyInfo); h++)
    {
        if(
IsPlayerInRangeOfPoint(playerid2.0FamilyInfo[h][FamilySafe][0], FamilyInfo[h][FamilySafe][1], FamilyInfo[h][FamilySafe][2]))
        {
            if(
FamilyInfo[h][FamilyUSafe] == 1)
            {
                
GameTextForPlayer(playerid"~y~gang safe~w~~n~Type ~r~/safehelp~w~ for more information"50003);
            }
        }
    }
    if(
GetPlayerState(playerid) == && IsPlayerInRangeOfPoint(playerid,2.0, -1608.8733,1284.3466,7.1777) || IsPlayerInRangeOfPoint(playerid,2.02101.7676,-1885.9995,13.5469) || IsPlayerInRangeOfPoint(playerid,2.0534.2360,913.0679,-42.9609))
    {
        if(
PlayerInfo[playerid][pJob] == 24)
        {
            new 
string[128];
            
format(stringsizeof(string), "~y~Materials Bank~n~Materials storage: ~r~%d ~n~~w~You can restock in San Fierro"matssys[MatsAmmount]);
            
GameTextForPlayer(playeridstring50003);
        }
        else if(
PlayerInfo[playerid][pJob] != 24)
        {
            new 
string[128];
            
format(stringsizeof(string), "~y~Materials Bank~n~Materials storage: ~r~%d"matssys[MatsAmmount]);
            
GameTextForPlayer(playeridstring50003);
        }
        else if(
PlayerInfo[playerid][pJob] == 9)
        {
            new 
string[128];
            
format(stringsizeof(string), "~y~Materials Bank~n~Materials storage: ~r~%d ~n~~w~You can ~g~/getmats ~w~in Los Angeles"matssys[MatsAmmount]);
            
GameTextForPlayer(playeridstring50003);
        }
    }
    if(
GetPlayerState(playerid) == && IsPlayerInRangeOfPoint(playerid,2.0,325.6044,1123.5282,1083.8828))
    {
        if(
PlayerInfo[playerid][pJob] == 14)
        {
            new 
string[128];
            
format(stringsizeof(string), "~y~Drug House (Pot): %d~n~~y~Drug House (Crack): %d"drugsys[DrugPotAmmount], drugsys[DrugCrackAmmount]);
            
GameTextForPlayer(playeridstring50003);
        }
        else if(
PlayerInfo[playerid][pJob] == 4)
        {
            new 
string[128];
            
format(stringsizeof(string), "~y~Drug House (Pot): %d~n~~y~Drug House (Crack): %d~n~~w~You can /getpot && /getcrack here"drugsys[DrugPotAmmount], drugsys[DrugCrackAmmount]);
            
GameTextForPlayer(playeridstring50003);
        }
        else
        {
            new 
string[128];
            
format(stringsizeof(string), "~y~Drug House (Pot): %d~n~~y~Drug House (Crack): %d"drugsys[DrugPotAmmount], drugsys[DrugCrackAmmount]);
            
GameTextForPlayer(playeridstring50003);
        }
    }
    if(
GetPlayerState(playerid) == && IsPlayerInRangeOfPoint(playerid,2.0,-51.4929,1398.0430,1084.4297))
    {
        new 
string[128];
        
format(stringsizeof(string), "~y~Type ~r~/cookheroin~n~~y~to begin cooking your heroin!");
        
GameTextForPlayer(playeridstring50003);
    }
    if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsPlayerInRangeOfPoint(playerid,2.0,-1584.3499,-2718.8491,48.5391))
    {
        new 
string[128];
        
format(stringsizeof(string), "~y~Type ~r~/opengarage ~y~to enter the garage.");
        
GameTextForPlayer(playeridstring50003);
    }
    for(new 
0sizeof(Points); h++)
    {
        if(
IsPlayerInRangeOfPoint(playerid2.0Points[h][Pointx], Points[h][Pointy], Points[h][Pointz]))
        {
            if(
Points[h][Type] == && GetPVarInt(playerid"Packages") == 0)
            {
                
GameTextForPlayer(playerid"~w~Type /getmats to purchase a ~n~~r~materials package"50005);
            }
            else if(
Points[h][Type] == && PlayerInfo[playerid][pPot] < 3)
            {
                
GameTextForPlayer(playerid"~w~Type /getseeds to purchase some ~r~pot seeds"50005);
            }
        }
    }
    if(
SafeTime[playerid] > 0) {
        if(--
SafeTime[playerid] == && gPlayerAccount[playerid] == && gPlayerLogged{playerid} == 0) {
            
SendClientMessageEx(playeridCOLOR_WHITE"HINT: You can now login by typing your password below.");
        }
    }
    if(
PlayerInfo[playerid][pLocal] != 255 && PlayerInfo[playerid][pInt] != 0)
    {
        new 
house PlayerInfo[playerid][pLocal];
        
GetPlayerPos(playeridoldposxoldposyoldposz);
        if(
oldposz != 0.0)
        {
            if(
oldposz 600.0)
            {
                if(
house == 242)
                {
                    
SetPlayerInterior(playerid,0);
                    
SetPlayerPos(playerid,1073.0619,-344.5148,73.9922);
                    
PlayerInfo[playerid][pInt] = 0;
                    
PlayerInfo[playerid][pLocal] = 255;
                }
            }
        }
    }
    if(
CellTime[playerid] > 0)
    {
        if (
CellTime[playerid] == cchargetime)
        {
            
CellTime[playerid] = 1;
            if(
Mobile[Mobile[playerid]] == playerid)
            {
                
CallCost[playerid] += callcost;
            }
        }
        
CellTime[playerid]++;
        if (
Mobile[Mobile[playerid]] == INVALID_PLAYER_ID && CellTime[playerid] == 5)
        {
            if(
IsPlayerConnected(Mobile[playerid]))
            {
                new 
Float:rXFloat:rYFloat:rZ;
                
GetPlayerPos(playeridrXrYrZ);
                new 
string[18 MAX_PLAYER_NAME];
                
format(stringsizeof(string), "* %s's phone rings."GetPlayerNameEx(Mobile[playerid]));
                
RingTone[Mobile[playerid]] = 10;
                
ProxDetector(30.0Mobile[playerid], stringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
        }
    }
    if(
CellTime[playerid] == && CallCost[playerid] > 0)
    {
        new 
string[28];
        
format(stringsizeof(string), "~w~The call cost~n~~r~$%d",CallCost[playerid]);
        
GivePlayerCash(playerid, -CallCost[playerid]);
        
GameTextForPlayer(playeridstring50001);
        
CallCost[playerid] = 0;
    }
    if(
GetPVarInt(playerid"rccam") == 0)
    {
        if(
GetVehicleModel(GetPlayerVehicleID(playerid)) != 594)
        {
             
DestroyVehicle(GetPVarInt(playerid"rcveh"));
             
KillTimer(GetPVarInt(playerid"rccamtimer"));
        }
    }

Error
PHP код:
[18:57:37] [debugRun time error 4"Array index out of bounds"
[18:57:37] [debug]  Accessing element at index 12 past array upper bound 11
[18:57:37] [debugAMX backtrace:
[
18:57:37] [debug#0 00795cc8 in ServerHeartbeatTwo (playerid=0) at C:\Users\-\Documents\LSCRP Scripts\gamemodes\lscrp.pwn:129242
[18:57:37] [debug#1 00795a84 in public ServerHeartbeatTwo@_yT (p=0) at C:\Users\-\Documents\LSCRP Scripts\gamemodes\lscrp.pwn:129232 
And i get it every second
Reply
#2

Show lines 129232 and 129242. Also write which array has 12 slots (0 - 11).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)