[Release] Broadcast

05/18/2009 22:20 Vortex.#1
Well first of all, The broadcast release by ArcherMaster didn't work for me.. So I just made my own

This code is better, Because you can't broadcast in botjail.. Nor spam the broadcast..

Lets get started
In, Client.cs Search
Code:
public class Client
    {
After that add;
Code:
public DateTime CanBroadcastTime = DateTime.Now;
        public bool CanBroadcast = true;

Now search for "case 2050:"

Replace the entire case with;

Code:
case 2050:
                        {
                            if (MyChar.LocMap == 6001 || MyChar.LocMap == 6000)
                            {
                                SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You can't do that here!", 2005));
                            }
                            else
                            {
                                if (!CanBroadcast)
                                    if (DateTime.Now >= CanBroadcastTime)
                                        CanBroadcast = true;
                                if (CanBroadcast)
                                {
                                    if (Data[4] == 3 && MyChar.CPs >= 5)
                                    {
                                        MyChar.CPs -= 5;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        byte Len = Data[13];
                                        string Message = "";
                                        for (int i = 0; i < Len; i++)
                                        {
                                            Message += Convert.ToChar(Data[14 + i]);
                                        }
                                        World.SendMsgToAll(Message, MyChar.Name, 2500);
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Message sent successfully!.", 2005));
                                        CanBroadcast = false;
                                        CanBroadcastTime = DateTime.Now.AddSeconds(20);
                                    }
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Please wait to send your message!", 2005));
                                }
                            }
                            break;
                        }
If I helped you press `Thanks'
05/18/2009 22:45 PeTe Ninja#2
lol you probaly copied the whole thing all you had to do was change the chat type from like 2000 to 2500
05/18/2009 22:48 Pete1990#3
This is from Cov2
05/18/2009 23:11 Vortex.#4
@ Petee didn't even download CoV2.. Cause of the bad reviews..

@PeTe Yeah I knew that.. Even AlexBigFoot tried.. And it didn't work.. Anyway this method is better to me
05/19/2009 05:21 vladrage08#5
hey vortex where can i put this codes and where can i find client.cs or character.cs? plz reply back asap!
05/19/2009 09:29 leavemealone#6
I have to say, Over time all the Broadcasts scripts posted have the most basic broadcast systems. It's not very hard to write a broadcast system that supports a queue system.
05/19/2009 21:15 Vortex.#7
Quote:
Originally Posted by vladrage08 View Post
hey vortex where can i put this codes and where can i find client.cs or character.cs? plz reply back asap!
LOL..
05/19/2009 21:34 LetterX#8
Quote:
Originally Posted by vladrage08 View Post
hey vortex where can i put this codes and where can i find client.cs or character.cs? plz reply back asap!
You find "Client.cs" and "Character.cs" in the LOTF source.

But considering you just asked that question; I recommend learning C# first or AT LEAST get a basic understanding of it X_X
05/19/2009 22:30 tao4229#9
Quote:
Originally Posted by LetterX View Post
You find "Client.cs" and "Character.cs" in the LOTF source.

But considering you just asked that question; I recommend learning C# first or AT LEAST get a basic understanding of it X_X
Take your own advice plz.
05/19/2009 23:58 bigjesse#10
does this let me do free broadcast?
05/20/2009 01:35 Vortex.#11
Nope, but edit the code and you can
05/30/2009 18:23 turk55#12
Quote:
Originally Posted by Vortex. View Post
Code:
case 2050:
                        {
                            if (MyChar.LocMap == 6001 || MyChar.LocMap == 6000)
                            {
                                SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You can't do that here!", 2005));
                            }
                            else
                            {
                                if (!CanBroadcast)
                                    if (DateTime.Now >= CanBroadcastTime)
                                        CanBroadcast = true;
                                if (CanBroadcast)
                                {
                                    if (Data[4] == 3 && MyChar.CPs >= 5)
                                    {
                                        MyChar.CPs [COLOR="Red"]-= 5;[/COLOR]
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        byte Len = Data[13];
                                        string Message = "";
                                        for (int i = 0; i < Len; i++)
                                        {
                                            Message += Convert.ToChar(Data[14 + i]);
                                        }
                                        World.SendMsgToAll(Message, MyChar.Name, 2500);
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Message sent successfully!.", 2005));
                                        CanBroadcast = false;
                                        CanBroadcastTime = DateTime.Now.AddSeconds(20);
                                    }
                                }
                                else
                                {
                                    SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Please wait to send your message!", 2005));
                                }
                            }
                            break;
                        }
if you want to make it free change -=5 ; into -=0 ; and your done
05/30/2009 18:33 _Emme_#13
Quote:
if (MyChar.LocMap == 6001 || MyChar.LocMap == 6000)
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You cannot broadcast in here",2005));
else
{
if (DateTime.Now >= BroadCast.AddSeconds(10))
{
if (Data[4] == 3 && MyChar.CPs >= 5)
{
MyChar.CPs -= 5;
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
string Message = "";
for (int i = 0; i < Data[13]; i++)
{
Message += Convert.ToChar(Data[14 + i]);
}
World.SendMsgToAll(Message, MyChar.Name, 2500);
}
else
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Please wait a few seconds before broadcasting again!",2005));

}

that's what I had in my old old old old old old old old old old LOTF source, probably is better.
06/08/2009 02:26 Vortex.#14
Hows it better?
08/12/2010 23:10 syko666#15
Don't work for me.