11.07.2015, 15:24
Now i am using the following code but it gives me a error
This is the error
PHP код:
new WeaponNames[47][] =
{
"Unarmed","Brass Knuckless","Golf Club","Night Stick","Knife","Basketball Bat","Shovel","Pool Cue",
"Katana","Chainsaw","Purple Dildo","White Dildo","Long White Dildo","White Dildo 2","Flowers","Cane",
"Grenades","Tear Gas","Molotovs","Missle1","Missle2","Missle3","Pistol","Silenced Pistol","Desert Eagle","Shotgun",
"Sawn Off Shotgun","Combat Shotgun","Micro UZI","MP5","AK-47","M4","Tec9","Rifle","Sniper Rifle","RPG",
"Rocket Launcher","Flame Thrower","Minigun","Sachet Chargers","Detonator","Spry Paint","Fire Extinguer",
"Camera","Nightvision Goggles","Thermal Goggles","Parachute"
};
CMD:mycommand(playerid, params[])
{
new model_array[7][2];
new desc_array[7][MAX_DIALOG_HEADER_SIZE];
new x = 0;
for(new i = 0;i < Item[playerid][MaxItems]; i++)
{
if(Item[playerid][Weapon][i] != 0)
{
format(model_array[x], 2, "%2d", Item[playerid][Weapon][i]);
format(desc_array[x], MAX_DIALOG_HEADER_SIZE, "%s", WeaponNames[Item[playerid][Weapon][i]]);
x++;
}
}
ShowPlayerPreviewModelDialog(playerid, DIALOG_BACKPACK, "asd", model_array, desc_array, "Select", "Cancel");
return 1;
}
PHP код:
C:\Documents and Settings\Javed\Desktop\testing.pwn(58) : error 048: array dimensions do not match