[HELP]Dini Help
#1

I have been working on an admin system and have hit a little... snag with dini. Here are a few issues I need help with.

Here is the player file.
Код:
new playerfile[128], pname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, sizeof(pname));
		format(playerfile, sizeof(playerfile), "Users/%s.ini",pname);
Код:
	if(dialogid == 201)
	{
		if(!strlen(inputtext)) return ShowPlayerDialog(playerid,201,DIALOG_STYLE_INPUT,"Registration","ERROR: You did not enter a password.\nPlease enter a password to register this account!","Register","Cancel");
	    new playerfile[128], pname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, sizeof(pname));
		format(playerfile, sizeof(playerfile), "Users/%s.ini",pname);
	 	if(dini_Exists(playerfile)) return SendClientMessage(playerid, red, "You are already registered!");
	 	dini_Create(playerfile);
		new playerip[20];
		GetPlayerIp(playerid, playerip, sizeof(playerip));
  		dini_IntSet(playerfile, "Password", udb_hash(inputtext));
		dini_Set(playerfile, "Ip", playerip);
		dini_IntSet(playerfile, "Level", 0);
		dini_IntSet(playerfile, "Cash", 0);
		dini_IntSet(playerfile, "Score", 0);
		logged[playerid] = 1;
		SendClientMessage(playerid, yellow, "You have registered your account! You have also been logged in.");
	}
This doesnt create an account
I know this funtion is being called because when I do this it does say
You have registered your account! You have also been logged in.
and allows me to spawn

Does anyone see anything wrong with it? because I dont :/
Reply
#2

pawn Код:
else if(!dini_Exists(playerfile)) SendClientMessage(playerid, orange, "This username is registered! Type /login to log into your account.");
The file doesn't exist, "This username is registered! Type /login to log into your account." gets printed out. I don't see a problem.

You mixed up the SendClientMessages
Reply
#3

Neither do I but it is printing that its registered.
Reply
#4

Oh wow im stupid i switched the two arround, ok thats one problem down
Reply
#5

edit; you found out
Reply
#6

I know sorry I misread lol

Edit: do you see anything wrong with the register dialog?
Reply
#7

Never mind I got it fixed
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)