SA-MP Forums Archive
yini INI_ParseFile problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: yini INI_ParseFile problem (/showthread.php?tid=602505)



yini INI_ParseFile problem - gumball3000 - 08.03.2016

I have these functions:
PHP код:
stock UserPath(playerid)
{
    new 
string[128],playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,playername,sizeof(playername));
    
format(string,sizeof(string),PATH,playername);
    return 
string;
}
forward LoadUser_data(playeridname[], value[]);
public 
LoadUser_data(playerid,name[],value[])
{
    
INI_String("mdc",PlayerData[playerid][mcrimes], 1024);
    return 
1;

PHP код:
function somefunction(playerididlevelreason[])
{
    if(
fexist(UserPath(playerid)))
    {
    
INI_ParseFile(UserPath(id), "LoadUser_%s", .bExtra true, .extra id);
    
format(longstringsizeof(longstring), "%s%s: %s - %s"PlayerData[id][mcrimes], datereasonPlayerData[playerid][Name]);
     new 
INI:File INI_Open(UserPath(id));
    
INI_WriteString(File,"mdc",longstring);
    
INI_WriteInt(File,"crimes",PlayerData[id][MDC]);
    
INI_Close(File);
    }
    else
    {
    
format(longstringsizeof(longstring), "%s%s: %s - %s"longstringdatereasonPlayerData[playerid][Name]);
     new 
INI:File INI_Open(UserPath(id));
    
INI_WriteString(File,"mdc",longstring);
    
INI_WriteInt(File,"crimes",PlayerData[id][MDC]);
    
INI_Close(File);
    }
    return 
1;
    } 
The rest of somefunction is irelevant, my problem is that when i do INI_ParseFile(UserPath(id), "LoadUser_%s", .bExtra = true, .extra = id); the contents of mdc don't get stored inside PlayerData[playerid][mcrimes].

Please help i've been stuck on this for days i can provide extra information if needed.