Do not load Y_INI value?
#1

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 ..

PHP код:
// OnPlayerConnect: 
    
if(fexist(_var)) 
        
INI_ParseFile(User(playerid),"Load_%s", .bExtra true, .extra playerid); 
//Loading conta: 
public Load_user(playeridname[], 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,playernamesizeof(playername)); 
    
format(string,sizeof(string), "Contas/%s.ini"playername); 
    return 
string

Reply
#2

Well, try this:
PHP код:
//Loading conta:  
public Load_user(playeridname[], value[]){  
new 
INI:file INI_Open(User(playerid));  
INI_Int("Senha"Info[playerid][SenhaX]);    
INI_SetTag(file"data");
INI_Close(file);  
return 
1;  
}  
// Creating Conta  
public Create(playerid){  
new 
INI:file INI_Open(User(playerid));
INI_SetTag(file"data");   
INI_WriteInt(file"Senha"0000); 
INI_Close(file);  
INI_ParseFile(User(playerid),"Load_%s", .bExtra true, .extra playerid);  
return 
1;  

Reply
#3

Not fuction.

Helps?
Reply
#4

what exactly is the problem ?
Reply
#5

My problem is that I can't seem to get the value of an .ini file using Y_INI. Namely, I have on a player's .ini file as follows:

Password: 1234.

And I want to load it, but after doing so, I get the value 0 and the value 1234. The code above is the way I am doing ...
Reply
#6

When loading a file must not open it for writing, you must open it to read it, try as well.

PHP код:
// OnPlayerConnect:
    
if(fexist(User(playerid))) 
PHP код:
public Load_user(playeridname[], value[])
{
    
//new INI:file = INI_Open(User(playerid));
    
    
INI_Int("Senha"Info[playerid][SenhaX]);
    
    
//INI_Close(file);
    
    
return true;

Reply
#7

No Sucess....
Reply
#8

UPPpppp
Reply
#9

help pleaseeeeeeeeee
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)