Dynamic Door Zone (+REP)
#2

First of all: holy shit OP, avoid code duplication!
pawn Код:
stock CreateDynamicDoor(doorid)
{
    new string[128];
    if(DDoorsInfo[doorid][ddType] != 0) format(string, sizeof(string), "%s\nBuilding Address: %d", DDoorsInfo[doorid][ddDescription], StripUnderscore(DDoorsInfo[doorid][ddOwnerName]), doorid);
    else format(string, sizeof(string), "%s\nBuilding Address: %d", DDoorsInfo[doorid][ddDescription], doorid);

    if (-1 != DDoorsInfo[doorid][ddColor]) {
        new
            colour
        ;

        switch(DDoorsInfo[doorid][ddColor])
        {
            case 1: colour = COLOR_TWWHITE
            case 2: colour = COLOR_TWPINK
            case 3: colour = COLOR_TWRED
            case 4: colour = COLOR_TWBROWN
            case 5: colour = COLOR_TWGRAY
            case 6: colour = COLOR_TWOLIVE
            case 7: colour = COLOR_TWPURPLE
            case 8: colour = COLOR_TWORANGE
            case 9: colour = COLOR_TWAZURE
            case 10: colour = COLOR_TWGREEN
            case 11: colour = COLOR_TWBLUE
            case 12: colour = COLOR_TWBLACK
            default: colour = COLOR_YELLOW
        }

        DDoorsInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, colour, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ]+1,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DDoorsInfo[doorid][ddExteriorVW], DDoorsInfo[doorid][ddExteriorInt], -1);
    }

    if (-1 != DDoorsInfo[doorid][ddPickupModel]) {
        new
            model
        ;

        switch(DDoorsInfo[doorid][ddPickupModel])
        {
            case 1: model = 1210;
            case 2: model = 1212;
            case 3: model = 1239;
            case 4: model = 1240;
            case 5: model = 1241;
            case 6: model = 1242;
            case 7: model = 1247;
            case 8: model = 1248;
            case 9: model = 1252;
            case 10: model = 1253;
            case 11: model = 1254;
            case 12: model = 1313;
            case 13: model = 1272;
            case 14: model = 1273;
            case 15: model = 1274;
            case 16: model = 1275;
            case 17: model = 1276;
            case 18: model = 1277;
            case 19: model = 1279;
            case 20: model = 1314;
            case 21: model = 1316;
            case 22: model = 1317;
            case 23: model = 1559;
            case 24: model = 1582;
            case 25: model = 2894;
            default: model = 1318;
        }

        DDoorsInfo[doorid][ddPickupID] = CreateDynamicPickup(model, 23, DDoorsInfo[doorid][ddExteriorX], DDoorsInfo[doorid][ddExteriorY], DDoorsInfo[doorid][ddExteriorZ], DDoorsInfo[doorid][ddExteriorVW]);
    }
}
Now: What exactly do you mean by zone. Name of map zone, like "Grove street", or something?
Reply


Messages In This Thread
Dynamic Door Zone (+REP) - by Trevor Gin - 12.03.2015, 13:22
Re: Dynamic Door Zone (+REP) - by Misiur - 12.03.2015, 13:42
Re: Dynamic Door Zone (+REP) - by Trevor Gin - 12.03.2015, 13:43
Re: Dynamic Door Zone (+REP) - by Misiur - 12.03.2015, 14:13
Re: Dynamic Door Zone (+REP) - by Trevor Gin - 12.03.2015, 14:55
Re: Dynamic Door Zone (+REP) - by Misiur - 12.03.2015, 15:14
Re: Dynamic Door Zone (+REP) - by Trevor Gin - 12.03.2015, 15:19

Forum Jump:


Users browsing this thread: 1 Guest(s)