Forum C# A little help please?

A little help please?

Postby 12345hassan » December 2nd, 2017, 10:17 am

Hello, i get error in C# so can someone help me?
the code:

player.PayVault.Refresh(delegate()
{
player.PayVault.Give(new BuyItemInfo[]{
new BuyItemInfo("darkwizardhat" && "darkwizardshoes" && "darkwizardbeard")
}, delegate()
{
player.Send("Unpacked");
});


the error i get
operator && cannot be applied to operands of type 'string' and 'string'
soooo wt should i use instead "&&"
12345hassan
 
Posts: 44
Joined: August 5th, 2016, 11:40 am

Re: A little help please?

Postby Henrik » December 6th, 2017, 4:58 am

Give takes an array of BuyItemInfo, and each BuyItemInfo represents a single item. So if you want to give three items, you need to write it like this:

Code: Select all
player.PayVault.Give(new BuyItemInfo[]{
    new BuyItemInfo("darkwizardhat"),
    new BuyItemInfo("darkwizardshoes"),
    new BuyItemInfo("darkwizardbeard")
});
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: A little help please?

Postby 12345hassan » December 7th, 2017, 11:23 am

Thanks a lot :)
12345hassan
 
Posts: 44
Joined: August 5th, 2016, 11:40 am


Return to C#