Dini Login/Register Issue
#1

I made this little Dialog Login/Register system. All works fine - there's just 1 problem. The code doesn't create the *.ini file. I tried run as administrator, but that didn't work as well. Can someone please tell me how to fix this issue?

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 0)
	{
	  if (response)
		{
	    new Pname[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, Pname, sizeof(Pname));
	    format(File, sizeof(File), "\\Users\\%s.ini", Pname);
   		dini_Create(File);
  		dini_IntSet(File, "HashPW", udb_hash(inputtext));
			dini_Set(File, "Password", inputtext);
			dini_IntSet(File, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0);
			dini_IntSet(File, "Score", PlayerInfo[playerid][Score] = 0);
			dini_IntSet(File, "Money", PlayerInfo[playerid][Cash] = 500);
	    Logged[playerid] = 1;
		}
		else
		{
		  new Pname[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, Pname, sizeof(Pname));
		  SendClientMessageToAll(Warning, "%s was kicked by AutoAdmin: Failed to register.", Pname);
		  Kick(playerid);
		}
		return 1;
	}
	
	if(dialogid == 1) // LoginBox
	{
	  if (response)
	  {
			new Pname[MAX_PLAYER_NAME];
			GetPlayerName(playerid, Pname, sizeof(Pname));
			format(File, sizeof(File), "\\Users\\%s.ini", Pname);
			new TMP;
  		TMP = dini_Int(File, "HashPW");
  		if(udb_hash(inputtext) != TMP)
  		{
  		  SendClientMessageToAll(Warning, "%s was kicked by AutoAdmin: Failed to input vailed password.", Pname);
  		  Kick(playerid);
			}
  			else
  			{
  			  Logged[playerid] = 1;
  			  PlayerInfo[playerid][AdminLevel] = dini_Int(File, "AdminLevel");
  			  SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
  			  GivePlayerMoney(playerid, dini_Int(File, "Money")-GetPlayerMoney(playerid));
			}
		}
		else
		{
		  new Pname[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, Pname, sizeof(Pname));
		  SendClientMessageToAll(Warning, "%s was kicked by AutoAdmin: Failed to login.", Pname);
		  Kick(playerid);
		}
	}
return 0;
}
- Yes I do have Includes. Dini & dudb


Also I need help with a few warnings:
Quote:

C:\Users\Mikkel Petersen\Documents\CityLifeRoleplay.pwn(130) : warning 202: number of arguments does not match definition
C:\Users\Mikkel Petersen\Documents\CityLifeRoleplay.pwn(147) : warning 202: number of arguments does not match definition
C:\Users\Mikkel Petersen\Documents\CityLifeRoleplay.pwn(162) : warning 202: number of arguments does not match definition
C:\Users\Mikkel Petersen\Documents\CityLifeRoleplay.pwn(166) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Warnings.

Reply


Messages In This Thread
Dini Login/Register Issue - by iNoT - 17.06.2010, 17:11
Re: Dini Login/Register Issue - by Flashy - 17.06.2010, 17:14
Re: Dini Login/Register Issue - by iNoT - 17.06.2010, 17:15
Re: Dini Login/Register Issue - by Flashy - 17.06.2010, 17:18
Re: Dini Login/Register Issue - by iNoT - 17.06.2010, 17:27
Re: Dini Login/Register Issue - by Flashy - 17.06.2010, 17:30
Re: Dini Login/Register Issue - by iNoT - 17.06.2010, 17:34
Re: Dini Login/Register Issue - by randomkid88 - 17.06.2010, 18:24

Forum Jump:


Users browsing this thread: 1 Guest(s)