GetPlayer2DZone, Question custom zone names by VirtualWorlds
#4

pawn Код:
stock GetPlayer2DZone(playerid, zone[], len)
{
    new AmmuInMarket[50] = "Ammunation In Market(LS)",
        AmmuInComeALot[50] = "Ammunation In Come-A-Lot",
        AmmuInBoneCounty[50] = "Ammunation In Bone County",
        AmmuInFortCarson[50] = "Ammunation In Fort Carson",
        AmmuInElquabrados[50] = "Ammunation In El Quebrados",
        LasVenturasPolice[50] = "Las Venturas Police Department",
        LosSantosPolice[50] = "Los Santos Police Department",
        SanFierroPolice[50] = "San Fierro Police Department",
        FourDragonCasino[50] = "The Four Dragon Casino",
        CaligulaCasino[50] = "Caligula's Casino",
        playerzone[50];
   
    for(new j; j < sizeof(zones); j++) {
        if(IsPlayerInZone(playerid,j)) {
            memcpy(playerzone, zones[j][zone_name], 0, 108);
            break;
        }
        switch (GetPlayerVirtualWorld(playerid)) {
            case 11: return AmmuInMarket;
            case 12: return AmmuInComeALot;
            case 13: return AmmuInBoneCounty;
            case 14: return AmmuInFortCarson;
            case 15: return AmmuInElquabrados;
            case 20: return LasVenturasPolice;
            case 21: return SanFierroPolice;
            case 22: return LosSantosPolice;
            case 23: return FourDragonCasino;
            case 24: return CaligulaCasino;
        }
    }
    if(playerzone[0] != '\0') return playerzone;
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    for(new i = 0; i != sizeof(gSAZones); i++ )
    {
         if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
        {
            return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
        }
    }
    return 0;
}
I don't know if I understand your goal completely, but here I just merged them, so firstly it checks the virtual worlds, then the 2D Zones
Reply


Messages In This Thread
GetPlayer2DZone, Question custom zone names by VirtualWorlds - by andrew2695 - 02.08.2012, 06:57
Re: GetPlayer2DZone, Question custom zone names by VirtualWorlds - by Misiur - 02.08.2012, 10:02
Re : GetPlayer2DZone, Question custom zone names by VirtualWorlds - by andrew2695 - 02.08.2012, 16:23
Re: GetPlayer2DZone, Question custom zone names by VirtualWorlds - by Misiur - 02.08.2012, 16:38

Forum Jump:


Users browsing this thread: 1 Guest(s)