case DIALOG_Login:
{
if(!response) return Kick(playerid);
if(!strcmp(APlayerData[playerid][Senha], inputtext, true, 20)) digitada
{
new Query[70];
mysql_format(mysql, Query, sizeof(Query), "SELECT * FROM `Contas` WHERE Nome='%s'", Nome(playerid));
mysql_tquery(mysql, Query, "CarregarContas", "d", playerid);
// Formatamos a Query realizamos a consulta e enviamos o resultado para a callback CarregarContas
} else {
// comparaзгo sem sucesso ::
SendClientMessage(playerid, -1, "ERRO:{FFFFFF} Senha incorreta !");
SPD(playerid, DIALOG_Login, DIALOG_STYLE_PASSWORD, "Digite sua senha:", "Digite sua senha abaixo para logar-se", "Logar", "Voltar");
}
}
}
case DIALOG_Registro:
{
if(!response) return Kick(playerid);
if(strlen(inputtext) < 4 || strlen(inputtext) > 20)
{
new Dialog[240]; // variavel da dialog registro
format(Dialog, sizeof(Dialog),"{F8F8FF}Bem Vindo(a) Ao Servidor {058AFF}%s{F8F8FF}\n\nVocк nгo tem uma Conta registrada\n\nDigite uma senha para Registrar\n\nStatus: {058AFF}N/A Registrado{F8F8FF}\n\nIP: {058AFF}%s", Nome(playerid));
SPD(playerid, DIALOG_Registro, DIALOG_STYLE_PASSWORD, "Registro", Dialog, "Registrar", "Cancelar");
}
getdate(DiaR[playerid], MesR[playerid], AnoR[playerid]);
format(APlayerData[playerid][DataRegistro], 50, "%02d/%02d/%d", DiaR[playerid], MesR[playerid], AnoR[playerid]);
format(APlayerData[playerid][LastLogin], 128, "%02d/%02d/%d бs %02d:%02d:%02d", DiaL[playerid], MesL[playerid], AnoL[playerid], HoraL[playerid], MinutoL[playerid], SegundoL[playerid]);
new Query[100];
mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `Contas`(`Nome`, `Senha`) VALUES ('%s', '%s')", Nome(playerid), inputtext);
mysql_tquery(mysql, Query, "DadosRegistrados", "i", playerid);
SPD(playerid, DIALOG_GANGS, DIALOG_STYLE_LIST, "Escolha uma facзгo para poder continuar:", "Grove\nBallas\nCops", "Escolher", "Voltar");
RegistrarDados(playerid);
}
if(dialogid == DIALOG_CMD)
{
if(response ==0)
{
SPD(playerid, DIALOG_FACCOES2, DIALOG_STYLE_LIST, "Escolha uma facзгo para poder continuar:", "Comando Vermelho\nAmigo dos Amigos\nTerceiro Comando Puro\nMilicia\nOutras Organizaзхes", "Escolher", "Voltar");
}
if(response == 1)
{
if(listitem == 0)
{
APlayerData[playerid][FACCOES] = 1;
APlayerData[playerid][Lider]=0;
APlayerData[playerid][CMD]=1;
APlayerData[playerid][Vapor]=0;
APlayerData[playerid][Fogueteiro]=0;
APlayerData[playerid][Gerente]=0;
APlayerData[playerid][FRENTE]=0;
APlayerData[playerid][Dono]=0;
APlayerData[playerid][Admin]=0;
APlayerData[playerid][BOPE]=0;
APlayerData[playerid][PMRJ]=0;
APlayerData[playerid][PCRJ]=0;
APlayerData[playerid][pHelper]=0;
APlayerData[playerid][DJ] = 0;
APlayerData[playerid][MTX] = 0;
APlayerData[playerid][Iniciante] = 0;
TogglePlayerSpectating(playerid, false);
SCM(playerid, COR_ERRO, "[INFO]: Vocк escolheu ser 'Comando Vermelho' da favela 'Complexo Da Penha' use '!' para se comunicar com sua facзгo.");
SpawnPlayer(playerid);
SalvarPlayerEx(playerid);
Logadu{playerid} = true;
}
if(APlayerData[playerid][FACCOES] == 1)
{
SetPlayerColor(playerid,COR_CMD);
SetPlayerInterior(playerid,0);
TogglePlayerSpectating(playerid, false);
GameTextForPlayer(playerid,"CMD: ~r~Complexo Da Penha", 1000,1);//ok
SetPlayerPos(playerid,-2673.4482,801.1677,49.9761);
}
KAmper
PHP код:
|