[Include] Dialogs include - Adding new styles to SAMP GUI
#81

Nice
Reply
#82

Very nice, REP+.

Actually this is having lots of features than mSelection. I would love to switch this from mSelection to Dialogs
Reply
#83

I do not understand what is the difference? dialogs.inc and dialogs2.inc
Reply
#84

Amazing! Thank you
Reply
#85

Someone just asked me why this dialog wasn't affected by their dialog mods... XD
Reply
#86

Quote:
Originally Posted by Kolstin
Посмотреть сообщение
I do not understand what is the difference? dialogs.inc and dialogs2.inc
dialogs.inc only supports DIALOG_STYLE_PREVMODEL but dialogs2.inc supports both DIALOG_STYLE_PREVMODEL and DIALOG_STYLE_PREVMODEL_HEADERS.

There is no extra functions in dialogs2 but only a new style which will add labels to the dialog's preview models, see the function ShowPlayerPreviewModelDialog.

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Someone just asked me why this dialog wasn't affected by their dialog mods... XD
That implies my design is pretty epic!
Reply
#87

When i Tried Your Example For the Skin gui
it works but all the pics is CJ
If you have any idea Please tell me
Reply
#88

Quote:
Originally Posted by hussinhfny
View Post
When i Tried Your Example For the Skin gui
it works but all the pics is CJ
If you have any idea Please tell me
Thats because you might have set the preview models to 0, i.e. the array you input is having something like this: {0, 0...}.

Or else show your code.
Reply
#89



Hmmm :S Haven't done anything with it, i just included it and compiled.
Reply
#90

Quote:
Originally Posted by liquor
Посмотреть сообщение


Hmmm :S Haven't done anything with it, i just included it and compiled.
Thats because dialogs2 uses 3D array to store label text for each listitem and its the only way to do so.
pawn Код:
gPlayerListHeaders[MAX_PLAYERS][MAX_DIALOG_MODELS][MAX_DIALOG_HEADER_SIZE];
This increases the output size ^^

It would be good if i make a plugin on this (but time leaves me behind)
Reply
#91

You could use packed strings, this would reduce the size to <2mb.
Reply
#92

Confused about these arrays

Lets say i have a variable which stores a model id

Код:
Model[playerid][Slot][10]
now these are 10 variables for each player. Now i want to show the model ids to a player via your dialog except those which have "0" value. How could i do that ? I am really confused...
Reply
#93

Quote:
Originally Posted by hamzajaved780
Посмотреть сообщение
Confused about these arrays

Lets say i have a variable which stores a model id

Код:
Model[playerid][Slot][10]
now these are 10 variables for each player. Now i want to show the model ids to a player via your dialog except those which have "0" value. How could i do that ? I am really confused...
You can do something like this:
pawn Код:
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;
            }
        }
    }
}
Say var is your player array and var2 is a new array where the data will be sorted. You don't need to make it player array, because the dialog only requires models. So end saves the last index and everything is done. This is one example of sorting, don't know if there is better method. You may download an include for sorting arrays, i have seen an include on sorting before.
Reply
#94

Now i am using the following code but it gives me a 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(playeridparams[])
{
    new 
model_array[7][2];
    new 
desc_array[7][MAX_DIALOG_HEADER_SIZE];
    new 
0;
    for(new 
0;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(playeridDIALOG_BACKPACK"asd"model_arraydesc_array"Select""Cancel");
    return 
1;

This is the error
PHP код:
C:\Documents and Settings\Javed\Desktop\testing.pwn(58) : error 048: array dimensions do not match 
Reply
#95

Nice Work...
Reply
#96

Quote:
Originally Posted by hamzajaved780
Посмотреть сообщение
Now i am using the following code but it gives me a 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(playeridparams[])
{
    new 
model_array[7][2];
    new 
desc_array[7][MAX_DIALOG_HEADER_SIZE];
    new 
0;
    for(new 
0;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(playeridDIALOG_BACKPACK"asd"model_arraydesc_array"Select""Cancel");
    return 
1;

This is the error
PHP код:
C:\Documents and Settings\Javed\Desktop\testing.pwn(58) : error 048: array dimensions do not match 
Can you tell me what you are trying to do. Making an array for weapons name is not good cause PAWN gave us GetWeaponName.

And that error is because of this:
pawn Код:
new model_array[7][2];
The parameter info[] only supports 1D array, where as you have a 2D array. Must be like this:
pawn Код:
new model_array[7];
I don't know what you are trying here but your code is quite wrong because you are using model_array as a string: (maybe this is the right way)
pawn Код:
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;
}
Reply
#97

I got that... Thanks +REP
Reply
#98

Make it compatible with y_dialogs...
Reply
#99

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.
Reply

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Make it compatible with y_dialogs...
Hooking y_dialogs' functions is all you have to do to make it compatiable. I don't know if y_dialogs have style range check cause this include introduces new styles? If so, it may require code editing.

Quote:
Originally Posted by Crayder
Посмотреть сообщение
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.
Its 6MB (approx) for me. It actually depends on the usage, more you use, more the output size. I will in future make a version using PVars so this include becomes supportive and non buggy in multiple platforms. Also, it will save alot for PlayerTextdraws' slots as well.
Reply


Forum Jump:


Users browsing this thread: 8 Guest(s)