Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <a_mysql>
- #include <zcmd>
- // == Configurações do FS
- // => Mysql
- #define Host "localhost"
- #define Usuario "root"
- #define DataBase "samp"
- #define Senha ""
- //Registro
- #define SKIN_INICIAL 26 //Mude para a skin desejada
- #define LEVEL_INICIAL 1 // ||
- #define DINHEIRO_INICIAL 5000 // ||
- #define POSX_INICIAL 1721.8422 //Pos X de spawn de registro
- #define POSY_INICIAL -1880.1793 //Pos Y de spawn de registro
- #define POSZ_INICIAL 13.5649 //Pos Z de spawn de registro
- #define WHATSAPP "edite" // troque pelo whats desejado
- #define FORUM "edite" // troque pelo seu endereço do forum
- #define DIALOG_REGISTRO 100
- #define DIALOG_SEXO 101
- #define DIALOG_IDADE 102
- #define DIALOG_SENHA 103
- #define DIALOG_NICK 104
- #define DIALOG_LOGIN 200
- #define DIALOG_FORUM 201
- #define DIALOG_WHATS 202
- #define SKIN_USADA PlayerInfo[playerid][Skin]
- new Conexao;
- new DigitouSenha[MAX_PLAYERS], DigitouSexo[MAX_PLAYERS];
- new DigitouIdade[MAX_PLAYERS], DigitouLogin[MAX_PLAYERS];
- new ClicouWhats[MAX_PLAYERS], ClicouForum[MAX_PLAYERS];
- new Text:Draw_Fundo[MAX_PLAYERS][8];
- new Text:Draw_Registro[MAX_PLAYERS][7];
- new Text:Draw_Login[MAX_PLAYERS][7];
- enum pInfo
- {
- ID,
- pPassword[129],
- Sexo,
- Idade,
- Dinheiro,
- Skin,
- Matou,
- Morreu,
- Level,
- Admin,
- Float:Pos[3],
- bool:Logado
- };
- new PlayerInfo[MAX_PLAYERS][pInfo];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" FS Registro/Login por Cleyson Stein");
- print("--------------------------------------\n");
- Conexao = mysql_connect(Host, Usuario, DataBase, Senha);
- mysql_query(Conexao, "CREATE TABLE IF NOT EXISTS `usuarios`(`ID`int AUTO_INCREMENT PRIMARY KEY, `Nome` varchar(24) NOT NULL, `Senha` varchar(129) NOT NULL, `Admin` int(11) NOT NULL, `Sexo` int(11) NOT NULL, `Idade` int(11) NOT NULL, `Dinheiro` int(11) NOT NULL, `Skin` int(11) NOT NULL, `Matou` int(11) NOT NULL, `Morreu` int(11) NOT NULL, `PosX` float NOT NULL,`PosY` float NOT NULL,`PosZ` float NOT NULL)", false);
- return 1;
- }
- public OnFilterScriptExit()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- SalvarDados(i);
- }
- mysql_close(Conexao);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- CriarTextDraw(playerid);
- new Query[70];
- mysql_format(Conexao, Query, sizeof(Query), "SELECT * FROM usuarios WHERE Nome='%e'", Nome(playerid));
- mysql_tquery(Conexao, Query, "Mysql_Verificar", "d", playerid);
- return 1;
- }
- forward Mysql_Verificar(playerid);
- public Mysql_Verificar(playerid)
- {
- SelectTextDraw(playerid, 0xFF0000FF);
- TextDrawShowForPlayer(playerid, Draw_Fundo[playerid][0]);
- TextDrawShowForPlayer(playerid, Draw_Fundo[playerid][1]);
- TextDrawShowForPlayer(playerid, Draw_Fundo[playerid][2]);
- TextDrawShowForPlayer(playerid, Draw_Fundo[playerid][3]);
- TextDrawShowForPlayer(playerid, Draw_Fundo[playerid][4]);
- TextDrawShowForPlayer(playerid, Draw_Fundo[playerid][5]);
- TextDrawShowForPlayer(playerid, Draw_Fundo[playerid][6]);
- TextDrawShowForPlayer(playerid, Draw_Fundo[playerid][7]);
- if(cache_get_row_count(Conexao) == 1)
- {
- new tmp[129];
- cache_get_field_content(0, "Senha", tmp); format(PlayerInfo[playerid][pPassword], 129, "%s", tmp);
- PlayerInfo[playerid][ID] = cache_get_field_content_int(0, "ID");
- PlayerInfo[playerid][Skin] = cache_get_field_content_int(0, "Skin");
- TextDrawShowForPlayer(playerid, Draw_Login[playerid][0]);
- TextDrawShowForPlayer(playerid, Draw_Login[playerid][1]);
- TextDrawShowForPlayer(playerid, Draw_Login[playerid][2]);
- TextDrawShowForPlayer(playerid, Draw_Login[playerid][3]);
- TextDrawShowForPlayer(playerid, Draw_Login[playerid][4]);
- TextDrawShowForPlayer(playerid, Draw_Login[playerid][5]);
- } else {
- TextDrawShowForPlayer(playerid, Draw_Registro[playerid][0]);
- TextDrawShowForPlayer(playerid, Draw_Registro[playerid][1]);
- TextDrawShowForPlayer(playerid, Draw_Registro[playerid][2]);
- TextDrawShowForPlayer(playerid, Draw_Registro[playerid][3]);
- TextDrawShowForPlayer(playerid, Draw_Registro[playerid][4]);
- TextDrawShowForPlayer(playerid, Draw_Registro[playerid][5]);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SalvarDados(playerid);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[playerid][Morreu]++;
- PlayerInfo[killerid][Matou]++;
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new Msg_format[128];
- switch(dialogid)
- {
- case DIALOG_REGISTRO:
- {
- if(!response) return SendClientMessage(playerid, -1, "Você não quis digitar uma senha");
- if(strlen(inputtext) < 4 || strlen(inputtext) > 16)
- {
- SendClientMessage(playerid, -1, "Sua senha deve conter entre 4 e 16 caracteres!!!");
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Digite uma senha:", "Digite uma senha abaixo para registrar-se.\n\nObs: Ela deve conter no mínimo 4 e no máximo 16 caracteres.", "Registrar", "Voltar");
- return 1;
- }
- if(response)
- {
- DigitouSenha[playerid] = 1;
- TextDrawSetString(Draw_Registro[playerid][2], inputtext);
- new Query[200];
- mysql_format(Conexao, Query, sizeof(Query), "INSERT INTO `usuarios` (`Nome`, `Senha`) VALUES ('%e','%e')", Nome(playerid), inputtext);
- mysql_tquery(Conexao, Query, "DadosRegistrados", "i", playerid);
- return 1;
- }
- return 1;
- }
- case DIALOG_SEXO:
- {
- if(!response)
- {
- DigitouSexo[playerid] = 1;
- SendClientMessage(playerid, -1, "Seu sexo é feminino.");
- TextDrawSetString(Draw_Registro[playerid][3], "Feminino");
- PlayerInfo[playerid][Sexo] = 1;
- } else {
- DigitouSexo[playerid] = 1;
- SendClientMessage(playerid, -1, "Seu sexo é masculino.");
- TextDrawSetString(Draw_Registro[playerid][3], "Masculino");
- PlayerInfo[playerid][Sexo] = 2;
- }
- return 1;
- }
- case DIALOG_IDADE:
- {
- if(!response) return SendClientMessage(playerid, -1, "Você não quis digitar a idade do seu personagem.");
- if(!strlen(inputtext))
- {
- SendClientMessage(playerid, -1, "Você não digitou nada, digite uma idade!");
- ShowPlayerDialog(playerid, DIALOG_IDADE, DIALOG_STYLE_INPUT, "Digite sua idade", "Digite a idade do seu personagem abaixo.\n\nObs: Mínimo 12 e máximo 80 anos.", "Registrar", "Voltar");
- return 1;
- }
- if(strval(inputtext) < 10 || strval(inputtext) > 100)
- {
- SendClientMessage(playerid, -1, "Sua idade deve ser entre 10 e 100 anos.");
- ShowPlayerDialog(playerid, DIALOG_IDADE, DIALOG_STYLE_INPUT, "Digite sua idade", "Digite a idade do seu personagem abaixo.\n\nObs: Mínimo 12 e máximo 80 anos.", "Registrar", "Voltar");
- return 1;
- }
- DigitouIdade[playerid] = 1;
- TextDrawSetString(Draw_Registro[playerid][4], inputtext);
- PlayerInfo[playerid][Idade] = strval(inputtext);
- return 1;
- }
- case DIALOG_LOGIN:
- {
- if(!response) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Digite sua senha:", "Você já é um player registrado, digite uma senha abaixo para logar-se", "Logar", "Voltar");
- if(!strcmp(PlayerInfo[playerid][pPassword], inputtext, true, 129))
- {
- DigitouLogin[playerid] = 1;
- TextDrawSetString(Draw_Login[playerid][2], inputtext);
- } else {
- SendClientMessage(playerid, -1, "[ERRO] Senha incorreta !");
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Digite sua senha:", "Você já é um player registrado, digite uma senha abaixo para logar-se", "Logar", "Voltar");
- }
- return 1;
- }
- case DIALOG_SENHA:
- {
- if(!response) return SendClientMessage(playerid, -1, "Você não quis digitar uma senha");
- if(strlen(inputtext) < 4 || strlen(inputtext) > 16)
- {
- SendClientMessage(playerid, -1, "Sua senha deve conter entre 4 e 16 caracteres!!!");
- ShowPlayerDialog(playerid, DIALOG_SENHA, DIALOG_STYLE_PASSWORD, "Digite uma senha:", "Digite sua nova senha abaixo\n\nObs: Ela deve conter no mínimo 4 e no máximo 16 caracteres.", "Trocar", "Voltar");
- return 1;
- }
- if(response)
- {
- new Query[120];
- mysql_format(Conexao, Query, sizeof(Query), "UPDATE `usuarios` SET `Senha`='%e' WHERE `ID`='%d'",inputtext, PlayerInfo[playerid][ID]);
- mysql_tquery(Conexao, Query,"","");
- format(Msg_format, sizeof(Msg_format), "Sua senha foi alterada com sucesso, nova senha: %s!!!", inputtext);
- SendClientMessage(playerid, -1, Msg_format);
- return 1;
- }
- return 1;
- }
- case DIALOG_NICK:
- {
- if(!response) return SendClientMessage(playerid, -1, "Você não quis digitar uma senha");
- if(strlen(inputtext) > 25)
- {
- SendClientMessage(playerid, -1, "Seu novo nick name deve conter ate 25 caracteres!!!");
- ShowPlayerDialog(playerid, DIALOG_NICK, DIALOG_STYLE_PASSWORD, "Digite um novo nick:", "Digite seu novo nick abaixo\n\nObs: Ele deve conter no máximo 25 caracteres.", "Trocar", "Voltar");
- return 1;
- }
- if(response)
- {
- SetPlayerName(playerid, inputtext);
- new Query[120];
- mysql_format(Conexao, Query, sizeof(Query), "UPDATE `usuarios` SET `Nome`='%e' WHERE `ID`='%d'", inputtext, PlayerInfo[playerid][ID]);
- mysql_tquery(Conexao, Query,"","");
- format(Msg_format, sizeof(Msg_format), "Seu nick foi alterado com sucesso, novo nick: %s!!!", inputtext);
- SendClientMessage(playerid, -1, Msg_format);
- return 1;
- }
- return 1;
- }
- }
- return 1;
- }
- forward Mysql_Carregar(playerid);
- public Mysql_Carregar(playerid)
- {
- PlayerInfo[playerid][Admin] = cache_get_field_content_int(0, "Admin");
- PlayerInfo[playerid][Sexo] = cache_get_field_content_int(0, "Sexo");
- PlayerInfo[playerid][Idade] = cache_get_field_content_int(0, "Idade");
- PlayerInfo[playerid][Dinheiro] = cache_get_field_content_int(0, "Dinheiro");
- PlayerInfo[playerid][Skin] = cache_get_field_content_int(0, "Skin");
- PlayerInfo[playerid][Matou] = cache_get_field_content_int(0, "Matou");
- PlayerInfo[playerid][Morreu] = cache_get_field_content_int(0, "Morreu");
- PlayerInfo[playerid][Pos][0] = cache_get_field_content_int(0, "PosX");
- PlayerInfo[playerid][Pos][1] = cache_get_field_content_int(0, "PosY");
- PlayerInfo[playerid][Pos][2] = cache_get_field_content_int(0, "PosZ");
- CarregarDados(playerid);
- return 1;
- }
- stock SalvarDados(playerid)
- {
- if(PlayerInfo[playerid][Logado] == false) return 1;
- new Float:X, Float:Y, Float:Z, Query[320];
- GetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
- mysql_format(Conexao, Query, sizeof(Query), "UPDATE `usuarios` SET `Admin`='%d', `Sexo`='%d', `Idade`='%d', `Dinheiro`='%d', `Skin`='%d', `Matou`='%d', `Morreu`='%d', `PosX`=%.1f, `PosY`=%.1f, `PosZ`=%.1f WHERE `ID`='%d'",
- PlayerInfo[playerid][Admin],
- PlayerInfo[playerid][Sexo],
- PlayerInfo[playerid][Idade],
- GetPlayerMoney(playerid),
- PlayerInfo[playerid][Skin],
- PlayerInfo[playerid][Matou],
- PlayerInfo[playerid][Morreu],
- Float:X,
- Float:Y,
- Float:Z,
- PlayerInfo[playerid][ID]);
- mysql_tquery(Conexao, Query,"DadosSalvos","d", playerid);
- return 1;
- }
- stock CarregarDados(playerid)
- {
- TirarTextDraw(playerid);
- CancelSelectTextDraw(playerid);
- SetPlayerScore(playerid, PlayerInfo[playerid][Level]);
- GivePlayerMoney(playerid, PlayerInfo[playerid][Dinheiro]);
- SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], PlayerInfo[playerid][Pos][0], PlayerInfo[playerid][Pos][1], PlayerInfo[playerid][Pos][2], 269.15, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- SendClientMessage(playerid, -1, "Sua conta foi carregada com sucesso!");
- PlayerInfo[playerid][Logado] = true;
- return 1;
- }
- forward DadosRegistrados(playerid);
- public DadosRegistrados(playerid)
- {
- PlayerInfo[playerid][ID] = cache_insert_id();
- printf("-> Nova conta registrada ID: %d", PlayerInfo[playerid][ID]);
- return 1;
- }
- forward DadosSalvos(playerid);
- public DadosSalvos(playerid)
- {
- printf("-> Conta salva ID: %d", PlayerInfo[playerid][ID]);
- return 1;
- }
- stock Nome(playerid)
- {
- new name[MAX_PLAYER_NAME];
- return(GetPlayerName(playerid, name, sizeof(name)), name);
- }
- stock CriarTextDraw(playerid)
- {
- // == Text draws box fundo ou seja nao irao alterar se for login ou registro
- Draw_Fundo[playerid][0] = TextDrawCreate(130.000000, 80.000000, "#");
- TextDrawBackgroundColor(Draw_Fundo[playerid][0], 255);
- TextDrawFont(Draw_Fundo[playerid][0], 0);
- TextDrawLetterSize(Draw_Fundo[playerid][0], 0.800000, 30.799999);
- TextDrawColor(Draw_Fundo[playerid][0], -1);
- TextDrawSetOutline(Draw_Fundo[playerid][0], 0);
- TextDrawSetProportional(Draw_Fundo[playerid][0], 1);
- TextDrawSetShadow(Draw_Fundo[playerid][0], 1);
- TextDrawUseBox(Draw_Fundo[playerid][0], 1);
- TextDrawBoxColor(Draw_Fundo[playerid][0], -120);
- TextDrawTextSize(Draw_Fundo[playerid][0], 508.000000, 81.000000);
- Draw_Fundo[playerid][1] = TextDrawCreate(130.000000, 80.000000, "#");
- TextDrawBackgroundColor(Draw_Fundo[playerid][1], 255);
- TextDrawFont(Draw_Fundo[playerid][1], 0);
- TextDrawLetterSize(Draw_Fundo[playerid][1], 0.800000, 2.299995);
- TextDrawColor(Draw_Fundo[playerid][1], -1);
- TextDrawSetOutline(Draw_Fundo[playerid][1], 0);
- TextDrawSetProportional(Draw_Fundo[playerid][1], 1);
- TextDrawSetShadow(Draw_Fundo[playerid][1], 1);
- TextDrawUseBox(Draw_Fundo[playerid][1], 1);
- TextDrawBoxColor(Draw_Fundo[playerid][1], 102);
- TextDrawTextSize(Draw_Fundo[playerid][1], 508.000000, 81.000000);
- Draw_Fundo[playerid][2] = TextDrawCreate(130.000000, 337.000000, "#");
- TextDrawBackgroundColor(Draw_Fundo[playerid][2], 255);
- TextDrawFont(Draw_Fundo[playerid][2], 0);
- TextDrawLetterSize(Draw_Fundo[playerid][2], 0.800000, 2.299995);
- TextDrawColor(Draw_Fundo[playerid][2], -1);
- TextDrawSetOutline(Draw_Fundo[playerid][2], 0);
- TextDrawSetProportional(Draw_Fundo[playerid][2], 1);
- TextDrawSetShadow(Draw_Fundo[playerid][2], 1);
- TextDrawUseBox(Draw_Fundo[playerid][2], 1);
- TextDrawBoxColor(Draw_Fundo[playerid][2], 102);
- TextDrawTextSize(Draw_Fundo[playerid][2], 508.000000, 81.000000);
- Draw_Fundo[playerid][3] = TextDrawCreate(123.000000, 96.000000, "-");
- TextDrawBackgroundColor(Draw_Fundo[playerid][3], 255);
- TextDrawFont(Draw_Fundo[playerid][3], 1);
- TextDrawLetterSize(Draw_Fundo[playerid][3], 27.550069, 0.899999);
- TextDrawColor(Draw_Fundo[playerid][3], 65535);
- TextDrawSetOutline(Draw_Fundo[playerid][3], 1);
- TextDrawSetProportional(Draw_Fundo[playerid][3], 1);
- Draw_Fundo[playerid][4] = TextDrawCreate(123.000000, 331.000000, "-");
- TextDrawBackgroundColor(Draw_Fundo[playerid][4], 255);
- TextDrawFont(Draw_Fundo[playerid][4], 1);
- TextDrawLetterSize(Draw_Fundo[playerid][4], 27.550069, 0.899999);
- TextDrawColor(Draw_Fundo[playerid][4], 65535);
- TextDrawSetOutline(Draw_Fundo[playerid][4], 1);
- TextDrawSetProportional(Draw_Fundo[playerid][4], 1);
- Draw_Fundo[playerid][5] = TextDrawCreate(255.000000, 77.000000, "~b~Bem Vindo");
- TextDrawBackgroundColor(Draw_Fundo[playerid][5], 255);
- TextDrawFont(Draw_Fundo[playerid][5], 0);
- TextDrawLetterSize(Draw_Fundo[playerid][5], 0.959999, 2.299998);
- TextDrawColor(Draw_Fundo[playerid][5], -1);
- TextDrawSetOutline(Draw_Fundo[playerid][5], 0);
- TextDrawSetProportional(Draw_Fundo[playerid][5], 1);
- TextDrawSetShadow(Draw_Fundo[playerid][5], 1);
- Draw_Fundo[playerid][6] = TextDrawCreate(256.000000, 335.000000, "~b~Bom Jogo !");
- TextDrawBackgroundColor(Draw_Fundo[playerid][6], 255);
- TextDrawFont(Draw_Fundo[playerid][6], 0);
- TextDrawLetterSize(Draw_Fundo[playerid][6], 0.959999, 2.299998);
- TextDrawColor(Draw_Fundo[playerid][6], -1);
- TextDrawSetOutline(Draw_Fundo[playerid][6], 0);
- TextDrawSetProportional(Draw_Fundo[playerid][6], 1);
- TextDrawSetShadow(Draw_Fundo[playerid][6], 1);
- Draw_Fundo[playerid][7] = TextDrawCreate(450.000000, 310.000000, " Cancelar");
- TextDrawBackgroundColor(Draw_Fundo[playerid][7], 255);
- TextDrawFont(Draw_Fundo[playerid][7], 2);
- TextDrawLetterSize(Draw_Fundo[playerid][7], 0.209999, 1.600000);
- TextDrawColor(Draw_Fundo[playerid][7], -1);
- TextDrawSetOutline(Draw_Fundo[playerid][7], 0);
- TextDrawSetProportional(Draw_Fundo[playerid][7], 1);
- TextDrawSetShadow(Draw_Fundo[playerid][7], 1);
- TextDrawUseBox(Draw_Fundo[playerid][7], 1);
- TextDrawBoxColor(Draw_Fundo[playerid][7], 153);
- TextDrawTextSize(Draw_Fundo[playerid][7], 500.000000, 10.000000);
- // ===== TextDraw Registroo
- Draw_Registro[playerid][0] = TextDrawCreate(211.000000, 110.000000, "Ola, sua conta ainda nao e registrada");
- TextDrawBackgroundColor(Draw_Registro[playerid][0], 255);
- TextDrawFont(Draw_Registro[playerid][0], 2);
- TextDrawLetterSize(Draw_Registro[playerid][0], 0.219999, 1.899999);
- TextDrawColor(Draw_Registro[playerid][0], 255);
- TextDrawSetOutline(Draw_Registro[playerid][0], 0);
- TextDrawSetProportional(Draw_Registro[playerid][0], 1);
- TextDrawSetShadow(Draw_Registro[playerid][0], 0);
- Draw_Registro[playerid][1] = TextDrawCreate(385.000000, 310.000000, " Registrar");
- TextDrawBackgroundColor(Draw_Registro[playerid][1], 255);
- TextDrawFont(Draw_Registro[playerid][1], 2);
- TextDrawLetterSize(Draw_Registro[playerid][1], 0.209999, 1.600000);
- TextDrawColor(Draw_Registro[playerid][1], -1);
- TextDrawSetOutline(Draw_Registro[playerid][1], 0);
- TextDrawSetProportional(Draw_Registro[playerid][1], 1);
- TextDrawSetShadow(Draw_Registro[playerid][1], 1);
- TextDrawUseBox(Draw_Registro[playerid][1], 1);
- TextDrawBoxColor(Draw_Registro[playerid][1], 153);
- TextDrawTextSize(Draw_Registro[playerid][1], 437.000000, 10.000000);
- Draw_Registro[playerid][2] = TextDrawCreate(170.000000, 144.000000, " Senha");
- TextDrawBackgroundColor(Draw_Registro[playerid][2], 255);
- TextDrawFont(Draw_Registro[playerid][2], 2);
- TextDrawLetterSize(Draw_Registro[playerid][2], 0.500000, 3.000000);
- TextDrawColor(Draw_Registro[playerid][2], -1);
- TextDrawSetOutline(Draw_Registro[playerid][2], 0);
- TextDrawSetProportional(Draw_Registro[playerid][2], 1);
- TextDrawSetShadow(Draw_Registro[playerid][2], 1);
- TextDrawUseBox(Draw_Registro[playerid][2], 1);
- TextDrawBoxColor(Draw_Registro[playerid][2], 153);
- TextDrawTextSize(Draw_Registro[playerid][2], 335.000000, 30.000000);
- Draw_Registro[playerid][3] = TextDrawCreate(170.000000, 206.000000, " Sexo");
- TextDrawBackgroundColor(Draw_Registro[playerid][3], 255);
- TextDrawFont(Draw_Registro[playerid][3], 2);
- TextDrawLetterSize(Draw_Registro[playerid][3], 0.500000, 3.000000);
- TextDrawColor(Draw_Registro[playerid][3], -1);
- TextDrawSetOutline(Draw_Registro[playerid][3], 0);
- TextDrawSetProportional(Draw_Registro[playerid][3], 1);
- TextDrawSetShadow(Draw_Registro[playerid][3], 1);
- TextDrawUseBox(Draw_Registro[playerid][3], 1);
- TextDrawBoxColor(Draw_Registro[playerid][3], 153);
- TextDrawTextSize(Draw_Registro[playerid][3], 335.000000, 30.000000);
- Draw_Registro[playerid][4] = TextDrawCreate(170.000000, 267.000000, " Idade");
- TextDrawBackgroundColor(Draw_Registro[playerid][4], 255);
- TextDrawFont(Draw_Registro[playerid][4], 2);
- TextDrawLetterSize(Draw_Registro[playerid][4], 0.500000, 3.000000);
- TextDrawColor(Draw_Registro[playerid][4], -1);
- TextDrawSetOutline(Draw_Registro[playerid][4], 0);
- TextDrawSetProportional(Draw_Registro[playerid][4], 1);
- TextDrawSetShadow(Draw_Registro[playerid][4], 1);
- TextDrawUseBox(Draw_Registro[playerid][4], 1);
- TextDrawBoxColor(Draw_Registro[playerid][4], 153);
- TextDrawTextSize(Draw_Registro[playerid][4], 335.000000, 30.000000);
- Draw_Registro[playerid][5] = TextDrawCreate(390.000000, 146.000000, "New Textdraw");
- TextDrawBackgroundColor(Draw_Registro[playerid][5], 255);
- TextDrawFont(Draw_Registro[playerid][5], 5);
- TextDrawLetterSize(Draw_Registro[playerid][5], 0.600000, -5.099998);
- TextDrawColor(Draw_Registro[playerid][5], -1);
- TextDrawSetOutline(Draw_Registro[playerid][5], 0);
- TextDrawSetProportional(Draw_Registro[playerid][5], 1);
- TextDrawSetShadow(Draw_Registro[playerid][5], 1);
- TextDrawUseBox(Draw_Registro[playerid][5], 1);
- TextDrawBoxColor(Draw_Registro[playerid][5], 255);
- TextDrawTextSize(Draw_Registro[playerid][5], 105.000000, 145.000000);
- TextDrawSetPreviewModel(Draw_Registro[playerid][5], SKIN_INICIAL);
- TextDrawSetPreviewRot(Draw_Registro[playerid][5], -16.000000, 0.000000, -55.000000, 1.000000);
- Draw_Registro[playerid][6] = TextDrawCreate(139.000000, 310.000000, "~r~Por favor preencha todos os dados !");
- TextDrawBackgroundColor(Draw_Registro[playerid][6], 255);
- TextDrawFont(Draw_Registro[playerid][6], 2);
- TextDrawLetterSize(Draw_Registro[playerid][6], 0.270000, 1.300000);
- TextDrawColor(Draw_Registro[playerid][6], -1);
- TextDrawSetOutline(Draw_Registro[playerid][6], 1);
- TextDrawSetProportional(Draw_Registro[playerid][6], 1);
- // ==== TextDraw Login
- Draw_Login[playerid][0] = TextDrawCreate(211.000000, 110.000000, "Ola, sua conta ja esta registrada.");
- TextDrawBackgroundColor(Draw_Login[playerid][0], 255);
- TextDrawFont(Draw_Login[playerid][0], 2);
- TextDrawLetterSize(Draw_Login[playerid][0], 0.219999, 1.899999);
- TextDrawColor(Draw_Login[playerid][0], 255);
- TextDrawSetOutline(Draw_Login[playerid][0], 0);
- TextDrawSetProportional(Draw_Login[playerid][0], 1);
- TextDrawSetShadow(Draw_Login[playerid][0], 0);
- Draw_Login[playerid][1] = TextDrawCreate(385.000000, 310.000000, " Logar");
- TextDrawBackgroundColor(Draw_Login[playerid][1], 255);
- TextDrawFont(Draw_Login[playerid][1], 2);
- TextDrawLetterSize(Draw_Login[playerid][1], 0.209999, 1.600000);
- TextDrawColor(Draw_Login[playerid][1], -1);
- TextDrawSetOutline(Draw_Login[playerid][1], 0);
- TextDrawSetProportional(Draw_Login[playerid][1], 1);
- TextDrawSetShadow(Draw_Login[playerid][1], 1);
- TextDrawUseBox(Draw_Login[playerid][1], 1);
- TextDrawBoxColor(Draw_Login[playerid][1], 153);
- TextDrawTextSize(Draw_Login[playerid][1], 437.000000, 10.000000);
- Draw_Login[playerid][2] = TextDrawCreate(170.000000, 144.000000, " Senha");
- TextDrawBackgroundColor(Draw_Login[playerid][2], 255);
- TextDrawFont(Draw_Login[playerid][2], 2);
- TextDrawLetterSize(Draw_Login[playerid][2], 0.500000, 3.000000);
- TextDrawColor(Draw_Login[playerid][2], -1);
- TextDrawSetOutline(Draw_Login[playerid][2], 0);
- TextDrawSetProportional(Draw_Login[playerid][2], 1);
- TextDrawSetShadow(Draw_Login[playerid][2], 1);
- TextDrawUseBox(Draw_Login[playerid][2], 1);
- TextDrawBoxColor(Draw_Login[playerid][2], 153);
- TextDrawTextSize(Draw_Login[playerid][2], 335.000000, 30.000000);
- Draw_Login[playerid][3] = TextDrawCreate(170.000000, 206.000000, " Forum");
- TextDrawBackgroundColor(Draw_Login[playerid][3], 255);
- TextDrawFont(Draw_Login[playerid][3], 2);
- TextDrawLetterSize(Draw_Login[playerid][3], 0.500000, 3.000000);
- TextDrawColor(Draw_Login[playerid][3], -1);
- TextDrawSetOutline(Draw_Login[playerid][3], 0);
- TextDrawSetProportional(Draw_Login[playerid][3], 1);
- TextDrawSetShadow(Draw_Login[playerid][3], 1);
- TextDrawUseBox(Draw_Login[playerid][3], 1);
- TextDrawBoxColor(Draw_Login[playerid][3], 153);
- TextDrawTextSize(Draw_Login[playerid][3], 335.000000, 30.000000);
- Draw_Login[playerid][4] = TextDrawCreate(170.000000, 267.000000, " WhatsApp");
- TextDrawBackgroundColor(Draw_Login[playerid][4], 255);
- TextDrawFont(Draw_Login[playerid][4], 2);
- TextDrawLetterSize(Draw_Login[playerid][4], 0.500000, 3.000000);
- TextDrawColor(Draw_Login[playerid][4], -1);
- TextDrawSetOutline(Draw_Login[playerid][4], 0);
- TextDrawSetProportional(Draw_Login[playerid][4], 1);
- TextDrawSetShadow(Draw_Login[playerid][4], 1);
- TextDrawUseBox(Draw_Login[playerid][4], 1);
- TextDrawBoxColor(Draw_Login[playerid][4], 153);
- TextDrawTextSize(Draw_Login[playerid][4], 335.000000, 30.000000);
- Draw_Login[playerid][5] = TextDrawCreate(390.000000, 146.000000, "New Textdraw");
- TextDrawBackgroundColor(Draw_Login[playerid][5], 255);
- TextDrawFont(Draw_Login[playerid][5], 5);
- TextDrawLetterSize(Draw_Login[playerid][5], 0.600000, -5.099998);
- TextDrawColor(Draw_Login[playerid][5], -1);
- TextDrawSetOutline(Draw_Login[playerid][5], 0);
- TextDrawSetProportional(Draw_Login[playerid][5], 1);
- TextDrawSetShadow(Draw_Login[playerid][5], 1);
- TextDrawUseBox(Draw_Login[playerid][5], 1);
- TextDrawBoxColor(Draw_Login[playerid][5], 255);
- TextDrawTextSize(Draw_Login[playerid][5], 105.000000, 145.000000);
- TextDrawSetPreviewModel(Draw_Login[playerid][5], SKIN_USADA);
- TextDrawSetPreviewRot(Draw_Login[playerid][5], -16.000000, 0.000000, -55.000000, 1.000000);
- Draw_Login[playerid][6] = TextDrawCreate(139.000000, 310.000000, "~r~Por favor coloque sua senha !");
- TextDrawBackgroundColor(Draw_Login[playerid][6], 255);
- TextDrawFont(Draw_Login[playerid][6], 2);
- TextDrawLetterSize(Draw_Login[playerid][6], 0.270000, 1.300000);
- TextDrawColor(Draw_Login[playerid][6], -1);
- TextDrawSetOutline(Draw_Login[playerid][6], 1);
- TextDrawSetProportional(Draw_Login[playerid][6], 1);
- TextDrawSetSelectable(Text:Draw_Fundo[playerid][7], true);
- TextDrawSetSelectable(Text:Draw_Registro[playerid][1], true);
- TextDrawSetSelectable(Text:Draw_Registro[playerid][2], true);
- TextDrawSetSelectable(Text:Draw_Registro[playerid][3], true);
- TextDrawSetSelectable(Text:Draw_Registro[playerid][4], true);
- TextDrawSetSelectable(Text:Draw_Login[playerid][1], true);
- TextDrawSetSelectable(Text:Draw_Login[playerid][2], true);
- TextDrawSetSelectable(Text:Draw_Login[playerid][3], true);
- TextDrawSetSelectable(Text:Draw_Login[playerid][4], true);
- return 1;
- }
- stock TirarTextDraw(playerid)
- {
- TextDrawHideForPlayer(playerid, Draw_Registro[playerid][0]);
- TextDrawHideForPlayer(playerid, Draw_Registro[playerid][1]);
- TextDrawHideForPlayer(playerid, Draw_Registro[playerid][2]);
- TextDrawHideForPlayer(playerid, Draw_Registro[playerid][3]);
- TextDrawHideForPlayer(playerid, Draw_Registro[playerid][4]);
- TextDrawHideForPlayer(playerid, Draw_Registro[playerid][5]);
- TextDrawHideForPlayer(playerid, Draw_Registro[playerid][6]);
- TextDrawHideForPlayer(playerid, Draw_Login[playerid][0]);
- TextDrawHideForPlayer(playerid, Draw_Login[playerid][1]);
- TextDrawHideForPlayer(playerid, Draw_Login[playerid][2]);
- TextDrawHideForPlayer(playerid, Draw_Login[playerid][3]);
- TextDrawHideForPlayer(playerid, Draw_Login[playerid][4]);
- TextDrawHideForPlayer(playerid, Draw_Login[playerid][5]);
- TextDrawHideForPlayer(playerid, Draw_Login[playerid][6]);
- TextDrawHideForPlayer(playerid, Draw_Fundo[playerid][0]);
- TextDrawHideForPlayer(playerid, Draw_Fundo[playerid][1]);
- TextDrawHideForPlayer(playerid, Draw_Fundo[playerid][2]);
- TextDrawHideForPlayer(playerid, Draw_Fundo[playerid][3]);
- TextDrawHideForPlayer(playerid, Draw_Fundo[playerid][4]);
- TextDrawHideForPlayer(playerid, Draw_Fundo[playerid][5]);
- TextDrawHideForPlayer(playerid, Draw_Fundo[playerid][6]);
- TextDrawHideForPlayer(playerid, Draw_Fundo[playerid][7]);
- return 1;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- // === Draw registro
- if(clickedid == Draw_Registro[playerid][2]) ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Digite uma senha:", "Digite uma senha abaixo para registrar-se.\n\nObs: Ela deve conter no mínimo 4 e no máximo 16 caracteres.", "Registrar", "Voltar");
- if(clickedid == Draw_Registro[playerid][3]) ShowPlayerDialog(playerid, DIALOG_SEXO, DIALOG_STYLE_MSGBOX, "Escolha seu sexo:", "Escolhe seu sexo clicando nos botões abaixo.", "Masculino", "Feminino");
- if(clickedid == Draw_Registro[playerid][4]) ShowPlayerDialog(playerid, DIALOG_IDADE, DIALOG_STYLE_INPUT, "Digite sua idade", "Digite a idade do seu personagem abaixo.\n\nObs: Mínimo 10 e máximo 100 anos.", "Registrar", "Voltar");
- if(clickedid == Draw_Fundo[playerid][7]) Kick(playerid); //box canxelar
- if(clickedid == Draw_Registro[playerid][1]) // Registrar
- {
- if(DigitouSenha[playerid] == 1 && DigitouSexo[playerid] == 1 && DigitouIdade[playerid] == 1)
- {
- TirarTextDraw(playerid);
- DigitouSenha[playerid] = 0;
- DigitouSexo[playerid] = 0;
- DigitouIdade[playerid] = 0;
- PlayerInfo[playerid][Level] = LEVEL_INICIAL;
- PlayerInfo[playerid][Skin] = SKIN_INICIAL;
- PlayerInfo[playerid][Dinheiro] = DINHEIRO_INICIAL;
- PlayerInfo[playerid][Pos][0] = POSX_INICIAL;
- PlayerInfo[playerid][Pos][1] = POSY_INICIAL;
- PlayerInfo[playerid][Pos][2] = POSZ_INICIAL;
- SendClientMessage(playerid, -1, "Sua conta foi registrada com sucesso!");
- CarregarDados(playerid);
- } else {
- TextDrawShowForPlayer(playerid, Draw_Registro[playerid][6]); // mensagem de erro preencha todos os dados
- }
- }
- // === TextDraw Login
- if(clickedid == Draw_Login[playerid][2]) ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Digite sua senha:", "Você já é um player registrado, digite uma senha abaixo para logar-se", "Logar", "Voltar");
- if(clickedid == Draw_Login[playerid][1]) // LOGIN
- {
- if(DigitouLogin[playerid] == 1)
- {
- new Query[70];
- mysql_format(Conexao, Query, sizeof(Query), "SELECT * FROM usuarios WHERE Nome='%s'", Nome(playerid));
- mysql_tquery(Conexao, Query, "Mysql_Carregar", "d", playerid);
- DigitouLogin[playerid] = 0;
- } else {
- TextDrawShowForPlayer(playerid, Draw_Login[playerid][6]); // mensagem de erro, esqueceu de digitar senha
- }
- }
- if(clickedid == Draw_Login[playerid][4]) // WhatsApp
- {
- if(ClicouWhats[playerid] == 0)
- {
- TextDrawSetString(Draw_Login[playerid][4], WHATSAPP);
- ClicouWhats[playerid] = 1;
- } else if(ClicouWhats[playerid] == 1){
- TextDrawSetString(Draw_Login[playerid][4], "WhatsApp");
- ClicouWhats[playerid] = 0;
- }
- }
- if(clickedid == Draw_Login[playerid][3]) // Forum
- {
- if(ClicouForum[playerid] == 0)
- {
- TextDrawSetString(Draw_Login[playerid][3], FORUM);
- ClicouForum[playerid] = 1;
- } else if(ClicouForum[playerid] == 1){
- TextDrawSetString(Draw_Login[playerid][3], "Forum");
- ClicouForum[playerid] = 0;
- }
- }
- return 1;
- }
- CMD:trocarsenha(playerid)
- {
- ShowPlayerDialog(playerid, DIALOG_SENHA, DIALOG_STYLE_PASSWORD, "Digite uma senha:", "Digite sua nova senha abaixo\n\nObs: Ela deve conter no mínimo 4 e no máximo 16 caracteres.", "Trocar", "Voltar");
- return 1;
- }
- CMD:trocarnick(playerid)
- {
- ShowPlayerDialog(playerid, DIALOG_NICK, DIALOG_STYLE_PASSWORD, "Digite um novo nick:", "Digite seu novo nick abaixo\n\nObs: Ele deve conter no máximo 25 caracteres.", "Trocar", "Voltar");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement