Need help with dini.
#1

Hello, after few attempts of saving player 'stats' to file, using dini functions, I realized i just couldn't do it, and don't know why.

I'm using ZCMD command processor, sscanf 2.0 and of course dini.

Here is the register command:
pawn Код:
CMD:register(playerid, params[])
{
new file[128], pName[MAX_PLAYER_NAME], password[36];
GetPlayerName(playerid,pName,sizeof(pName));
format(file,sizeof(file),"/Users/%s.ini",pName);
if(sscanf(params,"s",password)) return SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /register [password]");
if(dini_Exists(file)) return SendClientMessage(playerid,COLOR_CYAN,"SERVER: This account is already registered.");

dini_Create(file);
dini_Set(file,"Name",pName);
dini_Set(file,"Password",password);
dini_IntSet(file,"AdminLevel",gStat[playerid][AdminLevel]);
dini_IntSet(file,"Money",gStat[playerid][Cash]);
dini_IntSet(file,"Score",gStat[playerid][Score]);

SendClientMessage(playerid,COLOR_CYAN,"You have successfuly registered.");
gLogged[playerid]=1;
SendClientMessage(playerid,COLOR_GREEN,"You have automaticaly logged in.");
return 1;
}
After typing /register password, it saves only AdminLevel,Cash and Score.

.ini files contains this:

Код:
Name:
Password:
AdminLevel:0
Money:500
Score:0
Can you help me make it to save Name and Password of player, because i really need it?

Thank you in advance.
Reply


Messages In This Thread
Need help with dini. - by Doom8890 - 31.12.2010, 18:13
Re: Need help with dini. - by Doom8890 - 31.12.2010, 19:34
Re: Need help with dini. - by Doom8890 - 31.12.2010, 19:55

Forum Jump:


Users browsing this thread: 2 Guest(s)