SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 06/10/2015, 05:51 PM   #1
Jimmi
Huge Clucker
 
Join Date: Jan 2015
Posts: 387
Reputation: 4
Default (280) : error 018: initialization data exceeds declared size

(280) : error 018: initialization data exceeds declared size

280: {"1410.1044", "-1305.7026", "9.3780", "Downtown Los Santos"},
all code

new pumpkins[][4] = {
{"1410.1044", "-1305.7026", "9.3780", "Downtown Los Santos"},
{"811.0631", "-1098.3042", "25.9063", "CNN Los Santos"},
{"395.0076", "-1892.1541", "7.8301", "Santa Maria Beach"},
{"1208.2128", "-1997.4165", "69.0078", "Verdant Bluffs"},
{"1291.9706", "-788.6403", "96.4609", "Mulholland"},
{"1319.6095", "1254.3007", "14.2731", "Las Venturas Airport"},
{"2000.8856", "1565.8356", "15.3672", "The Strip"},
{"2592.7739", "2790.8081", "10.8203", "KACC Military Fuels"},
{"1058.6401", "1260.5609", "10.8203", "Blackfield"},
{"1697.7155", "679.0499", "14.8222", "Randolph Ind. Estate"},
{"2206.8350", "1286.4581", "10.8203", "The Camel's Toe"},
{"2060.2539", "-2376.2620", "16.1250", "LS International"},
{"2505.8127", "-1693.7687", "13.5579", "Ganton"},
{"1883.6287", "1990.4550", "7.5946", "Redsands East | The Visage"}
};
Jimmi is offline   Reply With Quote
Old 06/10/2015, 06:02 PM   #2
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,324
Reputation: 652
Default Re: (280) : error 018: initialization data exceeds declared size

Are you sure you want all of these to be strings? You can store the floats and strings in one array using an enumerator.

First off I'll explain what the error is about. You have a basic 2 dimensional array. You have an undetermined number of arrays in the first dimension and 4 cells in each of those. In each of those undetermined cells you're the second dimensional arrays. In the second dimension arrays you are trying to store strings. The strings do not have a set size. For your code to work as-is with strings, do this:
pawn Code:
new pumpkins[][4][32] = {
{"1410.1044", "-1305.7026", "9.3780", "Downtown Los Santos"},
{"811.0631", "-1098.3042", "25.9063", "CNN Los Santos"},
{"395.0076", "-1892.1541", "7.8301", "Santa Maria Beach"},
{"1208.2128", "-1997.4165", "69.0078", "Verdant Bluffs"},
{"1291.9706", "-788.6403", "96.4609", "Mulholland"},
{"1319.6095", "1254.3007", "14.2731", "Las Venturas Airport"},
{"2000.8856", "1565.8356", "15.3672", "The Strip"},
{"2592.7739", "2790.8081", "10.8203", "KACC Military Fuels"},
{"1058.6401", "1260.5609", "10.8203", "Blackfield"},
{"1697.7155", "679.0499", "14.8222", "Randolph Ind. Estate"},
{"2206.8350", "1286.4581", "10.8203", "The Camel's Toe"},
{"2060.2539", "-2376.2620", "16.1250", "LS International"},
{"2505.8127", "-1693.7687", "13.5579", "Ganton"},
{"1883.6287", "1990.4550", "7.5946", "Redsands East | The Visage"}
};
Or more properly, with floats and strings in the second dimension:
pawn Code:
enum E_PUMP {Float:pX, Float:pY, Float:pZ, pStr[32]}
new pumpkins[][E_PUMP] = {
    {1410.1044, -1305.7026, 9.3780,     "Downtown Los Santos"},
    {811.0631-1098.3042, 25.9063,    "CNN Los Santos"},
    {395.0076-1892.1541, 7.8301,     "Santa Maria Beach"},
    {1208.2128, -1997.4165, 69.0078,    "Verdant Bluffs"},
    {1291.9706, -788.640396.4609,    "Mulholland"},
    {1319.6095, 1254.300714.2731,    "Las Venturas Airport"},
    {2000.8856, 1565.835615.3672,    "The Strip"},
    {2592.7739, 2790.808110.8203,    "KACC Military Fuels"},
    {1058.6401, 1260.560910.8203,    "Blackfield"},
    {1697.7155, 679.0499,   14.8222,    "Randolph Ind. Estate"},
    {2206.8350, 1286.458110.8203,    "The Camel's Toe"},
    {2060.2539, -2376.2620, 16.1250,    "LS International"},
    {2505.8127, -1693.7687, 13.5579,    "Ganton"},
    {1883.6287, 1990.45507.5946,     "Redsands East | The Visage"}
};
Crayder is offline   Reply With Quote
Old 06/10/2015, 06:28 PM   #3
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,208
Reputation: 352
Default Re: (280) : error 018: initialization data exceeds declared size

The second option is correct
AbyssMorgan is offline   Reply With Quote
Old 07/10/2015, 10:27 AM   #4
Jimmi
Huge Clucker
 
Join Date: Jan 2015
Posts: 387
Reputation: 4
Default Re: (280) : error 018: initialization data exceeds declared size

C:\Users\Jimmi\Desktop\Server\93.119.25.182-7777\gamemodes\RunStrike.pwn(9555) : error 035: argument type mismatch (argument 2)
Hear
tmp_obj = CreateObject(19320,pumpkins[p][0],pumpkins[p][1],pumpkins[p][2],0,0,0);
Jimmi is offline   Reply With Quote
Old 07/10/2015, 10:45 AM   #5
MrDiase
Little Clucker
 
MrDiase's Avatar
 
Join Date: Sep 2015
Location: Daqui mesmo
Posts: 34
Reputation: 0
Default Re: (280) : error 018: initialization data exceeds declared size

Removed
MrDiase is offline   Reply With Quote
Old 07/10/2015, 11:15 AM   #6
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,324
Reputation: 652
Default Re: (280) : error 018: initialization data exceeds declared size

Quote:
Originally Posted by Jimmi View Post
C:\Users\Jimmi\Desktop\Server\93.119.25.182-7777\gamemodes\RunStrike.pwn(9555) : error 035: argument type mismatch (argument 2)
Hear
tmp_obj = CreateObject(19320,pumpkins[p][0],pumpkins[p][1],pumpkins[p][2],0,0,0);
Like this:
pawn Code:
tmp_obj = CreateObject(19320,pumpkins[p][pX],pumpkins[p][pY],pumpkins[p][pZ],0,0,0);
Crayder is offline   Reply With Quote
Old 07/10/2015, 11:36 AM   #7
Jimmi
Huge Clucker
 
Join Date: Jan 2015
Posts: 387
Reputation: 4
Default Re: (280) : error 018: initialization data exceeds declared size

Done.Thanks.

Last edited by Jimmi; 07/10/2015 at 12:06 PM.
Jimmi is offline   Reply With Quote
Old 23/02/2018, 09:45 AM   #8
Susenkus
Little Clucker
 
Join Date: Feb 2018
Posts: 7
Reputation: 0
Default Re: (280) : error 018: initialization data exceeds declared size

Can you plz with my code? (line 20)

#include <a_samp>
#include <core>
#include <float>

new glob0[500];

new Text:glob7D0[500];

new Text:globFA0[500];

new Text:glob1770[500];

new Text:glob1F40[500];

new Text:glob2710[500];

new Float:glob2EE0[500][3];

new glob4E20[212][1] = {
"Jeep Wagoneer",
"Mercury Cougar",
"Camaro with Scoop",
"Big Rig",
"Jeep Grand Wagoneer",
"BMW 7-Series",
"Dumptruck",
"SA Firetruck",
"Peterbuilt",
"Lincoln Towncar",
"Dodge Aries",
"Acura NSX '05",
"Chevy Biscayne",
"Ford Aerostar",
"Ford Box Van",
"Ferrari Testarosso",
"Ford Econoline",
"Emergency Heli",
"Chevrolet Astrovan",
"Cadillac Eldorado",
"Chevy Caprice",
"Lincoln Mark 7",
"Chevrolet S10",
"Chevy Ice Cream Truck",
"Volkswagen Beach Buggy",
"AH-64A",
"Chevrolet Caprice",
"International SWAT Van",
"Securita Van",
"Dodge Viper",
"Preditor",
"Volvo Bus",
"M1A1 Abrams",
"Barracks",
"Ford Hot Rod",
"Trailer",
"Nissan Pulsar",
"Old Coach",
"Caprice Classic Cab",
"Ford Mustang Mach 1",
"Mercedes Van",
"RC Bandit",
"Cadillac Hearse",
"Packer/Stunt Helper",
"Chevy S-10 Monster Truck",
"Mercedes-Benz S-Class",
"Chris Craft Stinger",
"Bell 47G",
"Piaggio Vespa PX 200",
"Tram",
"Trailer",
"Ferrari F40",
"Go-Fast Boat",
"Orca",
"Sea Ray 270 Sedan Bridge",
"Flatbed",
"1992 Ford F800",
"Golf Car",
"Ford Taurus Wagon",
"Honda Life '74",
"Cessna 150 With Floats",
"Honda CBR 600 '92",
"Piaggio Vespa PX 200 '86",
"Harley Davidson Soft Tail",
"RC Red Baron",
"RC Raider",
"Dodge Dart",
"Plymouth Belverdere",
"Yamaha DT 200 Dirt Bike",
"Bell 47G",
"Hummer H-1",
"Honda TRX250x '92",
"Coastguard Boat",
"Rescue Boat",
"Mercury '51",
"Chevy Chevelle",
"Curtiss P-40D Warhawk",
"Mazda RX-7",
"Chevy Farm Truck",
"Chevy Caprice Estate",
"Porsche 911",
"Schwinn BMX",
"Dodge Ramvan",
"Volkswagen Bus",
"Endeavour 42",
"Equitech M40 '85",
"Bulldozer",
"Bell 206L-4",
"Bell 206B-3",
"Ford Bronco",
"Chevrolet Suburban '92",
"Lincoln Mark 7",
"Dodge Diplomat",
"CMN Interceptor DV-15",
"Ford Mustang LX",
"Ford Bronco",
"Honda CRX",
"Bell 206L-4",
"Chevy Cargo Van",
"Ford Moving Van",
"Jeep Wrangler",
"RC Heli",
"Ford Mustang LX '86",
"Ford Mustang LX '86",
"Customised Glendale",
"Ford Bronco '80",
"Mitsubishi 3000 GT",
"Buick Roadmaster",
"GMC R.V.",
"Old Bike",
"Schwinn Mesa Mountain Hardtail",
"C-2 Greyhound",
"Grumman G-164 AgCat",
"Pitt's Special",
"Gas Tanker",
"International 9370 Truck",
"Lincoln Towncar",
"Chevy Monte Carlo",
"Chevrolet Monte Carlo",
"Bombardier Learjet 55",
"AV-8 Harrier Jump-Jet",
"Honda CBR 900 RR Fireblade",
"Honda NSR 500 '01",
"Kawasaki KZ1000-P21",
"Chevrolet Cement Truck",
"Tow Truck '91",
"Ford Thunderbird",
"Ford Escort",
"CSI/FBI Investigation Truck",
"Dodge Dynasty",
"Forklift '89",
"Old Tractor",
"Combine Harvester",
"Mercedes-Benz SL-Class",
"Lincoln Mark 5",
"Chevy CST '68",
"Chevrolet Caprice Droptop",
"1972 EMD SD40",
"Amtrak F40PH",
"Hovercraft",
"Mercedes Benz E120",
"Ford GT-40",
"Chevy Nova",
"Dodge 100 Series",
"SA Firetruck",
"Ford Hotrod",
"Chevrolet Lumina",
"Oldsmobile Cutlass Ciera",
"Sikorsky CH-53",
"Dodge Roadrunner",
"Late 80's Honda Sedan",
"Mercury Grand Marquis",
"Chevy 2500",
"Douglas C-47",
"GMC Sierra",
"Jaguar XKE '66",
"Chevy S-10 Monster Truck",
"Chevy S-10 Monster Truck",
"Eagle Talon",
"Toyota Supra",
"Impreza 2.5RS '95",
"Honda Accord Wagon",
"Nissan R34 Skyline",
"Sikorsky UH-60 Black Hawk",
"RC Tiger",
"Honda Civic",
"Oldsmobile Cutlass",
"Chevy Impala",
"Half Life 2 Sand Rail",
"EMD SD40",
"Trailer",
"Go Kart",
"Ride-On Lawn Mower",
"Mercedes-Benz AK 4x4 '91",
"Elgin Pelican",
"Caddilac '54",
"Chevy Bel Air '57",
"Boeing 737",
"Flatbed",
"Range Rover",
"Rolls Royce",
"Honda VFR 400",
"Dodge Ramvan Newsvan",
"Baggage Tow Tractor HTAG-30/40",
"Trailer",
"Infinity J30 '92",
"Honda Goldwing GL1500 '04",
"Nissan 350Z/240SX",
"Hotdog Van",
"Volkswagen Golf",
"Trailer",
"Trailer",
"Lockheed C-5 Galaxy",
"Cessna 150",
"WTF u shouldnt drive this",
"CMN Interceptor DV-15",
"Chevy Caprice LA",
"Chevy Caprice SF",
"Chevy Caprice LV",
"Chevy Blazer Desert",
"Chevrolet El Camino '68",
"S.W.A.T. Van",
"Dodge Stealth '91",
"Pontiac Trans AM",
"Dodge Dart",
"Dodge 100 Series",
"Luggage Trailer",
"Luggage Trailer",
"Stair Trailer",
"Chevy Cargo Van",
"Farm Plow",
"Chevy 2500 Trailer"
};

thx
Susenkus is offline   Reply With Quote
Old 24/02/2018, 07:36 AM   #9
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,324
Reputation: 652
Default Re: (280) : error 018: initialization data exceeds declared size

Code:
Can you plz with my code? (line 20)

#include <a_samp>
#include <core>
#include <float>

new glob0[500];

new Text:glob7D0[500];

new Text:globFA0[500];

new Text:glob1770[500];

new Text:glob1F40[500];

new Text:glob2710[500];

new Float:glob2EE0[500][3];

new glob4E20[212][1] = {
        "Jeep Wagoneer",
	"Mercury Cougar",
	"Camaro with Scoop",
	"Big Rig",
	"Jeep Grand Wagoneer",
	"BMW 7-Series",
	"Dumptruck",
	"SA Firetruck",
	"Peterbuilt",
	"Lincoln Towncar",
	"Dodge Aries",
	"Acura NSX '05",
	"Chevy Biscayne",
	"Ford Aerostar",
	"Ford Box Van",
	"Ferrari Testarosso",
	"Ford Econoline",
	"Emergency Heli",
	"Chevrolet Astrovan",
	"Cadillac Eldorado",
	"Chevy Caprice",
	"Lincoln Mark 7",
	"Chevrolet S10",
	"Chevy Ice Cream Truck",
	"Volkswagen Beach Buggy",
	"AH-64A",
	"Chevrolet Caprice",
	"International SWAT Van",
	"Securita Van",
	"Dodge Viper",
	"Preditor",
	"Volvo Bus",
	"M1A1 Abrams",
	"Barracks",
	"Ford Hot Rod",
	"Trailer",
	"Nissan Pulsar",
	"Old Coach",
	"Caprice Classic Cab",
	"Ford Mustang Mach 1",
	"Mercedes Van",
	"RC Bandit",
	"Cadillac Hearse",
	"Packer/Stunt Helper",
	"Chevy S-10 Monster Truck",
	"Mercedes-Benz S-Class",
	"Chris Craft Stinger",
	"Bell 47G",
	"Piaggio Vespa PX 200",
	"Tram",
	"Trailer",
	"Ferrari F40",
	"Go-Fast Boat",
	"Orca",
	"Sea Ray 270 Sedan Bridge",
	"Flatbed",
	"1992 Ford F800",
	"Golf Car",
	"Ford Taurus Wagon",
	"Honda Life '74",
	"Cessna 150 With Floats",
	"Honda CBR 600 '92",
	"Piaggio Vespa PX 200 '86",
	"Harley Davidson Soft Tail",
	"RC Red Baron",
	"RC Raider",
	"Dodge Dart",
	"Plymouth Belverdere",
	"Yamaha DT 200 Dirt Bike",
	"Bell 47G",
	"Hummer H-1",
	"Honda TRX250x '92",
	"Coastguard Boat",
	"Rescue Boat",
	"Mercury '51",
	"Chevy Chevelle",
	"Curtiss P-40D Warhawk",
	"Mazda RX-7",
	"Chevy Farm Truck",
	"Chevy Caprice Estate",
	"Porsche 911",
	"Schwinn BMX",
	"Dodge Ramvan",
	"Volkswagen Bus",
	"Endeavour 42",
	"Equitech M40 '85",
	"Bulldozer",
	"Bell 206L-4",
	"Bell 206B-3",
	"Ford Bronco",
	"Chevrolet Suburban '92",
	"Lincoln Mark 7",
	"Dodge Diplomat",
	"CMN Interceptor DV-15",
	"Ford Mustang LX",
	"Ford Bronco",
	"Honda CRX",
	"Bell 206L-4",
	"Chevy Cargo Van",
	"Ford Moving Van",
	"Jeep Wrangler",
	"RC Heli",
	"Ford Mustang LX '86",
	"Ford Mustang LX '86",
	"Customised Glendale",
	"Ford Bronco '80",
	"Mitsubishi 3000 GT",
	"Buick Roadmaster",
	"GMC R.V.",
	"Old Bike",
	"Schwinn Mesa Mountain Hardtail",
	"C-2 Greyhound",
	"Grumman G-164 AgCat",
	"Pitt's Special",
	"Gas Tanker",
	"International 9370 Truck",
	"Lincoln Towncar",
	"Chevy Monte Carlo",
	"Chevrolet Monte Carlo",
	"Bombardier Learjet 55",
	"AV-8 Harrier Jump-Jet",
	"Honda CBR 900 RR Fireblade",
	"Honda NSR 500 '01",
	"Kawasaki KZ1000-P21",
	"Chevrolet Cement Truck",
	"Tow Truck '91",
	"Ford Thunderbird",
	"Ford Escort",
	"CSI/FBI Investigation Truck",
	"Dodge Dynasty",
	"Forklift '89",
	"Old Tractor",
	"Combine Harvester",
	"Mercedes-Benz SL-Class",
	"Lincoln Mark 5",
	"Chevy CST '68",
	"Chevrolet Caprice Droptop",
	"1972 EMD SD40",
	"Amtrak F40PH",
	"Hovercraft",
	"Mercedes Benz E120",
	"Ford GT-40",
	"Chevy Nova",
	"Dodge 100 Series",
	"SA Firetruck",
	"Ford Hotrod",
	"Chevrolet Lumina",
	"Oldsmobile Cutlass Ciera",
	"Sikorsky CH-53",
	"Dodge Roadrunner",
	"Late 80's Honda Sedan",
	"Mercury Grand Marquis",
	"Chevy 2500",
	"Douglas C-47",
	"GMC Sierra",
	"Jaguar XKE '66",
	"Chevy S-10 Monster Truck",
	"Chevy S-10 Monster Truck",
	"Eagle Talon",
	"Toyota Supra",
	"Impreza 2.5RS '95",
	"Honda Accord Wagon",
	"Nissan R34 Skyline",
	"Sikorsky UH-60 Black Hawk",
	"RC Tiger",
	"Honda Civic",
	"Oldsmobile Cutlass",
	"Chevy Impala",
	"Half Life 2 Sand Rail",
	"EMD SD40",
	"Trailer",
	"Go Kart",
	"Ride-On Lawn Mower",
	"Mercedes-Benz AK 4x4 '91",
	"Elgin Pelican",
	"Caddilac '54",
	"Chevy Bel Air '57",
	"Boeing 737",
	"Flatbed",
	"Range Rover",
	"Rolls Royce",
	"Honda VFR 400",
	"Dodge Ramvan Newsvan",
	"Baggage Tow Tractor HTAG-30/40",
	"Trailer",
	"Infinity J30 '92",
	"Honda Goldwing GL1500 '04",
	"Nissan 350Z/240SX",
	"Hotdog Van",
	"Volkswagen Golf",
	"Trailer",
	"Trailer",
	"Lockheed C-5 Galaxy",
	"Cessna 150",
	"WTF u shouldnt drive this",
	"CMN Interceptor DV-15",
	"Chevy Caprice LA",
	"Chevy Caprice SF",
	"Chevy Caprice LV",
	"Chevy Blazer Desert",
	"Chevrolet El Camino '68",
	"S.W.A.T. Van",
	"Dodge Stealth '91",
	"Pontiac Trans AM",
	"Dodge Dart",
	"Dodge 100 Series",
	"Luggage Trailer",
	"Luggage Trailer",
	"Stair Trailer",
	"Chevy Cargo Van",
	"Farm Plow",
	"Chevy 2500 Trailer"
};

thx
new glob4E20[212][1] = {

>

new glob4E20[][] = {
Crayder is offline   Reply With Quote
Old 24/02/2018, 07:15 PM   #10
Susenkus
Little Clucker
 
Join Date: Feb 2018
Posts: 7
Reputation: 0
Default Re: (280) : error 018: initialization data exceeds declared size

Crayder, I tried thet, it doesn't say there's error, but my status bar is glitched
Susenkus is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error 018: initialization data exceeds declared size DStreet Scripting Help 3 13/10/2013 08:50 PM
error 018: initialization data exceeds declared size radiobizza Scripting Help 6 06/05/2013 05:37 PM
error 018: initialization data exceeds declared size CoaPsyFactor Scripting Help 4 29/07/2012 11:36 PM
error 018: initialization data exceeds declared size sanrock Scripting Help 10 08/06/2012 03:22 PM
error 018: initialization data exceeds declared size anant Help Archive 4 09/05/2011 08:34 AM


All times are GMT. The time now is 06:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.