Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- //REGISTER
- //Enter password
- if(dialogid == REGISTER_DIALOG_INPUT)
- {
- if(response == 1)
- {
- if(!inputtext[0])
- {
- ShowPlayerDialog(playerid, REGISTER_DIALOG_INPUT ,DIALOG_STYLE_INPUT, "Registracija", "Upisi zeljenu lozinku u mjesto za pisanje.","Registriraj","Odustani");
- return 1;
- }
- new FilePath[128];
- format(FilePath, sizeof(FilePath), "Admin/Korisnici/%s.ini", PlayerName(playerid));
- new strdate[20], year,month,day;
- getdate(year, month, day);
- new Ip[16];
- GetPlayerIp(playerid,Ip,sizeof(Ip));
- new password = num_hash(inputtext);
- PlayerInfo[playerid][Password] = password;
- PlayerInfo[playerid][Registered] = 1;
- PlayerInfo[playerid][LoggedIn] = 1;
- dini_Create(FilePath);
- dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]);
- dini_Set(FilePath,"Ip",Ip);
- format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year);
- dini_Set(FilePath,"RegisteredDate",strdate);
- dini_IntSet(FilePath,"Level",0);
- dini_IntSet(FilePath,"Jailed",0);
- dini_IntSet(FilePath,"Frozen",0);
- dini_IntSet(FilePath,"Warnings", 0);
- dini_IntSet(FilePath,"Money",0);
- dini_IntSet(FilePath,"Score",0);
- dini_IntSet(FilePath,"kills",0);
- SendClientMessage(playerid, COLOR_GREY, " ");
- SendClientMessage(playerid, COLOR_GREY, "Registracija: Jedan korak je dovrsen (1/3 zavrseno)");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Nova lozinka je uspjesno spremljena.");
- new string[256];
- format(string, sizeof(string), "Tvoja .NOVA. lozinka je: \'%s\'.", inputtext);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "2 korak, sigurnosno pitanje");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Napisi svoje pitanje npr. moj datum rodjenja, u slucaju ako zaboravis lozinku!");
- ShowPlayerDialog(playerid, REGISTER_DIALOG_SAFETY, DIALOG_STYLE_INPUT, "Sigurnosno pitanje", "Napisi neko pitanje na koje ces znati odg. \nTocan odgovor ce biti trazen u sljedecem koraku", "OK", "Odustani");
- return 1;
- }
- return ShowPlayerDialog(playerid, REGISTER_DIALOG_INPUT ,DIALOG_STYLE_INPUT, "Registracija", "Upisi svoju NOVU lozinku.","OK","Odustani");}
- //Enter Safety Question
- if(dialogid == REGISTER_DIALOG_SAFETY)
- {
- if(response == 1)
- {
- new FilePath[128];
- format(FilePath, sizeof(FilePath), "Admin/Korisnici/%s.ini", PlayerName(playerid));
- new string[128];
- format(string, sizeof(string), "%s", inputtext);
- SendClientMessage(playerid, COLOR_GREY, " ");
- SendClientMessage(playerid, COLOR_GREY, "Safety question:");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
- SendClientMessage(playerid, COLOR_GREY, " ");
- dini_Set(FilePath,"SafetyQuestion", string);
- SendClientMessage(playerid, COLOR_GREY, "Registracija: Korak 2 Zavrsen! (2/3 zavrseno)");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, " ");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Korak 3 odg. na sigurnosno pitanje");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Napisi odg. na pitanje koje si napisao prije par sekundi!");
- ShowPlayerDialog(playerid, REGISTER_DIALOG_SAFETY_ANSWER, DIALOG_STYLE_INPUT, "Sigurnosno pitanje", "Upisi tocan odgovor na pitanje koje si postavio", "OK", "Odustani");
- return 1;
- }
- return 1;
- }
- //Enter Answer for Safety Question
- if(dialogid == REGISTER_DIALOG_SAFETY_ANSWER)
- {
- if(response == 1)
- {
- new answer = num_hash(inputtext);
- if(!inputtext[0])
- {
- ShowPlayerDialog(playerid, REGISTER_DIALOG_SAFETY_ANSWER, DIALOG_STYLE_INPUT, "Sigurnosno pitanje", "Upisi tocan odgovor na pitanje koje si postavio", "OK", "Odustani");
- return 1;
- }
- new FilePath[128];
- format(FilePath, sizeof(FilePath), "Admin/Korisnici/%s.ini", PlayerName(playerid));
- new string[128];
- format(string, sizeof(string), "%s", inputtext);
- SendClientMessage(playerid, COLOR_GREY, " ");
- SendClientMessage(playerid, COLOR_GREY, "Sigurnosno pitanje odgovor:");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
- SendClientMessage(playerid, COLOR_GREY, " ");
- PlayerInfo[playerid][SafetyAnswer] = answer;
- dini_IntSet(FilePath,"SafetyAnswer",PlayerInfo[playerid][SafetyAnswer]);
- TextDrawHideForPlayer(playerid, Textdraw0);
- TextDrawHideForPlayer(playerid, Textdraw1);
- TextDrawHideForPlayer(playerid, Textdraw2);
- TextDrawHideForPlayer(playerid, Textdraw3);
- TextDrawHideForPlayer(playerid, Textdraw6);
- TextDrawHideForPlayer(playerid, Textdraw7);
- SendClientMessage(playerid, COLOR_GREY, "Registracija korak 3 (3/3 zavrseno)");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Cestitamo uspijesno si kreirao svoj account/racun!");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Sljedeci put kada dodes na server morati ces se ulogirati sa svojom lozinkom!");
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "Uzivaj na serveru!");
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement