Array + Loop
#5

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
new GW_Name[][] =
{
    !"Glen Park",
    !"Upper Grove",
    !"Grove Street",
    !"Car Wash",
    !"LSPD Headquarters",
    !"LS Medical Center",
    !"Ferris Wheel",
    !"Vinewood",
    !"Filmstudios",
    !"Fuel Station",
    !"Tram STation",
    !"Burger Shot LS North",
    !"LS Parking Lot",
    !"Walk of Fame",
    !"LS Mall",
    !"LS Beach Canal",
    !"The Pig Pen Brothel",
    !"Complex of Buildings",
    !"Fashion Corner",
    !"Lighthouse",
    !"Vinewood Barracks",
    !"LS North-East Building", //could use a rename
    !"Tram Barracks",
    !"LS Airport",
    !"Mansion",
    !"Ammunation LS Canals",
    !"Leisure Center",
    !"LS Docks Canals",
    !"LS Southside Bridge",
    !"LS Cluckin' Bell Quarters",
    !"LS Docks",
    !"LS South-East Beach Quarters",
    !"SF Building Lot",
    !"Wang Cars",
    !"SF Warehouse Area",
    !"SF Baseball Quarters",
    !"Missionary Hill",
    !"Foster Valley",
    !"SF Airport",
    !"SF Industrial",
    !"SF Harborside",
    !"SF Ship",
    !"Hippie Quarters",
    !"SF West Beach Quarters",
    !"SF Hotel",
    !"SFPD Headquarters",
    !"SF Government",
    !"SF Medical Center",
    !"SF North-West Quarters",
    !"China Town",
    !"Snake Road",
    !"Pier 69",
    !"Otto's Autos",
    !"SF Skyscrapers",
    !"SF North Quarters",
    !"Gant Bridge Diner and Museum",
    !"Whetstone Small Farm",
    !"Whetstone Grand Farm"
};

GetZoneName(zoneid)
{
    new str[35];

    str = "Unknown";

    if(0 <= zoneid < sizeof(GW_Name))
        strunpack(str,GW_Name);

    return str;
}

public OnGameModeInit()
{
    new string[80];
    for(new i=0; i < MAX_GANG_ZONES; i++)
    {
        format(string, sizeof(string), "» GANG ZONE «\nID: %i\nName: %s", i, GetZoneName(i));
        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;
}
Sorry if off topic.
Wow. strunpack. Never heard of that, you know any tutorials?
Btw, if I use that, how do I get zoneID from zoneName?
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)