SA-MP Forums Archive
Passwords, take of the server. - 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: Passwords, take of the server. (/showthread.php?tid=491570)



Passwords, take of the server. - AfikAtashga - 31.01.2014

Код:
if(!response) return Kick(playerid);
if(!strlen(inputtext)) return SendClientMessage(playerid, color_gray, "ERROR: Wrong");
if(strlen(inputtext) < 6 || strlen(inputtext) > 16) return SendClientMessage(playerid, color_gray, "ERROR: Wrong");
Somehow, unregister player, attack my server and shut him down!
That's not a files error,
some password that he do. take off the server.
Someone can help me? Please!


Re: Passwords, take of the server. - Konstantinos - 31.01.2014

The percent symbol (%) can crash the server if it's used in inputtext.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    for (new i, length = strlen(inputtext); i != length; ++i)
    {
        if (inputtext[i] == '%') inputtext[i] = '#';
    }
    // rest of code..



Re: Passwords, take of the server. - AfikAtashga - 31.01.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The percent symbol (%) can crash the server if it's used in inputtext.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    for (new i, length = strlen(inputtext); i != length; ++i)
    {
        if (inputtext[i] == '%') inputtext[i] = '#';
    }
    // rest of code..
only %? what about ~?