Save player money
#1

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
Код:
#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 have fix the errors.

I'm using this tutorial for help (https://sampforum.blast.hk/showthread.php?tid=273088)
Reply


Messages In This Thread
Save player money - by Stm - 06.09.2012, 09:44
Re: Save player money - by Stm - 06.09.2012, 09:55
Re: Save player money - by Stm - 06.09.2012, 18:31
Re: Save player money - by sniperwars - 06.09.2012, 18:54
Re: Save player money - by Stm - 06.09.2012, 19:02

Forum Jump:


Users browsing this thread: 3 Guest(s)