#C Question!!

07/14/2009 09:52 imported_spitt_fire911#1
Ok well im dun asking for stuff i want im going to learn #c and stop being a damn lazy nub.... Ok i looked at some guides... and did i do this correct?

Code:
#region TEST NCP
                case 10008://TEST
                    if (LinkBack == 0)
                    {
                        Text("Would you like to buy a DB for 100CPs?", CSocket);
                        Link("Sure, I guess", 1, CSocket);
                        Link("No Thanks", 255, CSocket);
                        End(CSocket);
                    }
                    else if (LinkBack == 1)
                    {
                        if (CSocket.Client.CPs >= 100)
                        {
                                CPs(-100, CSocket);
                                AddItem(1088000, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                        }
                        else
                        {
                            Text("Im sorry you do not have the required amount of cps", CSocket);
                            Link("Okay", 255, CSocket);
                            End(CSocket);
                        }
                    break;
                    }
            
#endregion
If i did not can u help me correct it? Its a nub NPC.. but it will give me the point how to use link,end,text.. and CSocket.. and Link Back...
07/14/2009 11:00 xellios#2
It's fine if you want i can teach you some;)
07/14/2009 15:30 n0mansland#3
Didn't you test it before you put it on here? Are you getting errors or something? The code is perfectly fine as xellios said. (It's C# not #C, typo?)
07/14/2009 15:35 tanelipe#4
You could change the place of the last } and the break; so it'd look like this or similar:

PHP Code:
    } break; 
07/14/2009 17:29 alexbigfoot#5
[QUOTE=imported_spitt_fire911;2555848]
Code:
#region TEST NCP
                case 10008://TEST
                    if (LinkBack == 0)
                    {
                       //
                    }
                    else if (LinkBack == 1)
                    {
                        //
                   
                    }
                   [B] break;[/B]
#endregion