public OnPlayerRequestClass(playerid, classid)
{
new Arquivo[40];
new string[255];
format(Arquivo, sizeof(Arquivo), "ArquivosGM/Contas/%s.ini", Nome(playerid));
if(DOF2_FileExists(Arquivo))
{
format(string, sizeof(string),"SERVER: Vocк sу pode errar a senha 3(trкs) vezes.\nBem-vindo ao Nova Vida Portuguesa RPG \n Nick: %s\nStatus da conta: Registrada.\n\ndigite sua senha para logar.", Nome(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Nova Vida Portuguesa - RPG | Login", string, "Logar", "Cancelar");
}
else
{
format(string, sizeof(string),"Seja bem vindo ao Nova Vida Portuguesa \n Nick: %s\nStatus da conta: Nгo Registrada.\n\ndigite uma senha para se registrar.", Nome(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Nova Vida Portuguesa | Registro", string, "Registrar", "Cancelar");
}
ClearChatbox(playerid, 10);
SetPlayerInterior(playerid, 0);
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw4);
InterpolateCameraPos(playerid, 1992.643066, -1199.386474, 69.517288, 1992.643066, -1199.386474, 69.517288, 3000);
InterpolateCameraLookAt(playerid, 1996.424926, -1196.122802, 69.732063, 1990.572143, -1199.394653, 64.966323, 3000);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[255];
switch (dialogid)
{
case DIALOG_REGISTRO:
{
if(response)
{
if(strlen(inputtext) < 5 || strlen(inputtext) > 16 &&!strlen(inputtext))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Senha com no minimo 5 caracteres ou no mбximo 16.");
format(string, sizeof(string),"Seja bem vindo ao Nova Vida Portuguesa - RPG \nNick: %s\nStatus da conta: Nгo Registrada.\n\ndigite uma senha para se registrar.", Nome(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Nova Vida Portuguesa - RPG | Registro", string, "Registrar", "Cancelar");
return 1;
}
new Arquivo[40];
format(Arquivo, sizeof(Arquivo), "ArquivosGM/Contas/%s.ini", Nome(playerid));
DOF2_CreateFile(Arquivo);
DOF2_SetString(Arquivo, "Password", inputtext);
DOF2_SetInt(Arquivo, "Level", 0);
DOF2_SetInt(Arquivo, "AdminLevel", 0);
DOF2_SetInt(Arquivo, "Registered", 0);
DOF2_SetInt(Arquivo, "Tutorial", 0);
DOF2_SetInt(Arquivo, "Sex", 0);
DOF2_SetInt(Arquivo, "Char", 0);
DOF2_SetInt(Arquivo, "Kills", 0);
DOF2_SetInt(Arquivo, "Deaths", 0);
DOF2_SetInt(Arquivo, "Money", 0);
DOF2_SetString(Arquivo,"Email",PlayerInfo[playerid][pEmail]);
DOF2_SaveFile();
SendClientMessage(playerid, COR_SUCESSO, "SERVER: Conta registrada com sucesso.");
format(string, sizeof(string),"SERVER: Vocк sу pode errar a senha 3(trкs) vezes.\nBem-vindo ao Nova vida portuguesa - RPG %s\nStatus da conta: Registrada.\n\ndigite sua senha para logar.", Nome(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Nova vida portuguesa - RPG | Login", string, "Logar", "Cancelar");
return 1;
}
else
{
Kick(playerid);
}
}
case DIALOG_LOGIN:
{
if(response)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid, 0x33FF00AA, "SERVER: Conta registrada com sucesso.");
format(string, sizeof(string),"SERVER: Vocк sу pode errar a senha 3(trкs) vezes.\nBem-vindo ao Nova vida portuguesa - RPG %s\nStatus da conta: Registrada.\n\ndigite sua senha para logar.", Nome(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Nova vida portuguesa - RPG | Login", string, "Logar", "Cancelar");
return 1;
}
new Arquivo[40];
format(Arquivo, sizeof(Arquivo), "ArquivosGM/Contas/%s.ini", Nome(playerid));
if(!strcmp(inputtext,DOF2_GetString(Arquivo,"Password"),false))
{
CarregarPlayer(playerid);
return 1;
}
else
{
format(string, sizeof string,
"Aviso: A senha digitada estб incorreta (%d de 3 tentativas).", ErrouSenha[playerid]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string),"SERVER: Vocк sу pode errar a senha 3(trкs) vezes.\nBem-vindo ao Nova vida portuguesa - RPG %s\nStatus da conta: Registrada.\n\ndigite sua senha para logar.", Nome(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Nova vida portuguesa - RPG | Login", string, "Logar", "Cancelar");
ErrouSenha[playerid]+= 1;
if(ErrouSenha[playerid] == 4)
{
Kick(playerid);
return 1;
}
}
}
else
{
Kick(playerid);
}
}
}
if(dialogid == DIALOG_SEXO)
{
if(response == 0)
{
return true;
}
if(response >= 1)
{
if(listitem == 0)
{
ClearChatbox(playerid, 10);
PlayerInfo[playerid][pSex] = 1;
PlayerInfo[playerid][pChar] = 26;
SendClientMessage(playerid, COLOR_SAMP, "* O seu personagem й do sexo {33CCFF}Masculino.");
format(string, sizeof string, "{00B9F6}Olб %s, digite seu email corretamente, pois ele poderб servir para vocк trocar sua senha", Nome(playerid));
ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Digite seu email", string, "Validar", "");
}
/* if(listitem == 1)
{
ClearChatbox(playerid, 10);
PlayerInfo[playerid][pSex] = 2;
PlayerInfo[playerid][pChar] = 87;
SendClientMessage(playerid, COLOR_SAMP, "' O seu personagem й do sexo {FFFF80}Homossexual.");
format(string, sizeof string, "{00B9F6}Olб %s, digite seu email corretamente, pois ele poderб servir para vocк trocar sua senha", Nome(playerid));
ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Digite seu email", string, "Validar", "");
}*/
if(listitem == 1)
{
ClearChatbox(playerid, 10);
PlayerInfo[playerid][pSex] = 3;
PlayerInfo[playerid][pChar] = 41;
SendClientMessage(playerid, COLOR_SAMP, "* O seu personagem й do {FF66FF}Feminino.");
format(string, sizeof string, "{00B9F6}Olб %s, digite seu email corretamente, pois ele poderб servir para vocк trocar sua senha", Nome(playerid));
ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Digite seu email", string, "Validar", "");
}
}
return 1;
}
if(dialogid == DIALOG_TUTO)
{
if(response == 1)
{
PlayerInfo[playerid][pTut] = 1;
SpawnPlayer(playerid);
ClearChatbox(playerid, 10);
SendClientMessage(playerid, -1, "[Logado]:Bem vindo ao Nova Vida Portuguesa");
}
return 0x01;
}
if(dialogid == DIALOG_EMAIL)
{
if(!EmailValido(inputtext))
{
format(string, sizeof string,
"{00B9F6}Olб %s, digite seu email corretamente, pois ele poderб servir para vocк trocar sua senha\n\n\
{FF0000}Email invбlido", Nome(playerid));
ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Digite seu email", string, "Validar", "");
}
else
{
ClearChatbox(playerid, 10);
format(PlayerInfo[playerid][pEmail], 128, inputtext);
format(string, sizeof string, "{00B9F6}Ok, seu email й: {FFFFFF}%s{00B9F6}.", inputtext);
SendClientMessage(playerid, -1, string);
new message[] = "Aparte do tutorial estб em construзгo.";
ShowPlayerDialog(playerid, DIALOG_TUTO, DIALOG_STYLE_MSGBOX, "LEIA AS REGRAS",message,"Avanзar","");
}
return 0;
}
return 1;
}
Eu quando coloco a senha o bagulho desaparece e fica o < > spawn eu queria que spawna-se logo sabem como faz isso?
|
#include <a_samp>
#include <DOF2>
public OnFilterScriptExit()
{
DOF2_Exit();
return 1;
}
#define REGISTRO 0
#define LOGIN 1
enum PlayerInfo
{
Senha,
Skin,
Grana,
Level
}
new pInfo[MAX_PLAYERS][PlayerInfo];
new ErrouPass[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
if(!DOF2_FileExists(Conta(playerid))) // Porque o ! ?? Porque esse ! Quer dizer 'nгo' no Pawn, e no caso aqui !Existe Ou seja, Nгo Existe o arquivo
{
ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_INPUT, "Senha", "Digite uma senha para registrar", "Ok", "Cancelar");
}
else // Caso existir irб retornar o Login.
{
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Senha", "Digite a sua senha para logar", "Ok", "Cancelar");
}
CarregarConta(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerSkin(playerid, pInfo[playerid][Skin]);
SetTimerEx("AtualizarConta", 1000, true, "i", playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SalvarConta(playerid);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == REGISTRO)
{
if(!response) return Kick(playerid);
if(strlen(inputtext) < 4 || strlen(inputtext) > 20) return SendClientMessage(playerid, -1, "| ERRO | Pelomenos entre 4 e 20 caracteres!");
pInfo[playerid][Senha] = DOF2_SetString(Conta(playerid), "Senha", inputtext);
pInfo[playerid][Skin] = DOF2_SetInt(Conta(playerid), "Skin", 230); // mendigo
pInfo[playerid][Grana] = DOF2_SetInt(Conta(playerid), "Grana", 1000); // 100 reais
pInfo[playerid][Level] = DOF2_SetInt(Conta(playerid), "Level", 1); // 1 de level
DOF2_SaveFile(); // Quando fazer uma modificaзгo sempre salve na ultima linha.
}
if(dialogid == LOGIN)
{
if(!response) return Kick(playerid);
if(strlen(inputtext) < 4 || strlen(inputtext) > 20) return SendClientMessage(playerid, -1, "| ERRO | Pelomenos entre 4 e 20 caracteres!");
if(strcmp(inputtext, DOF2_GetString(Conta(playerid), "Senha"), true)) // Irб verificar se a senha dele for igual a que ele registrou
{
SendClientMessage(playerid, -1, "| INFO | Logado com sucesso.");
}
else
{
if(ErrouPass[playerid] == 3)
{
SendClientMessage(playerid, -1, "| KICK | Vocк recebeu 3 avisos e levou Kick!");
}
else
{
new erros[80];
ErrouPass[playerid] ++;
format(erros, 80, "| AVISOS | %d de 3", ErrouPass[playerid]);
SendClientMessage(playerid, -1, erros);
}
}
}
return 0;
}
static CarregarConta(playerid)
{
pInfo[playerid][Skin] = DOF2_GetInt(Conta(playerid), "Skin");
pInfo[playerid][Grana] = DOF2_GetInt(Conta(playerid), "Grana");
pInfo[playerid][Level] = DOF2_GetInt(Conta(playerid), "Level");
GivePlayerMoney(playerid, pInfo[playerid][Grana]);
SetPlayerScore(playerid, pInfo[playerid][Level]);
return 1;
}
static SalvarConta(playerid)
{
DOF2_SetInt(Conta(playerid), "Skin", pInfo[playerid][Skin]);
DOF2_SetInt(Conta(playerid), "Grana", pInfo[playerid][Grana]);
DOF2_SetInt(Conta(playerid), "Level", pInfo[playerid][Level]);
GetPlayerSkin(pInfo[playerid][Skin]);
GetPlayerMoney(pInfo[playerid][Grana]);
GetPlayerScore(pInfo[playerid][Level]);
DOF2_SaveFile();
return 1;
}
static Conta(playerid)
{
new File[44], Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, 20);
format(File, 44, "/Contas/%s.ini", Nome);
return File;
}
forward AtualizarConta(playerid);
public AtualizarConta(playerid)
{
SalvarConta(playerid);
return 1;
}
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw4);
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;
new Text:Textdraw[4];
TextDrawShowForPlayer(playerid, Textdraw[0]);
TextDrawShowForPlayer(playerid, Textdraw[1]);
TextDrawShowForPlayer(playerid, Textdraw[2]);
TextDrawShowForPlayer(playerid, Textdraw[3]);
Opa amigo, nгo sei resolver seu problema, porйm notei algo no seu sistema, й bom para vocк melhorar.
PHP код:
PHP код:
PHP код:
|
new Text:Textdraw[4];
for(new i = 0; i < 4; i++) { TextDrawShowForPlayer(playerid, Textdraw[i]); }