Someone can help me with this?

03/15/2010 19:27 .Beatz#1
Code:
#region Boxing
                                    if (Control == 4)
                                    {
                                        if (GC.MyChar.InventoryContains(1088000, 1))
                                        {
                                            GC.AddSend(Packets.NPCSay("Ok i will upgrade you Proficiency for you."));
                                            GC.AddSend(Packets.NPCLink("Thank you", 255));
                                            GC.MyChar.RemoveItem(GC.MyChar.NextItem(1088000));
                                            GC.MyChar.RWProf(new Game.Prof() { ID = 000, Lvl = 1, Exp = 0 });
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else if (GC.MyChar.InventoryContains(1088000, 1))
                                        {
                                            GC.AddSend(Packets.NPCSay("Congratulations your weapon proficiency has improved."));
                                            GC.MyChar.RWProf(new Game.Prof() { ID = 000, Lvl = 1, });
                                            GC.MyChar.RWProf(new Game.Prof() { ID = 000, Lvl = 2, Exp = 0 });

                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You don't have the required items"));
                                            GC.AddSend(Packets.NPCLink("Sorry", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    #endregion
I am not very good with else and else if statments. i am trying to get it to work like.
If skill = 000, lvl = 1 then upgrade to skill = 000, lvl =2, exp = 0
anyone can help me with this would be awesome.
Thanks in advance.
03/15/2010 19:32 Arcо#2
Have you tried += 1?
03/15/2010 20:09 .Beatz#3
Quote:
Originally Posted by .Arco View Post
Have you tried += 1?
yes i have tried that xD you suggested it to me. it brings up some errors.
i was wondering if it would work with an else/else if statement?
03/15/2010 20:14 Arcо#4
Quote:
Originally Posted by mattyc2580 View Post
yes i have tried that xD you suggested it to me. it brings up some errors.
i was wondering if it would work with an else/else if statement?
That'd be alot of else if statements lmao.
03/15/2010 20:29 .Beatz#5
Quote:
Originally Posted by .Arco View Post
That'd be alot of else if statements lmao.
yer i know lol but that would only be until i could fix it to use += somehow :) could ya help me with an else if on this code that i have posted here? then i can just implement it into the rest of my code :D
03/15/2010 20:48 Arcо#6
I guess it would be,
if (GC.MyChar.RWProf(new Game.Prof() { ID = 000, Lvl = 1, Exp = 0 }))
{
GC.MyChar.RWProf(new Game.Prof() { ID = 000, Lvl = 2, Exp = 0 })
}
That repeatedly lol
03/15/2010 20:58 .Beatz#7
Quote:
Originally Posted by .Arco View Post
I guess it would be,
if (GC.MyChar.RWProf(new Game.Prof() { ID = 000, Lvl = 1, Exp = 0 }))
{
GC.MyChar.RWProf(new Game.Prof() { ID = 000, Lvl = 2, Exp = 0 })
}
That repeatedly lol
cheers Arco will go try it now.
03/15/2010 21:12 .Beatz#8
Cannot implicitly convert type 'void' to 'bool'

nope that dont work :S comes up with this error ^^^

whoops sorry for the double post
03/16/2010 14:16 .Guru#9
bool is either true or false.. void is just running what's inside the { }.. you're calling a void as a true or false.. post the exact lines you're erroring at..
03/16/2010 16:13 LegalConquer#10
why is it called boxing 0.0 thts the part im stuck on rotflol XD
03/16/2010 18:43 Arcо#11
Quote:
Originally Posted by LegalConquer View Post
why is it called boxing 0.0 thts the part im stuck on rotflol XD
It's an npc raising the boxing prof.
03/17/2010 09:26 LegalConquer#12
Oh now i get it why not just add it to the prof god....
03/18/2010 18:15 .Beatz#13
Quote:
Originally Posted by LegalConquer View Post
Oh now i get it why not just add it to the prof god....
It is the prof god, but only 1 part of it. I am making one like reg CO but using a DB for each lvl not expballs

I dont get errors as such, But if i use += 1 it will error whereas if i use = 1 it will work but only make the prof lvl 1 and wont lvl it up by a lvl.
I have tried many things and nothing is working.
If someone thinks they can fix this i can send the whole code so you can see what i mean :)