[HELP]Dini 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Dini Help (
/showthread.php?tid=157643)
[SOLVED]Dini Help -
[SF]Bamdude37 - 07.07.2010
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 :/
Re: [HELP]Dini Help -
dice7 - 07.07.2010
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
Re: [HELP]Dini Help -
[SF]Bamdude37 - 07.07.2010
Neither do I but it is printing that its registered.
Re: [HELP]Dini Help -
[SF]Bamdude37 - 07.07.2010
Oh wow im stupid i switched the two arround, ok thats one problem down
Re: [HELP]Dini Help -
dice7 - 07.07.2010
edit; you found out
Re: [HELP]Dini Help -
[SF]Bamdude37 - 07.07.2010
I know sorry I misread lol
Edit: do you see anything wrong with the register dialog?
Re: [SOLVED]Dini Help -
[SF]Bamdude37 - 07.07.2010
Never mind I got it fixed