Inventory system (MySQL based)
#1

- found problem -
Reply
#2

Would this work?
pawn Code:
AddPlayerItem(playerid, listitem+1);
Under
pawn Code:
case DIALOG_ITEMS:
        {
            if(!response)return false;
            else
            {
                AddPlayerItem(playerid, listitem+1); //here
            }
        }
Reply
#3

Quote:
Originally Posted by Deduction
View Post
Would this work?
pawn Code:
AddPlayerItem(playerid, listitem+1);
Under
pawn Code:
case DIALOG_ITEMS:
        {
            if(!response)return false;
            else
            {
                AddPlayerItem(playerid, listitem+1); //here
            }
        }
It won't it's gonna mess the whole thing, when you gonna try to pick up objects in different order than sequence (I mean like, line by line). Maybe there's a way to avoid counting from 1 UID? I need help, damn.
Reply
#4

So start from 0 ? xd or use listitem+1 ?
Reply
#5

You can't use listitem+1 because, it's messing the whole thing, it doesn't work, I tested it out yesterday already. And how do I count from 0, if it starts from 1. That's the problem. Maybe there's other way to do it, I checked other Inventory systems, but they're working different way.
Reply
#6

So your problem here is to do with listitem starting at 0.
And the objects start at 1, so theres no object at 0.
listitem+1 would work here.
Since, if you chose the first list item it would be 0+1=1.
Then second list item would be 1+1=2.
Get what I am saying?
So how it stuffs things up has me completely confused.
Reply
#7

Well, imagine like I've got three objects in my GUI and I want to pick up the third one, it's gonna be 3, and you're right, but the previous one, gonna mess up. It's really hard to explain, but what can I say, it doesn't work. Listitem always should start from '0' number. I might do some changes, but I need some ideas, if someone has some. Maybe other way doing it with MySQL support?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)