[Assistance] coding

06/24/2011 18:23 Jay10291#1
from 12tails 5361 source

if (client.Inventory.Contains(700011, 15))
{
client.Inventory.Remove(700011, 15);
Checks and takes 15 "700011"(ndragongem) from inventory ...now how can I add 1 "700012"(rdragongem) to the inventory?
I just want the line of code to add shit cause idk it, and theres no good reference in the source.
06/24/2011 20:45 zTek#2
Have you even tried searching the source? Look in the UseItems and find DBScroll, there should be an example to add item in there.
06/24/2011 20:46 _DreadNought_#3
Gee I dunno.

If remove is
Code:
client.Inventory.Remove
Try
Code:
client.Inventory.Add
06/27/2011 05:27 Jay10291#4
@dreadnought
Gee I dunno.
Maybe I already tried that

@zTek
At first I simply added
Quote:
client.Inventory.Add(700012, 1);
under
Quote:
client.Inventory.Remove(700011, 15);
That was a no brainer but surprisingly it didnt work and the error was no help. But all I needed to do to get it to work was add in "0" for some reason.
Quote:
client.Inventory.Add(700012, 0, 1);
What does the 0 represent? :S
06/27/2011 09:26 Santa#5
Right click on "add" and click on "Go To Definition." That will be a lot of help for you im sure.
06/27/2011 09:51 Jay10291#6
@StarBucks
Yeah it was, appreciate it.

@angelius
And yeah, I did try that.. I just didnt know I was missing a value.