Dialog 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: Dialog crash (
/showthread.php?tid=649495)
Dialog crash -
NotThatWeird - 09.02.2018
Hey, so i have a lot of dialogs on my server with different styles, every dialog works, but there's a problem with DIALOG_STYLE_INPUT, when the dialog displays to the player and if the player types like: "%s%s%s%s%s" in the dialog, it will cause the server to crash. I have tested it a few times and it actually crashes the server. I didn't open the server yet, but i just want to be safe and fix it, is there any way to fix it?
Re: Dialog crash -
Mugala - 10.02.2018
what did u exactly wrote in a dialog and which version of SA:MP u're using? (I mean 0.3.8, 0.3.DL or 0.3.7?)
Re: Dialog crash -
RogueDrifter - 10.02.2018
add this:
PHP код:
for (new i, l = strlen(inputtext); i < l; i ++)
{
if (inputtext[i] == '%')
{
inputtext[i] = '#';
}
}
at the top of
OnDialogResponse and it'll replace all of the invalid values.
Re: Dialog crash -
NotThatWeird - 10.02.2018
Quote:
Originally Posted by RogueDrifter
add this:
PHP код:
for (new i, l = strlen(inputtext); i < l; i ++)
{
if (inputtext[i] == '%')
{
inputtext[i] = '#';
}
}
at the top of OnDialogResponse and it'll replace all of the invalid values.
|
Hey i tried this code you sent but when i compiled the script the pawn stopped working
EDIT: I forgot a bracket, this actually worked! Thank you so much, +REP.