Sign in to follow this  
Overcrash

Inventory System

Recommended Posts

20 minutes ago, Robson said:

Its pretty easy: make it yourself

If it was easy for him he wouldn’t be sitting here making this thread.

OP you need to think about the system, how will you create items, how will your server know who holds what, how will you be able to give someone an item and add it to their inventory. This isn’t a simple thing someone can quickly write up for you. Learning how to do things yourself is a great way to learn and posting here or in discord for assistance with your code is how you can get better assistance

Share this post


Link to post
Share on other sites


namespace rp.model
{
    public class InventoryModel
    {
        public int id { get; set; }
        public String hash { get; set; }
        public String description { get; set; }
        public int type { get; set; }
        public int amount { get; set; }
    }
}
 

Quote

 

model item 

using GTANetworkAPI;
using System;

namespace rp.model
{
    public class ItemModel
    {
        public int id { get; set; }
        public String hash { get; set; }
        public String ownerEntity { get; set; }
        public int ownerIdentifier { get; set; }
        public int amount { get; set; }
        public Vector3 position { get; set; }
        public uint dimension { get; set; }
        public GTANetworkAPI.Object objectHandle { get; set; }

        public ItemModel Copy()
        {
            ItemModel itemModel = new ItemModel();
            itemModel.id = id;
            itemModel.hash = hash;
            itemModel.ownerEntity = ownerEntity;
            itemModel.ownerIdentifier = ownerIdentifier;
            itemModel.amount = amount;
            itemModel.position = position;
            itemModel.dimension = dimension;
            itemModel.objectHandle = objectHandle;
            return itemModel;
        }
    }
}

 

 

Edited by Overcrash
  • Mask 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.