YSI Text_Dialog causes pawno crash - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: YSI Text_Dialog causes pawno crash (
/showthread.php?tid=539802)
YSI Text_Dialog causes pawno crash -
terrance - 30.09.2014
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?
Re: YSI Text_Dialog causes pawno crash -
Pottus - 30.09.2014
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;
}
Re: YSI Text_Dialog causes pawno crash -
terrance - 30.09.2014
It works, thank you!
I get this warning:
Код:
local variable "playerid" shadows a variable at a preceding level
Does it matter anything?
Re: YSI Text_Dialog causes pawno crash -
Pottus - 30.09.2014
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.