Help with my login and register command. rep+ - 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: Help with my login and register command. rep+ (
/showthread.php?tid=310011)
Help with my login and register command. rep+ -
Azzeto - 10.01.2012
pawn Код:
CMD:register(playerid,params[])
{
if(IsLogged[playerid] == 0)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",PlayerInfo[playerid][Password]);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Skin",0);
INI_Close(File);
SendClientMessage(playerid,COLOR_YELLOW,"You've successfully registered. (login with /login)");
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"You're already registered. Please login with /login.");
}
return 1;
}
CMD:login(playerid,params[])
{
if(PlayerInfo[playerid][Password])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SendClientMessage(playerid,COLOR_WHITE,"You've successfully logged in.");
}
else
{
SendClientMessage(playerid,-1,EMBED_RED"WRONG PASSWORD!" EMBED_GREEN "Please attempt to re-login.");
}
return 1;
}
I do /register, it says i'v registered, but when I do /login it says wrong password, why? ( I'm trying to work with Y_INI a bit ) thanks in advance
Re: Help with my login and register command. rep+ -
Lee_Percox - 10.01.2012
Where do you set? PlayerInfo[playerid][Password]
As shouldn't it be the params instead of the stored version, as nothing will be stored until login?