19.11.2011, 22:00
Bom da pra entrar na conta com qualquer senha, por ex registrei a senha : 12354 e posso digitar qualquer coisa que digita vai , aqui o code :
pawn Код:
#include <a_samp>
#include <dini>
new Logado[MAX_PLAYERS];
#define COLOR_BRANCO 0xFFFFFFFF
#define COLOR_DORADO 0xFFFF00FF
public OnPlayerConnect(playerid)
{
new log[35];
new regstring[130];
format(log,sizeof log,"Contas/%s.ini",Nome(playerid));
if(!dini_Exists(log))
{
SendClientMessage(playerid,0x00FF00FF,"Seja bem vindo pela primeira vez. Por favor digite uma senha para se registrar.");
format(regstring,sizeof(regstring),"{FFE4E1}%s, Vocк ainda nгo й registrado no FuctioN.\nPor favor digite uma senha para se registrar.",Nome(playerid));
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{87CEEB}Registrar",regstring,"Registrar","Sair");
return 1;
}
SendClientMessage(playerid,0x00FFFFFF,"Digite sua senha no diбlogo abaixo para poder logar.");
format(regstring,sizeof(regstring),"{FAF0E6}%s, Voк ja tem uma conta no FuctioN.\nDigite sua senha abaixo para poder logar.",Nome(playerid));
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar",regstring,"Logar","Sair");
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(Logado[playerid] == 0)
{
SendClientMessage(playerid,0xFFFF45,"Antes de Spawnar logue-se.");
return 0;
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new arq[30];
format(arq,sizeof arq,"Contas/%s.ini",Nome(playerid));
if(dialogid == 1)
{
if(response == 1)
{
new regstring[130];
dini_Create(arq);
SendClientMessage(playerid,0xFFFF47,"Sua conta foi registrada com sucesso! Logue-se no diбlogo abaixo.");
format(regstring,sizeof(regstring),"{FAF0E6}Parabйns %s, vocк registrou sua conta.\nDigite sua senha abaixo para poder logar.",Nome(playerid));
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar",regstring,"Logar","Sair");
dini_IntSet(arq,"Senha",strval(inputtext));
dini_IntSet(arq,"Score",GetPlayerScore(playerid));
dini_IntSet(arq,"Dinheiro",GetPlayerMoney(playerid));
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(dini_Int(arq,"Senha") == strval(inputtext))
{
//Aqui coloca-se as variбveis do texto, como Level, dinheiro,etc.
SendClientMessage(playerid,0xFFFF43,"Vocк logou no servidor com sucesso!");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid,0xFFFF43," ");
SendClientMessage(playerid, COLOR_DORADO, "FuctioN 1.6");
SendClientMessage(playerid, COLOR_BRANCO, "Seja Bem Vindo Ao Nosso Servidor");
SendClientMessage(playerid, COLOR_BRANCO, "Nosso Servidor й no Estilo : {FFFF00}DM/STUNT/DRIFT");
SendClientMessage(playerid, COLOR_BRANCO, "Vocк Acabou de Logar em Nosso Servidor ");
SendClientMessage(playerid, COLOR_BRANCO, "Sua Conta й : {FFFF00}Registrada");
SendClientMessage(playerid, COLOR_BRANCO, "Para vocк pegar mas armas digite {FFF567}/kit");
Logado[playerid] = 1;
GivePlayerMoney(playerid, dini_Int(arq,"Dinheiro"));
SetPlayerScore(playerid, dini_Int(arq,"Score"));
return 1;
}
SendClientMessage(playerid,0xFFFF88,"Vocк digitou a senha incorretamente. Tente Novamente.");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar","Digite a senha corretamente.","Logar","Sair");
return 1;
}
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
Kick(playerid);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new arq[30];
format(arq,sizeof arq,"Contas/%s.ini",Nome(playerid));
dini_IntSet(arq,"Score",GetPlayerScore(playerid));
dini_IntSet(arq,"Dinheiro",GetPlayerMoney(playerid));
return 1;
}
stock Nome(playerid)
{
new nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome));
return nome;
}