Am i doing something wrong?

Discussion in 'Empyrion API' started by Nyfaria, Jul 22, 2017.

  1. Nyfaria

    Nyfaria Ensign

    Joined:
    Feb 12, 2017
    Messages:
    14
    Likes Received:
    0
    So I am making a Command in my Mod to give something to a player when they say something in chat, but it seems to not be working.
    Code:
    if (stats.msg.ToUpper() == "CU:GETSOME")
                            {
                                ItemStack[] ExchangeItems =  { new ItemStack(411,999), new ItemStack(402,999) };
                               
                               GameAPI.Game_Request(CmdId.Request_Player_ItemExchange, (ushort)CmdId.Request_Player_ItemExchange, new ItemExchangeInfo(stats.playerId, "Gimme Stuff", "Because I said so!", "Here Ya Go", ExchangeItems));
    
    
                           }
    
     
    #1
  2. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    try this? I'm no programmer but this isn't showing any errors when i type it in to Visual Studio
    Code:
    ItemStack[] EchangeItems = new ItemStack[] 
                {
                    new ItemStack(411,999),
                    new ItemStack(402,999),
                }
    
     
    #2
  3. Nyfaria

    Nyfaria Ensign

    Joined:
    Feb 12, 2017
    Messages:
    14
    Likes Received:
    0
    you have one too many commas, but this is pretty much the same as what i have, it was my stats.playerId that wasn't working properly, thanks for trying though =)
     
    #3

Share This Page