13.03.2015, 15:41
Hello, my problem is that I can not get the value that is contained in the personal player file, for example:
Password: 1234
I try to load it in the game with the code below, but is 0 the loaded value and the file is 1234. I did debug and printou 0 in the console and do not know what to do ..
Password: 1234
I try to load it in the game with the code below, but is 0 the loaded value and the file is 1234. I did debug and printou 0 in the console and do not know what to do ..
PHP код:
// OnPlayerConnect:
if(fexist(_var))
INI_ParseFile(User(playerid),"Load_%s", .bExtra = true, .extra = playerid);
//Loading conta:
public Load_user(playerid, name[], value[]){
new INI:file = INI_Open(User(playerid));
INI_Int("Senha", Info[playerid][SenhaX]);
INI_Close(file);
return 1;
}
// Creating Conta
public Create(playerid){
new INI:file = INI_Open(User(playerid));
INI_WriteInt(file, "Senha", 0000);
INI_Close(file);
INI_ParseFile(User(playerid),"Load_%s", .bExtra = true, .extra = playerid);
return 1;
}
stock User(playerid)
{
new string[128], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername, sizeof(playername));
format(string,sizeof(string), "Contas/%s.ini", playername);
return string;
}