31.12.2010, 18:13
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:
After typing /register password, it saves only AdminLevel,Cash and Score.
.ini files contains this:
Can you help me make it to save Name and Password of player, because i really need it?
Thank you in advance.
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;
}
.ini files contains this:
Код:
Name: Password: AdminLevel:0 Money:500 Score:0
Thank you in advance.