Help command :dice plus emulator

CricketHotel18

New Member
Jun 20, 2019
8
0
Could someone help me solve the command :dice at the moment of putting the number does not work, random numbers come out.

using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Slopt.HabboHotel.GameClients;

namespace Slopt.HabboHotel.Rooms.Chat.Commands.Administrator
{
class ForceDiceCommand : IChatCommand
{
public string PermissionRequired
{
get { return "user_16"; }
}

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

public string Description
{
get { return "Allows you to carry a hand item"; }
}

public void Execute(GameClient Session, Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Debes colocar una cifra para que salga en el dado de 1 a 6.");
return;
}

GameClient Target = SloptEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (Target == null)
{
Session.SendWhisper("¡Oops, no se ha conseguido este usuario!");
return;
}

int Number;
if (!int.TryParse(Params[2], out Number))
{
Session.SendWhisper("Porfavor introduce un número válido.");
return;
}

if(Number > 6 || Number < 1)
{
Session.SendWhisper("La cifra debe estar entre 1 y 6.");
return;
}

Target.GetHabbo().RigDice = true;
Target.GetHabbo().DiceNumber = Number;
Session.SendWhisper("Acabas de activar el número " + Number + " para que salga en los dados de " + Target.GetHabbo().Username + ".");
}
}
}
 

JayC

Always Learning
Aug 8, 2013
5,492
1,397
This command is terribly written for 1, and you should seek a released command.

The parameters are :roll User #

As far this code goes it sets a variable and the rigging is actually controlled when the user interacts
 

Users who are viewing this thread

Top