Advertisement
Parix

OnDialogResponse

Sep 2nd, 2014
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.85 KB | None | 0 0
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2. {
  3.  
  4.     if(dialogid==DIALOGREG)
  5.     {
  6.     new nome[25];
  7.     new stringa[250];
  8.     if(!response) return Kick(playerid); //Kicka il player che non si registra
  9.     if(!strlen(inputtext)) return
  10.     ShowPlayerDialog(playerid,DIALOGREG,DIALOG_STYLE_INPUT,"Registrazione","INSERISCI UNA PASSWORD\nInserisci una password per registrarti","Registrati","");
  11.     GetPlayerName(playerid,nome,sizeof(nome));
  12.     format(stringa,sizeof(stringa),"Utenti/%s",nome);
  13.     dini_Create(stringa); //Creiamo il file per l’account utente
  14.     dini_IntSet(stringa,"Livello",0);
  15.     dini_IntSet(stringa,"Uccisioni",0);
  16.     dini_IntSet(stringa,"Morti",0);
  17.     dini_Set(stringa,"Password",inputtext);
  18.     ShowPlayerDialog(playerid,DIALOGLOGIN,DIALOG_STYLE_INPUT,"Login","Ti sei registrato. Inserisci la password per loggarti","Login","");
  19.     return 1;
  20. }
  21. //Qui dovrebbe esserci l’evento per il DIALOGREG
  22.     if(dialogid==DIALOGLOGIN)
  23.     {
  24.     new nome[25];
  25.     new stringa[250];
  26.     if(!response ) return Kick(playerid); //Kicka il player che non si logga
  27.     GetPlayerName(playerid,nome,sizeof(nome));
  28.     format(stringa,sizeof(stringa),"Utenti/%s",nome);
  29.     new Pass[256];  // <---------- Riga che ha l'errore
  30.     Pass=dini_Get(stringa,"Password");
  31.     if(strcmp(Pass,inputtext,true) || !strlen(inputtext)) //Controlla se la password è corretta
  32.     {
  33.     ShowPlayerDialog(playerid,DIALOGLOGIN,DIALOG_STYLE_INPUT,"Login","PASSWORD ERRATA \nInserisci lapassword per loggarti","Login","");
  34.     return 1;
  35.     }
  36.     Giocatore[playerid][Livello]=dini_Int(stringa,"Livello"); //Qui carica i dati del giocatore
  37.     Giocatore[playerid][Morti]=dini_Int(stringa,"Morti");
  38.     Giocatore[playerid][Uccisioni]=dini_Int(stringa,"Uccisioni");
  39.     Giocatore[playerid][Loggato]=1; //Ci servirà per quando si disconnetterà
  40.     }
  41.     return 1;
  42. }
  43.  
  44. if(dialogid == FAZIONE) <---
  45.     {
  46.     if(!response) return SendClientMessage(playerid,rosso,"Hai abbandonato la selezione!"), Kick(playerid); <----
  47.     {
  48.         switch(listitem) <----
  49.         {
  50.             case 0: <-----
  51.             {
  52.                 Polizia[playerid] = 1;
  53.                 TogglePlayerControllable(playerid,1);
  54.                 SetPlayerPos(playerid,1552.8185,-1675.9204,16.1953);
  55.                 SetPlayerSkin(playerid,280);
  56.                 GivePlayerWeapon(playerid, 24,500);
  57.                 GivePlayerWeapon(playerid, 25, 100);
  58.                 GivePlayerWeapon(playerid, 29, 500);
  59.             }
  60.             case 1: //<------------- 369
  61.             {
  62.                 Criminali[playerid] = 1;
  63.                 TogglePlayerControllable(playerid,1);
  64.                 SetPlayerPos(playerid,2441.5508,-1286.5040,24.0000);
  65.                 SetPlayerSkin(playerid,106);
  66.                 GivePlayerWeapon(playerid, 24,500);
  67.                 GivePlayerWeapon(playerid, 28, 500);
  68.             }
  69.         }
  70.     }
  71.     return 1; <----
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement