SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 18/02/2012, 12:00 PM   #1
aRoach
Gangsta
 
aRoach's Avatar
 
Join Date: Mar 2011
Location: Bucharest, Romania
Posts: 512
Reputation: 83
Default RDLG - Reliable/Fast Dialog Processor

Description
  • This is a little include that uses OnPlayerDialogResponse( ) to process players Dialogs.
    Each dialog has his own function like the Command Processors( ZCMD, DCMD, YCMD ), such method is much faster than the normal way.

Usage
  • All you need to do is to add a public function using special pre-defined macros, like this:
    pawn Code:
    DIALOG:1( playerid, response, listitem, inputtext[ ] )
    {
        // Your code here, like in the Normal Dialogs with 'if else if else if else'

        return ( 1 ); // My style, it's not obligatory to use returns like that
    }

    or( another macro ):

    pawn Code:
    DLG:1( playerid, response, listitem, inputtext[ ] )
    {
        // Your code here, like in the Normal Dialogs with 'if else if else if else'

        return ( 1 );
    }

Here is all like the normal dialogs, but much faster.
That's all! Very easy, isn't it?

How to make two different dialogs doing the same thing( like in ZCMD )
  • For example, you have the dialog '123' :
    pawn Code:
    DIALOG:123( playerid, response, listitem, inputtext[ ] )
    {
        // Your stuff here...
        return ( 1 );
    }

    And you want to create another one that does the same thing:
    pawn Code:
    DIALOG:456( playerid, response, listitem, inputtext[ ] )
    {
        return dlg_123( playerid, response, listitem, inputtext );
    }

Notes
  • If you want to check whether inputtext string is empty( like in ZCMD with parameters ) you should not do it like:
    pawn Code:
    if( !strlen( inputtext ) )
    {
        // ...
    }

    or:
    pawn Code:
    if( !inputtext[ 0 ] )
    {
        // ...
    }

    Just use isnull( ), because its length will never be NULL:
    pawn Code:
    if( isnull( inputtext ) )
    {
        // ...
    }

    Actually, if you use sscanf[1] you don't need to do this as it has built-in isnull checking.

Speed Test
  • I did the test between mine and FDLG( because I think is the faster ) and here's the Result:
    Code:
    Time taken to show 32766 RDLG dialogs: 3 ms, average call time: 3/32766 ms.
    Time taken to execute 100,000,000 RDLG OnDialogResponse calls: 8805 ms.
    
    Time taken to show 32766 FDLG dialogs: 4 ms, average call time: 4/32766 ms.
    Time taken to execute 100,000,000 FDLG OnDialogResponse calls: 8818 ms.
    Both are almost the same at timing!

Requirements
Downloads
Special thanks to
  • ****** - For some Tips.
  • stuntman - For some Tips.
  • Gamer_Z - His Speed Test Filterscript.
__________________

Thanks to Zh3r0 for the Smudge Tutorial.

Last edited by aRoach; 19/02/2012 at 06:27 AM.
aRoach is offline   Reply With Quote
Old 18/02/2012, 12:10 PM   #2
coole210
Gangsta
 
Join Date: Jul 2008
Location: Canada
Posts: 995
Reputation: 84
Default Re: RDLG - Reliable/Fast Dialog Processor

I like it, but execution time is not that far off from FDLG.
coole210 is offline   Reply With Quote
Old 18/02/2012, 12:11 PM   #3
aRoach
Gangsta
 
aRoach's Avatar
 
Join Date: Mar 2011
Location: Bucharest, Romania
Posts: 512
Reputation: 83
Default Re: RDLG - Reliable/Fast Dialog Processor

Quote:
Originally Posted by coole210 View Post
I like it, but execution time is not that far off from FDLG.
Exactly, I think I will work on it to increase the performance, if I can...
__________________

Thanks to Zh3r0 for the Smudge Tutorial.
aRoach is offline   Reply With Quote
Old 18/02/2012, 12:32 PM   #4
Unknown1234
Big Clucker
 
Unknown1234's Avatar
 
Join Date: Jan 2011
Location: Unknown
Posts: 119
Reputation: 2
Default Re: RDLG - Reliable/Fast Dialog Processor

i want without y hook.
__________________
- Unknown1234
Unknown1234 is offline   Reply With Quote
Old 18/02/2012, 12:37 PM   #5
aRoach
Gangsta
 
aRoach's Avatar
 
Join Date: Mar 2011
Location: Bucharest, Romania
Posts: 512
Reputation: 83
Default Re: RDLG - Reliable/Fast Dialog Processor

Quote:
Originally Posted by Unknown1234 View Post
i want without y hook.
Allright Unknown1234

EDIT: Done.
__________________

Thanks to Zh3r0 for the Smudge Tutorial.
aRoach is offline   Reply With Quote
Old 18/02/2012, 01:01 PM   #6
aRoach
Gangsta
 
aRoach's Avatar
 
Join Date: Mar 2011
Location: Bucharest, Romania
Posts: 512
Reputation: 83
Default Re: RDLG - Reliable/Fast Dialog Processor

I'm not bothered about the speed, the performance matter...
__________________

Thanks to Zh3r0 for the Smudge Tutorial.
aRoach is offline   Reply With Quote
Old 18/02/2012, 01:11 PM   #7
aRoach
Gangsta
 
aRoach's Avatar
 
Join Date: Mar 2011
Location: Bucharest, Romania
Posts: 512
Reputation: 83
Default Re: RDLG - Reliable/Fast Dialog Processor

Quote:
Originally Posted by ****** View Post
Speed IS performance, they mean the same thing!
I'm...
__________________

Thanks to Zh3r0 for the Smudge Tutorial.
aRoach is offline   Reply With Quote
Old 18/02/2012, 01:12 PM   #8
Edvin
Gangsta
 
Edvin's Avatar
 
Join Date: Dec 2010
Posts: 859
Reputation: 71
Default Re: RDLG - Reliable/Fast Dialog Processor

Nice, relase Good Job!
Edvin is offline   Reply With Quote
Old 18/02/2012, 01:12 PM   #9
PowerMix
Little Clucker
 
PowerMix's Avatar
 
Join Date: Sep 2011
Posts: 12
Reputation: 4
Default Re: RDLG - Reliable/Fast Dialog Processor

Mnoh...Good job
PowerMix is offline   Reply With Quote
Old 18/02/2012, 01:40 PM   #10
aRoach
Gangsta
 
aRoach's Avatar
 
Join Date: Mar 2011
Location: Bucharest, Romania
Posts: 512
Reputation: 83
Default Re: RDLG - Reliable/Fast Dialog Processor

Thank you
__________________

Thanks to Zh3r0 for the Smudge Tutorial.
aRoach is offline   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
[Include] B-Dial - Fast Dialog Response Processor BigETI Includes 35 15/10/2012 09:38 PM
[Include] BTXT - Fast and Easy Text Processor BigETI Includes 23 23/11/2011 04:50 PM
[HowTo] Fast command processor: DCMD (0.3 Ready) DracoBlue Help Archive 8 28/11/2010 11:13 AM
fast command processor [mad]MLK Help Archive 1 22/08/2009 01:32 AM
Fast rcon command processor: RCMD (modified DCMD) Correlli Filterscripts 7 01/08/2009 12:02 PM


All times are GMT. The time now is 07:20 PM.


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