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

You are not formatting it correct. Check the examples, you have to specify modelid and then the text.

Correct version:
PHP Code:
for (new isizeof SkinItemsi++) 

    
format(stringsizeof string"%s%i\t%s\n"stringSkinItems[i][attachModel], SkinItems[i][attachName]); 

Reply

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(piddialogidresponselistitemstring:inputtext[]) {
           
#pragma unused inputtext, dialogid, pid, listitem, response
           
if ( response ) {
               
printf("listitem: %d, modelid: %d"listitemAttachments listitem ] [ attach_model ] ) ;
            
SetPlayerAttachedObject playerid0Attachments listitem ] [ attach_model ], ) ;
            
EditAttachedObject playerid) ;    
           }
       }    
       
sQuery ] = EOS ;
       for ( new 
isizeof Attachments ); ++ ) {
        
strcat(tempAttachments ] [ attach_name ], 36 ) ;
        if ( 
strlen Attachments ] [ attach_name ] ) > 12 ) {
            
strins(temp"~n~"123) ;
        }
        
format sQuerysizeof sQuery ), "%s%i\t%s\n"sQueryAttachments ] [ attach_model ], Attachments ] [ attach_name ]) ;
        
Dialog_SetListitemPreviewRot(playeridi, -30.00.025.01.00xFFFFFFFF0xFFFFFFFF );  
    }
       
Dialog_ShowCallback(playeridusing inline ToyStoreListDIALOG_STYLE_PREVMODEL,  "Attachments Store"sQuery"Select""Cancel");
       return 
true ;
  } 
Always returns 0.
Reply

Quote:
Originally Posted by Dignity
View Post
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(piddialogidresponselistitemstring:inputtext[]) {
           
#pragma unused inputtext, dialogid, pid, listitem, response
           
if ( response ) {
               
printf("listitem: %d, modelid: %d"listitemAttachments listitem ] [ attach_model ] ) ;
            
SetPlayerAttachedObject playerid0Attachments listitem ] [ attach_model ], ) ;
            
EditAttachedObject playerid) ;    
           }
       }    
       
sQuery ] = EOS ;
       for ( new 
isizeof Attachments ); ++ ) {
        
strcat(tempAttachments ] [ attach_name ], 36 ) ;
        if ( 
strlen Attachments ] [ attach_name ] ) > 12 ) {
            
strins(temp"~n~"123) ;
        }
        
format sQuerysizeof sQuery ), "%s%i\t%s\n"sQueryAttachments ] [ attach_model ], Attachments ] [ attach_name ]) ;
        
Dialog_SetListitemPreviewRot(playeridi, -30.00.025.01.00xFFFFFFFF0xFFFFFFFF );  
    }
       
Dialog_ShowCallback(playeridusing inline ToyStoreListDIALOG_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.
Reply

Woah! I was looking for such thing.
Now i am gonna replace mSelection with this new awesome include!
Reply

Why it was removed?
Is there any way to get it without any issues?
I'd really appreciate it.
Reply

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

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

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

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

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

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
Reply

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

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(playeridTESTDIALOG_STYLE_PREVMODEL"Test""0\n1\n2\n3\n4""select""close");
    return 
1;
}
Dialog:TEST(playeridresponselistiteminputtext[])
{
    
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(playeridTESTDIALOG_STYLE_PREVMODEL"Test""0\n1\n2\n19130\n1318""select""close");
    return 
1;
}
Dialog:TEST(playeridresponselistiteminputtext[])
{
    
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
Reply

sorry for double posting
a simple fix for the list-item returning 0 bug

replacing all
Quote:

new inputtext[5];

with
Quote:

new inputtext[7]; //or 6

Reply

Quote:
Originally Posted by Fungi
View Post
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.
Reply

Quote:
Originally Posted by PatrickGTR
View Post
A string size issue somewhere that doesn't even reach the MAX_DIALOG_LIST_ITEMS, it happens when you combine labels+preview models.

Code: https://paste.ofcode.org/CpPy2yhmMy3r6XQdUmHUMS

Screenshot:

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
Reply

Very useful include! Rep+
Reply

Quote:
Originally Posted by Gammix
View Post
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
Reply

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);
Reply

Quote:
Originally Posted by grymtn
View Post
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.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)