Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[ADDON]Anti-AFK by Sicily94

Junior Spellweaver
Joined
Jul 15, 2012
Messages
102
Reaction score
21

Sicily94 - [ADDON]Anti-AFK by Sicily94 - RaGEZONE Forums


Go to Navicat->your_db->user_stats (right click mouse and select Design Table) insert new line with this settings and save!
Name: time_afk
Type: int
Lenght: 11
Decimal: 0
Not null: clicked
Default: 0

Go to Plus->Habbo Hotel->Users->Process->ProcessComponent.cs and isert this!

Search: this._player.TimeAFK += 1

and bottom this insert

PHP:
DataRow TimeAfk = null;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `user_stats` SET `time_afk` = '" + this._player.TimeAFK + "' WHERE `id` = '" + this._player.Id + "'");
TimeAfk = dbClient.GetRow();
}
if (this._player.TimeAFK == 10)
{
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
this._player.GetClient().Disconnect();
this._player.GetClient().SendPacket(new RoomNotificationComposer("Sistema Anti-AFK", "Il nostro sistema Anti-AFK ha rilevato che sei stato/a AFK per piu di: " + this._player.TimeAFK + " minuti e ti ha fatto disconnettere.", "AMB", "", ""));
}
}

Go to Plus->Habbo Hotel->Rooms->RoomUser.cs and isert this!

Search: GetClient().GetHabbo().TimeAFK = 0

and bottom this insert

PHP:
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("UPDATE `user_stats` SET `time_afk` = '" + GetClient().GetHabbo().TimeAFK + "' WHERE `id` = '" + GetClient().GetHabbo().Id + "'");
dbClient.GetRow();
}

Compile it and Enjoy :cool:
 

Attachments

You must be registered for see attachments list
Last edited:
Back
Top