Half of OnGameModeInIt not loading
#1

Hello guys, the title pretty much says it all.

Today I have made a server, I have uploaded the script and everything was fine, Playing on it for around 5-6 hours, Suddenly I realized there was a miss type, I opened Pawno.exe as an administrator and edited just that line no other line and nothing else just that pacific word. I compiled it and it was fine.

I then uploaded it to the host and restarted the server. Then none of the gates loaded. None of the cars loaded. They just wouldn't spawn. I done /veh 560 3 3 and nothing spawned.

If you know anything got to do with this please tell me how to fix it thanks.
Reply
#2

Thanks ******, This is what I have found.

Код:
[debug] Run time error 4: "Array index out of bounds"
[16:53:02] [debug] Accessing element at index 15 past array upper bound 14
[16:53:02] [debug] AMX backtrace:
[16:53:02] [debug] #0 000d7098 in ?? () from LARP12.amx
[16:53:02] [debug] #1 00105350 in public SSCANF_OnGameModeInit () from LARP12.amx
[16:53:02] [debug] #2 native CallLocalFunction () [00472000] from samp-server.exe
[16:53:02] [debug] #3 0000ff9c in public zcmd_OnGameModeInit () from LARP12.amx
[16:53:02] [debug] #4 native CallLocalFunction () [00472000] from samp-server.exe
[16:53:02] [debug] #5 0000f8fc in ?? () from LARP12.amx
[16:53:02] [debug] #6 000090ac in public Itter_OnGameModeInit () from LARP12.amx
[16:53:02] [debug] #7 native CallLocalFunction () [00472000] from samp-server.exe
[16:53:02] [debug] #8 000026d4 in public ScriptInit_OnGameModeInit () from LARP12.amx
[16:53:02] [debug] #9 000015a4 in public OnGameModeInit () from LARP12.amx
Reply
#3

I put inside pawno.cfg "-d3 -O1 -r" and when I compiled and uploaded it I got the same I think..

Код:
[17:22:44] [debug] Run time error 4: "Array index out of bounds"
[17:22:44] [debug] Accessing element at index 15 past array upper bound 14
[17:22:44] [debug] AMX backtrace:
[17:22:44] [debug] #0 000d7098 in ?? () from LARP12.amx
[17:22:44] [debug] #1 00105350 in public SSCANF_OnGameModeInit () from LARP12.amx
[17:22:44] [debug] #2 native CallLocalFunction () [00472000] from samp-server.exe
[17:22:44] [debug] #3 0000ff9c in public zcmd_OnGameModeInit () from LARP12.amx
[17:22:44] [debug] #4 native CallLocalFunction () [00472000] from samp-server.exe
[17:22:44] [debug] #5 0000f8fc in ?? () from LARP12.amx
[17:22:44] [debug] #6 000090ac in public Itter_OnGameModeInit () from LARP12.amx
[17:22:44] [debug] #7 native CallLocalFunction () [00472000] from samp-server.exe
[17:22:44] [debug] #8 000026d4 in public ScriptInit_OnGameModeInit () from LARP12.amx
[17:22:44] [debug] #9 000015a4 in public OnGameModeInit () from LARP12.amx
Anything else I can do or did I even do it right?
Reply
#4

Ok so in Pawno.cfg there is -d3 -O0 -r

and the Crash Detect is still the same..

Код:
[17:49:02] [debug] Run time error 4: "Array index out of bounds"
[17:49:02] [debug] Accessing element at index 15 past array upper bound 14
[17:49:02] [debug] AMX backtrace:
[17:49:02] [debug] #0 000d7098 in ?? () from LARP12.amx
[17:49:02] [debug] #1 00105350 in public SSCANF_OnGameModeInit () from LARP12.amx
[17:49:02] [debug] #2 native CallLocalFunction () [00472000] from samp-server.exe
[17:49:02] [debug] #3 0000ff9c in public zcmd_OnGameModeInit () from LARP12.amx
[17:49:02] [debug] #4 native CallLocalFunction () [00472000] from samp-server.exe
[17:49:02] [debug] #5 0000f8fc in ?? () from LARP12.amx
[17:49:02] [debug] #6 000090ac in public Itter_OnGameModeInit () from LARP12.amx
[17:49:02] [debug] #7 native CallLocalFunction () [00472000] from samp-server.exe
[17:49:02] [debug] #8 000026d4 in public ScriptInit_OnGameModeInit () from LARP12.amx
[17:49:02] [debug] #9 000015a4 in public OnGameModeInit () from LARP12.amx
Is there any other solution you can think of?
Reply
#5

And also in the Web Console it keeps giving this.

Код:
[17:53:01] [debug] Run time error 4: "Array index out of bounds"
[17:53:01] [debug] Accessing element at index 12 past array upper bound 11
[17:53:01] [debug] AMX backtrace:
[17:53:01] [debug] #0 005e1258 in ?? (0x00000001) from LARP12.amx
[17:53:01] [debug] #1 005e10b8 in public ServerHeartbeatTwo@_yT (0x00000001) from LARP12.amx
What ever that means?
Reply
#6

Anyone?
Reply
#7

Well, somewhere there is OBOE. Your timer ServerHeartbeatTwo calls some function, and bad stuff happens there - show the ServerHeartbeatTwo, and look for any array access where you are using some variable (probably that'll be inside loop)
Reply
#8

Well, atleast it gives a hint (in the first one) that something in OnGameModeInit causes the run time error. Post that callback.
Reply
#9

Is it is, I did not find anything wrong with it. I re-installed everything on the host and it worked. But when I restart it, it all goes wrong.

pawn Код:
ptask ServerHeartbeatTwo[1000](playerid)
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new myweapons[13][2];
    //new szMessage[128];
    if(GetPVarInt(playerid, "IsInArena") == -1)
    {
        for (new i = 0; i < 13; i++)
        {
            GetPlayerWeaponData(playerid, i, myweapons[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(playerid, 1))
    {
        TogglePlayerBurning(playerid, false);
    }
    if(CanPlayerBurn(playerid) && IsAtFire(playerid))
        {
            TogglePlayerBurning(playerid, true);
        }
        #if defined BurnOthers
        new Float:x, Float:y, Float:z;
        for(new i; i < MAX_PLAYERS; i++)
        {
            if(playerid != i && IsPlayerConnected(i) && !IsPlayerNPC(i))
            {
                if(CanPlayerBurn(i) && GetPVarInt(playerid, "IsOnFire") && !GetPVarInt(i, "IsOnFire"))
                {
                    GetPlayerPos(i, x, y, z);
                    if(IsPlayerInRangeOfPoint(playerid, BURNING_RADIUS, x, y, z))
                    {
                        TogglePlayerBurning(i, true);
                    }
                }
            }
        }
        #endif
    if(IsPlayerInAnyVehicle(playerid)) {
        SetPlayerArmedWeapon(playerid, 0);
    }
    if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK && JetPack[playerid] == 0 && PlayerInfo[playerid][pAdmin] < 4)
    {
        new string[74 + MAX_PLAYER_NAME];
        format( string, sizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) possibly just loaded s0biet and gave himself a fucking jetpack...Faggot", GetPlayerNameEx(playerid), playerid);
        ABroadCast( COLOR_YELLOW, string, 2 );
        format(string, sizeof(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 h = 0; h < sizeof(FamilyInfo); h++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, FamilyInfo[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", 5000, 3);
            }
        }
    }
    if(GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,2.0, -1608.8733,1284.3466,7.1777) || IsPlayerInRangeOfPoint(playerid,2.0, 2101.7676,-1885.9995,13.5469) || IsPlayerInRangeOfPoint(playerid,2.0, 534.2360,913.0679,-42.9609))
    {
        if(PlayerInfo[playerid][pJob] == 24)
        {
            new string[128];
            format(string, sizeof(string), "~y~Materials Bank~n~Materials storage: ~r~%d ~n~~w~You can restock in San Fierro", matssys[MatsAmmount]);
            GameTextForPlayer(playerid, string, 5000, 3);
        }
        else if(PlayerInfo[playerid][pJob] != 24)
        {
            new string[128];
            format(string, sizeof(string), "~y~Materials Bank~n~Materials storage: ~r~%d", matssys[MatsAmmount]);
            GameTextForPlayer(playerid, string, 5000, 3);
        }
        else if(PlayerInfo[playerid][pJob] == 9)
        {
            new string[128];
            format(string, sizeof(string), "~y~Materials Bank~n~Materials storage: ~r~%d ~n~~w~You can ~g~/getmats ~w~in Los Angeles", matssys[MatsAmmount]);
            GameTextForPlayer(playerid, string, 5000, 3);
        }
    }
    if(GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,2.0,325.6044,1123.5282,1083.8828))
    {
        if(PlayerInfo[playerid][pJob] == 14)
        {
            new string[128];
            format(string, sizeof(string), "~y~Drug House (Pot): %d~n~~y~Drug House (Crack): %d", drugsys[DrugPotAmmount], drugsys[DrugCrackAmmount]);
            GameTextForPlayer(playerid, string, 5000, 3);
        }
        else if(PlayerInfo[playerid][pJob] == 4)
        {
            new string[128];
            format(string, sizeof(string), "~y~Drug House (Pot): %d~n~~y~Drug House (Crack): %d~n~~w~You can /getpot && /getcrack here", drugsys[DrugPotAmmount], drugsys[DrugCrackAmmount]);
            GameTextForPlayer(playerid, string, 5000, 3);
        }
        else
        {
            new string[128];
            format(string, sizeof(string), "~y~Drug House (Pot): %d~n~~y~Drug House (Crack): %d", drugsys[DrugPotAmmount], drugsys[DrugCrackAmmount]);
            GameTextForPlayer(playerid, string, 5000, 3);
        }
    }
    if(GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,2.0,-51.4929,1398.0430,1084.4297))
    {
        new string[128];
        format(string, sizeof(string), "~y~Type ~r~/cookheroin~n~~y~to begin cooking your heroin!");
        GameTextForPlayer(playerid, string, 5000, 3);
    }
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsPlayerInRangeOfPoint(playerid,2.0,-1584.3499,-2718.8491,48.5391))
    {
        new string[128];
        format(string, sizeof(string), "~y~Type ~r~/opengarage ~y~to enter the garage.");
        GameTextForPlayer(playerid, string, 5000, 3);
    }
    for(new h = 0; h < sizeof(Points); h++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, Points[h][Pointx], Points[h][Pointy], Points[h][Pointz]))
        {
            if(Points[h][Type] == 1 && GetPVarInt(playerid, "Packages") == 0)
            {
                GameTextForPlayer(playerid, "~w~Type /getmats to purchase a ~n~~r~materials package", 5000, 5);
            }
            else if(Points[h][Type] == 3 && PlayerInfo[playerid][pPot] < 3)
            {
                GameTextForPlayer(playerid, "~w~Type /getseeds to purchase some ~r~pot seeds", 5000, 5);
            }
        }
    }
    if(SafeTime[playerid] > 0) {
        if(--SafeTime[playerid] == 1 && gPlayerAccount[playerid] == 1 && gPlayerLogged{playerid} == 0) {
            SendClientMessageEx(playerid, COLOR_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(playerid, oldposx, oldposy, oldposz);
        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:rX, Float:rY, Float:rZ;
                GetPlayerPos(playerid, rX, rY, rZ);
                new string[18 + MAX_PLAYER_NAME];
                format(string, sizeof(string), "* %s's phone rings.", GetPlayerNameEx(Mobile[playerid]));
                RingTone[Mobile[playerid]] = 10;
                ProxDetector(30.0, Mobile[playerid], string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
        }
    }
    if(CellTime[playerid] == 0 && CallCost[playerid] > 0)
    {
        new string[28];
        format(string, sizeof(string), "~w~The call cost~n~~r~$%d",CallCost[playerid]);
        GivePlayerCash(playerid, -CallCost[playerid]);
        GameTextForPlayer(playerid, string, 5000, 1);
        CallCost[playerid] = 0;
    }
    if(TransportDriver[playerid] < 999)
    {
        if(GetPlayerVehicleID(playerid) != GetPlayerVehicleID(TransportDriver[playerid]) || !TransportDuty[TransportDriver[playerid]])
        {
            if(IsPlayerConnected(TransportDriver[playerid]))
            {
                TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
                TransportTime[TransportDriver[playerid]] = 0;
                TransportCost[TransportDriver[playerid]] = 0;
                new string[36];
                format(string, sizeof(string), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
                GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
                TransportDriver[playerid] = 999;
            }
        }
        else if(TransportTime[playerid] >= 16)
        {
            TransportTime[playerid] = 1;
            if(TransportDriver[playerid] < 999)
            {
                if(IsPlayerConnected(TransportDriver[playerid]))
                {
                    TransportCost[playerid] += TransportValue[TransportDriver[playerid]];
                    TransportCost[TransportDriver[playerid]] = TransportCost[playerid];
                }
            }
        }
        TransportTime[playerid] += 1;
        new string[24];
        format(string, sizeof(string), "~r~%d ~w~: ~g~$%d",TransportTime[playerid],TransportCost[playerid]);
        GameTextForPlayer(playerid, string, 15000, 6);
        if(TransportCost[playerid] > GetPlayerCash(playerid))
        {
            //RemovePlayerFromVehicle(playerid);
            new Float:slx, Float:sly, Float:slz;
            GetPlayerPos(playerid, slx, sly, slz);
            SetPlayerPos(playerid, slx, sly, slz + 2);
            GameTextForPlayer(playerid, "~r~You're flat out of cash!", 4000, 4);
        }
    }
    if(GetPVarInt(playerid, "rccam") == 0)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 594)
        {
            DestroyVehicle(GetPVarInt(playerid, "rcveh"));
            KillTimer(GetPVarInt(playerid, "rccamtimer"));
        }
    }
}
Reply
#10

There are a few places where you should check the value:
pawn Код:
//What is sizeof Mobile? What is the value of Mobile[playerid]?
Mobile[Mobile[playerid]]
RingTone[Mobile[playerid]]
TransportCost[TransportDriver[playerid]]
Etc. etc., check every single [] access, especially where the value is some other access
Reply
#11

Can you explain that a little better please sorry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)