Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid==DIALOGREG)
- {
- new nome[25];
- new stringa[250];
- if(!response) return Kick(playerid); //Kicka il player che non si registra
- if(!strlen(inputtext)) return
- ShowPlayerDialog(playerid,DIALOGREG,DIALOG_STYLE_INPUT,"Registrazione","INSERISCI UNA PASSWORD\nInserisci una password per registrarti","Registrati","");
- GetPlayerName(playerid,nome,sizeof(nome));
- format(stringa,sizeof(stringa),"Utenti/%s",nome);
- dini_Create(stringa); //Creiamo il file per l’account utente
- dini_IntSet(stringa,"Livello",0);
- dini_IntSet(stringa,"Uccisioni",0);
- dini_IntSet(stringa,"Morti",0);
- dini_Set(stringa,"Password",inputtext);
- ShowPlayerDialog(playerid,DIALOGLOGIN,DIALOG_STYLE_INPUT,"Login","Ti sei registrato. Inserisci la password per loggarti","Login","");
- return 1;
- }
- //Qui dovrebbe esserci l’evento per il DIALOGREG
- if(dialogid==DIALOGLOGIN)
- {
- new nome[25];
- new stringa[250];
- if(!response ) return Kick(playerid); //Kicka il player che non si logga
- GetPlayerName(playerid,nome,sizeof(nome));
- format(stringa,sizeof(stringa),"Utenti/%s",nome);
- new Pass[256]; // <---------- Riga che ha l'errore
- Pass=dini_Get(stringa,"Password");
- if(strcmp(Pass,inputtext,true) || !strlen(inputtext)) //Controlla se la password è corretta
- {
- ShowPlayerDialog(playerid,DIALOGLOGIN,DIALOG_STYLE_INPUT,"Login","PASSWORD ERRATA \nInserisci lapassword per loggarti","Login","");
- return 1;
- }
- Giocatore[playerid][Livello]=dini_Int(stringa,"Livello"); //Qui carica i dati del giocatore
- Giocatore[playerid][Morti]=dini_Int(stringa,"Morti");
- Giocatore[playerid][Uccisioni]=dini_Int(stringa,"Uccisioni");
- Giocatore[playerid][Loggato]=1; //Ci servirà per quando si disconnetterà
- }
- return 1;
- }
- if(dialogid == FAZIONE) <---
- {
- if(!response) return SendClientMessage(playerid,rosso,"Hai abbandonato la selezione!"), Kick(playerid); <----
- {
- switch(listitem) <----
- {
- case 0: <-----
- {
- Polizia[playerid] = 1;
- TogglePlayerControllable(playerid,1);
- SetPlayerPos(playerid,1552.8185,-1675.9204,16.1953);
- SetPlayerSkin(playerid,280);
- GivePlayerWeapon(playerid, 24,500);
- GivePlayerWeapon(playerid, 25, 100);
- GivePlayerWeapon(playerid, 29, 500);
- }
- case 1: //<------------- 369
- {
- Criminali[playerid] = 1;
- TogglePlayerControllable(playerid,1);
- SetPlayerPos(playerid,2441.5508,-1286.5040,24.0000);
- SetPlayerSkin(playerid,106);
- GivePlayerWeapon(playerid, 24,500);
- GivePlayerWeapon(playerid, 28, 500);
- }
- }
- }
- return 1; <----
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement