10.02.2012, 20:51
Well. I have a problem where I go in the server, create an account but it wont save. I doesn't appear in the scriptfiles and its asking me to register everytime i enter there server
This is the registration code:
Do I need some kind of include or something?
This are the includes I have in the script.
Any help is appreciated.
This is the registration code:
pawn Код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "accounts/%s.ini", playername3);
new File: hFile = fopen(string3, io_write);
if (hFile)
{
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
new var[64];
format(var, 64, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
format(var, 64, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
format(var, 64, "Admin=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
format(var, 64, "Reg=%d\n",PlayerInfo[playerid][pReg]);fwrite(hFile, var);
format(var, 64, "Cash=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
format(var, 64, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 64, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
format(var, 64, "Rank=%d\n",PlayerInfo[playerid][pRank]);fwrite(hFile, var);
format(var, 64, "Donator=%d\n",PlayerInfo[playerid][pDonator]);fwrite(hFile, var);
format(var, 64, "Team=%d\n",PlayerInfo[playerid][pTeam]);fwrite(hFile, var);
format(var, 64, "Warns=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
format(var, 64, "Locked=%d\n",PlayerInfo[playerid][pLocked]);fwrite(hFile, var);
fclose(hFile);
gPlayerAccount[playerid] = 1;
/////////// REGISTER DIALOG ///////////////
new Dialog1[256];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(Dialog1,256,"Welcome to WW2!\nAccount: %s\nType here password:",pName);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login system",Dialog1,"Login","Quit");
/////////// REGISTER DIALOG ///////////////
}
}
return 1;
}
This are the includes I have in the script.
pawn Код:
#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>