27.06.2015, 12:40
Nice
I do not understand what is the difference? dialogs.inc and dialogs2.inc
|
Hmmm :S Haven't done anything with it, i just included it and compiled. |
gPlayerListHeaders[MAX_PLAYERS][MAX_DIALOG_MODELS][MAX_DIALOG_HEADER_SIZE];
Model[playerid][Slot][10]
Confused about these arrays
Lets say i have a variable which stores a model id Код:
Model[playerid][Slot][10] |
new var[10];
new var2[10];
new end;
for(new i = 0; i < 10; i++)
{
if(var[i] != 0)
{
for(new x = 0; x < 10; x++)
{
if(var2[x] == 0)
{
var2[x] = var[i];
end = (x + 1);
break;
}
}
}
}
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;
}
C:\Documents and Settings\Javed\Desktop\testing.pwn(58) : error 048: array dimensions do not match
Now i am using the following code but it gives me a error
PHP код:
PHP код:
|
new model_array[7][2];
new model_array[7];
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];
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)
{
model_array[x] = 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;
}
When I include dialogs2, I get an instant 19.8 mb added to the output. That's a lot more than the guy who reported the 5.9mb output above. I even have everything dialog related removed (except for the preview dialogs).
If you want to see my version of dialogs2 and check for the size issue please pm me. EDIT: However, 27.5 MB is a lot less than my 64.6 version. The 64.6 version uses an actual dialog, it saves 10 pages of 20 lines. Each line is ~60 characters. Each character has their own array of pages. EDIT: I should probably mention that my MAX_PLAYERS is actually only 100, so these are outrageous numbers for only 100 players. |