Is there any way.

08/25/2010 10:41 buckeyes10#16
K,i figured it out.
If i kill the boss,i get 2,5k CPs,but the MSG dont work.
Here's my code.
Code:
 if (MyMath.ChanceSuccess(100))
                {
                    if (MobID == 100)
                    {
                        Char.CPs += 2500;
                        SendMsgToAll("SYSTEM", Name + " has killed a CopperTiger and recieved 2,5k CPs!", 2000, 0);
                        return;
08/25/2010 11:47 dowhatuwant#17
I think is World.SendMsgToAll
08/25/2010 12:21 Arcо#18
Quote:
Originally Posted by BLASTER!!!! View Post
Code:
if (Char != null)
   //if not null
else
   //if null
If the char was null is wouldn't be online :facepalm:
08/25/2010 12:39 ~Master#19
Quote:
Originally Posted by buckeyes10 View Post
K,i figured it out.
If i kill the boss,i get 2,5k CPs,but the MSG dont work.
Here's my code.
Code:
 if (MyMath.ChanceSuccess(100))
                {
                    if (MobID == 100)
                    {
                        Char.CPs += 2500;
                        [COLOR="Red"]World.[/COLOR]SendMsgToAll("SYSTEM", Name + " has killed a CopperTiger and recieved 2,5k CPs!", 2000, 0);
                        return;
                   [COLOR="Red"][COLOR="Red"] }
                }[/COLOR][/COLOR]
That's it.
08/25/2010 12:59 dowhatuwant#20
Quote:
Originally Posted by .Arco View Post
If the char was null is wouldn't be online :facepalm:
I know lol, it was just he used the null check.
08/25/2010 13:07 buckeyes10#21
Its work now,but its says mobs name twice.
Copper Tiger has kill Copper Tiger.
08/25/2010 13:16 ~Master#22
Quote:
Originally Posted by buckeyes10 View Post
Its work now,but its says mobs name twice.
Copper Tiger has kill Copper Tiger.
Replace Name with GC.MyChar.Name in the code.
08/25/2010 13:35 dowhatuwant#23
is just Char.Name
as is not using MyChar ;)
08/25/2010 13:54 µ~Xero~µ#24
Quote:
Originally Posted by .Arco View Post
If the char was null is wouldn't be online :facepalm:
I wouldnt say that ..... he uses LOTF :rolleyes:
08/26/2010 01:35 Arcо#25
Quote:
Originally Posted by µ~Xero~µ View Post
I wouldnt say that ..... he uses LOTF :rolleyes:
Lmao this is true :p
08/26/2010 03:38 Korvacs#26
Quote:
Originally Posted by .Arco View Post
If the char was null is wouldn't be online :facepalm:
Well....unless the player disconnected durring looting in which case...

Oh and i dug this up from one of my older posts for people confused about statements:

Code:
            //When using if statements without brackets its important to realise that 
            //only the line immediately after the if statement will be called if the statement is true

            int Job = 55;

            if (Job == 55)
                Console.WriteLine("Yay! This line is called.");
            Console.WriteLine("This line is also called, but only because it would be the next line after the statement finshes");

            //This for example would not work out well if you dont want the contents of the if statement to be called

            if (Job == 100)
                Console.WriteLine("We dont want this line to be called, and it isnt, so Yay!");
            Console.WriteLine("Oh no! This line has been called because its not part of the if statement!");

            //If you want to have more than 1 line in the if statement then you HAVE to use brackets

            if (Job == 55)
            {
                Console.Write("All is good, the contents of this if statement");
                Console.Write(" is called and works exactly as we intended");
            }
08/26/2010 04:10 _tao4229_#27
Who needs brackets when we can just use whitespace?

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]