Jump to content

Inventory System


Overcrash

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

Link to comment
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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...