[ TUTORIAL ] Comando desativar eventos 10.01.17 8:06
Olá, venho trazer um comando que desativa os eventos.
Sabe aqueles eventos chatos que te atrapalha quando escreve e talls ?
Agora não mais!
Quer ver o tutorial original? Clique aqui
» Prints:
Tutorial:
1- Abra a source do seu emulador e dirija-se até a pasta HabboHotel --> Rooms --> Chat --> Commands --> Users , clique com o botão direito --> ADD --> Class e crie um novo comando com o nome DisableEventsCommand.cs e coloque tudo isso lá dentro:
Vá até CommandManager.cs na linha 151 dê enter e adicione:
2- Agora substitua o seu EventAlert por este:
ESTE PASSO DEVE SER SEGUIDO COM ATENÇÃO OU PODERÁ BUGAR O SEU HOTEL.
3- Vamos até HabboHotel --> Users --> Habbo, vamos até a linha 80 apertamos enter e adicionamos:
4- No mesmo arquivo vamos até a linha 183 e trocamos está linha por:
5- Continuando neste mesmo arquivo (até o fim do tutorial) vamos até a linha 226 apertamos enter e colocamos:
6- Agora na vamos até a linha 564 apertamos enter e colamos:
7- Vamos até HabboHotel --> Users --> Authenticator --> HabboFactory --> Authenticator.cs , procuramos por rank_vip neste mesmo arquivo e atrás dele colocamos:
8- Agora vamos até HabboHotel --> Users --> UserDataManagement --> UserDataFactory.cs e na linha 45 atrás de rank_vip adicionamos `allow_events`:
9- E por fim na linha 232 fazemos o mesmo:
10- Agora executamos este SQL:
11- Agora damos debug e testamos.
~ Desculpe pelos erros, sou novato ainda no ppf...
Créditos:
TOTAIS Á [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]
Sabe aqueles eventos chatos que te atrapalha quando escreve e talls ?
Agora não mais!
Quer ver o tutorial original? Clique aqui
» Prints:
- 1:
- [Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]
- 2:
- [Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]
Tutorial:
1- Abra a source do seu emulador e dirija-se até a pasta HabboHotel --> Rooms --> Chat --> Commands --> Users , clique com o botão direito --> ADD --> Class e crie um novo comando com o nome DisableEventsCommand.cs e coloque tudo isso lá dentro:
- DisableEventsCommand.cs:
- using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Plus.Database.Interfaces;
namespace Plus.HabboHotel.Rooms.Chat.Commands.User
{
class DisableEventsCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_disable_events"; }
}
public string Parameters
{
get { return ""; }
}
public string Description
{
get { return "Ativar ou desativar mensagens de eventos."; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
Session.GetHabbo().AllowEvents = !Session.GetHabbo().AllowEvents;
Session.SendWhisper("Você " + (Session.GetHabbo().AllowEvents == true ? "permite" : "não permite") + " receber mensagens de eventos.");
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("UPDATE `users` SET `allow_events` = @AllowEvents WHERE `id` = '" + Session.GetHabbo().Id + "'");
dbClient.AddParameter("AllowEvents", PlusEnvironment.BoolToEnum(Session.GetHabbo().AllowEvents));
dbClient.RunQuery();
}
}
}
}
Vá até CommandManager.cs na linha 151 dê enter e adicione:
- Código:
- this.Register("eventosoff", new DisableEventsCommand());
2- Agora substitua o seu EventAlert por este:
- Código:
- using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Rooms.Engine;
using System.Linq;
using Plus.Communication.Packets.Outgoing.Inventory.Purse;
namespace Plus.HabboHotel.Rooms.Chat.Commands.Events
{
internal class EventAlertCommand : IChatCommand
{
public string PermissionRequired
{
get
{
return "command_event_alert";
}
}
public string Parameters
{
get
{
return "%message%";
}
}
public string Description
{
get
{
return "Enviar um alerta de evento";
}
}
public void Execute(GameClient Session, Room Room, string[] Params)
{
if (Session != null)
{
if (Room != null)
{
if (Params.Length == 1)
{
Session.SendWhisper("Por favor, digite uma mensagem para enviar.");
return;
}
foreach (GameClient client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
if (client.GetHabbo().AllowEvents == true)
{
string Message = CommandManager.MergeParams(Params, 1);
client.SendMessage(new RoomNotificationComposer("Está acontecendo um evento!",
"Está acontecendo um novo jogo realizado pela equipe Staff! <br><br>Este, tem o intuito de proporcionar um entretenimento a mais para os usuários!<br><br>Evento: <b>" + Message +
"</b><br>Por: <b>" + Session.GetHabbo().Username +
"</b> <br><br>Caso deseje participar, clique no botão abaixo!",
"/fig/" + Session.GetHabbo().Look + "", "Participar do Evento", "event:navigator/goto/" + Session.GetHabbo().CurrentRoomId));
}
else
client.SendWhisper("Parece que está havendo um novo evento em nosso hotel. Para reativar as mensagens de eventos digite ;eventosoff", 1);
}
}
}
}
}
ESTE PASSO DEVE SER SEGUIDO COM ATENÇÃO OU PODERÁ BUGAR O SEU HOTEL.
3- Vamos até HabboHotel --> Users --> Habbo, vamos até a linha 80 apertamos enter e adicionamos:
- Código:
- private bool _allowEvents;
4- No mesmo arquivo vamos até a linha 183 e trocamos está linha por:
- Código:
- int GOTWPoints, bool IgnoreInvites, double TimeMuted, double TradingLock, bool AllowGifts, int FriendBarState, bool DisableForcedEffects, bool AllowMimic, bool AllowEvents, int VIPRank)
5- Continuando neste mesmo arquivo (até o fim do tutorial) vamos até a linha 226 apertamos enter e colocamos:
- Código:
- this._allowEvents = AllowEvents;
6- Agora na vamos até a linha 564 apertamos enter e colamos:
- Código:
- public bool AllowEvents
{
get { return this._allowEvents; }
set { this._allowEvents = value; }
}
7- Vamos até HabboHotel --> Users --> Authenticator --> HabboFactory --> Authenticator.cs , procuramos por rank_vip neste mesmo arquivo e atrás dele colocamos:
- Código:
- PlusEnvironment.EnumToBool(Row["allow_events"].ToString()),
- Imagem:
- [Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]
8- Agora vamos até HabboHotel --> Users --> UserDataManagement --> UserDataFactory.cs e na linha 45 atrás de rank_vip adicionamos `allow_events`:
- Imagem:
- [Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]
9- E por fim na linha 232 fazemos o mesmo:
- imagem:
- [Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]
10- Agora executamos este SQL:
- sql:
- ALTER table `users`ADD COLUMN `allow_events` ENUM('0','1') NOT NULL DEFAULT '1' AFTER `allow_mimic`;
11- Agora damos debug e testamos.
~ Desculpe pelos erros, sou novato ainda no ppf...
Créditos:
TOTAIS Á [Tens de ter uma conta e sessão iniciada para poderes visualizar este link]