Need help with saving system
#1

I am sorry to disturb you, but I need to ask you a question. I'd like to describe my problem at first. I have I saving system that saves money, score (etc...) in a .ini file. For the player with name A the file is A.ini and for the player with name B the file is B.ini. I want my system to load the data from .ini files. I've made some code, but it doesn't work. Here it is:

Код:
	new Float:money;
	GetPlayerName(playerid,PlayerName,32);
	format(string,64,”%s.ini”,PlayerName);
	new inifile = ini_openFile(/save/playername.ini); 
	ini_getInteger(iniFile, "Money", money); 
	ini_closeFile(iniFile); 
	GivePlayerMoney(playerid,money);
What's wrong with it?! Could you explain me?

P.S.: Here's the full source code of my gamemode (link).

P.P.S.: The data is saved in /scriptfiles/save
Reply
#2

pawn Код:
GetPlayerName(playerid,PlayerName,32);
format(string,64,”%s.ini”,PlayerName);
new inifile = ini_openFile(/save/playername.ini);
pawn Код:
GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
format(string,64,"/save/%s.ini",PlayerName);
new inifile = ini_openFile(string);
Reply
#3

What file system are you using (Dini, SII, Y_INI.....)
Reply
#4

Viniborn, I am just a newbie, so could give me the right code that will work?

P.S.: The .ini files are in /scriptfiles/save.
Reply
#5

He meant, the first one is the current and the second one is the working one.
Reply
#6

HighPitchedVoice, but the second one doesn't work.
Reply
#7

Saad_, I am not sure, but it may be mxINI.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)