08.03.2016, 08:52
I have these functions:
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.
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(playerid, name[], value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_String("mdc",PlayerData[playerid][mcrimes], 1024);
return 1;
}
PHP код:
function somefunction(playerid, id, level, reason[])
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(id), "LoadUser_%s", .bExtra = true, .extra = id);
format(longstring, sizeof(longstring), "%s%s: %s - %s", PlayerData[id][mcrimes], date, reason, PlayerData[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(longstring, sizeof(longstring), "%s%s: %s - %s", longstring, date, reason, PlayerData[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;
}
Please help i've been stuck on this for days i can provide extra information if needed.