if (MyMath.ChanceSuccess(100))
{
if (Char != null)
if (Name == "Pheasant") // Change this to the name of the mob
{
Char.CPs += 50; // Change this to the amount of CPs you want to drop
SendMsgToAll("SYSTEM", Name + " has killed a monster and recieved 50 CPs", 2000, 0);
return;
}
}
if (MyMath.ChanceSuccess(100))
{
if (Char != null)
{
if (Name == "Pheasant") // Change this to the name of the mob
{
Char.CPs += 50; // Change this to the amount of CPs you want to drop
SendMsgToAll("SYSTEM", Name + " has killed a monster and recieved 50 CPs", 2000, 0);
return;
}
}
}
if (MyMath.ChanceSuccess(100))
{
if (Char != null)
{
if (Name == "Pheasant") // Change this to the name of the mob
{
Char.CPs += 50; // Change this to the amount of CPs you want to drop
SendMsgToAll("SYSTEM", Name + " has killed a monster and recieved 50 CPs", 2000, 0);
return;
}
}
}
fixed
Blaster you don't need the extra curly brackets there. That is just a drain on resources. Learn to code properly before failing at "fixing" other peoples posts. I have pretty much the EXACT same code in my source and works 100%.
If you want the same amount dropped for every mob it would be
Code:
if (MyMath.ChanceSuccess(100))
{ if (Char != null) { MyChar.CPs += 50; return; } }
Blaster you don't need the extra curly brackets there. That is just a drain on resources. Learn to code properly before failing at "fixing" other peoples posts. I have pretty much the EXACT same code in my source and works 100%.
If you want the same amount dropped for every mob it would be
Code:
if (MyMath.ChanceSuccess(100))
{ if (Char != null) { MyChar.CPs += 50; return; } }
dont talk before u got ur info.
u were the one who made one that didn't work.
I fixed ur brackets.
Code:
if (Char != null)
if (Name == "Pheasant") // Change this to the name of the mob
would never work
why?
Code:
if (Char != null)//checks only the next line after
if (Name == "Pheasant") // Change this to the name of the mob
Blaster you don't need the extra curly brackets there. That is just a drain on resources. Learn to code properly before failing at "fixing" other peoples posts. I have pretty much the EXACT same code in my source and works 100%.
A drain on resources!? For a bracket!?? Are you fucking kidding me?
No, adding a bracket won't drain your resources.
Quote:
Originally Posted by BLASTER!!!!
dont talk before u got ur info.
u were the one who made one that didn't work.
I fixed ur brackets.
Code:
if (Char != null)
if (Name == "Pheasant") // Change this to the name of the mob
would never work
why?
Code:
if (Char != null)//checks only the next line after
if (Name == "Pheasant") // Change this to the name of the mob
when to use if without brackets then?
Code:
if (Char != null)
//if not null
else
//if null
u can only use 1 line methodes there.
so whos right or wrong?
You're both wrong in your own special little ways.
Blaster, you're right that an if statement without brackets can only affect one line, but if that line is another if statement then if will keep going.
Code:
if (x)
if (y)
if (z)
Console.WriteLine("x, y, and z all have to be true for this to appear!");
A drain on resources!? For a bracket!?? Are you ******* kidding me?
No, adding a bracket won't drain your resources.
You're both wrong in your own special little ways.
Blaster, you're right that an if statement without brackets can only affect one line, but if that line is another if statement then if will keep going.
Code:
if (x)
if (y)
if (z)
Console.WriteLine("x, y, and z all have to be true for this to appear!");
lol I didn't mean drain on resources I couldn't think of the right word to use haha. Still can't think of the right word either lmao. But thanks for clearing that up
A drain on resources!? For a bracket!?? Are you ******* kidding me?
No, adding a bracket won't drain your resources.
You're both wrong in your own special little ways.
Blaster, you're right that an if statement without brackets can only affect one line, but if that line is another if statement then if will keep going.
Code:
if (x)
if (y)
if (z)
Console.WriteLine("x, y, and z all have to be true for this to appear!");
@Blaster, you were wrong twice.
@Matty, so were you.
Matty: It is not something you HAVE to do, Its style.
Matty: Resources won't really affect resources.
Blaster: You should never comment someone for his style, unless you OBVIOUSLY pointed out that you were commenting on his style, which you didn't.
Blaster: You corrected Matty saying he was wrong, but he wasn't.
@Kinshi,
You sir, posted a excellent answer on this page. <3
That's giving 50CPs for any monster i kill.
But i want to some of monsters,give more CP's,and when they die there will appear message.
Now i dont really know whose version works :/