10.07.2015, 11:02
https://sampforum.blast.hk/showthread.php?tid=524344 i used this tutorial to make this system, all working correctly but there is one thing. my user files show up but its empty(0kB)
public OnPlayerConnect(playerid)
{
if(strfind(RPNU(playerid), "_", true) == -1)
{
Kick(playerid);
SCM(playerid, COLOR_RED, "Su nimi peab olema formaadis Eesnimi_Perekonnanimi");
return 1;
}
LaadiKasutaja(playerid);
SisseLogitud[playerid] = 0;
new nimi[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, nimi, sizeof(nimi));
format(file, sizeof(file), KASUTAJAD, nimi); // This things and so on...
if (!ini_Exists(file))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registeerimine", "Sisesta enda parool, et registeerida", "Valmis", "Katkesta");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Logimine", "Sisesta enda parool, et logida", "Logi sisse", "Katkesta");
}
return 1;
}
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid))) //If there's a textfile for Twizted, then the user should login
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); //Loads the data from the user's textfile (password)
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login","Type your password below in order to login.","Login","Quit");
}
else //If the path for Twizted in the Scriptfiles/Accounts directory is non-existent, the user is prompted to register or quit
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Register","Type your password below in order to register a new account.","Register","Quit");
}
return 1;
}