Unreachable Code.
#1

Alright here it goes, ever since I've been trying to do this simple piece of code I get the same warning which is kind'a important.

Warning; "Unreachable Code".

This is the code, and yes it's under OnGameModeInit()

{
DisableInteriorEnterExits();
return 1;
}

Thanks in advance guys.
Reply
#2

Its like this?

pawn Код:
public OnGameModeInit()
{
    DisableInteriorEnterExits();
    return 1;
}
Since you are posting a half code.
// Post your whole OnGameModeInit here. I don't really trust it
Reply
#3

are u sure the whole callback is closed ordinary?

Or post the whole OnGameModeInit if its not too long.
Reply
#4

https://sampwiki.blast.hk/wiki/DisableInteriorEnterExits

make sure you post it the right way
Reply
#5

Sure thing it's from uh, the Beginner package by Jake_****

pawn Код:
public OnGameModeInit()
{
    DisableInteriorEnterExits();
    return 1;
}
//===============================DEALERSHIP=====================================
    LoadVehicles();
    LoadDealerships();
    LoadFuelStations();
    for(new i=1; i < MAX_DVEHICLES; i++)
    {
        UpdateVehicle(i, 0);
    }
    for(new i=1; i < MAX_DEALERSHIPS; i++)
    {
        UpdateDealership(i, 0);
    }
    for(new i=1; i < MAX_FUEL_STATIONS; i++)
    {
        UpdateFuelStation(i, 0);
    }
    SetTimer("MainTimer", 1000, true);
    SetTimer("SaveTimer", 2222, true);
//==============================================================================
    printf("------ Engine System Started------- ");
    SetGameModeText("TRP 0.002");
    gettime(ghour, gminute, gsecond);
    FixHour(ghour);
    ghour = shifthour;
    if (realtime)
    {
        new tmphour;
        new tmpminute;
        new tmpsecond;
        gettime(tmphour, tmpminute, tmpsecond);
        FixHour(tmphour);
        tmphour = shifthour;
        SetWorldTime(tmphour);
    }
//============================[Menus]===========================================
    Paper = CreateMenu("Paper", 2, 200.0, 100.0, 150.0, 150.0);
    AddMenuItem(Paper, 0, "Next Page");
    AddMenuItem(Paper, 0, "How to get a license");
    AddMenuItem(Paper, 0, "How to call a taxi");
    AddMenuItem(Paper, 0, "Where to live");
    AddMenuItem(Paper, 0, "Medic Help");
    AddMenuItem(Paper, 0, "SAPD help");
    AddMenuItem(Paper, 0, "OOC:Forums");
    Paper2 = CreateMenu("Paper2", 2, 200.0, 100.0, 150.0, 150.0);
    AddMenuItem(Paper2, 0, "Next Page");
    AddMenuItem(Paper2, 0, "Garbage Collector");
    AddMenuItem(Paper2, 0, "Taximeter");
    AddMenuItem(Paper2, 0, "Fishing");
    AddMenuItem(Paper2, 0, "Mechanic");
   
//================================[3D Text Labels]==============================
    Create3DTextLabel("/newspaper for information",COLOR_GREEN, 1707.8434,-2331.6506,-2.6797, 20.0,0,0);
    Create3DTextLabel("Los Santos Police Department", COLOR_WHITE, 1555.3313,-1675.4623,16.1953, 02.0,0,0);
//================================[TIMERS]======================================
    SetTimer("SyncTime", 60000, 1);
    SetTimer("ScoreUpdate", 1000, 1);
    SetTimer("SetPlayerUnMute", 1000, 1);
//===============================[PICKUPS]======================================
    AddStaticPickup(1239, 23, 1707.8434,-2331.6506,-2.6797);
    AddStaticPickup(1240, 23, 1173.112426, -1320.917602, 15.396226);
    AddStaticPickup(1318, 23, 1172.914794, -1325.471313, 15.398929);
    AddStaticPickup(1318, 23, 1482.534423, -1771.555541, 18.795755);
    AddStaticPickup(1318, 23, 1555.134277, -1675.773071, 16.195312);
    AddStaticPickup(1318, 23, 1565.185180, -1666.162963, 28.395606);
    AddStaticPickup(1318, 23, 1653.883056, -1655.420898, 22.515625);
    AddStaticPickup(1247, 23, 1525.285278, -1677.911865, 5.890625);
    AddStaticPickup(1318, 23, 1568.560302, -1690.335815, 5.890625);
    AddStaticPickup(1318, 23, 1727.056884, -1636.913208, 20.217334);
    AddStaticPickup(1318, 23, 1797.998046, -1578.819091, 14.090865);
    AddStaticPickup(1240, 23, 2034.583374, -1405.004516, 17.244943);
    AddStaticPickup(1318, 23, 2233.053955, -1333.350463, 23.981575);
    AddStaticPickup(1318, 23, 2232.929931, -1159.893554, 25.890625);
    AddStaticPickup(1318, 23, 2351.947021, -1170.659545, 28.074401);
    AddStaticPickup(1318, 23, 2421.583496, -1219.243041, 25.561477);
    AddStaticPickup(1318, 23, 2166.275634, -1671.659545, 15.073946);
    AddStaticPickup(1239, 23, 2165.229736, -1672.992187, 15.077716);
    AddStaticPickup(1239, 23, 1666.597900, -1524.166992, 13.546875);
    AddStaticPickup(1318, 23, 1667.901611, -1521.946777, 13.546875);
    AddStaticPickup(1318, 23, 1568.028320, -1898.009155, 13.560886);
    AddStaticPickup(1239, 23, 2162.161376, -102.522369, 2.750000);
//==============================[VEHICLES]==========================================
    AddStaticVehicle(596,1535.8279,-1667.0283,13.1042,1.2749,0,1); // //Copcar 1
    AddStaticVehicle(596,1535.7777,-1678.2174,13.1041,359.0435,0,1); // //Copcar 2
    AddStaticVehicle(596,1602.2314,-1688.1366,5.6119,88.9127,0,1); // //Copcar 3
    AddStaticVehicle(596,1602.3998,-1696.2252,5.6117,89.5110,0,1); // //Copcar 4
    AddStaticVehicle(596,1602.2968,-1704.6088,5.6114,89.2925,0,1); // //Copcar 5
    AddStaticVehicle(596,1591.6299,-1711.7292,5.6110,0.5575,0,1); // //Copcar 6
    AddStaticVehicle(596,1583.3506,-1711.8403,5.6123,359.9798,0,1); // //Copcar 7
    AddStaticVehicle(596,1574.4407,-1711.5636,5.6112,0.4981,0,1); // //Copcar 8
    AddStaticVehicle(596,1564.4946,-1711.8907,5.6117,0.0557,0,1); // //Copcar 9
    AddStaticVehicle(597,1602.1552,-1691.9513,5.6600,90.2862,1,0); // //Copcar 10
    AddStaticVehicle(597,1602.1045,-1684.0902,5.6588,89.9887,1,0); // //Copcar 11
    AddStaticVehicle(597,1602.5887,-1700.3116,5.6600,90.1532,1,0); // //Copcar 12
    AddStaticVehicle(597,1595.2753,-1711.4293,5.6598,1.4325,1,93); // //Copcar 13
    AddStaticVehicle(597,1587.3236,-1711.8318,5.6587,359.5460,1,93); // //Copcar 14
    AddStaticVehicle(598,1578.6815,-1712.0513,5.6365,358.1766,1,93); // //Copcar 15
    AddStaticVehicle(598,1570.2655,-1711.8102,5.6356,359.8264,1,93); // //Copcar 16
    AddStaticVehicle(596,1558.4491,-1711.7164,5.6120,0.7168,1,93); // //Copcar 17
    AddStaticVehicle(596,1584.6483,-1671.5382,5.6145,270.2792,1,93); // //Copcar 18
    AddStaticVehicle(596,1584.6222,-1667.4482,5.6145,270.0910,1,93); // //Copcar 19
    AddStaticVehicle(599,1546.2502,-1650.8398,6.0786,90.8912,0,1); // //cop car 20
    AddStaticVehicle(599,1546.8645,-1659.1162,6.0787,90.3100,0,1); // //cop car 21
    AddStaticVehicle(599,1546.6399,-1667.8623,6.0780,90.4493,0,1); // //cop car 22
    AddStaticVehicle(601,1545.8365,-1655.1222,5.6494,89.7686,0,1); // //cop car Swat Tank 23
    AddStaticVehicle(528,1546.2603,-1662.9534,5.9328,89.3495,0,1); // //cop FBI truck(blue one) 24
    AddStaticVehicle(427,1530.1572,-1644.9054,6.0225,179.7986,0,1); // //SWAT Enforcer 25
    AddStaticVehicle(427,1538.6517,-1644.5701,6.0426,180.0564,0,1); // //SWAT Enforcer 26
    AddStaticVehicle(427,1534.6859,-1645.0800,6.0228,178.4550,0,1); // //SWAT Enforcer 27
    AddStaticVehicle(427,1526.0662,-1645.3656,6.0223,180.0917,0,1); // //SWAT Enforcer 28
    AddStaticVehicle(428,570.7433,-1252.2587,17.6663,292.1557,24,1); // //Bank Truck in Rodeo Car 29
    AddStaticVehicle(428,608.0444,-1237.8926,18.4802,111.9092,24,1); // //Bank Truck in Rodeo Car 30
    AddStaticVehicle(426,1543.2870,-1612.4788,13.1262,269.5055,25,25); // //Cop Undercover Car 31
    AddStaticVehicle(426,1543.1644,-1606.7509,13.1253,269.9076,25,25); // //Cop Undercover Car 32
    AddStaticVehicle(421,1555.6886,-1605.9546,13.2653,180.6853,53,53); // //Cop Undercover Car 33
    AddStaticVehicle(421,1561.6571,-1606.0315,13.2653,180.1476,53,53); // //Cop Undercover Car 34
    AddStaticVehicle(416,1177.8341,-1338.3657,14.0368,270.3866,1,3); // //Ambulance EMS Car 35
    AddStaticVehicle(416,1176.9736,-1308.6931,14.0205,267.3689,1,3); // //Ambulance EMS Car 36
    AddStaticVehicle(442,1146.2450,-1295.7229,13.4723,90.3940,1,3); // Hearse for EMS Car 37
    AddStaticVehicle(489,1146.2805,-1302.9196,13.8021,88.5398,1,3); // Rancher for EMS Car 38
    AddStaticVehicle(489,1146.2393,-1309.4309,13.8083,91.4548,1,3); // Rancher for EMS Car 39
    AddStaticVehicle(442,1145.8127,-1316.3143,13.4507,92.9838,1,3); // Hearse for EMS Car 40
    AddStaticVehicle(563,1162.4646,-1301.3418,32.2003,277.2430,1,3); // EMS Heli 41
    AddStaticVehicle(563,1163.9746,-1318.8575,32.1941,271.8757,1,3); // EMS Heli 42
    AddStaticVehicle(490,1666.7798,-1719.3749,20.6192,0.9672,0,0); // FBI 43
    AddStaticVehicle(490,1660.0472,-1719.5132,20.6102,359.8513,0,0); // FBI 44
    AddStaticVehicle(490,1671.4838,-1710.0861,20.6083,90.5516,0,0); // FBI 45
    AddStaticVehicle(490,1671.6444,-1702.4733,20.6114,92.2191,0,0); // FBI 46
    AddStaticVehicle(541,1645.6516,-1695.8042,20.0834,270.8706,0,0); // FBI Bullet Car 47
    AddStaticVehicle(541,1645.8918,-1700.3801,20.1054,270.4592,0,1); // FBI Bullet Car 48
    AddStaticVehicle(421,1646.3101,-1709.2988,20.3669,269.9211,0,1); // FBI Washington Car 49
    AddStaticVehicle(421,1646.3663,-1704.7172,20.3669,268.8617,0,1); // FBI Washington Car 50
    AddStaticVehicle(416,2037.2849,-1425.5010,17.1416,359.6898,1,3); // //County hospital ambulance Car 51
    AddStaticVehicle(416,2007.9158,-1410.9948,17.1415,90.1937,1,3); // //County hospital ambulance Car 52
    AddStaticVehicle(416,2001.8311,-1399.1924,18.3391,181.5330,1,3); // //County hospital ambulance Car 53
    AddStaticVehicle(416,2033.9324,-1447.6057,17.3766,270.3489,1,3); // //County hospital ambulance Car 54
    dmvc = AddStaticVehicle(405,1415.5630,-1706.7310,13.4196,267.9858,1,1); // license1
    dmvc1 = AddStaticVehicle(405,1416.1293,-1712.1976,13.4219,271.2856,1,1); // license2
    dmvc2 = AddStaticVehicle(405,1415.3511,-1718.4138,13.4218,267.3419,1,1); // license3
    return 1;
}
Reply
#6

Remove the first return1; and that bracket.
Sorry I can't post a example, when I copy past it's fucked.
Reply
#7

Cannot understand why
there is
Quote:

OnGameModeInit()
{
//something
}
//remaining code
} //another bracket?

Just remove the return and the bracket } in ongamemodeinit

*It seems somebody already answered :troll:
Reply
#8

But then again the white arrow does not move from the Los Santos Police Department.
Reply
#9

Yes, but the main error is gone. They is a other function for that. Not sure wich one. Hope someone will post it.
Reply
#10

Oh heh, I may wait then. Both people who helped +1 rep.

Cheers guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)