05.09.2009, 12:13
Hey,
I am having a problem saving the player password.
When a player register, then try to login, it always fails because the Password string on the file is like this: Password=
It does not shows anything after "=" .
How can i fix this ?
When a player regists:
SaveData tool (used OnPlayerDisconnect):
I hop get some help,
Best Regards.
I am having a problem saving the player password.
When a player register, then try to login, it always fails because the Password string on the file is like this: Password=
It does not shows anything after "=" .
How can i fix this ?
When a player regists:
pawn Код:
dcmd_register(playerid,params[])
{
if (Logged[playerid]) return SystemMsg(playerid,"[ » ] Already Logged in !");
new player[128];
format(player, sizeof(player),"users/%s.txt",PlayerName(playerid));
if(dini_Exists(player)) return SystemMsg(playerid,"[ » ] Account already exists, please use '/login password'.") && GameTextForPlayer(playerid,"~w~Use~r~/login (password)",5000,6);
if(strlen(params)==0) return SystemMsg(playerid,"[ » ] Correct usage: '/register password'") && GameTextForPlayer(playerid,"~r~Use /register (password)",5000,6);
if(dini_Create(player)) return SystemMsg(playerid,"[ » ] Account successfully created. Login with '/login password' now !") && SetJob(playerid,1) && AddItemToPlayerInventory(playerid,CHECKBANK20,1,"Check +20EP") && GameTextForPlayer(playerid,"~r~Use~w~/login (password)",5000,6);
strmid(PlayerData[playerid][Pass], params, 0, strlen(params), 255);
return false;
}
pawn Код:
forward SaveData(playerid);
public SaveData(playerid)
{
new player[128];new saver[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(player, sizeof(player), "users/%s.txt",pname);
format(saver,sizeof(saver),"Password");
dini_Set(player,saver,PlayerData[playerid][Pass]);
}
Best Regards.