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
|
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 i; i < sizeof(PlayerSkins); i++)
{
if(PlayerSkins[i][playerid] == 0) break;
format(caption, sizeof caption, "%i\tID: %i\n", PlayerSkins[i][playerid], PlayerSkins[i][playerid]);
strcat(dialogstr, caption);
}
}
ShowPlayerDialog(playerid, DIALOG_ASHOP1, DIALOG_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 i; i < sizeof(PlayerSkins); i++)
{
if(PlayerSkins[i][playerid] == 0) break;
format(caption, sizeof caption, "%i\tID: %i\n", PlayerSkins[i][playerid], PlayerSkins[i][playerid]);
strcat(dialogstr, caption);
}
}
ShowPlayerDialog(playerid, DIALOG_ASHOP1, DIALOG_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(playerid, listitem, Float:rx, Float:ry, Float:rz, Float:zoom);
Example:
PHP код:
for (new i; i < sizeof(PlayerSkins); i++)
{
if(PlayerSkins[i][playerid] == 0) break;
format(caption, sizeof caption, "%i\tID: %i\n", PlayerSkins[i][playerid], PlayerSkins[i][playerid]);
strcat(dialogstr, caption);
SetDialogPreviewRotation(playerid, i, 0.0, 0.0, -0.45, 1.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(playerid, listitem, Float:rx, Float:ry, Float:rz, Float:zoom);
Example:
PHP код:
for (new i; i < sizeof(PlayerSkins); i++)
{
if(PlayerSkins[i][playerid] == 0) break;
format(caption, sizeof caption, "%i\tID: %i\n", PlayerSkins[i][playerid], PlayerSkins[i][playerid]);
strcat(dialogstr, caption);
SetDialogPreviewRotation(playerid, i, 0.0, 0.0, -0.45, 1.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!
- New memory allocation technique, now there are no limitations, you can have as many listitems as you want! The memory for listitems is allocated dynamically while include is fetching data for listitems from ShowPlayerDialog.
- There is new syntax, the old syntax for ShowPlayerDialog is kept, but there is addon for having custom rotation for listitems while you're making dialog's info! Checkout examples for more info; also there is a paragraph about this in "Functionality" section!
- Only function this include provides is "ShowPlayerDialog", there is no ShowPreviewModelDialog or SetDialogPreviewRotation for rotation settings, these functions are simply removed!
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[] =
{
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)
{
new string[sizeof(SKIN_MODELS)*5];
for(new i = 0; i < sizeof(SKIN_MODELS); i++)
{
format(string, sizeof string, "%s%i\n", string, SKIN_MODELS[i], SKIN_MODELS[i]);
}
ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_PREVIEW_MODEL, " ", string, "Take", "Cancel");
}
}
}
case DIALOG_SKIN:
{
if(response)
{
SetPlayerSkin(playerid, SKIN_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.