Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

inventory system

$
0
0
Hello, I want to make an inventory system but I dont know how should I save it. I am going to use y_ini and I think I can use strings to save it. Is it logical to do it like this?;

Code:

"{13,2},{24,5},{12,7}"
{} represents an item table. first thing in this table is item id, second thing is item quantity. I will define item ids one by one. when you try to add an item to player, it will check this string and if item id exists, it will add 1 to specified item table's second argument. if item id doesn't exists then it will add new item table with 1 quantity. it goes same way with removing items.

I made this logic but I dont know how to do it in pawn. should I use sscanf for strings or what?

Also, would it be efficient to get whole string every time to add new item?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>