Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ==================================================================================================================================
- // onplayerconnect
- ==================================================================================================================================
- new log[35];
- new regstring[130];
- format(log,sizeof log,"CONTAS/%s.ini",Nome(playerid));
- if(!dini_Exists(log))
- {
- format(regstring,sizeof(regstring),"{FFE4E1}%s, you do not have an account in our database.\nPlease enter a password to register.",Nome(playerid));
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{87CEEB}Register",regstring,"Register","Exit");
- return 1;
- }
- format(regstring,sizeof(regstring),"{FAF0E6}%s, you already have an account in the database.\nPlease enter your password below to log in power.",Nome(playerid));
- ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Login",regstring,"Login","Exit");
- ==================================================================================================================================
- // ondialogresponse
- ==================================================================================================================================
- new arq[30];
- format(arq,sizeof arq,"CONTAS/%s.ini",Nome(playerid));
- if(dialogid == 1)
- {
- if(response == 1)
- {
- new regstring[130];
- if(!strlen(inputtext)) { // não digitar nada
- format(regstring,sizeof(regstring),"{FFE4E1}%s, you do not have an account in our database.\nPlease enter a password to register.",Nome(playerid));
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{87CEEB}Register",regstring,"Register","Exit");
- return 1;
- }
- dini_Create(arq);
- format(regstring,sizeof(regstring),"{FAF0E6}Congratulations %s, you registered your account.\nEnter your password below to log in power.",Nome(playerid));
- ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"{F5F5F5}Login",regstring,"Login","Exit");
- dini_Set(arq, "Senha", inputtext);
- return 1;
- }
- SendClientMessage(playerid,0xFFFF00,"Você usou a opção 'Sair' e foi kickado pelo servidor!");
- Kick(playerid);
- }
- else if(dialogid == 2)
- {
- if(response == 1)
- {
- if(!strlen(inputtext)) { // não digitar nada
- ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"{F5F5F5}Login","Enter the password correctly.","Login","Exit");
- return 1;
- }
- if(!strcmp(dini_Get(arq,"Senha"), inputtext))
- {
- //Aqui coloca-se as variáveis do texto, como Level, dinheiro,etc.
- Logado[playerid] = 1;
- OnPlayerLogin(playerid);
- return 1;
- }
- else
- {
- ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"{F5F5F5}Login","Enter the password correctly.","Login","Exit");
- return 1;
- }
- // SendClientMessage(playerid,0xFFFF00,"Você usou a opção 'Sair' e foi kickado pelo servidor!");
- // Kick(playerid);
- }
- else // se der cancel
- {
- SendClientMessage(playerid,0xFFFF00,"You used the Exit option and was kicked by the server!");
- Kick(playerid);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment