Array + Loop
#2

Try using enums
pawn Код:
Text3D:GangZoneLabel[MAX_GANG_ZONES];
 
 enum e_GW
 {
    GW_Name[100],
    GW_ID
}

new GW_Name_ID[][e_GW] =
{
    {"Glen Park", 0},
    {"Upper Grove", 1},
    {"Grove Street", 2},
    {"Car Wash", 3},
    {"LSPD Headquarters", 4},
    {"LS Medical Center", 5},
    {"Ferris Wheel", 6},
    {"Vinewood", 7},
    {"Filmstudios", 8},
    {"Fuel Station", 9},
    {"Tram STation", 10},
    {"Burger Shot LS North", 11},
    {"LS Parking Lot", 12},
    {"Walk of Fame", 13},
    {"LS Mall", 14},
    {"LS Beach Canal", 15},
    {"The Pig Pen Brothel", 16},
    {"Complex of Buildings", 17},
    {"Fashion Corner", 18},
    {"Lighthouse", 19},
    {"Vinewood Barracks", 20},
    {"LS North-East Building", 21}, //could use a rename
    {"Tram Barracks", 22},
    {"LS Airport", 23},
    {"Mansion", 24},
    {"Ammunation LS Canals", 25},
    {"Leisure Center", 26},
    {"LS Docks Canals", 27},
    {"LS Southside Bridge", 28},
    {"LS Cluckin' Bell Quarters", 29},
    {"LS Docks", 30},
    {"LS South-East Beach Quarters", 31},
    {"SF Building Lot", 32},
    {"Wang Cars", 33},
    {"SF Warehouse Area", 34},
    {"SF Baseball Quarters", 35},
    {"Missionary Hill", 36},
    {"Foster Valley", 37},
    {"SF Airport", 38},
    {"SF Industrial", 39},
    {"SF Harborside", 40},
    {"SF Ship", 41},
    {"Hippie Quarters", 42},
    {"SF West Beach Quarters", 43},
    {"SF Hotel", 44},
    {"SFPD Headquarters", 45},
    {"SF Government", 46},
    {"SF Medical Center", 47},
    {"SF North-West Quarters", 48},
    {"China Town", 49},
    {"Snake Road", 50},
    {"Pier 69", 51},
    {"Otto's Autos", 52},
    {"SF Skyscrapers", 53},
    {"SF North Quarters", 54},
    {"Gant Bridge Diner and Museum", 55},
    {"Whetstone Small Farm", 56},
    {"Whetstone Grand Farm", 57}
};

public OnGameModeInit()
{
    new string[80];
    for(new i=0; i < MAX_GANG_ZONES; i++)
    {
        format(string, sizeof(string), "» GANG ZONE «\nID: %i\nName: %s", GW_Name_ID[i][GW_Name], GW_Name_ID[i][GW_ID]);
        GangZoneLabel[i] = CreateDynamic3DTextLabel(string, C_WHITE, GW_CaptureCPs[i][0], GW_CaptureCPs[i][1], GW_CaptureCPs[i][2], 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, -1, 100.0);
        GangZone[i] = GangZoneCreate(GW_ZoneCoordinates[i][0], GW_ZoneCoordinates[i][1], GW_ZoneCoordinates[i][2], GW_ZoneCoordinates[i][3]);
    }
    return 1;
}
Fixed my last problem on my fishing system.
Reply


Messages In This Thread
Array + Loop - by Manyula - 04.07.2014, 14:42
Re: Array + Loop - by greentarch - 04.07.2014, 14:47
AW: Array + Loop - by Mellnik - 04.07.2014, 14:47
Re: Array + Loop - by Jefff - 04.07.2014, 14:52
Re: Array + Loop - by greentarch - 04.07.2014, 14:58
Re: Array + Loop - by Manyula - 04.07.2014, 21:10
Re: Array + Loop - by Jefff - 04.07.2014, 22:59

Forum Jump:


Users browsing this thread: 1 Guest(s)