This is the same as i gave in the first post only in Latvian language.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == logindialog && response)
{
new dialogstr[256];
new pame[MAX_PLAYER_NAME];
GetPlayerName(playerid, pame, sizeof(pame));
if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"Jus jau esat registrejies un piesledzies.");
if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"Sis akaunts jau eksiste, ludzu izmantojiet '/login'.");
if (strlen(inputtext)==0) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}Tavs lietotajvards ir registrets! Ievadi paroli, lai varetu spelet!"), ShowPlayerDialog(playerid, logindialog, 3, "{FF0000}Pieslegties:{FFFFFF} %s", dialogstr, "Labi", "Atcelt");
if (udb_CheckLogin(PlayerName2(playerid),inputtext))
{
new file[256], tmp3[100], string[128];
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(playerid)) );
GetPlayerIp(playerid,tmp3,100);
dini_Set(file,"ip",tmp3);
LoginPlayer(playerid);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
if(PlayerInfo[playerid][Level] > 0) {
format(string,sizeof(string),"Veiksmigi piesledzies. (Limenis: %d)", PlayerInfo[playerid][Level] );
return SendClientMessage(playerid,green,string);
} else return SendClientMessage(playerid,green,"Veiksmigi piesledzies.");
}
else {
PlayerInfo[playerid][FailLogin]++;
printf("LOGIN: %s neizdevas pieslegties, nepareiza parole (%s) Meginajums: (%d)", PlayerName2(playerid), inputtext, PlayerInfo[playerid][FailLogin] );
if(PlayerInfo[playerid][FailLogin] == MAX_FAIL_LOGINS)
{
new string[128]; format(string, sizeof(string), "%s tika izmests (Neizdevas pieslegties)", PlayerName2(playerid) );
SendClientMessageToAll(COLOR_GREY, string);
print(string);
Kick(playerid);
}
return SendClientMessage(playerid,red,"Neizdevas pieslegties, nepareiza parole!");
}
}
if(dialogid == registerdialog && response)
{
new dialogstr[256];
new pame[MAX_PLAYER_NAME];
GetPlayerName(playerid, pame, sizeof(pame));
if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"Jus jau esat registrejies un piesledzies.");
if (udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"Sis akaunts jau eksiste, ludzu izmantojiet '/login'.");
if (strlen(inputtext) == 0) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}Lietotajvards{00FF00} `%s` {FFFFFF}nav registrets, lai registretos ievadiet paroli!", pame), ShowPlayerDialog(playerid, registerdialog, DIALOG_STYLE_INPUT, "{FF0000}Registracija.", dialogstr, "Labi", "Atcelt");
if (strlen(inputtext) < 4 || strlen(inputtext) > 20) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}Lietotajvards{00FF00} `%s` {FFFFFF}nav registrets, lai registretos ievadiet paroli!", pame), ShowPlayerDialog(playerid, registerdialog, DIALOG_STYLE_INPUT, "{FF0000}Registracija.", dialogstr, "Labi", "Atcelt");
if (udb_Create(PlayerName2(playerid),inputtext))
{
new file[256],name[MAX_PLAYER_NAME], tmp3[100];
new strdate[20], year,month,day; getdate(year, month, day);
GetPlayerName(playerid,name,sizeof(name)); format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(name));
GetPlayerIp(playerid,tmp3,100); dini_Set(file,"ip",tmp3);
// dini_Set(file,"password",params);
dUserSetINT(PlayerName2(playerid)).("registered",1);
format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year);
dini_Set(file,"RegisteredDate",strdate);
dUserSetINT(PlayerName2(playerid)).("loggedin",1);
dUserSetINT(PlayerName2(playerid)).("banned",0);
dUserSetINT(PlayerName2(playerid)).("level",0);
dUserSetINT(PlayerName2(playerid)).("LastOn",0);
dUserSetINT(PlayerName2(playerid)).("money",0);
dUserSetINT(PlayerName2(playerid)).("kills",0);
dUserSetINT(PlayerName2(playerid)).("deaths",0);
dUserSetINT(PlayerName2(playerid)).("Pistolskill",0);
dUserSetINT(PlayerName2(playerid)).("SilencedPistolskill",0);
dUserSetINT(PlayerName2(playerid)).("DesertEagleskill",0);
dUserSetINT(PlayerName2(playerid)).("Shotgunskill",0);
dUserSetINT(PlayerName2(playerid)).("Sawnoffskill",0);
dUserSetINT(PlayerName2(playerid)).("Spas12shotgunskill",0);
dUserSetINT(PlayerName2(playerid)).("MicroUziskill",0);
dUserSetINT(PlayerName2(playerid)).("MP5skill",0);
dUserSetINT(PlayerName2(playerid)).("AK47skill",0);
dUserSetINT(PlayerName2(playerid)).("M4skill",0);
dUserSetINT(PlayerName2(playerid)).("Sniperskill",0);
dUserSetINT(PlayerName2(playerid)).("hours",0);
dUserSetINT(PlayerName2(playerid)).("minutes",0);
dUserSetINT(PlayerName2(playerid)).("seconds",0);
PlayerInfo[playerid][LoggedIn] = 1;
PlayerInfo[playerid][Registered] = 1;
SendClientMessage(playerid, green, "Jus tikat registrets un automatiski pievienots.");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return 1;
}
return 1;
}
return 1;
}