05.03.2009, 20:09
Okey guys, My register system doesn't save the variable that my dini sets...
Okey?
I mean those:
dini_IntSet(string,"Password",password);
dini_IntSet(string,"Money",20000);
dini_IntSet(string,"Bank",50000);
dini_IntSet(string,"DriverLic",0);
dini_IntSet(string,"WeaponLic",0);
dini_IntSet(string,"Faction",0);
It doesn't set the red marked numbers... So the %s.ini file looks like this:
Password
Money
Bank
DriverLic
WeaponLic
Faction
Can someone help me please? =)
pawn Код:
if(strcmp(cmd,"/register",true) == 0)
{
new tmp[128], pName[MAX_PLAYER_NAME], string[256], password;
GetPlayerName(playerid,pName,sizeof(pName));
format(string,sizeof(string),"EQRP//Players//%s.ini",pName);
tmp = strtok(cmdtext, idx);
password = strlen(tmp);
if(dini_Exists(string)) return SendClientMessage(playerid,COLOR_DARKRED,"Already Registered");
if(strlen(tmp) == 0) return SendClientMessage(playerid,COLOR_DARKRED,"USAGE: /register [password], (ONLY NUMBERS)");
dini_Create(string);
dini_IntSet(string,"Password",password);
dini_IntSet(string,"Money",20000);
dini_IntSet(string,"Bank",50000);
dini_IntSet(string,"DriverLic",0);
dini_IntSet(string,"WeaponLic",0);
dini_IntSet(string,"Faction",0);
PlayerInfo[playerid][pRegged] = 1;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Account Registered, now use /login [password]");
return 1;
}
if(strcmp(cmd,"/login",true) == 0)
{
new tmp[128], pName[MAX_PLAYER_NAME], string[256], password;
GetPlayerName(playerid,pName,sizeof(pName));
format(string,sizeof(string),"EQRP//Players//%s.ini",pName);
tmp = strtok(cmdtext, idx);
password = strlen(tmp);
if(PlayerInfo[playerid][pLogged] == 1) return SendClientMessage(playerid,COLOR_DARKRED,"Already Logged In");
if(strlen(tmp) == 0) return SendClientMessage(playerid,COLOR_DARKRED,"USAGE: /login [password]");
if(!dini_Exists(string)) return SendClientMessage(playerid,COLOR_DARKRED,"Not registered, use /register [password], (ONLY NUMBERS)");
if(dini_Int(string,"Password") != password) return SendClientMessage(playerid,COLOR_DARKRED,"Wrong Password");
PlayerInfo[playerid][pLogged] = 1;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Logged In");
return 1;
}
I mean those:
dini_IntSet(string,"Password",password);
dini_IntSet(string,"Money",20000);
dini_IntSet(string,"Bank",50000);
dini_IntSet(string,"DriverLic",0);
dini_IntSet(string,"WeaponLic",0);
dini_IntSet(string,"Faction",0);
It doesn't set the red marked numbers... So the %s.ini file looks like this:
Password
Money
Bank
DriverLic
WeaponLic
Faction
Can someone help me please? =)