SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 11/08/2017, 04:40 PM   #321
Iszcegg
Gangsta
 
Iszcegg's Avatar
 
Join Date: Oct 2013
Location: Venezuela
Posts: 835
Reputation: 81
Default Re: Dialogs include - Adding new styles to SAMP GUI

Code:
Dialog_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[], BG_COLOR = 0, DIALOG_LIST_ITEM_COLOR = 5864548, DIALOG_SELECTED_LIST_ITEM_COLOR = -1608903836)
The idea would be to customize the menu colors.

Another thing that would be useful, a callback that points to the player that item selected in real time. It would be used to point out additional item information (would be optional, for inventory systems).
Iszcegg is offline   Reply With Quote
Old 11/08/2017, 06:16 PM   #322
FinStar
Big Clucker
 
Join Date: Nov 2013
Location: Hell :3
Posts: 125
Reputation: 0
Default Re: Dialogs include - Adding new styles to SAMP GUI

I have a mode where I use nex-ac include and your include but when I use a command to display skins, the dialog will not appear

Only the cursor is displayed
FinStar is offline   Reply With Quote
Old 12/08/2017, 02:12 AM   #323
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,687
Reputation: 662
Default Re: Dialogs include - Adding new styles to SAMP GUI

Quote:
Originally Posted by Unrea1 View Post
Code:
Dialog_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[], BG_COLOR = 0, DIALOG_LIST_ITEM_COLOR = 5864548, DIALOG_SELECTED_LIST_ITEM_COLOR = -1608903836)
The idea would be to customize the menu colors.

Another thing that would be useful, a callback that points to the player that item selected in real time. It would be used to point out additional item information (would be optional, for inventory systems).
Well i won't add this because that was not the real intention of this include. Its about adding new dialog style, dialog which look similar to SAMP dialogs. So if i add color customization, it will not be the same then. Feel free to edit the include as you like.

Quote:
Originally Posted by FinStar View Post
I have a mode where I use nex-ac include and your include but when I use a command to display skins, the dialog will not appear

Only the cursor is displayed
Show the code you use to display the dialog.
__________________
Gammix is online now   Reply With Quote
Old 12/08/2017, 04:50 AM   #324
FinStar
Big Clucker
 
Join Date: Nov 2013
Location: Hell :3
Posts: 125
Reputation: 0
Default Re: Dialogs include - Adding new styles to SAMP GUI

Code:
new string[sizeof SkinItems* 50]; 
for (new i; i < sizeof SkinItems; i++) 
{ 
	format(string, sizeof string, "%s\t%s\n", string, SkinItems[i][attachName]); 
}
						
ShowPlayerDialog(playerid, DIALOG_SKINS, DIALOG_STYLE_PREVMODEL, "Select Skins", string, "Select", "Close");

Code:
enum MaleSkins
{
    attachModel,
    attachName[25]
};

new const SkinItems[][MaleSkins] =
{
    {9, "Skin"},
    {10, "Skin"},
    {12, "Skin"},
   // atp ......
    }
;
EDIT:

I use compilation file that contains textdraws, OnPlayerClickPlayerTextdraw and OnPlayerClickTextdraw, without my script displaying your dialog.
FinStar is offline   Reply With Quote
Old 12/08/2017, 04:56 AM   #325
FinStar
Big Clucker
 
Join Date: Nov 2013
Location: Hell :3
Posts: 125
Reputation: 0
Default Re: Dialogs include - Adding new styles to SAMP GUI

I use textdraw-list.pwn for compilation, textdraws is not located directly in main mode but special.
FinStar is offline   Reply With Quote
Old 12/08/2017, 05:39 AM   #326
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,687
Reputation: 662
Default Re: 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]); 

__________________
Gammix is online now   Reply With Quote
Old 12/08/2017, 06:30 AM   #327
Dignity
High-roller
 
Dignity's Avatar
 
Join Date: May 2013
Location: Belgium
Posts: 1,773
Reputation: 1037
Default Re: Dialogs include - Adding new styles to SAMP GUI

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


Shoot me or Reyo a PM for more information.
Dignity is offline   Reply With Quote
Old 13/08/2017, 05:17 AM   #328
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,687
Reputation: 662
Default Re: Dialogs include - Adding new styles to SAMP GUI

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.
__________________
Gammix is online now   Reply With Quote
Old 13/08/2017, 10:02 AM   #329
Debjit
Huge Clucker
 
Debjit's Avatar
 
Join Date: Feb 2017
Posts: 327
Reputation: 28
Default Re: Dialogs include - Adding new styles to SAMP GUI

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

Join Our: Forums | Discord
Release Date Announced! Read More


More the knowledge, lesser the ego. Lesser the Knowledge, more the ego.- Albert Einstein
Debjit is offline   Reply With Quote
Old 15/08/2017, 02:36 PM   #330
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,687
Reputation: 662
Default Re: Dialogs include - Adding new styles to SAMP GUI

@Dignity: So i tested it using the following code and everything works fine. The listitem returned is correct.

PHP Code:
#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;

__________________
Gammix is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Items spawner dialogs (zcmd & dialogs include) Q_Lite Filterscripts 17 16/10/2016 12:09 PM
[FilterScript] [FS]Fighting Styles,5 most usable styles Like in SP By Don_(GH) HAYTXA Filterscripts 10 28/03/2013 07:39 AM
Making an OnFilterScriptInit in an include without adding anything in the .pwn exepct the #include r3k1lLz_ Help Archive 6 06/01/2011 07:49 AM
[FilterScript] [FS]Trans World Airlines v0.2 [TWA] - Bug Fixed - Adding Dialogs Soon. Toni Filterscripts 16 13/06/2010 03:57 PM
[FilterScript] [FS] Fighting Styles (0.3a) - |Save styles in Dini| MoBiL[e] Filterscripts 23 24/04/2010 12:12 PM


All times are GMT. The time now is 02:46 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.