Inventory system -- help please
#1

Hello !

I would like to write a simple inventory system, but do not know where to start.
I tried to do something on the basis of
Код:
if (pinfo [playerid] [Helmet] == 1)
, but have married out of this bunch of code.
Please enter me in the right direction or send me a simple inventory system on y_ini


Sorry for my english
Reply
#2

you really mean "inventory"? 'cause I really can't get anything into my mind why you would need a helmet for inventory... try explaining us a bit more what the system should do
Reply
#3

Well first you need items that will be able to be stored in your inventory? Cigarettes, fuel can? some drinks?
Then make /inventory command that will display if you have anything in your inventory sure use veriables for that and so on The biggest help for this will be if you search for already scripted inventory system check it and learn from it, try to make your own system then good luck.
Reply
#4

Well I guess you could make an inventory by doing this

just try this
Код:
CMD:inventory(playerid, params[])
{
	if(Inventory[playerid][366] == 1) //Baseball bat
	{
		new Float:X,
			Float:Y,
			Float:Z;

		GetPlayerPos(playerid, X, Y, Z);
		CreateObject(366, X, Y, Z, 90, 0, 0);
	}
	else return (playerid, Red, "You do not have this item");
}
Or you could use some sort of dialog system where it gets all of the items in your inv, then shows them so you can click on it and then create it? idk but as you can see from that it is very simple and not that detailed but good look anyway
Reply
#5

Set your variables to different values when they're in the inventory.

pawn Код:
pinfo[playerid][Helmet] = 0; // doesn't have a helmet
pinfo[playerid][Helmet] = 1; // has a stored helmet
pinfo[playerid][Helmet] = 2; // is wearing a helmet
Reply
#6

Thanks but that's not what I meant.

The more I need a function that will read the object id, name and amount.
In addition, when you type the command /p player to display the GUI with their objects.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)