Is there any way to make an one monster drop x amount of CP's,and when someone kill him,or when it respawn all get message?
Im using 5165 Source.
:confused:
Im using 5165 Source.
:confused:
if (MyMath.ChanceSuccess(30))
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;
}
}
}
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%.Quote:
fixedCode: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) { MyChar.CPs += 50; return; } }
dont talk before u got ur info.Quote:
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; } }
if (Char != null)
if (Name == "Pheasant") // Change this to the name of the mob
if (Char != null)//checks only the next line after
if (Name == "Pheasant") // Change this to the name of the mob
if (Char != null) //if not null else //if null
A drain on resources!? For a bracket!?? Are you fucking kidding me?Quote:
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%.
You're both wrong in your own special little ways.Quote:
dont talk before u got ur info.
u were the one who made one that didn't work.
I fixed ur brackets.
would never workCode:if (Char != null) if (Name == "Pheasant") // Change this to the name of the mob
why?
when to use if without brackets then?Code:if (Char != null)//checks only the next line after if (Name == "Pheasant") // Change this to the name of the mob
u can only use 1 line methodes there.Code:if (Char != null) //if not null else //if null
so whos right or wrong?
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 upQuote:
A drain on resources!? For a bracket!?? Are you fucking 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!");
i know, but it wasnt a bool :)Quote:
A drain on resources!? For a bracket!?? Are you fucking 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!");
if (MyMath.ChanceSuccess(100))
{
if (MobID == 11169 || MobID == 83 || MobID == 1 || MobID == 2 || MobID == 3 || MobID == 4 || MobID == 5 || MobID == 6 || MobID == 7 || MobID == 8 || MobID == 9 || MobID == 10 || MobID == 11 || MobID == 12 || MobID == 13 || MobID == 14 || MobID == 15 || MobID == 16 || MobID == 17 || MobID == 18 || MobID == 19 || MobID == 20 || MobID == 21 || MobID == 22 || MobID == 23 || MobID == 24 || MobID == 25 || MobID == 26 || MobID == 27 || MobID == 28 || MobID == 29 || MobID == 30 || MobID == 31 || MobID == 32 || MobID == 33 || MobID == 34 || MobID == 35 || MobID == 36 || MobID == 37 || MobID == 38 || MobID == 39 || MobID == 40 || MobID == 41 || MobID == 42 || MobID == 43 || MobID == 45 || MobID == 46 || MobID == 47 || MobID == 48 || MobID == 49 || MobID == 50 || MobID == 51 || MobID == 52 || MobID == 53 || MobID == 54 || MobID == 55 || MobID == 56 || MobID == 57 || MobID == 58 || MobID == 59 || MobID == 60 || MobID == 61 || MobID == 62 || MobID == 63 || MobID == 64 || MobID == 65 || MobID == 66 || MobID == 67 || MobID == 68 || MobID == 69 || MobID == 70 || MobID == 71 || MobID == 72)
{
Char.Silvers += 1000;
Char.CPs += 50;
}
}