SwiftEMU custom command [MakeUsersay]
So im trying to code a command similar to the existing one "everybodysays" but make it only one person.
Now i've attempted to code it, but it did not work. I've tried and tried but failed
Code:
internal void usersaysnow() {
string username = null;
GameClient clientByUsername = null;
Room currentRoom = this.Session.GetHabbo().CurrentRoom;
username = this.Params[1];
clientByUsername = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUsername(username);
if (clientByUsername == null)
{
this.Session.SendNotif(LanguageLocale.GetValue("input.usernotfound"));
}
else
{
string message = MergeParams(this.Params, 1);
if (message != "")
{
username.Chat(user.GetClient(), message, false, 0);
}
}
}
Could someone help? ty :)
Re: SwiftEMU custom command [MakeUsersay]
Try this:
Quote:
string message = MergeParams(this.Params, 2);
Re: SwiftEMU custom command [MakeUsersay]
Quote:
username.Chat(user.GetClient(), message, false, 0);
.Chat( = 'string' does not contain a definition for 'chat' and no extension method 'chat'
user = the name 'user' does not exist in the current context
Re: SwiftEMU custom command [MakeUsersay]
Code:
internal void makeUserSay()
{
Room currentRoom = this.Session.GetHabbo().CurrentRoom;
if (currentRoom != null)
{
if (this.Params[2] != "")
{
RoomUser roomUser = currentRoom.GetRoomUserManager().GetRoomUserByHabbo(this.Params[1]);
if(roomUser != null)
{
roomUser.Chat(roomUser.GetClient(), MergeParams(this.Params,2), true);
}
}
}
}
Didn't test. I'm assuming you are doing :commandname AKllX such a troll command
Re: SwiftEMU custom command [MakeUsersay]
Quote:
Originally Posted by
AKllX
Code:
internal void makeUserSay()
{
Room currentRoom = this.Session.GetHabbo().CurrentRoom;
if (currentRoom != null)
{
if (this.Params[2] != "")
{
RoomUser roomUser = currentRoom.GetRoomUserManager().GetRoomUserByHabbo(this.Params[1]);
if(roomUser != null)
{
roomUser.Chat(roomUser.GetClient(), MergeParams(this.Params,2), true);
}
}
}
}
Didn't test. I'm assuming you are doing :commandname AKllX such a troll command
ty :)
yes its kinda of a troll command ;) but not a command to be abused. Just to be the same as 'everybodysay' :)