showplayerdialog | ondialogresponse
#1

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
Reply
#2

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;
}
Reply
#3

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;
}
Reply
#4

This mean player can't input % in text?
Reply
#5

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


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


Forum Jump:


Users browsing this thread: 1 Guest(s)