Wrong password after dini offline edit
#1

Ok so I'm using the next command to unban people. After I use that the passwords are becoming invalid, it's like I edit the ini file with notepad. The passwords are encrypted, I'm using a very changed version of GodFather

This is my command, I have more but this is one of them
Код:
	if(strcmp(cmd, "/unban", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        new string2[256];
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GREY, "USAGE: /unban [full name(case sensative)]");
				return 1;
			}
			if (PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pBanAppealer])
			{
			    format(string, sizeof(string), "%s.ini",tmp);
	    	    if(dini_Exists(string))
	    	    {
	    	        if(dini_Int(string, "Band") > 0)
	    	        {
						new clearban[6];
	    	            format(clearban, sizeof(clearban),"None");
						dini_Set(string, "BanReason",clearban);
	    	            dini_IntSet(string, "Band", 0);
	    	            dini_IntSet(string, "Warnings", 0);
	    	            string2 = dini_Get(string, "IP");
	    	            format(string, sizeof(string),"unbanip %s", string2);
        	            SendRconCommand(string);
            		    SendRconCommand("reloadbans");
            		    format(string, 256, "AdmWarning: %s has unbanned account '%s' and IP '%s'.",PlayerName(playerid),tmp,string2);
                        ABroadCast(COLOR_LIGHTRED, string, 1);
            		    return 1;
            	    }
            	    else
            	    {
            	        SendClientMessage(playerid, COLOR_GRAD2, "That player is not account-banned. You have unbanned their IP.");
            	        string2 = dini_Get(string, "IP");
            		    format(string, sizeof(string), "unbanip %s", string2);
            		    SendRconCommand(string);
            		    SendRconCommand("reloadbans");
            		    return 1;
            	    }
	    	    }
	    	    else
	    	    {
	        	    SendClientMessage(playerid, COLOR_GRAD2, "That player does not exist!");
	    	    }
			}
		}
		return 1;
	}
I hope you can help me
Reply
#2

Show your encrypt function.
Reply
#3

I can already tell what script you're using and you won't be able to use Dini to change integers without changing the Dini include alone, seeing as the way that the script you're using saves data to files and the way that Dini doesn't.
Reply
#4

So is there any other ini editor which makes the changes in that way ? I also tried to read them with dini under OnPlayerLogin but I was dying every time I logged in

Nevermind, I removed \r from dini include
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)