Lemke

Member
Hello!First: AWESOME module to get your shard into your Discord channel.
I buyed the module,installed,and going good,now i need a bit of help to get some scripts doing server message on Discord,example,on the player dead message.

Original code example:

C#:
 case 0:
                            args.Mobile.PlaySound(256);
                            World.Broadcast(0x4B9, true, "Death Has Taken {0} May God Have Mercy On Thier Soul.", args.Mobile.Name);
                            break;

Thats what im trying:

C#:
case 0:
                            args.Mobile.PlaySound(256);
                            World.Broadcast(0x4B9, true, "Death Has Taken {0} May God Have Mercy On Thier Soul.", args.Mobile.Name);
                            VitaNex.Modules.Discord.DiscordBot.SendMessage("Death Has Taken {0} May God Have Mercy On Thier Soul.", args.Mobile.Name);
                            break;

Error im getting:

C#:
Errors:
 + Custom/Death announce/[ServUO.com]-MobKilledPlayerv15.cs:
    CS1502: Line 34: The best overloaded method match for 'VitaNex.Modules.Discord.DiscordBot.SendMessage(string, bool)' has some invalid arguments
    CS1503: Line 34: Argument 2: cannot convert from 'string' to 'bool'
Scripts: One or more scripts failed to compile or no script files were found.

Thanks in advance!!!!
 
Voxpire will be around to answer this better as I don't have access to the module but what is happening here is you are passing a string into the SendMessage method where it is expecting a bool.

You will need to look at the method to see what the bool actually is for and write your code to accommodate that.
 
I have no clue what the bool is for but you can do something like
C#:
VitaNex.Modules.Discord.DiscordBot.SendMessage("Death Has Taken "+args.Mobile.Name+" May God Have Mercy On Thier Soul.", true );
 
I have no clue what the bool is for but you can do something like
C#:
VitaNex.Modules.Discord.DiscordBot.SendMessage("Death Has Taken "+args.Mobile.Name+" May God Have Mercy On Thier Soul.", true );

Working like a charm mate,thank you so much,now in the shard,if any player die vs monster,Discord bot send the message to Discord channel well.
Awesome thank you!
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back