13.10.2009, 08:21
Hello,
I have a problem with my register system.
If a person registers with the password "Happy" in scriptfiles his password is saved as "H" , only the first alphabet .... I dont know why ... Please look at the register command below
Thanks for helping
I have a problem with my register system.
If a person registers with the password "Happy" in scriptfiles his password is saved as "H" , only the first alphabet .... I dont know why ... Please look at the register command below
pawn Код:
new playername[MAX_PLAYER_NAME];
new string[500];
PlayerInfo[playerid][pPassword] = inputtext[playerid];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "\\Accounts\\%s.ini", playername);
new File: file = fopen(string, io_read);
if (file)
{
new s[128],pName[24];
GetPlayerName(playerid, pName, 24);
format(s,sizeof(s),"Welcome, %s!\n\nThat name is allready used",pName);
ShowPlayerDialog(playerid,60,1,"Register your account",s,"Register"," ");
fclose(file);
Kick(playerid);
return 1;
}
new File:hFile;
hFile = fopen(string, io_append);
new var[32];
format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
format(var, 32, "Admin=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
fclose(hFile);
SendClientMessage(playerid, Green, "[Server]: Succesfully Registered!");
OnPlayerLogin(playerid,inputtext);
TutorialTime[playerid] = 1;
Thanks for helping