SA-MP Forums Archive
[Include] Dialogs include - Adding new styles to SAMP GUI - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Dialogs include - Adding new styles to SAMP GUI (/showthread.php?tid=570213)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17


Re: Dialogs include - Adding new styles to SAMP GUI - Gammix - 30.03.2018

Update v4.6:
- Pointer management, single array holding pointer to pointers! (less pre-allocated memory)
- Fixed listitem text mixing bug.
- Fix for ShowPlayerDialog "info" expressions.


Re: Dialogs include - Adding new styles to SAMP GUI - BigETI - 30.03.2018

Hi, it is good to see that someone uses my plugin. However I saw in your source code that you have pre-defined limits for how many dialogs can exist. My suggestion would be to entirely remove the dialog count limit by re-allocating memory if needed. Also you can add support for sampctl:
https://sampforum.blast.hk/showthread.php?tid=651159
https://github.com/Southclaws/sampctl
https://github.com/sampctl/


Re: Dialogs include - Adding new styles to SAMP GUI - Gammix - 30.03.2018

Quote:
Originally Posted by BigETI
Посмотреть сообщение
Hi, it is good to see that someone uses my plugin. However I saw in your source code that you have pre-defined limits for how many dialogs can exist. My suggestion would be to entirely remove the dialog count limit by re-allocating memory if needed. Also you can add support for sampctl:
https://sampforum.blast.hk/showthread.php?tid=651159
https://github.com/Southclaws/sampctl
https://github.com/sampctl/
I actually need that limit to allocate memory whenever a player joins because there is rotation function which changes the rotation of a listitem before showing the dialog (showing is when i would allocate memory with your way).

And sampctl, i have no idea how to add support. If someone can link me a tutorial or do it for me that would be great!


Re: Dialogs include - Adding new styles to SAMP GUI - Dignity - 30.06.2018

Quote:
Originally Posted by Gammix
Посмотреть сообщение
I didn't change any syntax or compatibility. The only thing in the latest update is using memory.inc plugin. Is that why its not working?
I don't know. I'll do some testing and tell you what's up.


Re: Dialogs include - Adding new styles to SAMP GUI - MRM - 28.07.2018

I have problem with player dialog.
PHP код:
if (dialogstr[0] == EOS) { 
    for (new 
isizeof(PlayerSkins); i++) 
    {
        if(
PlayerSkins[i][playerid] == 0) break;
                        
format(captionsizeof caption"%i\tID: %i\n"PlayerSkins[i][playerid], PlayerSkins[i][playerid]); 
                        
strcat(dialogstrcaption);
    } 
}                
ShowPlayerDialog(playeridDIALOG_ASHOP1DIALOG_STYLE_PREVIEW_MODEL"Special skins"dialogstr"Select""Cancel"); 
When player change skin rotation with scrolls for other player skins got change.
How to fix it?


Re: Dialogs include - Adding new styles to SAMP GUI - Gammix - 29.07.2018

Quote:
Originally Posted by MRM
Посмотреть сообщение
I have problem with player dialog.
PHP код:
if (dialogstr[0] == EOS) { 
    for (new 
isizeof(PlayerSkins); i++) 
    {
        if(
PlayerSkins[i][playerid] == 0) break;
                        
format(captionsizeof caption"%i\tID: %i\n"PlayerSkins[i][playerid], PlayerSkins[i][playerid]); 
                        
strcat(dialogstrcaption);
    } 
}                
ShowPlayerDialog(playeridDIALOG_ASHOP1DIALOG_STYLE_PREVIEW_MODEL"Special skins"dialogstr"Select""Cancel"); 
When player change skin rotation with scrolls for other player skins got change.
How to fix it?
Use this function in your loop:
PHP код:
SetDialogPreviewRotation(playeridlistitemFloat:rxFloat:ryFloat:rzFloat:zoom); 
Example:
PHP код:
for (new isizeof(PlayerSkins); i++) 
{
    if(
PlayerSkins[i][playerid] == 0) break;
    
format(captionsizeof caption"%i\tID: %i\n"PlayerSkins[i][playerid], PlayerSkins[i][playerid]); 
    
strcat(dialogstrcaption);
                        
    
SetDialogPreviewRotation(playeridi0.00.0, -0.451.0);




Re: Dialogs include - Adding new styles to SAMP GUI - MRM - 29.07.2018

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Use this function in your loop:
PHP код:
SetDialogPreviewRotation(playeridlistitemFloat:rxFloat:ryFloat:rzFloat:zoom); 
Example:
PHP код:
for (new isizeof(PlayerSkins); i++) 
{
    if(
PlayerSkins[i][playerid] == 0) break;
    
format(captionsizeof caption"%i\tID: %i\n"PlayerSkins[i][playerid], PlayerSkins[i][playerid]); 
    
strcat(dialogstrcaption);
                        
    
SetDialogPreviewRotation(playeridi0.00.0, -0.451.0);

Not working ...


Re: Dialogs include - Adding new styles to SAMP GUI - Gammix - 06.08.2018

You need Pawn-Memory plugin, download it from the link in thread. Also put "memory" in your plugins line in server.cfg.


Re: Dialogs include - Adding new styles to SAMP GUI - Gammix - 07.08.2018

Update v4.7:
Optional update, but recommended!
I'd say this version is more optimized in terms of memory management, everything is dynamically allocated, nothing is pre-allocated and allocation size is not static!


Re: Dialogs include - Adding new styles to SAMP GUI - Verc - 07.08.2018

I never thought this will be one of the most awesome include I've found. I respect that you still developing this after 3 years while most of the authors don't do that.


Re: Dialogs include - Adding new styles to SAMP GUI - MRM - 07.08.2018

Quote:
Originally Posted by Gammix
Посмотреть сообщение
You need Pawn-Memory plugin, download it from the link in thread. Also put "memory" in your plugins line in server.cfg.
I have Pawn-Memory plugin.
In the new version the problem has been fixed?


Re: Dialogs include - Adding new styles to SAMP GUI - Gammix - 07.08.2018

Quote:
Originally Posted by MRM
Посмотреть сообщение
I have Pawn-Memory plugin.
In the new version the problem has been fixed?
That has never been a problem related to the include. You are most likely not installing Pawn-Memory plugin correctly.

@Verc: thanks


Re: Dialogs include - Adding new styles to SAMP GUI - BigETI - 07.08.2018

There is a way to copy memory using MEM_copy, instead of writing each value using a for loop. There is also no MEM_delete to free memory before this bit.

For an example you can take a look, how it's done at pawn-vector
Heck you can actually use this library to use "dynamicly re-sizable arrays".


Re: Dialogs include - Adding new styles to SAMP GUI - CantBeJohn - 27.08.2018

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

Код:
new SKIN_MODELS[] = 
{
6, 8, 10, 20, 40, 50, 120, 211, 232, 235
};


CMD:test(playerid)
{
    ShowPlayerDialog(playerid, DIALOG_SELECT, DIALOG_STYLE_LIST, " ", "Option 0\nOption 1\nOption 2 [skins] \nOption 3","Go","Cancel");
return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case DIALOG_SELECT:
{
if(response)
{
if(listitem == 2)
{
ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_PREVIEW_MODEL, " ", SKIN_MODELS, "Take", "Cancel");
}
}
}
case DIALOG_SKIN:
{
if(response){
SetPlayerSkin(playerid, SKIN_MODELS[listitem]);
DDS[playerid][cSkin] = SKIN_MODELS[listitem];
}
}
}
return 1;
}
Here you go:

PHP код:

new SKIN_MODELS[] = 
{
    
6810204050120211232235
};
CMD:test(playerid)
{
    
ShowPlayerDialog(playeridDIALOG_SELECTDIALOG_STYLE_LIST" ""Option 0\nOption 1\nOption 2 [skins] \nOption 3","Go","Cancel");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch (
dialogid)
    {
        case 
DIALOG_SELECT:
        {
            if(
response)
            {
                if(
listitem == 2)
                {
                    new 
string[sizeof(SKIN_MODELS)*5];
                    for(new 
0sizeof(SKIN_MODELS); i++)
                    {
                        
format(stringsizeof string"%s%i\n"stringSKIN_MODELS[i], SKIN_MODELS[i]); 
                    }
                    
ShowPlayerDialog(playeridDIALOG_SKINDIALOG_STYLE_PREVIEW_MODEL" "string"Take""Cancel");
                }
            }
        }
        case 
DIALOG_SKIN:
        {
            if(
response)
            {
                
SetPlayerSkin(playeridSKIN_MODELS[listitem]);
                
DDS[playerid][cSkin] = SKIN_MODELS[listitem];
            }
        }
    }
    return 
1;

You have to loop through the array "SKIN_MODELS", which I did for you.


Re: Dialogs include - Adding new styles to SAMP GUI - BigETI - 12.12.2018

You need the memory access plugin include file to compile the code and the memory access plugin to run that code.


Re: Dialogs include - Adding new styles to SAMP GUI - neropic - 20.12.2018

Nice job, it's great


Re: Dialogs include - Adding new styles to SAMP GUI - tuantruoq - 21.12.2018

help pls



Re: Dialogs include - Adding new styles to SAMP GUI - qanddstairs - 21.12.2018

Hey all can you please give me ch#### codes for the game thanks


Re: Dialogs include - Adding new styles to SAMP GUI - Stefhan - 21.12.2018

How do I make the skin selection so that you can only pick between a few skins? ( id 20001 to 20008 )


Re: Dialogs include - Adding new styles to SAMP GUI - Gammix - 26.12.2018

Quote:
Originally Posted by Stefhan
Посмотреть сообщение
How do I make the skin selection so that you can only pick between a few skins? ( id 20001 to 20008 )
pawn Код:
#define SKIN_DIALOG 420

ShowPlayerDialog(playerid, SKIN_DIALOG, DIALOG_STYLE_PREVIEW_MODEL, "Skin selection", "20001\n20002\n20008", "Select", "Close");
There is also examples in main post about the syntax, read them.