SA-MP Forums Archive
Help! - 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: Help! (/showthread.php?tid=581063)



Help! - Mouiz - 10.07.2015

This is the login system placed under "OnPlayerConnect",but the problem is that it loads the player data before logging in,so other players can hack an account easily.

Код:
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    	format(str1, 150, "{FFFFFF}Welcome back to FreeRoam Server\n\n{00FF00}Account:{FFFFFF} %s \n\nPlease Enter Your Password Below", name);
       	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login Account", str1, "Login", "");
    }
    else
    {
        format(str1, 150, "\nWelcome To FreeRoam Server\n\n{00FF00}Account Name:{FFFFFF} %s\n\nEnter A Password To Register This Account", name);
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registration", str1, "Register", "");
	}



Re: Help! - Mouiz - 10.07.2015

Please anyone help


Re: Help! - Mouiz - 10.07.2015

anyone?


Re: Help! - kalanerik99 - 10.07.2015

Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
Remove this above login dialog
and place it under

OnDialogRespose.....

Like
Код:
public OnDialogResponse(playerid.......)
{
if(dialogid ==  .....)
{
if(password OK)
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}
else
{
ShowPlayerDialog(playerid,LOGIN DIALOG.....)(;



Re: Help! - Mouiz - 10.07.2015

i already tested it,it dident worked because the script cant detect the password if the file is not loaded,any other way?