23.07.2014, 17:34
The problem is simple
when I write /save the ini file write houseid = 1 but when i want to read the integer with the command myhouse it sends me 0 all time... whats wrong? ![Confused](images/smilies/confused.png)
Im confused at all
Thanks
pawn Код:
enum pInfo
{
pHouseid
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Houseid,",PlayerInfo[playerid][pHouseid]);
}
pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}
return 1;
}
pawn Код:
YCMD:save(playerid, params[], help)
{
#pragma unused params
#pragma unused help
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File, "Houseid", 1);
INI_Close(File);
}
pawn Код:
YCMD:myhouse(playerid, params[], help)
{
#pragma unused params
#pragma unused help
new string [128];
format(string, sizeof(string), "%i", PlayerInfo[playerid][pHouseid]);
return SendClientMessage(playerid, -1, string);
}
![Confused](images/smilies/confused.png)
Im confused at all
Thanks