[PROBLEM];afk Command

xFlyx

New Member
Jan 29, 2018
21
4
Hello, the AFK Command:

Code:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Plus.Communication.Packets.Outgoing.Rooms.Avatar;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.Items;

using Plus.Communication.Packets.Outgoing.Rooms.Chat;

using Plus.Communication.Packets.Outgoing.Inventory.Furni;
using Plus.Database.Interfaces;

namespace Plus.HabboHotel.Rooms.Chat.Commands.User
{
    class AfkCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_afk"; }
        }

        public string Parameters
        {
            get { return "%grund%"; }
        }

        public string Description
        {
            get { return "Go away!"; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            User.IsAsleep = true;
            Room.SendMessage(new SleepComposer(User, true));
            Session.GetHabbo().Effects().ApplyEffect(503);
          
            Room.SendMessage(new ChatComposer(User.VirtualId, "* " + Session.GetHabbo().Username + "  is away! Reason: " + Params[1] + " * ", 1, User.LastBubble));
        }
    }
}

The Problem: The Message * " + Session.GetHabbo().Username + " is away! Reason: " + Params[1] + " * should all 60 Seconds be repeated.

Can u help me? PS: How shoult i do the ;back command?
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
You can't repeat that in the command. You will need to add a boolean like isAfk into the habbo class, and then on the user loop/process every 60 seconds you check if they are afk, and in a valid room, then have them chat.
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
Could you send me a code?
You must be confused about how this forum works. It's a community of developers and gamers, not spoonfeeders. We don't just write you all the code, that's why you learn yourself or hire a developer.

The fact that you just ask for the code without trying....
 

Users who are viewing this thread

Top