y_ini doesn't parse files? -
karemmahmed22 - 23.10.2015
Literally I feel stupidty, y_ini works prefectly in my gamemode, but it doesn't in my filterscript..
I trying to load/save an integer, it saves but, it doesn't even call the LoadUser stock..
Heres my codes.. I'm pretty sure theres no thing wrong in this code, Because I compared it with my gamemode ones its same..
LoadUser:
PHP код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Police",Police[playerid]);
INI_Int("JailTime",JailTime[playerid]);
SendClientMessageToAll(-1, "User data loaded.");
return 1;
}
UserPath stock:
PHP код:
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),Path,playername);
return string;
}
Path define:
PHP код:
#define Path "Police/%s.ini"
OnPlayerConnect:
PHP код:
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SendClientMessageToAll(-1, "File exists, Called LoadUser.");
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}
else
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"police");
INI_WriteInt(File,"Police",0);
INI_WriteInt(File,"JailTime",0);
INI_Close(File);
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SendClientMessageToAll(-1, "File not exists, Created New file.");
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}
return 1;
}
OnPlayerDisconnect:
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"police");
INI_WriteInt(File,"Police",Police[playerid]);
INI_WriteInt(File,"JailTime",JailTime[playerid]);
INI_Close(File);
Police[playerid] = 0;
JailTime[playerid] = 0;
return 1;
}
I've added some debug strings as you can see, But it doesn't show
PHP код:
SendClientMessageToAll(-1, "User data loaded.");
In LoadUser stock, So I can say, The stock isn't being called even...
What causes this? I checked my codes many time, I'm pretty sure theres nothing wrong with it so.. Probably a bug in y_ini?
Re: y_ini doesn't parse files? -
ATGOggy - 23.10.2015
Why do you parse it twice?
Make a debug line for each line and see what's wrong.
Re: y_ini doesn't parse files? -
karemmahmed22 - 23.10.2015
I tried to parse it twice because it doesn't get parsed, I already tried the debug lines, but it doesn't even call the
LoadUser..