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
#2

Unfortunately this doesn't work.

If I use this i get error and 2 warnings:
Код:
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
error 035: argument type mismatch (argument 3)
Any other solution?
Reply
#3

Still not working :S

I guess problems is not withing this part itself....I'll search whole script for bugs tomorrow...

Meanwhile, some of you could sort this thing out, if the problem is actually in this part.


EDIT:Alright, I solved this, I want to thanks to everyone who tried to help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)