AlexstyleRetro
Member
- Dec 17, 2017
- 151
- 19
Hi Devbest, I have a problem with the :removebadge of my emulator (base Plus)
This is code of TakeBadgeCommand.cs
the problem is that when I try to remove a badge it says "This user does not have this badge" but this is not true.
Where is a problem? Thanks!
This is code of TakeBadgeCommand.cs
PHP:
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Quasar.Communication.Packets.Outgoing.Rooms.Notifications;
using Quasar.HabboHotel.GameClients;
namespace Quasar.HabboHotel.Rooms.Chat.Commands.Personeel
{
class TakeBadgeCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_removebadge"; }
}
public string Parameters
{
get { return "+ username + codice"; }
}
public string Description
{
get { return "Rimuovi un badge ad un utente"; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length != 3)
{
Session.SendWhisper("Inserisci il nome dell'utente a cui vuoi rimuovere l'username e il codice del badge!");
return;
}
GameClient TargetClient = QuasarEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (TargetClient != null)
{
if (!TargetClient.GetHabbo().GetBadgeComponent().HasBadge(Params[2]))
{
TargetClient.GetHabbo().GetBadgeComponent().RemoveBadge(Params[2]);
if (TargetClient.GetHabbo().Id != Session.GetHabbo().Id)
TargetClient.SendWhisper("Ti è stato rimosso il badge " + Params[2] + "!");
else
Session.SendWhisper("Hai rimosso correttamente il badge " + Params[2] + " a " + Params[1] + "!");
}
else
Session.SendWhisper("Questo utente non ha il distintivo " + Params[2] +"");
return;
}
else
{
Session.SendWhisper("Utente non trovato!");
return;
}
}
}
}
the problem is that when I try to remove a badge it says "This user does not have this badge" but this is not true.
Where is a problem? Thanks!