Re: Dialogs include - Adding new styles to SAMP GUI -
Gammix - 12.08.2017
You are not formatting it correct. Check the examples, you have to specify modelid and then the text.
Correct version:
PHP Code:
for (new i; i < sizeof SkinItems; i++)
{
format(string, sizeof string, "%s%i\t%s\n", string, SkinItems[i][attachModel], SkinItems[i][attachName]);
}
Re: Dialogs include - Adding new styles to SAMP GUI -
Dignity - 12.08.2017
Sorry if this has been answered before but in the latest version what does "listitem" return? The modelid or the actual listitem? The testing I've done basically returns fuck all, just "0".
I'm trying to pull the listitem so I can use it with an array.
PHP Code:
enum attachmentData {
attach_model,
attach_name [ 32 ]
} ;
// This is their primary attachment slot, but it is not absolute.
new Attachments [ ] [ attachmentData ] = {
{ 19528, "Witch Hat" } ,
{ 19520, "Police Cap 1" } ,
{ 19521, "Police Cap 2" }
} ;
CMD:test(playerid) {
new sQuery [ 2048 ], temp [ 36 ] ;
inline ToyStoreList(pid, dialogid, response, listitem, string:inputtext[]) {
#pragma unused inputtext, dialogid, pid, listitem, response
if ( response ) {
printf("listitem: %d, modelid: %d", listitem, Attachments [ listitem ] [ attach_model ] ) ;
SetPlayerAttachedObject ( playerid, 0, Attachments [ listitem ] [ attach_model ], 1 ) ;
EditAttachedObject ( playerid, 0 ) ;
}
}
sQuery [ 0 ] = EOS ;
for ( new i; i < sizeof ( Attachments ); i ++ ) {
strcat(temp, Attachments [ i ] [ attach_name ], 36 ) ;
if ( strlen ( Attachments [ i ] [ attach_name ] ) > 12 ) {
strins(temp, "~n~", 12, 3) ;
}
format ( sQuery, sizeof ( sQuery ), "%s%i\t%s\n", sQuery, Attachments [ i ] [ attach_model ], Attachments [ i ] [ attach_name ]) ;
Dialog_SetListitemPreviewRot(playerid, i, -30.0, 0.0, 25.0, 1.0, 0xFFFFFFFF, 0xFFFFFFFF );
}
Dialog_ShowCallback(playerid, using inline ToyStoreList, DIALOG_STYLE_PREVMODEL, "Attachments Store", sQuery, "Select", "Cancel");
return true ;
}
Always returns 0.
Re: Dialogs include - Adding new styles to SAMP GUI -
Gammix - 13.08.2017
Quote:
Originally Posted by Dignity
Sorry if this has been answered before but in the latest version what does "listitem" return? The modelid or the actual listitem? The testing I've done basically returns fuck all, just "0".
I'm trying to pull the listitem so I can use it with an array.
PHP Code:
enum attachmentData {
attach_model,
attach_name [ 32 ]
} ;
// This is their primary attachment slot, but it is not absolute.
new Attachments [ ] [ attachmentData ] = {
{ 19528, "Witch Hat" } ,
{ 19520, "Police Cap 1" } ,
{ 19521, "Police Cap 2" }
} ;
CMD:test(playerid) {
new sQuery [ 2048 ], temp [ 36 ] ;
inline ToyStoreList(pid, dialogid, response, listitem, string:inputtext[]) {
#pragma unused inputtext, dialogid, pid, listitem, response
if ( response ) {
printf("listitem: %d, modelid: %d", listitem, Attachments [ listitem ] [ attach_model ] ) ;
SetPlayerAttachedObject ( playerid, 0, Attachments [ listitem ] [ attach_model ], 1 ) ;
EditAttachedObject ( playerid, 0 ) ;
}
}
sQuery [ 0 ] = EOS ;
for ( new i; i < sizeof ( Attachments ); i ++ ) {
strcat(temp, Attachments [ i ] [ attach_name ], 36 ) ;
if ( strlen ( Attachments [ i ] [ attach_name ] ) > 12 ) {
strins(temp, "~n~", 12, 3) ;
}
format ( sQuery, sizeof ( sQuery ), "%s%i\t%s\n", sQuery, Attachments [ i ] [ attach_model ], Attachments [ i ] [ attach_name ]) ;
Dialog_SetListitemPreviewRot(playerid, i, -30.0, 0.0, 25.0, 1.0, 0xFFFFFFFF, 0xFFFFFFFF );
}
Dialog_ShowCallback(playerid, using inline ToyStoreList, DIALOG_STYLE_PREVMODEL, "Attachments Store", sQuery, "Select", "Cancel");
return true ;
}
Always returns 0.
|
They return the actual listitem so that you access your array ofcourse. Last time i did a test this was working flawless. Might be y_inline conflicting here.
Anyways I'll test it again and let you know.
Re: Dialogs include - Adding new styles to SAMP GUI -
Zeth - 13.08.2017
Woah! I was looking for such thing.
Now i am gonna replace mSelection with this new awesome include!
Re: Dialogs include - Adding new styles to SAMP GUI -
oMa37 - 15.09.2017
Why it was removed?
Is there any way to get it without any issues?
I'd really appreciate it.
Re: Dialogs include - Adding new styles to SAMP GUI -
Eoussama - 15.09.2017
Quote:
Originally Posted by oMa37
Why it was removed?
Is there any way to get it without any issues?
I'd really appreciate it.
|
Totally agree, I thought I was the only one!
Re: Dialogs include - Adding new styles to SAMP GUI -
Gammix - 15.09.2017
Quote:
Originally Posted by oMa37
Why it was removed?
Is there any way to get it without any issues?
I'd really appreciate it.
|
Well you can port it from old version to new one. You just need to add some if/else statements and then create textdraws accordingly. And same under OnPlayerClickTextDraw.
I know it sounds hard and it will be hard for you since you didn't designed the code. And i don't have time for this if you want me to do it, so sorry!
The reason why i removed it was the lack of users, i didn't see single person using it or talking about the second style!
Re: Dialogs include - Adding new styles to SAMP GUI -
oMa37 - 15.09.2017
That's sad .. I was about to use it as a vehicles dealership list in my gamemode. It would've really fit my system.
Thank you anyway.
Re: Dialogs include - Adding new styles to SAMP GUI -
hottabych1607 - 15.09.2017
Hello Gammix.
I understand this is a bug. How to make the color of buttons 2 and buttons1 the same?(that is, when you move the mouse over the button)
button1 is completely painted in red, and button 2 is not, it is for some reason transparent, how to fix it?
Re: Dialogs include - Adding new styles to SAMP GUI -
Gammix - 15.09.2017
Quote:
Originally Posted by hottabych1607
Hello Gammix.
I understand this is a bug. How to make the color of buttons 2 and buttons1 the same?(that is, when you move the mouse over the button)

|
Thats an internal game/samp bug. I cant do anything about it.
Re: Dialogs include - Adding new styles to SAMP GUI -
hottabych1607 - 15.09.2017
Quote:
Originally Posted by Gammix
Thats an internal game/samp bug. I cant do anything about it.
|
that is, you have exactly the same?
in the previous versions everything was fine
Re: Dialogs include - Adding new styles to SAMP GUI -
Gammix - 15.09.2017
Quote:
Originally Posted by hottabych1607
that is, you have exactly the same?
in the previous versions everything was fine
|
Yes everyone have this. In previous version this was not there because of some weird reason, this bug happens when you mix up textdraws with different font. No idea how to fix it or when it occurs.
Re: Dialogs include - Adding new styles to SAMP GUI -
Fungi - 21.09.2017
Quote:
Originally Posted by Gammix
@Dignity: So i tested it using the following code and everything works fine. The listitem returned is correct.
PHP код:
#include <a_samp>
#include <dialogs>
#include <zcmd>
#include <easydialog>
main()
{
}
CMD:test(playerid)
{
Dialog_Show(playerid, TEST, DIALOG_STYLE_PREVMODEL, "Test", "0\n1\n2\n3\n4", "select", "close");
return 1;
}
Dialog:TEST(playerid, response, listitem, inputtext[])
{
printf("listitem = %i", listitem);
return 1;
}
|
It returns listitem ID 0 if you use large object model id such as 19130
PHP код:
#include <a_samp>
#include <dialogs>
#include <zcmd>
#include <easydialog>
main()
{
}
CMD:test(playerid)
{
Dialog_Show(playerid, TEST, DIALOG_STYLE_PREVMODEL, "Test", "0\n1\n2\n19130\n1318", "select", "close");
return 1;
}
Dialog:TEST(playerid, response, listitem, inputtext[])
{
printf("listitem = %i", listitem);
return 1;
}
Selecting the
third row in this dialog will return listitem 0 , however the 1st ,2nd ,4th rows returns are normal.
@Dignity used object ids { 19528,19520,19521 } and you used (1,2,3) thats why it works for you
Re: Dialogs include - Adding new styles to SAMP GUI -
Fungi - 21.09.2017
sorry for double posting
a simple fix for the list-item returning 0 bug
replacing all
with
Re: Dialogs include - Adding new styles to SAMP GUI -
Gammix - 22.09.2017
Quote:
Originally Posted by Fungi
sorry for double posting
a simple fix for the list-item returning 0 bug
replacing all
with
|
Thanks for reporting, and as your fixes says that was the issue.
Re: Dialogs include - Adding new styles to SAMP GUI -
Gammix - 25.10.2017
Quote:
Originally Posted by PatrickGTR
|
What is "%m" ?
PHP Code:
"%s%i\t%s~g~(%m)\n"
You should declare string size like this instead:
PHP Code:
new string[sizeof (mInfo) * /*max length of the item name string*/ + 3/*for specifiers in format*/];
Maybe that might fix it but as i said in my space right now! lol
Re: Dialogs include - Adding new styles to SAMP GUI -
GamezCEO - 25.10.2017
Very useful include! Rep+
Re: Dialogs include - Adding new styles to SAMP GUI -
Eoussama - 25.10.2017
Quote:
Originally Posted by Gammix
What is "%m" ?
PHP Code:
"%s%i\t%s~g~(%m)\n"
|
Not very sure, but I guess that's a custom specifier, refer to this post for further information.
https://sampforum.blast.hk/showthread.php?tid=313488
Re: Dialogs include - Adding new styles to SAMP GUI -
grymtn - 12.11.2017
hey all. Im trying to use this for my vehicle menus but they just look bad because i cant change the preview rotation and zoom. I know i saw the function in first post but where and how do i actually use this?
Code:
Dialog_SetListitemPreviewRot(playerid, 0, 5.0, 5.0, 2.0, 10.0, cola1, colb1);
Re: Dialogs include - Adding new styles to SAMP GUI -
Gammix - 12.11.2017
Quote:
Originally Posted by grymtn
hey all. Im trying to use this for my vehicle menus but they just look bad because i cant change the preview rotation and zoom. I know i saw the function in first post but where and how do i actually use this?
Code:
Dialog_SetListitemPreviewRot(playerid, 0, 5.0, 5.0, 2.0, 10.0, cola1, colb1);
|
Before showing your dialog, use this.
Also you know, you have to set rotation of other listitems too. Use a for loop with limit of number of listitems (array size) and use this function in it.