YSI Text_Dialog causes pawno crash
#1

Hello!
I'm trying to create dialog window with YSI framework. So, I try to compile this code:

Код:
#include <YSI\y_text>
#include <YSI\y_languages>
#include <YSI\y_colors>

// some code

public OnPlayerConnect(playerid)
{
    // some code
    Text_DialogBox(playerid, DIALOG_STYLE_INPUT, using inline OnRegisterDialog, $DIALOG_REGISTER_CAPTION, $DIALOG_REGISTER_TEXT, $DIALOGS_OK, $DIALOGS_CANCEL);
    // some code
    return 1;
}

inline OnRegisterDialog(playerid, dialogid, response, listitem, string:inputtext[])
{
    // some code
    return 1;
}
When Pawno crashes with errors:

Код:
   Problem Event Name: APPCRASH 
** Application Name: pawncc.exe 
** Application Version: 3.2.3664.0 
** Application Timestamp: 4655bfe0 
** Name of the module with the error: PAWNC.dll 
** Version of the module with the error: 3.2.3664.0 
** Timestamp Fault Module: 4655bfdf 
** Exception code: c0000005 
** Exception Offset: 000119ec 
** OS Version: 6.1.7601.2.1.0.256.1 
** Language Code: 1049 
** Additional Information 1: 0a9e 
** Additional Information 2: 0a9e372d3b4ad19135b953a78882e789 
** Additional Information 3: 0a9e 
** Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Maybe I need to include some additional libraries something else?
Reply
#2

That is not how y_inline works you need to do this the inline responses are emedded within the function in which they are used.

pawn Код:
#include <YSI\y_text>
#include <YSI\y_languages>
#include <YSI\y_colors>
#include <YSI\y_inline>
#include <YSI\y_dialog>

// some code

public OnPlayerConnect(playerid)
{
    inline OnRegisterDialog(playerid, dialogid, response, listitem, string:inputtext[])
    {
        // some code
        return 1;
    }

    // some code
    Text_DialogBox(playerid, DIALOG_STYLE_INPUT, using inline OnRegisterDialog, $DIALOG_REGISTER_CAPTION, $DIALOG_REGISTER_TEXT, $DIALOGS_OK, $DIALOGS_CANCEL);
    // some code
    return 1;
}
Reply
#3

It works, thank you!
I get this warning:
Код:
local variable "playerid" shadows a variable at a preceding level
Does it matter anything?
Reply
#4

Yeah change that to pid and you will be golden you may also need to add #pragma unused dialogid response listitem inputtext if there is other warnings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)