Password reset
#1

When I make myself admin through the scriptfiles, I try to log back in but my password has been reset.

So basically when I try and login, I get this error on the server_log:

[21:11:07] Incoming connection: 127.0.0.1:65108
[21:11:07] [join] Leonardo_Hill has joined the server (0:127.0.0.1)
[21:11:20] [alt tab vw debug] tabvw: 0 | tabvw type: 0
[21:11:20] [part] Leonardo_Hill has left the server (0:2)

I've already registered my account, I log out, set my admin rank from scriptfiles with the samp-server closed and then I try to log in but it says incorrect password.

Any ideas on how to fix this problem?
Reply
#2

Yes I believe I have an answer for that, show me your register dialog + onplayerdisconnect + onplayerconnect + login dialog.
Reply
#3

I think these are what you're looking for?

Register Dialog:
Code:
stock ShowMainMenuDialog(playerid, frame) {
	new
		string[180];

	switch(frame) {
		case 1: {
			format(string, sizeof(string), "{FFFFFF}That username is registered, please enter your password below.\n\n{00FF00}Username: {FFFFFF}%s\n\n{00FF00}Password:", GetPlayerNameEx(playerid));
			ShowPlayerDialogEx(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,"{00FF00}Visual Gaming Roleplay - Login",string,"Login","Quit");
		}
		case 2: {
			format(string, sizeof(string), "{FFFFFF}You may register this username by entering your desired password below.\n\n{00FF00}Username: {FFFFFF}%s\n\n{00FF00}Choose a Password:", GetPlayerNameEx(playerid));
			ShowPlayerDialogEx(playerid,MAINMENU2,DIALOG_STYLE_PASSWORD,"{00FF00}Visual Gaming Roleplay - Registration",string,"Register","Quit");
		}
		case 3: {
			format(string, sizeof(string), "{FFFFFF}Wrong password.\n\n{FFFFFF}That username is registered, please enter your password below.\n\n{00FF00}Username: {FFFFFF}%s\n\n{00FF00}Password:", GetPlayerNameEx(playerid));
			ShowPlayerDialogEx(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,"{00FF00}Visual Gaming Roleplay - Login",string,"Login","Quit");
		}
	}

	return 1;
}
onplayerdisconnect:
Code:
public OnPlayerDisconnect(playerid, reason)
{
    // Crash Fix
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	if(!strcmp(name, "InvalidNick", true)) return 1;
	if(!strcmp(name, "BannedPlayer", true)) return 1;
	if(playerid == MAX_PLAYERS) return 1;
//	DestroyProgressBar(Hunger[playerid]);
//	KillTimer(hungertimer[playerid]);
//	PlayerInfo[playerid][pPhoneCredits] = floatround(GetProgressBarValue(hungry[playerid]));
onplayerconnect:
Code:
public OnPlayerConnect(playerid) {
	new
	    szPlayerIP[16];

	// Code to patch a SA-MP exploit where you can connect to a SA-MP server multiple times with a bunch of names and completely rape the logs
	// We don't receive attacks like this very often, but I have produced the code so if we ever need it, we have it right in front of us. It requires testing though...
	/*new
	    szPlayerName[MAX_PLAYER_NAME],
	    szPlayerIP[16],
	    szPlayerIPs[16],
		szPlayerNames[MAX_PLAYER_NAME];

	GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
	GetPlayerIp(playerid, szPlayerIP, sizeof(szPlayerIP));

	foreach(Player, x) {
        GetPlayerName(x, szPlayerNames, MAX_PLAYER_NAME);
        GetPlayerIp(playerid, szPlayerIPs, sizeof(szPlayerIPs));
        if(strfind(szPlayerName, szPlayerNames, true) != -1 && !strcmp(szPlayerIPs, szPlayerIP, true) && IsStringAlphaNumeric(szPlayerNames) == 0)
			return BanEx(playerid, "NieXrlaM client spam attack attempt");
	}*/

	TotalConnect++;
	if(Iter_Count(Player) > MaxPlayersConnected)
	{
		MaxPlayersConnected = Iter_Count(Player);
		getdate(MPYear,MPMonth,MPDay);
	}
	if(PlayerInfo[playerid][pDeliverTruck] != -1)
    {
	    TruckPackages[PlayerInfo[playerid][pDeliverTruck]] = -1;
		PlayerInfo[playerid][pDeliverTruck] = -1;
    }
	GetPlayerIp(playerid, szPlayerIP, sizeof(szPlayerIP));

    if(!InvalidNameCheck(playerid)) return 1;
	if(CheckBan(szPlayerIP) == 1) {
	    SetPlayerName(playerid, "BannedPlayer");
	    SendClientMessage(playerid, COLOR_NEWS, "You're banned from Visual Gaming Roleplay. You can appeal your ban at Comming Soon");
		Kick(playerid);
		return 1;
	}
login dialog:
Not sure where to find this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)