Got problem with array
#1

Ok, so yeah i got array problem (or something else?) with stupid vehicle system wich is based to tAxI's system...
I know it's pretty legend problem here ;P

I get alltime following errors
Код:
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(716) : error 021: symbol already defined: "VehicleInfo"
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11073) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11074) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11075) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11076) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11076) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11077) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11077) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11078) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11078) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11079) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11079) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11080) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11080) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11081) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11081) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11082) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11082) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11083) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11083) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11084) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11084) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11085) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11085) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11086) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11086) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11087) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11087) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11088) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11088) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11089) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11089) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11090) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11090) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11091) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11091) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11092) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11092) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11093) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11093) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11094) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11094) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11095) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11095) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11096) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11096) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11097) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11097) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11098) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11098) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11099) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11099) : error 032: array index out of bounds (variable "VehicleInfo")
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11100) : warning 213: tag mismatch
H:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\(11100) : error 032: array index out of bounds (variable "VehicleInfo")
Can't just figure what is that damn problem.
My code looks like this

Header:
pawn Код:
enum vInfo
{
    modding,
    model,
    Float:x_spawn,
    Float:y_spawn,
    Float:z_spawn,
    Float:za_spawn,
    Float:ox_spawn,
    Float:oy_spawn,
    Float:oz_spawn,
    Float:oza_spawn,
    color_1,
    color_2,
    owner[128],
    vehiclecost,
    bought,
    buybar,
    name32[128],
    mod1,
    mod2,
    mod3,
    mod4,
    mod5,
    mod6,
    mod7,
    mod8,
    mod9,
    mod10,
    mod11,
    mod12,
    mod13,
    mod14,
    mod15,
    mod16,
    mod17,
    paintjob,
    Temp,
};

new VehicleInfo[MAX_VEHICLES][vInfo];

new VehicleName[212][0] = {
   "Landstalker",
   "Bravura",
   "Buffalo",
   "Linerunner",
   "Pereniel",
   "Sentinel",
   "Dumper",
   "Firetruck",
   "Trashmaster",
   "Stretch",
   "Manana",
   "Infernus",
   "Voodoo",
   "Pony",
   "Mule",
   "Cheetah",
   "Ambulance",
   "Leviathan",
   "Moonbeam",
   "Esperanto",
   "Taxi",
   "Washington",
   "Bobcat",
   "Mr Whoopee",
   "BF Injection",
   "Hunter",
   "Premier",
   "Enforcer",
   "Securicar",
   "Banshee",
   "Predator",
   "Bus",
   "Rhino",
   "Barracks",
   "Hotknife",
   "Trailer", //artict1
   "Previon",
   "Coach",
   "Cabbie",
   "Stallion",
   "Rumpo",
   "RC Bandit",
   "Romero",
   "Packer",
   "Monster Truck",
   "Admiral",
   "Squalo",
   "Seasparrow",
   "Pizzaboy",
   "Tram",
   "Trailer", //artict2
   "Turismo",
   "Speeder",
   "Reefer",
   "Tropic",
   "Flatbed",
   "Yankee",
   "Caddy",
   "Solair",
   "Berkley's RC Van",
   "Skimmer",
   "PCJ-600",
   "Faggio",
   "Freeway",
   "RC Baron",
   "RC Raider",
   "Glendale",
   "Oceanic",
   "Sanchez",
   "Sparrow",
   "Patriot",
   "Quad",
   "Coastguard",
   "Dinghy",
   "Hermes",
   "Sabre",
   "Rustler",
   "ZR-350",
   "Walton",
   "Regina",
   "Comet",
   "BMX",
   "Burrito",
   "Camper",
   "Marquis",
   "Baggage",
   "Dozer",
   "Maverick",
   "News Chopper",
   "Rancher",
   "FBI Rancher",
   "Virgo",
   "Greenwood",
   "Jetmax",
   "Hotring",
   "Sandking",
   "Blista Compact",
   "Police Maverick",
   "Boxville",
   "Benson",
   "Mesa",
   "RC Goblin",
   "Hotring Racer", //hotrina
   "Hotring Racer", //hotrinb
   "Bloodring Banger",
   "Rancher",
   "Super GT",
   "Elegant",
   "Journey",
   "Bike",
   "Mountain Bike",
   "Beagle",
   "Cropdust",
   "Stunt",
   "Tanker", //petro
   "RoadTrain",
   "Nebula",
   "Majestic",
   "Buccaneer",
   "Shamal",
   "Hydra",
   "FCR-900",
   "NRG-500",
   "HPV1000",
   "Cement Truck",
   "Tow Truck",
   "Fortune",
   "Cadrona",
   "FBI Truck",
   "Willard",
   "Forklift",
   "Tractor",
   "Combine",
   "Feltzer",
   "Remington",
   "Slamvan",
   "Blade",
   "Freight",
   "Streak",
   "Vortex",
   "Vincent",
   "Bullet",
   "Clover",
   "Sadler",
   "Firetruck", //firela
   "Hustler",
   "Intruder",
   "Primo",
   "Cargobob",
   "Tampa",
   "Sunrise",
   "Merit",
   "Utility",
   "Nevada",
   "Yosemite",
   "Windsor",
   "Monster Truck", //monstera
   "Monster Truck", //monsterb
   "Uranus",
   "Jester",
   "Sultan",
   "Stratum",
   "Elegy",
   "Raindance",
   "RC Tiger",
   "Flash",
   "Tahoma",
   "Savanna",
   "Bandito",
   "Freight", //freiflat
   "Trailer", //streakc
   "Kart",
   "Mower",
   "Duneride",
   "Sweeper",
   "Broadway",
   "Tornado",
   "AT-400",
   "DFT-30",
   "Huntley",
   "Stafford",
   "BF-400",
   "Newsvan",
   "Tug",
   "Trailer", //petrotr
   "Emperor",
   "Wayfarer",
   "Euros",
   "Hotdog",
   "Club",
   "Trailer", //freibox
   "Trailer", //artict3
   "Andromada",
   "Dodo",
   "RC Cam",
   "Launch",
   "Police Car (LSPD)",
   "Police Car (SFPD)",
   "Police Car (LVPD)",
   "Police Ranger",
   "Picador",
   "S.W.A.T. Van",
   "Alpha",
   "Phoenix",
   "Glendale",
   "Sadler",
   "Luggage Trailer", //bagboxa
   "Luggage Trailer", //bagboxb
   "Stair Trailer", //tugstair
   "Boxville",
   "Farm Plow", //farmtr1
   "Utility Trailer" //utiltr1
};

new heavycar[24][0] = {
    {406},
    {444},
    {556},
    {557},
    {573},
    {601},
    {407},
    {427},
    {433},
    {434},
    {499},
    {498},
    {482},
    {431},
    {524},
    {578},
    {455},
    {403},
    {414},
    {443},
    {515},
    {428},
    {408},
    {456}
};
new boat[11][0] = {
    {472},
    {473},
    {493},
    {595},
    {484},
    {430},
    {453},
    {452},
    {446},
    {454},
    {539}
};
new mbike[11][0] = {
    {581},
    {521},
    {462},
    {463},
    {468},
    {471},
    {586},
    {522},
    {523},
    {461},
    {448}
};
new pbike[3][0] = {
    {481},
    {509},
    {510}
};
new splane[6][0] = {
    {593},
    {512},
    {513},
    {460},
    {464},
    {465}
};
new mplane[2][0] = {
    {519},
    {511}
};
new lplane[2][0] = {
    {553},
    {592}
};
new milair[4][0] = {
    {520},
    {476},
    {447},
    {425}
};
new sheli[4][0] = {
    {487},
    {488},
    {469},
    {497}
};
new lheli[3][0] = {
    {417},
    {548},
    {563}
};

new spoiler[20][0] = {
    {1000},
    {1001},
    {1002},
    {1003},
    {1014},
    {1015},
    {1016},
    {1023},
    {1058},
    {1060},
    {1049},
    {1050},
    {1138},
    {1139},
    {1146},
    {1147},
    {1158},
    {1162},
    {1163},
    {1164}
};

new nitro[3][0] = {
    {1008},
    {1009},
    {1010}
};

new fbumper[23][0] = {
    {1117},
    {1152},
    {1153},
    {1155},
    {1157},
    {1160},
    {1165},
    {1167},
    {1169},
    {1170},
    {1171},
    {1172},
    {1173},
    {1174},
    {1175},
    {1179},
    {1181},
    {1182},
    {1185},
    {1188},
    {1189},
    {1192},
    {1193}
};

new rbumper[22][0] = {
    {1140},
    {1141},
    {1148},
    {1149},
    {1150},
    {1151},
    {1154},
    {1156},
    {1159},
    {1161},
    {1166},
    {1168},
    {1176},
    {1177},
    {1178},
    {1180},
    {1183},
    {1184},
    {1186},
    {1187},
    {1190},
    {1191}
};

new exhaust[28][0] = {
    {1018},
    {1019},
    {1020},
    {1021},
    {1022},
    {1028},
    {1029},
    {1037},
    {1043},
    {1044},
    {1045},
    {1046},
    {1059},
    {1064},
    {1065},
    {1066},
    {1089},
    {1092},
    {1104},
    {1105},
    {1113},
    {1114},
    {1126},
    {1127},
    {1129},
    {1132},
    {1135},
    {1136}
};

new bventr[2][0] = {
    {1042},
    {1044}
};

new bventl[2][0] = {
    {1043},
    {1045}
};

new bscoop[4][0] = {
    {1004},
    {1005},
    {1011},
    {1012}
};

new rscoop[13][0] = {
    {1006},
    {1032},
    {1033},
    {1035},
    {1038},
    {1053},
    {1054},
    {1055},
    {1061},
    {1067},
    {1068},
    {1088},
    {1091}
};

new lskirt[21][0] = {
    {1007},
    {1026},
    {1031},
    {1036},
    {1039},
    {1042},
    {1047},
    {1048},
    {1056},
    {1057},
    {1069},
    {1070},
    {1090},
    {1093},
    {1106},
    {1108},
    {1118},
    {1119},
    {1133},
    {1122},
    {1134}
};

new rskirt[21][0] = {
    {1017},
    {1027},
    {1030},
    {1040},
    {1041},
    {1051},
    {1052},
    {1062},
    {1063},
    {1071},
    {1072},
    {1094},
    {1095},
    {1099},
    {1101},
    {1102},
    {1107},
    {1120},
    {1121},
    {1124},
    {1137}
};

new hydraulics[1][0] = {
    {1087}
};

new base[1][0] = {
    {1086}
};

new rbbars[2][0] = {
    {1109},
    {1110}
};

new fbbars[2][0] = {
    {1115},
    {1116}
};

new wheels[17][0] = {
    {1025},
    {1073},
    {1074},
    {1075},
    {1076},
    {1077},
    {1078},
    {1079},
    {1080},
    {1081},
    {1082},
    {1083},
    {1084},
    {1085},
    {1096},
    {1097},
    {1098}
};

new lights[2][0] = {
    {1013},
    {1024}
};
Vehicles loading at ongameinit:
pawn Код:
// Vehicles loading
    LoadVehicles();
    foreach (Player, c)
    {
        ModVehicle(c);
    }
Some publics based to Vehicle info
pawn Код:
//----------------------------------------------------------

stock LoadVehicles()
{
    if(fexist("vehicles/setup/vehicles.txt"))
    {
        new SplitDiv[99][MAX_VEHICLES];
        new filestring[256];
        new File: file = fopen("vehicles/setup/vehicles.txt", io_read);
        if (file)
        {
            foreach (Player,vehicleid)
            {
                fread(file, filestring);
                split(filestring, SplitDiv, ',');
                VehicleInfo[vehicleid][model] = strval(SplitDiv[0]);
                VehicleInfo[vehicleid][x_spawn] = floatstr(SplitDiv[1]);
                VehicleInfo[vehicleid][y_spawn] = floatstr(SplitDiv[2]);
                VehicleInfo[vehicleid][z_spawn] = floatstr(SplitDiv[3]);
                VehicleInfo[vehicleid][za_spawn] = floatstr(SplitDiv[4]);
                VehicleInfo[vehicleid][ox_spawn] = floatstr(SplitDiv[5]);
                VehicleInfo[vehicleid][oy_spawn] = floatstr(SplitDiv[6]);
                VehicleInfo[vehicleid][oz_spawn] = floatstr(SplitDiv[7]);
                VehicleInfo[vehicleid][oza_spawn] = floatstr(SplitDiv[8]);
                VehicleInfo[vehicleid][color_1] = strval(SplitDiv[9]);
                VehicleInfo[vehicleid][color_2] = strval(SplitDiv[10]);
                VehicleInfo[vehicleid][vehiclecost] = strval(SplitDiv[11]);
                VehicleInfo[vehicleid][bought] = strval(SplitDiv[12]);
                VehicleInfo[vehicleid][mod1] = strval(SplitDiv[13]);
                VehicleInfo[vehicleid][mod2] = strval(SplitDiv[14]);
                VehicleInfo[vehicleid][mod3] = strval(SplitDiv[15]);
                VehicleInfo[vehicleid][mod4] = strval(SplitDiv[16]);
                VehicleInfo[vehicleid][mod5] = strval(SplitDiv[17]);
                VehicleInfo[vehicleid][mod6] = strval(SplitDiv[18]);
                VehicleInfo[vehicleid][mod7] = strval(SplitDiv[19]);
                VehicleInfo[vehicleid][mod8] = strval(SplitDiv[20]);
                VehicleInfo[vehicleid][mod9] = strval(SplitDiv[21]);
                VehicleInfo[vehicleid][mod10] = strval(SplitDiv[22]);
                VehicleInfo[vehicleid][mod11] = strval(SplitDiv[23]);
                VehicleInfo[vehicleid][mod12] = strval(SplitDiv[24]);
                VehicleInfo[vehicleid][mod13] = strval(SplitDiv[25]);
                VehicleInfo[vehicleid][mod14] = strval(SplitDiv[26]);
                VehicleInfo[vehicleid][mod15] = strval(SplitDiv[27]);
                VehicleInfo[vehicleid][mod16] = strval(SplitDiv[28]);
                VehicleInfo[vehicleid][mod17] = strval(SplitDiv[29]);
                VehicleInfo[vehicleid][paintjob] = strval(SplitDiv[30]);
                strmid(VehicleInfo[vehicleid][owner], SplitDiv[31], 0, strlen(SplitDiv[31]), 255);
                strmid(VehicleInfo[vehicleid][name23], SplitDiv[32], 0, strlen(SplitDiv[32]), 255);
                CreateVehicle(VehicleInfo[vehicleid][model], VehicleInfo[vehicleid][x_spawn], VehicleInfo[vehicleid][y_spawn], VehicleInfo[vehicleid][z_spawn], VehicleInfo[vehicleid][za_spawn], VehicleInfo[vehicleid][color_1], VehicleInfo[vehicleid][color_2],20000);
            }
        }
        fclose(file);
    }
    else
    {
        SetupVehiclesFile();
    }
}

//----------------------------------------------------------

stock SetupVehiclesFile()
{
    new File: file;
    file = fopen("vehicles/setup/vehicles.txt", io_write);
    new SplitDiv[99][MAX_VEHICLES];
    new filestring[256];
    file = fopen("vehicles/vehicles.txt", io_read);
    new carcost[MAX_VEHICLES];
    foreach (Player,vehicleid)
    {
        if (file)
        {
            fread(file, filestring);
            split(filestring, SplitDiv, ',');
            VehicleInfo[vehicleid][model] = strval(SplitDiv[0]);
            VehicleInfo[vehicleid][x_spawn] = floatstr(SplitDiv[1]);
            VehicleInfo[vehicleid][y_spawn] = floatstr(SplitDiv[2]);
            VehicleInfo[vehicleid][z_spawn] = floatstr(SplitDiv[3]);
            VehicleInfo[vehicleid][za_spawn] = floatstr(SplitDiv[4]);
            VehicleInfo[vehicleid][ox_spawn] = floatstr(SplitDiv[1]);
            VehicleInfo[vehicleid][oy_spawn] = floatstr(SplitDiv[2]);
            VehicleInfo[vehicleid][oz_spawn] = floatstr(SplitDiv[3]);
            VehicleInfo[vehicleid][oza_spawn] = floatstr(SplitDiv[4]);
            VehicleInfo[vehicleid][color_1] = strval(SplitDiv[5]);
            VehicleInfo[vehicleid][color_2] = strval(SplitDiv[6]);
            CreateVehicle(VehicleInfo[vehicleid][model], VehicleInfo[vehicleid][x_spawn], VehicleInfo[vehicleid][y_spawn], VehicleInfo[vehicleid][z_spawn], VehicleInfo[vehicleid][za_spawn], VehicleInfo[vehicleid][color_1], VehicleInfo[vehicleid][color_2],20000);
            carcost[vehicleid] = 50000;
            for(new s=0; s<24; s++) {
                if(VehicleInfo[vehicleid][model] == heavycar[s][0]) {
                    carcost[vehicleid] = 100000;
                }
            }
            for(new a=0; a<11; a++) {
                if(VehicleInfo[vehicleid][model] == boat[a][0]) {
                    carcost[vehicleid] = 50000;
                 }
            }
            for(new mb=0; mb<11; mb++) {
                if(VehicleInfo[vehicleid][model] == mbike[mb][0]) {
                    carcost[vehicleid] = 40000;
                }
            }
            for(new d=0; d<3; d++) {
                if(VehicleInfo[vehicleid][model] == pbike[d][0]) {
                    carcost[vehicleid] = 3000;
                 }
            }
            for(new e=0; e<6; e++) {
                if(VehicleInfo[vehicleid][model] == splane[e][0]) {
                    carcost[vehicleid] = 500000;
                }
            }
            for(new f=0; f<2; f++) {
                if(VehicleInfo[vehicleid][model] == mplane[f][0]) {
                        carcost[vehicleid] = 1500000;
                }
            }
            for(new v=0; v<2; v++) {
                if(VehicleInfo[vehicleid][model] == lplane[v][0]) {
                    carcost[vehicleid] = 2000000;
                }
            }
            for(new n=0; n<4; n++) {
                if(VehicleInfo[vehicleid][model] == milair[n][0]) {
                    carcost[vehicleid] = 4000000;
                }
            }
            for(new j=0; j<4; j++) {
                if(VehicleInfo[vehicleid][model] == sheli[j][0]) {
                    carcost[vehicleid] = 750000;
                }
            }
            for(new k=0; k<3; k++) {
                if(VehicleInfo[vehicleid][model] == lheli[k][0]) {
                    carcost[vehicleid] = 1250000;
                }
            }
            VehicleInfo[vehicleid][vehiclecost] = carcost[vehicleid];
            VehicleInfo[vehicleid][bought] = 0;
            VehicleInfo[vehicleid][mod1] = 0;
            VehicleInfo[vehicleid][mod2] = 0;
            VehicleInfo[vehicleid][mod3] = 0;
            VehicleInfo[vehicleid][mod4] = 0;
            VehicleInfo[vehicleid][mod5] = 0;
            VehicleInfo[vehicleid][mod6] = 0;
            VehicleInfo[vehicleid][mod7] = 0;
            VehicleInfo[vehicleid][mod8] = 0;
            VehicleInfo[vehicleid][mod9] = 0;
            VehicleInfo[vehicleid][mod10] = 0;
            VehicleInfo[vehicleid][mod11] = 0;
            VehicleInfo[vehicleid][mod12] = 0;
            VehicleInfo[vehicleid][mod13] = 0;
            VehicleInfo[vehicleid][mod14] = 0;
            VehicleInfo[vehicleid][mod15] = 0;
            VehicleInfo[vehicleid][mod16] = 0;
            VehicleInfo[vehicleid][mod17] = 0;
            VehicleInfo[vehicleid][paintjob] = -1;
            strmid(VehicleInfo[vehicleid][owner], dini_Int("settings/value.ini", "defaultcarown"), 0, strlen(dini_Int("settings/value.ini", "defaultcarown")), 255);
            strmid(VehicleInfo[vehicleid][name23], VehicleName[GetVehicleModel(vehicleid)-400][0], 0, strlen(VehicleName[GetVehicleModel(vehicleid)-400][0]), 255);
        }
    }
    fclose(file);
    SaveVehicles();
}

//----------------------------------------------------------

stock SaveVehicles()
{
    new filestring[512];
    new File: vfile = fopen("vehicles/setup/vehicles.txt", io_write);
    foreach (Player,vehicleid)
    {
        format(filestring, sizeof(filestring), "%d,%f,%f,%f,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%s,%s,%d\n",
        VehicleInfo[vehicleid][model],
        VehicleInfo[vehicleid][x_spawn],
        VehicleInfo[vehicleid][y_spawn],
        VehicleInfo[vehicleid][z_spawn],
        VehicleInfo[vehicleid][za_spawn],
        VehicleInfo[vehicleid][ox_spawn],
        VehicleInfo[vehicleid][oy_spawn],
        VehicleInfo[vehicleid][oz_spawn],
        VehicleInfo[vehicleid][oza_spawn],
        VehicleInfo[vehicleid][color_1],
        VehicleInfo[vehicleid][color_2],
        VehicleInfo[vehicleid][vehiclecost],
        VehicleInfo[vehicleid][bought],
        VehicleInfo[vehicleid][mod1],
        VehicleInfo[vehicleid][mod2],
        VehicleInfo[vehicleid][mod3],
        VehicleInfo[vehicleid][mod4],
        VehicleInfo[vehicleid][mod5],
        VehicleInfo[vehicleid][mod6],
        VehicleInfo[vehicleid][mod7],
        VehicleInfo[vehicleid][mod8],
        VehicleInfo[vehicleid][mod9],
        VehicleInfo[vehicleid][mod10],
        VehicleInfo[vehicleid][mod11],
        VehicleInfo[vehicleid][mod12],
        VehicleInfo[vehicleid][mod13],
        VehicleInfo[vehicleid][mod14],
        VehicleInfo[vehicleid][mod15],
        VehicleInfo[vehicleid][mod16],
        VehicleInfo[vehicleid][mod17],
        VehicleInfo[vehicleid][owner],
        VehicleInfo[vehicleid][name23],
        VehicleInfo[vehicleid][paintjob]
        );
        fwrite(vfile, filestring);
    }
    fclose(vfile);
}

//----------------------------------------------------------

stock ModVehicle(vehicleid)
{
    new tuned2 = 0;
    if(VehicleInfo[vehicleid][mod1] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod1]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod2] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod2]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod3] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod3]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod4] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod4]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod5] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod5]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod6] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod6]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod7] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod7]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod8] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod8]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod9] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod9]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod10] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod10]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod11] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod11]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod12] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod12]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod13] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod13]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod14] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod14]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod15] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod15]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod16] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod16]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][mod17] != 0) {
        AddVehicleComponent(vehicleid,VehicleInfo[vehicleid][mod17]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][color_1] > -1 || VehicleInfo[vehicleid][color_2] > -1) {
        ChangeVehicleColor(vehicleid,VehicleInfo[vehicleid][color_1],VehicleInfo[vehicleid][color_2]);
        tuned2 = 1;
    }
    if(VehicleInfo[vehicleid][paintjob] > -1) {
        ChangeVehiclePaintjob(vehicleid,VehicleInfo[vehicleid][paintjob]);
        tuned2 = 1;
    }
    if(tuned2 == 1) {
        tuned++;
    }
}

//----------------------------------------------------------
Anyone can help?

Using 0.3b RC3
Reply
#2

bump still got that problem...
Reply
#3

You have numerous errors with your code. Define one array (not even use it), compile and fix any errors. Add another array (also not using it), compile and fix any errors. Repeat until all arrays are defined. Now try and use one array variable at a time, compiling and fixing compilation errors as you go. Start small with simple code rather then adding a lot of code and trying to debug all of it at once.

Also, have a read of pawn-lang.pdf. The rumours are in fact true ... that pdf is useful.
Reply
#4

Readed pawn tutor ty about that

But I have problem again.
http://pawn.pastebin.com/54adsPT9

When I do, /test command it returns this:

This belong to
though it should be
This Landstalker belong to [name]

Why? I have looked through code many times, but I just don't see nothing wrong in it.
Reply
#5

why you use foreach in this case,a nyways, its looks you make something unlogical.

And check if somewhere you don't go more than MAX_VEHICLES amount
Reply
#6

Quote:
Originally Posted by Voldemort
Посмотреть сообщение
why you use foreach in this case, anyways, its looks you make something unlogical.
Can you explain more?
Reply
#7

Quote:
Originally Posted by woaha
Посмотреть сообщение
Readed pawn tutor ty about that

But I have problem again.
http://pawn.pastebin.com/54adsPT9

When I do, /test command it returns this:

This belong to
though it should be
This Landstalker belong to [name]

Why? I have looked through code many times, but I just don't see nothing wrong in it.
bumb sill need help with this.
Reply
#8

Try to replace "Temp," with "Temp" (just remove that comma).
Reply
#9

Quote:
Originally Posted by woaha
Посмотреть сообщение
Readed pawn tutor ty about that

But I have problem again.
http://pawn.pastebin.com/54adsPT9

When I do, /test command it returns this:

This belong to
though it should be
This Landstalker belong to [name]

Why? I have looked through code many times, but I just don't see nothing wrong in it.
bumb sill need help with this. =/
Reply
#10

new VehicleName[212][0]
Your major problem is the [0]
A dimension with the size 0 makes no sense.
For the string array you need to change it to 24 or so, for the other, just remove it and the unneccesary brackets around all the single elements:

pawn Код:
new lheli[3] = {
        417,
        548,
        563
};
This will drastically reduce the error messages.

Then remove the last , in the vInfo enum
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)