01.06.2015, 14:54
I am testing this on localhost with this specs, it shouldn't lag with only 1 player online....
Lemme show more code, under onplayerconnect:
This will load player's password if file exsist.
This is under OnPlayerLogin(playerid,password[]) custom function:
Register part:
Might be a problem that i am using 2 different functions for loading on same file?
Lemme show more code, under onplayerconnect:
This will load player's password if file exsist.
Код:
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUserP_%s", .bExtra = true, .extra = playerid);
gPlayerAccount[playerid] = 1;
return 1;
}
else
{
gPlayerAccount[playerid] = 0;
return 1;
}
Код:
if(fexist(UserPath(playerid)))
{
if(strcmp(PlayerInfo[playerid][pKey],password ,false) == 0)
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}
Код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string[128];
new playername3[MAX_PLAYER_NAME];
new playersip[24];
GetPlayerName(playerid, playername3, sizeof(playername3));
GetPlayerIp(playerid, playersip, sizeof(playersip));
new File: hFile = fopen(UserPath(playerid), io_write);
fclose(hFile);
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
SavePlayer(playerid);
....
}
return 1;
}

