Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- enum E_PLAYER_DATA
- {
- E_PLAYER_SPOL,
- E_PLAYER_GOD,
- E_PLAYER_PASS[24],
- E_PLAYER_ST[32]
- };
- new PlayerInfo[MAX_PLAYERS][E_PLAYER_DATA];
- public OnPlayerConnect(playerid)
- {
- //Ovdje sada formatiraš string za pronalaženje igračevog fajla
- //if(!fexist(filestr))
- {
- ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT,"Reg","Upišite željeni pass\nLozinka može imati najmanje 3 a najviše 24 slova","Unesi","Odustani");
- }
- return true;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case 100:
- {
- if(!response) Kick(playerid);
- if(strlen(inputtext)<3||strlen(inputtext)>24) return
- ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT,"Reg","Upišite željeni pass\nLozinka može imati najmanje 3 a najviše 24 slova","Unesi","Odustani");
- format(PlayerInfo[playerid][E_PLAYER_PASS],24,"%s",inputtext); // ovo je spremanje lozinke ako imaš hasher ubaci svoje samo
- ShowPlayerDialog(playerid,101,DIALOG_STYLE_LIST,"Reg","Muško\nŽensko","Odaberi","Odustani");
- }
- case 101:
- {
- if(!response) Kick(playerid);
- if(listitem==0)
- {
- PlayerInfo[playerid][E_PLAYER_SPOL]=1;
- ShowPlayerDialog(playerid,102,DIALOG_STYLE_INPUT,"Reg","Unesite koliko godina imate","Unesi","Odustani");
- }
- else if(listitem==1)
- {
- PlayerInfo[playerid][E_PLAYER_SPOL]=2;
- ShowPlayerDialog(playerid,102,DIALOG_STYLE_INPUT,"Reg","Unesite koliko godina imate","Unesi","Odustani");
- }
- }
- case 102:
- {
- if(!response) Kick(playerid);
- PlayerInfo[playerid][E_PLAYER_GOD]=strval(inputtext);
- ShowPlayerDialog(playerid,103,DIALOG_STYLE_INPUT,"Reg","Upišite odakle ste","Unesi","Odustani");
- }
- case 103:
- {
- if(!response) Kick(playerid);
- format(PlayerInfo[playerid][E_PLAYER_ST],32,"%s",inputtext);
- // tvoj kod dalje za registriranje , spremanje podataka u ini fileove itd.
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement