Password saves as 0. - 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)
+--- Thread: Password saves as 0. (
/showthread.php?tid=373207)
Password saves as 0. -
Guitar - 29.08.2012
Hey guys, this problem has occured like only today, where any new player registers his name and password and tries to relog his password changes to "0", I've checked everything in my registration system which I actually copied from
THIS TUTORIAL, and everything was alright, but why doesn't it save the password anymore? and saves 0 instead of the password .. ? If you want to see any code, please tell me.
Re: Password saves as 0. -
ThePrograme - 29.08.2012
I don't know why that register system is good.My advice is to change the register system here is one also with y_ini it is better for me than this one you are using:
https://sampforum.blast.hk/showthread.php?tid=269361
Re: Password saves as 0. -
Guitar - 29.08.2012
Sorry, but that means I need to change everything I worked on, but thank you .. I will try to change it, else I'll make a new thread, but for now I'm welcoming any help
.
However, I really want to convert my current registration system to commands not dialogs, how
?
Re: Password saves as 0. -
Guitar - 29.08.2012
Close this, I've managed to fix it .. Just thought about it a bit, I changed the dialog to a command-working registration and managed to fix the saving. If you guys wonder how, here it is for those who are facing the problem just like me
I declared playerpassword[128]; as "new" on the top of my script, then I scripted the following -
pawn Код:
CMD:register(playerid, params[])
{
if(sscanf(params,"s[128]",playerpassword)) return SendClientMessage(playerid, COLOR_ORANGE,"[REGISTRATION]/register <password>");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteString(File,"Password", playerpassword);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",-1);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Zombie",0);
INI_WriteInt(File,"Score",1);
INI_WriteInt(File,"Team",-1);
INI_Close(File);
PlayerInfo[playerid][pTeam] = -1;
PlayerInfo[playerid][pAdmin] = -1;
SavePlayerStats(playerid);
return 1;
}