06.02.2014, 13:12
(
Последний раз редактировалось Don_Cage; 15.02.2014 в 11:09.
)
Hello, i wonder how do i start converting from dini to yini.
And now how im supposed to convert this? do i need to define patch user file aswell or what?
I do understand how do i write ini string,float but how do i define start thing files like part from here
pawn Код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[64];
new string[128];
new playersip[24];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
GetPlayerIp(playerid, playersip, sizeof(playersip));
format(string3, sizeof(string3), "NLG/Users/%s.ini", playername3);
dini_Create(string3);
new password2 = num_hash(password);
PlayerInfo[playerid][pKey] = password2;
dini_IntSet(string3, "Password",password2);
dini_IntSet(string3, "Level",PlayerInfo[playerid][pLevel]);
ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"Welcome, Please Log-In","Account Successfuly Registred into the database!\nType your password below to log-in","Log-in","Quit");
new y,m,d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d) [%d:%d:%d] %s Has registred in under IP %s.",d,m,y,h,mi,s,playername3,playersip);
PlayerInfo[playerid][pReg] = 0;
LoginLog(string);
}
return 1;
}
pawn Код:
public OnPlayerUpdateEx(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "NLG/Users/%s.ini", playername3);
dini_IntSet(string3, "Password",PlayerInfo[playerid][pKey]);
dini_IntSet(string3, "Level",PlayerInfo[playerid][pLevel]);
}
}
return 1;
}
pawn Код:
public OnPlayerLogin(playerid,password[])
{
new tmp2[256]
new string2[64];
new string[128];
new playername2[MAX_PLAYER_NAME];
new playersip[24];
GetPlayerName(playerid, playername2, sizeof(playername2));
GetPlayerIp(playerid, playersip, sizeof(playersip));
format(string2, sizeof(string2), "NLG/Users/%s.ini", playername2);
if (dini_Exists(string2))
{
new password2 = num_hash(password);
if(dini_Int(string2,"Password") == password2)
{
PlayerInfo[playerid][pKey] = dini_Int(string2,"Password");
PlayerInfo[playerid][pLevel] = dini_Int(string2,"Level");
}
else
{
gPlayerLogTries[playerid] += 1;
ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"Try Again, please Log-In","You have entered an incorrect password\nType your password below to log-in","Log-in","Quit");
if(gPlayerLogTries[playerid] == 3) { Kick(playerid); }
return 1;
}
pawn Код:
new string3[64];
new string[128];
new playersip[24];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
GetPlayerIp(playerid, playersip, sizeof(playersip));
format(string3, sizeof(string3), "NLG/Users/%s.ini", playername3);
dini_Create(string3);
new password2 = num_hash(password);
PlayerInfo[playerid][pKey] = password2;