06.09.2012, 09:44
(
Последний раз редактировалось Stm; 06.09.2012 в 20:35.
)
Im learning how to use enum, and i have a problem again
.So im trying to make something like save system in my gamemode and almost everything is done except for some lines of my code that i have error and don`t know why
.
Here is what i have done
I have fix the errors.
I'm using this tutorial for help (https://sampforum.blast.hk/showthread.php?tid=273088)
.So im trying to make something like save system in my gamemode and almost everything is done except for some lines of my code that i have error and don`t know why
.Here is what i have done
Код:
#include <YSI\y_ini>
forward LoadUser_data(playerid,name[],value[]);
#define PATH "/Users/%s.ini"
enum pInfo
{
pMoney
}
new PlayerInfo[MAX_PLAYERS][pInfo];
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Cash",PlayerInfo[playerid][pMoney]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_Close(File);
IsPlayerOnWork[playerid] = 0;
return 1;
}
I'm using this tutorial for help (https://sampforum.blast.hk/showthread.php?tid=273088)

