SA-MP Forums Archive
Run Time Error 4, need help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Run Time Error 4, need help. (/showthread.php?tid=412177)



Run Time Error 4, need help. - Mr.1337 - 01.02.2013

[00:07:57] [debug] Run time error 4: "Array index out of bounds"
[00:07:57] [debug] Accessing element at index 1500 past array upper bound 1499
[00:07:57] [debug] AMX backtrace:
[00:07:57] [debug] #0 0011fc2c in public FC_OnGameModeInit () from internationalrp.amx
[00:07:57] [debug] #1 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #2 0000db7c in public SSCANF_OnGameModeInit () from internationalrp.amx
[00:07:57] [debug] #3 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #4 00005908 in public YVers_OnScriptInit () from internationalrp.amx
[00:07:57] [debug] #5 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #6 0000503c in public Timers_OnScriptInit () from internationalrp.amx
[00:07:57] [debug] #7 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #8 00004dbc in public Streamer_OnGameModeInit () from internationalrp.amx
[00:07:57] [debug] #9 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #10 0000291c in public Itter_OnGameModeInit () from internationalrp.amx
[00:07:57] [debug] #11 native CallLocalFunction () [080dc980] from samp03svr
[00:07:57] [debug] #12 0000077c in public OnGameModeInit () from internationalrp.amx

The weird thing is, when I run it from my PC it works perfect, but when I run it on linux server keeps crashing after typing any command. How to fix this?


Re: Run Time Error 4, need help. - 3ventic - 01.02.2013

You have an array, something like

new array[1500];

and you're trying to use array[1500] somewhere, while array only contains values up to array[1499] (1500 cells 0-1499). It should crash both on your PC and the linux server.


Re: Run Time Error 4, need help. - Mr.1337 - 01.02.2013

Hmm, so I should replace the [1500] with any other number?

And no, it doesn't crash in my PC, only linux somehow.


Re: Run Time Error 4, need help. - Mr.1337 - 01.02.2013

here's my ongamemodeinit code, please help me

pawn Код:
public OnGameModeInit()
{
    new
        string[128],
        hostname[128];

    AntiDeAMX();
    ManualVehicleEngineAndLights();
    DisableInteriorEnterExits();
    SendRconCommand(MAPNAME);
   // GetServerVarAsString("hostname", hostname, sizeof(hostname));
  //  if(strcmp(hostname, "None", true) == 0) SendRconCommand(HOSTNAME);

    SetNameTagDrawDistance(30.0);
    EnableStuntBonusForAll(0);
    format(last911callstr, sizeof(string),"No recent 911 calls.");
    GMX = false;
    gTakePoint = -1;
    RobStatus[BeingRobbed] = false;
    RobStatus[Robber] = INVALID_PLAYER_ID;
    RobStatus[Object][0] = INVALID_OBJECT_ID;
    RobStatus[Object][1] = INVALID_OBJECT_ID;
    RobStatus[BankReload] = 0;
    RobStatus[Setup] = false;
    Boxer1 = INVALID_PLAYER_ID;
    Boxer2 = INVALID_PLAYER_ID;
    TBoxer = INVALID_PLAYER_ID;
    BusCall = INVALID_PLAYER_ID;
    realtime = 1;
    wtime = 15;
    levelcost = 25000; //level cost
    deathcost = 2000; //death cost
    callcost = 10; //divided by 10 seconds
    matprice = 500; //getmats cost
    matpayout = 250; //materials payout amount
    dmatpayout = 350; //materials payout amount
    potgprice = 100; //price per gram
    crackgprice = 500; //price per gram
    dhstock = 1000; //drughouse supply
    dhlimit = 1000; //drughouse limit
    chstock = 500; //crackhouse supply
    chlimit = 500; //crackhouse limit
    faclimit = 1000;
    facstock = 1000;
    levelexp = 4; //levelexp
    adds = 1; //ads enabled
    noooc = 1; //noooc enabled
    realchat = true;
    timeshift = -1;
    addtimer = 60000;
    PointCapturable = 255;
    CapturingFamily = 255;
    EventHP = 100;
    CarsurfAlert = false;
    SoundEffects = false;
    gChristmasTree = INVALID_OBJECT_ID;
    //vehicleidcount = INVALID_VEHICLE_ID;
    //vehiclecount = 0;
    //SetDefaultBusinessSettings();
    SetDefaultDivisionPermissions();
    SetDefaultFactionSettings();
    SetDefaultHouseSettings();
    SetGameModeText("I:RP v1.922");

    gPoint[0] = GangZoneCreate(2557.310058, -2155.796875, 2709.310058, -2059.796875); // Fossil Fuel
    gPoint[1] = GangZoneCreate(1383.565795, -1368.170654, 1447.565795, -1256.170654); // Material Pickup 1
    gPoint[2] = GangZoneCreate(2302.000000, -2052.300048, 2414.000000, -1972.300048); // Material Pickup 2
    gPoint[3] = GangZoneCreate(2128.820556, -2337.746826, 2240.820556, -2209.746826); // Material Delivery 1
    gPoint[4] = GangZoneCreate(2225.440673, -1145.409301, 2297.440673, -1057.409301); // Material Delivery 2
    gPoint[5] = GangZoneCreate(2712.091064, -2575.454589, 2864.091064, -2327.454589); // Auto Export Company
    gPoint[6] = GangZoneCreate(1266.488647, 227.472656, 1386.488647, 355.472656); // Sprunk Factory

    MinigunData[0][Object] = CreateDynamicObject(2985,126.0612,1910.5907,18.7667-1,0.0,0.0,0.0);
    MinigunData[0][Xpos] = 126.0612; MinigunData[0][Ypos] = 1910.5907; MinigunData[0][Zpos] = 18.7667-1;
    Projectile[0][1] = CreateDynamicObject(19084, MinigunData[0][Xpos], MinigunData[0][Ypos], MinigunData[0][Zpos]+1, 0.00, 0.00, 0.00);

    MinigunData[1][Object] = CreateDynamicObject(2985,204.8786,1893.0282,17.6406-1,0.0,0.0,0.0);
    MinigunData[1][Xpos] = 204.8786; MinigunData[1][Ypos] = 1893.0282; MinigunData[1][Zpos] = 17.6406-1;
    Projectile[1][1] = CreateDynamicObject(19084, MinigunData[1][Xpos], MinigunData[1][Ypos], MinigunData[1][Zpos]+1, 0.00, 0.00, 0.00);

    /*MinigunData[2][Object] = CreateObject(2985,220.9531,1863.3491,13.1406-1,0.0,0.0,0.0);
    MinigunData[2][Xpos] = 220.9531; MinigunData[2][Ypos] = 1863.3491; MinigunData[2][Zpos] = 13.1406-1;
    Projectile[2][1] = CreateObject(19084, MinigunData[2][Xpos], MinigunData[2][Ypos], MinigunData[2][Zpos]+1, 0.00, 0.00, 0.00);
    AttachObjectToObject(Projectile[2][1], MinigunData[2][Object], MinigunData[2][Xpos], MinigunData[2][Ypos], MinigunData[2][Zpos]+1, 0.00, 0.00, 0.00, 1);*/


    SetTimer("DynWeather", 1200000, 0);

    /* Faction lockers */
    LockerText[0] = CreateDynamic3DTextLabel("Faction lockers - Type (/locker)",COLOR_GREEN,FactionInfo[1][fLX],FactionInfo[1][fLY],FactionInfo[1][fLZ]+0.6,12.0);
    LockerText[1] = CreateDynamic3DTextLabel("Faction lockers - Type (/locker)",COLOR_GREEN,FactionInfo[2][fLX],FactionInfo[2][fLY],FactionInfo[2][fLZ]+0.6,12.0);
    LockerText[2] = CreateDynamic3DTextLabel("Faction lockers - Type (/locker)",COLOR_GREEN,FactionInfo[3][fLX],FactionInfo[3][fLY],FactionInfo[3][fLZ]+0.6,12.0);
    LockerText[3] = CreateDynamic3DTextLabel("Faction lockers - Type (/locker)",COLOR_GREEN,FactionInfo[4][fLX],FactionInfo[4][fLY],FactionInfo[4][fLZ]+0.6,12.0);
    LockerText[4] = CreateDynamic3DTextLabel("Faction lockers - Type (/locker)",COLOR_GREEN,FactionInfo[5][fLX],FactionInfo[5][fLY],FactionInfo[5][fLZ]+0.6,12.0);
    LockerText[5] = CreateDynamic3DTextLabel("Faction lockers - Type (/order)",COLOR_GREEN,FactionInfo[6][fLX],FactionInfo[6][fLY],FactionInfo[6][fLZ]+0.6,12.0);
    LockerText[6] = CreateDynamic3DTextLabel("Faction lockers - Type (/order)",COLOR_GREEN,FactionInfo[7][fLX],FactionInfo[7][fLY],FactionInfo[7][fLZ]+0.6,12.0);
    LockerText[7] = CreateDynamic3DTextLabel("Faction lockers - Type (/order)",COLOR_GREEN,FactionInfo[8][fLX],FactionInfo[8][fLY],FactionInfo[8][fLZ]+0.6,12.0);

    /* Weapon smuggling */
    CreateDynamic3DTextLabel("Black Market - use \"/blackmarket\" to buy/sell a weapon/drug package.",COLOR_PICKUP,2731.6001, -2555.3000, 1682.0000+0.3,12.0);
    CreateDynamic3DTextLabel("Weapon Smuggler job\nType (/join) to become one",COLOR_PICKUP,2357.3801,-1990.5421,13.5469,20.0);
    CreateDynamic3DTextLabel("EMT job\nType (/join) to become one",COLOR_PICKUP,1702.9437,-1469.8970,13.5469,20.0);

    /* Sprunk 3D Text */
    CreateDynamic3DTextLabel("Sprunk Machine \nHit 'F' to grab a drink/snack",COLOR_YELLOW,2140.4504,-1161.4298,23.9922+0.6,12.0); // Sprunk Machine
    CreateDynamic3DTextLabel("Sprunk Machine \nHit 'F' to grab a drink/snack",COLOR_YELLOW,2153.8826,-1015.5273,62.8895+0.6,12.0); // Sprunk Machine
    CreateDynamic3DTextLabel("Sprunk Machine \nHit 'F' to grab a drink/snack",COLOR_YELLOW,2325.9705,-1646.1234,14.8270+0.6,12.0); // Sprunk Machine
    CreateDynamic3DTextLabel("Sprunk Machine \nHit 'F' to grab a drink/snack",COLOR_YELLOW,2060.2163,-1898.6940,13.5538+0.6,12.0); // Sprunk Machine
    CreateDynamic3DTextLabel("Sprunk Machine \nHit 'F' to grab a drink/snack",COLOR_YELLOW,1929.8986,-1772.5122,13.5469+0.6,12.0); // Sprunk Machine
    CreateDynamic3DTextLabel("Sprunk Machine \nHit 'F' to grab a drink/snack",COLOR_YELLOW,1153.6688,-1460.8262,15.7969+0.6,12.0); // Sprunk Machine

    CreateDynamic3DTextLabel("Federal Bureau of Investigation\nType /enter to enter.",COLOR_PICKUP,939.32, 1733.02, 10.2,12.0); // FBI

    CreateDynamic3DTextLabel("Weaponry\nType (/buygun) to buy some",COLOR_PICKUP,621.0515,2248.5686,26.0073,12.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, 1); // VIP Gunshop Ammo Spot
    CreateDynamic3DTextLabel("DMV Parking Ticket\nUse (/car pay) to pay the ticket",COLOR_PICKUP,1492.6208,1308.1964,1093.2936,5.0); // DMV Pay Ticket
    CreateDynamic3DTextLabel("Use (/getlicense) to start the lesson",COLOR_PICKUP,1490.3199,1305.9313,1093.2964,5.0); // DMV Pay Ticket
    CreateDynamic3DTextLabel("License Pickup\nUse /getlicense to get your licenses",COLOR_PICKUP,1490.3199,1305.9313,1093.2964,5.0); // DMV Get License
    CreateDynamic3DTextLabel("Paintball\nUse (/paintball) to join",COLOR_PICKUP,1310.0990,-1367.1959,13.5233,5.0);
    CreateDynamic3DTextLabel("Drugs Smuggler Job\nType (/join) to become one",COLOR_PICKUP,2354.2703,-1169.3293,28.0083,5.0);
    CreateDynamic3DTextLabel("Taxi Driver Job\nType (/join) to become one",COLOR_PICKUP,1741.7062,-1863.6664,13.5748,5.0);
    CreateDynamic3DTextLabel("Boxing Job\nType (/join) to become one",COLOR_PICKUP,756.7493,6.3762,1000.7001,5.0);
    CreateDynamic3DTextLabel("Pizza Boy Job\nType (/join) to become one",COLOR_PICKUP,2104.9707,-1810.2334,13.5547,5.0);
    CreateDynamic3DTextLabel("Arms Dealer Job\nType (/join) to become one",COLOR_PICKUP,1366.4325,-1275.2096,13.5469,5.0);
    CreateDynamic3DTextLabel("Bodyguard Job\nType (/join), to become one",COLOR_PICKUP,2226.1716,-1718.1792,13.5165,5.0);
    CreateDynamic3DTextLabel("Car Mechanic Job\nType (/join) to become one",COLOR_PICKUP,2329.4089,-2316.0996,13.5469,5.0);
    CreateDynamic3DTextLabel("Drug Dealer Job\nType (/join) to become one",COLOR_PICKUP,2166.3772,-1675.3829,15.0859,5.0);
    CreateDynamic3DTextLabel("Whore Job\nType (/join) to become one",COLOR_PICKUP,1204.8070,11.7829,1000.9219,5.0);
    CreateDynamic3DTextLabel("Lawyer Job\nType (/join) to become one",COLOR_PICKUP,1381.0413,-1088.8511,27.3906,5.0);
    CreateDynamic3DTextLabel("Detective Job\nType (/join) to become one",COLOR_PICKUP,256.6144,69.6090,1003.6406,5.0);
    CreateDynamic3DTextLabel("Trucker Job\nType (/join) to become one",COLOR_PICKUP,-77.0901,-1136.6024,1.0781,5.0);
    CreateDynamic3DTextLabel("Type (/clothes)\n To change your faction clothes",COLOR_PICKUP,206.4945,-101.1381,1005.2578,8.0);
    CreateDynamic3DTextLabel("Type (/buyclothes)\n To change your clothes",COLOR_PICKUP,208.9107,-101.1725,1005.2578,8.0);
    CreateDynamic3DTextLabel("Type (/buytoys)\n To buy some accessories",COLOR_PICKUP,2236.2937,130.1592,1035.4141,8.0);
    CreateDynamic3DTextLabel("Type (/ad)\n To place an advertisment",COLOR_PICKUP,649.2842,-1360.7402,13.5856,8.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, 0);
    format(string, sizeof(string), "Hours left to rob %d", RobStatus[BankReload]);
    RobStatus[TextLabel] = CreateDynamic3DTextLabel(string, COLOR_PICKUP,2370.4622,1802.3904,1125.7303,6.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, 1);

    LoadDivisions();
    LoadFactions();
    ClearReports();
    LoadEntrances();
    LoadBoxer();
    LoadStuff();
    LoadIRC();
    LoadGates();
    LoadFamilies();
    LoadPoints();
    LoadHouses();
    LoadStaticVehicles();
    LoadTags();

    vehicleMods[0][4] = {1013, 1024, 0, 0};
    vehicleMods[0][6] = {1018, 1019, 1020, 1021};
    vehicleMods[1][0] = {1001, 1003, 0, 0};
    vehicleMods[1][1] = {1004, 1005, 0, 0};
    vehicleMods[1][2] = {1006, 0, 0, 0};
    vehicleMods[1][3] = {1007, 0, 0, 0};
    vehicleMods[1][4] = {1013, 0, 0, 0};
    vehicleMods[1][6] = {1019, 1020, 0, 0};
    vehicleMods[1][12] = {1143, 1145, 0, 0};
    vehicleMods[4][0] = {1002, 1016, 1000, 0};
    vehicleMods[4][3] = {1007, 0, 0, 0};
    vehicleMods[4][4] = {1013, 0, 0, 0};
    vehicleMods[4][6] = {1019, 1020, 1021, 0};
    vehicleMods[5][0] = {1000, 1001, 1014, 1023};
    vehicleMods[5][6] = {1018, 1019, 1020, 1021};
    vehicleMods[10][0] = {1001, 1003, 1023, 0};
    vehicleMods[10][3] = {1007, 0, 0, 0};
    vehicleMods[10][4] = {1013, 1024, 0, 0};
    vehicleMods[10][6] = {1019, 1020, 1021, 0};
    vehicleMods[15][0] = {1001, 1003, 1023, 0};
    vehicleMods[15][6] = {1018, 1019, 0, 0};
    vehicleMods[15][3] = {1007, 0, 0, 0};
    vehicleMods[18][0] = {1002, 1016, 0, 0};
    vehicleMods[18][2] = {1006, 0, 0, 0};
    vehicleMods[18][6] = {1020, 1021, 0, 0};
    vehicleMods[20][0] = {1001, 1003, 0, 0};
    vehicleMods[20][1] = {1004, 1005, 0, 0};
    vehicleMods[20][6] = {1019, 1021, 0, 0};
    vehicleMods[21][0] = {1000, 1014, 1016, 1023};
    vehicleMods[21][6] = {1018, 1019, 1020, 1021};
    vehicleMods[22][3] = {1007, 0, 0, 0};
    vehicleMods[22][4] = {1013, 0, 0, 0};
    vehicleMods[22][6] = {1019, 1020, 1021, 0};
    vehicleMods[26][0] = {1001, 1003, 0, 0};
    vehicleMods[26][1] = {1004, 1005, 0, 0};
    vehicleMods[26][2] = {1006, 0, 0, 0};
    vehicleMods[26][6] = {1019, 1021, 0, 0};
    vehicleMods[36][0] = {1001, 1003, 0, 0};
    vehicleMods[36][2] = {1006, 0, 0, 0};
    vehicleMods[36][3] = {1007, 0, 0, 0};
    vehicleMods[36][4] = {1013, 0, 0, 0};
    vehicleMods[36][6] = {1019, 1020, 1021, 1022};
    vehicleMods[39][0] = {1001, 1003, 1023, 0};
    vehicleMods[39][3] = {1007, 0, 0, 0};
    vehicleMods[39][4] = {1013, 0, 0, 0};
    vehicleMods[39][12] = {1143, 1145, 0, 0};
    vehicleMods[77][2] = {1006, 0, 0, 0};
    vehicleMods[77][3] = {1007, 0, 0, 0};
    vehicleMods[77][6] = {1018, 1019, 1020, 1021};
    vehicleMods[78][1] = {1004, 1005, 1012, 0};
    vehicleMods[78][4] = {1013, 1024, 0, 0};
    vehicleMods[78][6] = {1020, 1021, 1022, 0};
    vehicleMods[89][0] = {1000, 1002, 1016, 0};
    vehicleMods[89][1] = {1004, 1005, 0, 0};
    vehicleMods[89][2] = {1006, 0, 0, 0};
    vehicleMods[89][4] = {1013, 1024, 0, 0};
    vehicleMods[89][6] = {1018, 1019, 1020, 0};
    vehicleMods[91][0] = {1003, 1014, 1023, 0};
    vehicleMods[91][3] = {1007, 0, 0, 0};
    vehicleMods[91][6] = {1018, 1019, 1020, 1021};
    vehicleMods[91][12] = {1143, 1145, 0, 0};
    vehicleMods[92][0] = {1000, 1016, 0, 0};
    vehicleMods[92][1] = {1004, 1005, 0, 0};
    vehicleMods[92][2] = {1006, 0, 0, 0};
    vehicleMods[96][0] = {1001, 1002, 1003, 1023};
    vehicleMods[96][1] = {1011, 0, 0, 0};
    vehicleMods[96][2] = {1006, 0, 0, 0};
    vehicleMods[96][6] = {1019, 1020, 0, 0};
    vehicleMods[96][12] = {1143, 0, 0, 0};
    vehicleMods[100][4] = {1013, 1024, 0, 0};
    vehicleMods[100][6] = {1019, 1020, 1021, 0};
    vehicleMods[116][0] = {1000, 1002, 1015, 1016};
    vehicleMods[116][1] = {1004, 0, 0, 0};
    vehicleMods[116][3] = {1007, 0, 0, 0};
    vehicleMods[116][6] = {1018, 1019, 1020, 1021};
    vehicleMods[117][0] = {1002, 1003, 1016, 1023};
    vehicleMods[117][3] = {1007, 0, 0, 0};
    vehicleMods[117][6] = {1018, 1019, 1020, 0};
    vehicleMods[117][12] = {1143, 1145, 0, 0};
    vehicleMods[118][0] = {1001, 1003, 1023, 0};
    vehicleMods[118][1] = {1005, 0, 0, 0};
    vehicleMods[118][2] = {1006, 0, 0, 0};
    vehicleMods[118][3] = {1007, 0, 0, 0};
    vehicleMods[118][4] = {1013, 0, 0, 0};
    vehicleMods[118][6] = {1018, 1020, 0, 0};
    vehicleMods[118][12] = {1143, 1145, 0, 0};
    vehicleMods[127][0] = {1001, 1014, 1015, 0};
    vehicleMods[127][3] = {1007, 0, 0, 0};
    vehicleMods[127][6] = {1018, 1020, 1021, 0};
    vehicleMods[129][0] = {1001, 1003, 1023, 0};
    vehicleMods[129][1] = {1011, 1012, 0, 0};
    vehicleMods[129][2] = {1006, 0, 0, 0};
    vehicleMods[129][3] = {1007, 0, 0, 0};
    vehicleMods[129][6] = {1018, 1019, 1020, 0};
    vehicleMods[134][1] = {1100, 1123, 1125, 0};
    vehicleMods[134][3] = {1101, 1106, 0, 0};
    vehicleMods[134][6] = {1126, 1127, 0, 0};
    vehicleMods[134][10] = {1179, 1185, 0, 0};
    vehicleMods[134][11] = {1178, 1180, 0, 0};
    vehicleMods[135][3] = {1118, 1119, 0, 0};
    vehicleMods[135][6] = {1113, 1114, 0, 0};
    vehicleMods[135][10] = {1115, 1116, 1117, 0};
    vehicleMods[135][11] = {1109, 1110, 0, 0};
    vehicleMods[136][2] = {1103, 1128, 0, 0};
    vehicleMods[136][3] = {1108, 0, 0, 0};
    vehicleMods[136][6] = {1104, 1105, 0, 0};
    vehicleMods[136][10] = {1181, 1182, 0, 0};
    vehicleMods[136][11] = {1183, 1184, 0, 0};
    vehicleMods[140][0] = {1001, 1023, 0, 0};
    vehicleMods[140][1] = {1004, 0, 0, 0};
    vehicleMods[140][2] = {1006, 0, 0, 0};
    vehicleMods[140][3] = {1007, 0, 0, 0};
    vehicleMods[140][4] = {1024, 0, 0, 0};
    vehicleMods[140][6] = {1018, 1019, 1020, 0};
    vehicleMods[140][12] = {1143, 1145, 0, 0};
    vehicleMods[142][0] = {1014, 1015, 0, 0};
    vehicleMods[142][6] = {1018, 1019, 1020, 1021};
    vehicleMods[142][12] = {1145, 0, 0, 0};
    vehicleMods[146][0] = {1001, 1002, 1023, 0};
    vehicleMods[146][1] = {1004, 0, 0, 0};
    vehicleMods[146][2] = {1006, 0, 0, 0};
    vehicleMods[146][3] = {1007, 0, 0, 0};
    vehicleMods[146][4] = {1024, 0, 0, 0};
    vehicleMods[146][6] = {1018, 1019, 0, 0};
    vehicleMods[146][12] = {1143, 1145, 0, 0};
    vehicleMods[147][0] = {1000, 1003, 1016, 0};
    vehicleMods[147][6] = {1018, 1019, 1020, 1021};
    vehicleMods[147][12] = {1143, 0, 0, 0};
    vehicleMods[149][0] = {1001, 1003, 1023, 0};
    vehicleMods[149][1] = {1011, 1012, 0, 0};
    vehicleMods[149][3] = {1007, 0, 0, 0};
    vehicleMods[149][6] = {1018, 1019, 1020, 0};
    vehicleMods[149][12] = {1143, 1145, 0, 0};
    vehicleMods[150][0] = {1001, 1003, 1023, 0};
    vehicleMods[150][1] = {1004, 1005, 0, 0};
    vehicleMods[150][2] = {1006, 0, 0, 0};
    vehicleMods[150][6] = {1018, 1019, 1020, 0};
    vehicleMods[150][12] = {1143, 1145, 0, 0};
    vehicleMods[151][0] = {1002, 1003, 1016, 1023};
    vehicleMods[151][1] = {1005, 0, 0, 0};
    vehicleMods[151][2] = {1006, 0, 0, 0};
    vehicleMods[151][6] = {1018, 1019, 1020, 1021};
    vehicleMods[158][0] = {1164, 1163, 0, 0};
    vehicleMods[158][2] = {1088, 1091, 0, 0};
    vehicleMods[158][3] = {1090, 1093, 0, 0};
    vehicleMods[158][6] = {1092, 1089, 0, 0};
    vehicleMods[158][10] = {1166, 1165, 0, 0};
    vehicleMods[158][11] = {1168, 1167, 0, 0};
    vehicleMods[160][0] = {1138, 1139, 0, 0};
    vehicleMods[160][2] = {1032, 1033, 0, 0};
    vehicleMods[160][3] = {1026, 1031, 0, 0};
    vehicleMods[160][6] = {1028, 1029, 0, 0};
    vehicleMods[160][10] = {1169, 1170, 0, 0};
    vehicleMods[160][11] = {1141, 1140, 0, 0};
    vehicleMods[161][0] = {1058, 1060, 0, 0};
    vehicleMods[161][2] = {1055, 1061, 0, 0};
    vehicleMods[161][3] = {1056, 1057, 0, 0};
    vehicleMods[161][6] = {1064, 1059, 0, 0};
    vehicleMods[161][10] = {1155, 1157, 0, 0};
    vehicleMods[161][11] = {1154, 1156, 0, 0};
    vehicleMods[162][0] = {1147, 1146, 0, 0};
    vehicleMods[162][2] = {1035, 1038, 0, 0};
    vehicleMods[162][3] = {1036, 1039, 0, 0};
    vehicleMods[162][6] = {1034, 1037, 0, 0};
    vehicleMods[162][10] = {1171, 1172, 0, 0};
    vehicleMods[162][11] = {1149, 1148, 0, 0};
    vehicleMods[165][0] = {1049, 1050, 0, 0};
    vehicleMods[165][2] = {1054, 1053, 0, 0};
    vehicleMods[165][3] = {1047, 1048, 0, 0};
    vehicleMods[165][6] = {1046, 1045, 0, 0};
    vehicleMods[165][10] = {1153, 1152, 0, 0};
    vehicleMods[165][11] = {1150, 1151, 0, 0};
    vehicleMods[167][2] = {1130, 1131, 0, 0};
    vehicleMods[167][3] = {1133, 0, 0, 0};
    vehicleMods[167][6] = {1129, 1132, 0, 0};
    vehicleMods[167][10] = {1189, 1188, 0, 0};
    vehicleMods[167][11] = {1187, 1186, 0, 0};
    vehicleMods[175][3] = {1042, 0, 0, 0};
    vehicleMods[175][6] = {1044, 1043, 0, 0};
    vehicleMods[175][10] = {1174, 1175, 0, 0};
    vehicleMods[175][11] = {1176, 1177, 0, 0};
    vehicleMods[176][3] = {1137, 1134, 0, 0};
    vehicleMods[176][6] = {1136, 1135, 0, 0};
    vehicleMods[176][10] = {1191, 1190, 0, 0};
    vehicleMods[176][11] = {1192, 1193, 0, 0};
    vehicleMods[180][0] = {1001, 1023, 0, 0};
    vehicleMods[180][2] = {1006, 0, 0, 0};
    vehicleMods[180][3] = {1007, 0, 0, 0};
    vehicleMods[180][6] = {1018, 1020, 0, 0};
    vehicleMods[185][0] = {1001, 1003, 1023, 0};
    vehicleMods[185][2] = {1006, 0, 0, 0};
    vehicleMods[185][3] = {1007, 0, 0, 0};
    vehicleMods[185][4] = {1013, 0, 0, 0};
    vehicleMods[185][6] = {1018, 1019, 1020, 0};
    vehicleMods[185][12] = {1143, 1145, 0, 0};
    vehicleMods[189][0] = {1000, 1016, 0, 0};
    vehicleMods[189][1] = {1005, 1004, 0, 0};
    vehicleMods[189][2] = {1006, 0, 0, 0};
    vehicleMods[189][3] = {1007, 0, 0, 0};
    vehicleMods[189][4] = {1013, 1024, 0, 0};
    vehicleMods[189][6] = {1018, 1020, 0, 0};
    vehicleMods[189][12] = {1145, 0, 0, 0};
    vehicleMods[199][0] = {1162, 1158, 0, 0};
    vehicleMods[199][2] = {1067, 1068, 0, 0};
    vehicleMods[199][3] = {1069, 1070, 0, 0};
    vehicleMods[199][6] = {1065, 1066, 0, 0};
    vehicleMods[199][10] = {1160, 1173, 0, 0};
    vehicleMods[199][11] = {1159, 1161, 0, 0};
    vehicleMods[200][1] = {1004, 1005, 0, 0};
    vehicleMods[200][2] = {1006, 0, 0, 0};
    vehicleMods[200][3] = {1007, 0, 0, 0};
    vehicleMods[200][4] = {1013, 0, 0, 0};
    vehicleMods[200][6] = {1018, 1020, 1022, 0};
    vehicleMods[203][0] = {1001, 1023, 0, 0};
    vehicleMods[203][2] = {1006, 0, 0, 0};
    vehicleMods[203][3] = {1007, 0, 0, 0};
    vehicleMods[203][4] = {1024, 0, 0, 0};
    vehicleMods[203][6] = {1019, 1020, 0, 0};
    vehicleMods[203][12] = {1143, 1145, 0, 0};

    gettime(ghour, gminute, gsecond);
    FixHour(ghour);
    ghour = shifthour;
    if(!realtime)
    {
        SetWorldTime(wtime);
    }
    AllowInteriorWeapons(1);
    UsePlayerPedAnims();
    ServerButton[0] = CreateButton(244.92, 72.29, 1004.27, 180.0); // LSPD DOOR ENTER 0.0
    ServerButton[1] = CreateButton(244.91, 73.81, 1004.27, 270.0); // LSPD DOOR EXIT 180.0
    ServerButton[2] = CreateButton(1765.9000, -1574.0979, 1641.7, 270.0); // PRISON CELL OPEN 270.0
    ServerButton[3] = CreateButton(222.41, 71.29, 1005.66, 270.0); // CHIEF DOOR OUTSIDE 90.0
    ServerButton[4] = CreateButton(221.87, 68.34, 1005.66, 90.0); // CHIEF DOOR INSIDE 270.0
    ServerButton[5] = CreateButton(218.10449219,1877.37500000,13.57175064, 82.0); // DEMORGAN OUTSIDE
    ServerButton[6] = CreateButton(218.27235413,1874.35571289,13.49783707, 135.99047852); // DEMORGAN INSIDE

    /*
     * Vehicle Spawns
     */



    new
        tmphour,
        tmpminute,
        tmpsecond;

    gettime(tmphour, tmpminute, tmpsecond);
    FixHour(tmphour);
    tmphour = shifthour;
    SetWorldTime(tmphour);

    for(new i = 0; i < sizeof(CreatedCars); i++)
    {
        CreatedCars[i] = INVALID_VEHICLE_ID;
    }
    for(new i = 0; i < sizeof(MinigunData); i++)
    {
        if(MinigunData[i][Object] != INVALID_OBJECT_ID)
        {
            if(MinigunData[i][Activated])
            {
                format(string, sizeof(string), "Minigun Active\nType (/minigun)\nID: %d",i);
            }
            else
            {
                format(string, sizeof(string), "Minigun Inactive\nType (/minigun)\nID: %d",i);
            }
            MinigunData[i][TextLabel] = CreateDynamic3DTextLabel(string,COLOR_RED,MinigunData[i][Xpos], MinigunData[i][Ypos], MinigunData[i][Zpos]+0.88,3.0);
        }
    }
    for(new i = 0; i <= sizeof(PedSkins)-1; i++)
    {
        AddPlayerClass(PedSkins[i][0],982.1890,-1624.2583,14.952,90,-1,-1,-1,-1,-1,-1);
    }
    for(new i = 1; i <= MAX_VEHICLES; i++)
    {
        Gas[i] = 100;
        SetVehicleRims(i);
    }

    printf(" Loaded %d Dynamic Objects.", CountDynamicObjects());
    printf(" Loaded %d Dynamic Text Labels.", CountDynamic3DTextLabels());
    printf(" Loaded %d Dynamic Areas.", CountDynamicAreas());
    printf(" Loaded %d Dynamic Pickups.", CountDynamicPickups());
    printf(" Everything loaded successfully!");
    return 1;
}


Timer:SyncUp[60000]()
{
    SyncTime();
    DollahScoreUpdate();
}

//  Minutes: 5.
Timer:SaveChars[300000]() // 300000
{
    foreach(Player, i)
    {
        if(GetPlayerState(i) != PLAYER_STATE_SPECTATING && !PlayerInfo[i][pPaintball])
        {
            OnPlayerSave(i);
        }
    }
    SaveFactions();
}

/*Timer:Zemmer[10000]()
{
    SaveFactions();
    SaveDivisions();
    printf("Saved ah mattie");
}*/


stock SyncTime()
{
    new
        tmphour,
        tmpminute,
        year,
        day,
        month,
        string[64],
        tmpsecond;

    getdate(year, month, day);
    gettime(tmphour, tmpminute, tmpsecond);
    FixHour(tmphour);
    tmphour = shifthour;
    if((tmphour > ghour) || (tmphour == 0 && ghour == 23))
    {
        format(string, sizeof(string), "The time is now %d:00 hour.",tmphour);
        SendClientMessageToAll(COLOR_WHITE,string);
        ghour = tmphour;
        PayDay();
        SetTimer("PointCheck", 300000, 0); //5 minutes
        for(new i = 0; i < sizeof(PointInfo); i++)
        {
            if(PointInfo[i][PointTime] > 0) PointInfo[i][PointTime]--;
        }
        /*for(new i = 0; i < MAX_SPRAYTAGS; i++)
        {
            if(SprayTag[i][Time] > 0) SprayTag[i][Time]--;
        }*/

        if(RobStatus[BankReload] > 0) RobStatus[BankReload]--;
        if(realtime) SetWorldTime(tmphour);
    }
}

Timer:Production[300000]()
{
    SavePoints();
    foreach(Player, i)
    {
        if(PlayerInfo[i][pFishes] >= 5)
        {
            if(FishCount[i] >= 3)
            {
                PlayerInfo[i][pFishes] = 0;
            }
            else
            {
                FishCount[i] += 1;
            }
        }
        if(PlayerInfo[i][pPayDay] <= 5)
        {
            if(!PlayerInfo[i][pPossiblyAwayFromKeyBoard][1]) PlayerInfo[i][pPayDay]++;
        }
    }
}



Re: Run Time Error 4, need help. - 3ventic - 01.02.2013

In the command(s) you tried to use (or in the callback maybe?), there's something trying to access array[1500] while array[1499] is the last one that exists. Whenever accessing the array, check that the cell exists before using it. I don't know enough pawn to help you further.


Re: Run Time Error 4, need help. - Mr.1337 - 01.02.2013

I don't really know how to fix this, as I don't even understand it. And how come it works on windows but not on linux?..