Advertisement
Guest User

Untitled

a guest
Jan 8th, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.92 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. enum E_PLAYER_DATA
  4. {
  5.      E_PLAYER_SPOL,
  6.      E_PLAYER_GOD,
  7.      E_PLAYER_PASS[24],
  8.      E_PLAYER_ST[32]
  9. };
  10. new PlayerInfo[MAX_PLAYERS][E_PLAYER_DATA];
  11.  
  12. public OnPlayerConnect(playerid)
  13. {
  14.      //Ovdje sada formatiraš string za pronalaženje igračevog fajla
  15.      //if(!fexist(filestr))
  16.      {
  17.         ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT,"Reg","Upišite željeni pass\nLozinka može imati najmanje 3 a najviše 24 slova","Unesi","Odustani");
  18.      }
  19.      return true;
  20. }
  21.  
  22. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  23. {
  24.     switch(dialogid)
  25.     {
  26.         case 100:
  27.         {
  28.             if(!response) Kick(playerid);
  29.             if(strlen(inputtext)<3||strlen(inputtext)>24) return
  30.             ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT,"Reg","Upišite željeni pass\nLozinka može imati najmanje 3 a najviše 24 slova","Unesi","Odustani");
  31.             format(PlayerInfo[playerid][E_PLAYER_PASS],24,"%s",inputtext); // ovo je spremanje lozinke ako imaš hasher ubaci svoje samo
  32.             ShowPlayerDialog(playerid,101,DIALOG_STYLE_LIST,"Reg","Muško\nŽensko","Odaberi","Odustani");
  33.         }
  34.         case 101:
  35.         {
  36.             if(!response) Kick(playerid);
  37.             if(listitem==0)
  38.             {
  39.                 PlayerInfo[playerid][E_PLAYER_SPOL]=1;
  40.                 ShowPlayerDialog(playerid,102,DIALOG_STYLE_INPUT,"Reg","Unesite koliko godina imate","Unesi","Odustani");
  41.             }
  42.             else if(listitem==1)
  43.             {
  44.                 PlayerInfo[playerid][E_PLAYER_SPOL]=2;
  45.                 ShowPlayerDialog(playerid,102,DIALOG_STYLE_INPUT,"Reg","Unesite koliko godina imate","Unesi","Odustani");
  46.             }
  47.         }
  48.         case 102:
  49.         {
  50.             if(!response) Kick(playerid);
  51.             PlayerInfo[playerid][E_PLAYER_GOD]=strval(inputtext);
  52.             ShowPlayerDialog(playerid,103,DIALOG_STYLE_INPUT,"Reg","Upišite odakle ste","Unesi","Odustani");
  53.         }
  54.         case 103:
  55.         {
  56.             if(!response) Kick(playerid);
  57.             format(PlayerInfo[playerid][E_PLAYER_ST],32,"%s",inputtext);
  58.             // tvoj kod dalje za registriranje , spremanje podataka u ini fileove itd.
  59.         }
  60.     }
  61.     return true;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement