SA-MP Forums Archive
Need help with dini. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with dini. (/showthread.php?tid=205210)



Need help with dini. - Doom8890 - 31.12.2010

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.


Re: Need help with dini. - Doom8890 - 31.12.2010

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?


Re: Need help with dini. - Doom8890 - 31.12.2010

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.