SA-MP Forums Archive
showplayerdialog | ondialogresponse - 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: showplayerdialog | ondialogresponse (/showthread.php?tid=609703)



showplayerdialog | ondialogresponse - ScIrUsna - 15.06.2016

Hi,

How to make this callback's use safier? because i heard it's possible to crash or hack by dialogid, need to store id or something simillar


Re: showplayerdialog | ondialogresponse - F1N4L - 15.06.2016

There exist a secret for use!
Code:
public OnDialogResponse(params...)
{
	if(dialogid == 100)
	{
		if(response)
		{
			//code for response > 0
		}
		else
		{
			//code for response < 1
		}
	}
	return 1;
}



Re: showplayerdialog | ondialogresponse - Sime30 - 15.06.2016

Use this to avoid the bug that causes to crash the server.

pawn Code:
CheckDialogBug(message[])
{
    new message_length = strlen(message);
    for(new i; i < message_length; i++)
    {
        if(message[i] == '%')
        {
            return 1;
        }
    }
    return 0;
}



Re: showplayerdialog | ondialogresponse - ScIrUsna - 16.06.2016

This mean player can't input % in text?


Re: showplayerdialog | ondialogresponse - Nin9r - 16.06.2016

Go to " public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])) "


Add this line: if(strfind(inputtext, "%", true) != -1) return SendClientMessage(playerid,-1, "Symbol denied.");