error 052: multi-dimensional arrays must be fully initialized
#1

Code:
C:\Users\Zack\Desktop\GunShop.pwn(54) : error 052: multi-dimensional arrays must be fully initialized
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Code:
/*	-----------------------------------------------------------------------------------------------

.##......##.########....###....########...#######..##....##.....######..##.....##..#######..########.
.##..##..##.##.........##.##...##.....##.##.....##.###...##....##....##.##.....##.##.....##.##.....##
.##..##..##.##........##...##..##.....##.##.....##.####..##....##.......##.....##.##.....##.##.....##
.##..##..##.######...##.....##.########..##.....##.##.##.##.....######..#########.##.....##.########.
.##..##..##.##.......#########.##........##.....##.##..####..........##.##.....##.##.....##.##.......
.##..##..##.##.......##.....##.##........##.....##.##...###....##....##.##.....##.##.....##.##.......
..###..###..########.##.....##.##.........#######..##....##.....######..##.....##..#######..##.......

										.########..##....##
										.##.....##..##..##.
										.##.....##...####..
										.########.....##...
										.##.....##....##...
										.##.....##....##...
										.########.....##...
										
		.##.....##....###.....######..##....##.##........########.##.....##.########.########.
		.##.....##...##.##...##....##.##...##..##....##..##.......##.....##.##.......##.....##
		.##.....##..##...##..##.......##..##...##....##..##.......##.....##.##.......##.....##
		.#########.##.....##.##.......#####....##....##..######...##.....##.######...########.
		.##.....##.#########.##.......##..##...#########.##........##...##..##.......##...##..
		.##.....##.##.....##.##....##.##...##........##..##.........##.##...##.......##....##.
		.##.....##.##.....##..######..##....##.......##..########....###....########.##.....##

------------------------------------------------------------------------------------------------ */
#define FILTERSCRIPT
#define VERSION_WEP_SHOP		"1.0"	// Version Script.
#define	WEAPONS_DIALOG			137		// Dialog ID for Weapon Shop (You can change this value if your script already defined this dialog ID).
#define MAX_WEAPS_SELL			28		// You must correct this value with enumeration on WeaponData. (Ex: I already have 28 weapons, and you must change value to 29 if you add a weapon in enum).
//-----------------------------------------------------------------------------------------------//
#include <a_samp>
#include <colors>
#include <sscanf>
#include <zcmd>
//-----------------------------------------------------------------------------------------------//
new WeaponData[MAX_WEAPS_SELL][3] =
{
	{22,200,100},		// 9MM
	{23,600,100},		// Silenced Pistol
	{24,1000,100},		// Desert Eagle
	{25,600,35},		// Shotgun
	{27,1000,35},		// Combat Shotgun
	{28,500,40},		// Micro SMG
	{29,2500,45},		// MP5
	{30,3500,50},		// AK-47
	{31,4500,50},		// M4A1
	{32,300,40},		// TEC-9
	{33,2000,20},		// Country Rifle
	{34,1000,20},		// Sniper Rifle
	{46,100,1},			// Parachute
	{0,2000,100}		// Health and Armour (I'm using ID 0 because ID 0 is fist (unused).
};// Format array: {Weapon ID, Weapon Price, Ammo} Further Information look at GetPlayerWeaponNameFromModel(weaponid);
new weaponstring[890];	// I know this array is too big.
how to fix?
Reply
#2

initialized your multi-dimensional array fully

As example

pawn Code:
new Array[5][3] = {
    {0, 1, 2},
    {3, 4, 5}
};
I only used the first two rows and wasted the last 3 => Error
Reply
#3

Quote:
Originally Posted by afizie98
View Post
Code:
#define MAX_WEAPS_SELL			28		// You must correct this value with enumeration on WeaponData. (Ex: I already have 28 weapons, and you must change value to 29 if you add a weapon in enum).
This line explains all. You must change this number.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)