initialization data exceeds declared size
#1

pawn Код:
new TruckLocations[][4] =
{
    {"LS Construction Site", 1859.0, -1314.0, 14.0}, // Location 1
    {"SF Construction Site", -2083.0, 209.0, 35.5}, // Location 2
    {"LV Construction Site", 2708.0, 878.0, 10.0}, // Location 3
    {"Avery Construction", 312.25, -233.75, 1.6}, // Location 4
    {"Clown's Pocket Constr.", 2467.0, 1923.0, 9.8}, // Location 5
    {"Solarin Industries", -1822.5, 41.25, 15.25}, // Location 6
    {"Blueberry Truck Terminal", 52.75, -278.0, 1.7}, // Location 7
    {"KACC Military Fuels", 2708.5, 2641.25, 11.0}, // Location 8
    {"SA Federal Mint", -2441.0, 521.5, 30.0}, // Location 9
    {"Angel Pine Sawmill", -1965.75, -2436.0, 30.7}, // Location 10
    {"Quarry", 587.25, 844.75, -42.5}, // Location 11
    {"Quarry Top", 370.0, 874.0, 20.5}, // Location 12
    {"Easter Bay Lumberyard", -763.5, -136.0, 65.7}, // Location 13
    {"LS Papermill", 2331.5, -2071.5, 13.6}, // Location 14
    {"Sprunk Factory", 1334.75, 287.0, 19.6}, // Location 15
    {"SF Medical Center", -2607.0, 684.0, 27.9}, // Location 16
    {"Angel Pine Junkyard", -1873.0, -1685.0, 21.8}, // Location 17
    {"LV Freight Depot", 599.5, 1224.75, 11.8}, // Location 18
    {"LS Garbage Compound", 2181.0, -1980.5, 13.6}, // Location 19
    {"LV Industrial Estate", 1635.75, 750.5, 11.0}, // Location 20
    {"EasterBoard Farm", -69.5, -35.75, 3.2}, // Location 21
    {"SF Hill Farm", -1423.5, -1469.0, 101.7}, // Location 22
    {"Pecker's Feed & Seed", -310.5, 2669.5, 62.7}, // Location 23
    {"San Fierro Port", -1691.0, 31.5, 3.6}, // Location 24
    {"LV Refinery", 262.5, 1453.75, 10.6}, // Location 25
    {"LS Refinery", 2484.0, -2085.0, 13.6}, // Location 26
    {"Countryside Gas Station", -86.0, -1192.75, 2.0}, // Location 27
    {"SF Xoomer Gas Station", -1659.0, 444.0, 7.2}, // Location 28
    {"SF Gas Station", -2421.5, 953.25, 45.3}, // Location 29
    {"LS Going Station", 1926.0, -1791.5, 13.5}, // Location 30
    {"Xoomer Gas Station", -1488.75, 1875.25, 32.7}, // Location 31
    {"Whetstone Gas Station", -1629.0, -2700.0, 48.6}, // Location 32
    {"Desert Gas Station", -1309.5, 2703.75, 50.1}, // Location 33
    {"Dilimore Gas Station", 664.5, -583.75, 16.4}, // Location 34
    {"Abandoned Airport Fuel", 387.9, 2590.25, 16.5}, // Location 35
    {"San Fierro International", -1152.25, -146.5, 14.2}, // Location 36
    {"Easter Bay Chemical", -1033.75, -625.25, 32.1}, // Location 37
    {"LS Ocean Docks", 2466.0, -2219.25, 13.6}, // Location 38
    {"Bioengineering Corp.", 1347.5, 349.5, 20.0}, // Location 39
    {"Greenglass College", 999.0, 1086.75, 11.0}, // Location 40
    {"Fleischberg Brewery", -149.75, -220.25, 1.5}, // Location 41
    {"Bayside Boatyard", -2430.75, 2310.5, 5.0}, // Location 42
    {"LV Butcher", 977.5, 2096.75, 11.0}, // Location 43
    {"SF Catering LTD", -1945.75, -1073.5, 31.0}, // Location 44
    {"LS Donut shop", 1025.75, -1355.0, 13.8}, // Location 45
    {"Porter's House", 2439.75, 114.5, 26.5}, // Location 46
    {"Chuckup LTD", 1470.5, 1017.5, 10.9}, // Location 47
    {"LS Warehouse", 2178.5, -2279.75, 13.6}, // Location 48
    {"SF Supa Save", -2463.5, 782.0, 35.2}, // Location 49
    {"Verona Mall", 1044.75, -1548.75, 13.6}, // Location 50
    {"Las Venturas Mall", 2867.25, 2586.0, 10.7}, // Location 51
    {"Vank Hoff Hotel", -2490.75, 337.5, 33.4}, // Location 52
    {"Emerald Mall", 2056.75, 2251.25, 10.7}, // Location 53
    {"LS Ocean Docks", 2574.25, -2223.75, 13.4}, // Location 54
    {"Bayside Warehouse", -2285.0, 2281.5, 5.0}, // Location 55
    {"Fleischberg Brewery", -18.5, -282.0, 5.5}, // Location 56
    {"Las Venturas Stadium", 1377.5, 2245.75, 10.9}, // Location 57
    {"P. Creek General Store", 2318.0, -92.5, 26.5}, // Location 58
    {"LV Dirtring Stadium", 1112.0, 1451.75, 5.9}, // Location 59
    {"The Pleasure Domes", -2697.0, 1402.5, 7.2}, // Location 60
    {"4 Dragons Casino", 1903.75, 960.5, 10.9}, // Location 61
    {"SF Financial Center", -2039.5, 467.5, 35.2}, // Location 62
    {"Area 69", 134.54, 1945.79, 19.00} // Location 63
};
pawn Код:
CMD:work(playerid,params[])
{
    new rand = random(sizeof(TruckLocations));
    new rand2 = random(sizeof(TruckLocations));
    CreateTruckMission(playerid,TruckLocations[rand][1],TruckLocations[rand][2],TruckLocations[rand][3],TruckLocations[rand2][1],TruckLocations[rand2][2],TruckLocations[rand2][3]);
    return 1;
}
stock CreateTruckMission(playerid,Float:X,Float:Y,Float:Z,Float:FX,Float:FY,Float:FZ)
{
    new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(pvehiclemodel == 403 || pvehiclemodel == 514 || pvehiclemodel == 515)
    {
        SendClientMessage(playerid, 0xFF0000FF,"This Mission Needs A Trailer");
    }
    Tinfo[playerid][FinishX] = FX;
    Tinfo[playerid][FinishY] = FY;
    Tinfo[playerid][FinishZ] = FZ;
    Tinfo[playerid][Checkpoint] = SetPlayerCheckpoint(playerid, X, Y, Z, 7);
    Tinfo[playerid][CheckpointID] = 1;
    return 1;
}
[pawn]
pawn Код:
C:\Users\carlo\Desktop\SA-MP Server\My Own Trucking\pawno\include\Loads.inc(3) : warning 213: tag mismatch
C:\Users\carlo\Desktop\SA-MP Server\My Own Trucking\pawno\include\Loads.inc(3) : warning 213: tag mismatch
C:\Users\carlo\Desktop\SA-MP Server\My Own Trucking\pawno\include\Loads.inc(3) : warning 213: tag mismatch
C:\Users\carlo\Desktop\SA-MP Server\My Own Trucking\pawno\include\Loads.inc(3) : error 018: initialization data exceeds declared size
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

Where's your line 3 of the script?
Reply
#3

Quote:
Originally Posted by InActtive™
Посмотреть сообщение
Where's your line 3 of the script?
Dude not in script, it is in lnclude
pawn Код:
Loads.inc
Reply
#4

All the elements of the array have to be the same type. You can't have strings and integers in the same array unless you use an enum(erator):

pawn Код:
enum E_TRUCKLOC
{
truckloc_name[16], // 16 = 15 max characters for names, make it higher if you need to.
Float:truckloc_x,
Float:truckloc_y,
Float:truckloc_z
}
new TruckLocations[][E_TRUCKLOC] =
{
    {"LS Construction Site", 1859.0, -1314.0, 14.0}, // Location 1
    {"SF Construction Site", -2083.0, 209.0, 35.5}, // Location 2
    {"LV Construction Site", 2708.0, 878.0, 10.0}, // Location 3
    {"Avery Construction", 312.25, -233.75, 1.6}, // Location 4
    {"Clown's Pocket Constr.", 2467.0, 1923.0, 9.8}, // Location 5
    {"Solarin Industries", -1822.5, 41.25, 15.25}, // Location 6
    {"Blueberry Truck Terminal", 52.75, -278.0, 1.7}, // Location 7
    {"KACC Military Fuels", 2708.5, 2641.25, 11.0}, // Location 8
    {"SA Federal Mint", -2441.0, 521.5, 30.0}, // Location 9
    {"Angel Pine Sawmill", -1965.75, -2436.0, 30.7}, // Location 10
    {"Quarry", 587.25, 844.75, -42.5}, // Location 11
    {"Quarry Top", 370.0, 874.0, 20.5}, // Location 12
    {"Easter Bay Lumberyard", -763.5, -136.0, 65.7}, // Location 13
    {"LS Papermill", 2331.5, -2071.5, 13.6}, // Location 14
    {"Sprunk Factory", 1334.75, 287.0, 19.6}, // Location 15
    {"SF Medical Center", -2607.0, 684.0, 27.9}, // Location 16
    {"Angel Pine Junkyard", -1873.0, -1685.0, 21.8}, // Location 17
    {"LV Freight Depot", 599.5, 1224.75, 11.8}, // Location 18
    {"LS Garbage Compound", 2181.0, -1980.5, 13.6}, // Location 19
    {"LV Industrial Estate", 1635.75, 750.5, 11.0}, // Location 20
    {"EasterBoard Farm", -69.5, -35.75, 3.2}, // Location 21
    {"SF Hill Farm", -1423.5, -1469.0, 101.7}, // Location 22
    {"Pecker's Feed & Seed", -310.5, 2669.5, 62.7}, // Location 23
    {"San Fierro Port", -1691.0, 31.5, 3.6}, // Location 24
    {"LV Refinery", 262.5, 1453.75, 10.6}, // Location 25
    {"LS Refinery", 2484.0, -2085.0, 13.6}, // Location 26
    {"Countryside Gas Station", -86.0, -1192.75, 2.0}, // Location 27
    {"SF Xoomer Gas Station", -1659.0, 444.0, 7.2}, // Location 28
    {"SF Gas Station", -2421.5, 953.25, 45.3}, // Location 29
    {"LS Going Station", 1926.0, -1791.5, 13.5}, // Location 30
    {"Xoomer Gas Station", -1488.75, 1875.25, 32.7}, // Location 31
    {"Whetstone Gas Station", -1629.0, -2700.0, 48.6}, // Location 32
    {"Desert Gas Station", -1309.5, 2703.75, 50.1}, // Location 33
    {"Dilimore Gas Station", 664.5, -583.75, 16.4}, // Location 34
    {"Abandoned Airport Fuel", 387.9, 2590.25, 16.5}, // Location 35
    {"San Fierro International", -1152.25, -146.5, 14.2}, // Location 36
    {"Easter Bay Chemical", -1033.75, -625.25, 32.1}, // Location 37
    {"LS Ocean Docks", 2466.0, -2219.25, 13.6}, // Location 38
    {"Bioengineering Corp.", 1347.5, 349.5, 20.0}, // Location 39
    {"Greenglass College", 999.0, 1086.75, 11.0}, // Location 40
    {"Fleischberg Brewery", -149.75, -220.25, 1.5}, // Location 41
    {"Bayside Boatyard", -2430.75, 2310.5, 5.0}, // Location 42
    {"LV Butcher", 977.5, 2096.75, 11.0}, // Location 43
    {"SF Catering LTD", -1945.75, -1073.5, 31.0}, // Location 44
    {"LS Donut shop", 1025.75, -1355.0, 13.8}, // Location 45
    {"Porter's House", 2439.75, 114.5, 26.5}, // Location 46
    {"Chuckup LTD", 1470.5, 1017.5, 10.9}, // Location 47
    {"LS Warehouse", 2178.5, -2279.75, 13.6}, // Location 48
    {"SF Supa Save", -2463.5, 782.0, 35.2}, // Location 49
    {"Verona Mall", 1044.75, -1548.75, 13.6}, // Location 50
    {"Las Venturas Mall", 2867.25, 2586.0, 10.7}, // Location 51
    {"Vank Hoff Hotel", -2490.75, 337.5, 33.4}, // Location 52
    {"Emerald Mall", 2056.75, 2251.25, 10.7}, // Location 53
    {"LS Ocean Docks", 2574.25, -2223.75, 13.4}, // Location 54
    {"Bayside Warehouse", -2285.0, 2281.5, 5.0}, // Location 55
    {"Fleischberg Brewery", -18.5, -282.0, 5.5}, // Location 56
    {"Las Venturas Stadium", 1377.5, 2245.75, 10.9}, // Location 57
    {"P. Creek General Store", 2318.0, -92.5, 26.5}, // Location 58
    {"LV Dirtring Stadium", 1112.0, 1451.75, 5.9}, // Location 59
    {"The Pleasure Domes", -2697.0, 1402.5, 7.2}, // Location 60
    {"4 Dragons Casino", 1903.75, 960.5, 10.9}, // Location 61
    {"SF Financial Center", -2039.5, 467.5, 35.2}, // Location 62
    {"Area 69", 134.54, 1945.79, 19.00} // Location 63
};
Remember: STRINGS are actually ARRAYS of CHARACTERS.

More on enums: http://en.wikipedia.org/wiki/Enumerated_type
Reply
#5

@MP2
pawn Код:
C:\Users\carlo\Desktop\SA-MP Server\My Own Trucking\pawno\include\Loads.inc(75) : warning 203: symbol is never used: "TruckLocations"
C:\Users\carlo\Desktop\SA-MP Server\My Own Trucking\pawno\include\Loads.inc(75) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

Quote:
Originally Posted by windrush
Посмотреть сообщение
@MP2
pawn Код:
C:\Users\carlo\Desktop\SA-MP Server\My Own Trucking\pawno\include\Loads.inc(75) : warning 203: symbol is never used: "TruckLocations"
C:\Users\carlo\Desktop\SA-MP Server\My Own Trucking\pawno\include\Loads.inc(75) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Post your line 75 bro... You can't just show us the error O_O
Reply
#7

The Errors now Is
pawn Код:
C:\Users\carlo\Desktop\SA-MP Server\My Own Trucking\pawno\include\Loads.inc(17) : warning 228: length of initialler exceeds size of the enum field
C:\Users\carlo\Desktop\SA-MP Server\My Own Trucking\pawno\include\Loads.inc(17) : error 018: initialization data exceeds declared size
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

Quote:
Originally Posted by MP2
Посмотреть сообщение
You can't have strings and integers in the same array unless you use an enum(erator):
PAWN is a typeless 32bit language. the compiler doesn't give 2 pennies whether or not it's a string or an integer, all it needs to know is each cell retains a 32 bit value.

pawn Код:
{
    new
        array[7] = "hello"
    ;
   
    array[6] = 10;
   
    for(new i = 0; i < 6; i++)
    {
        printf("%c", array[i]);
    }
   
    printf("%d", array[6]);
    printf("%s", array);
}
Код:
output:

h
e
l
l
o
10
hello
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)