Inventory system (MySQL based) -
Riddick94 - 17.12.2013
- found problem -
Re: Inventory system (MySQL based) -
Deduction - 17.12.2013
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
}
}
Re: Inventory system (MySQL based) -
Riddick94 - 17.12.2013
Quote:
Originally Posted by Deduction
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.
Re: Inventory system (MySQL based) -
Jefff - 17.12.2013
So start from 0 ? xd or use listitem+1 ?
Re: Inventory system (MySQL based) -
Riddick94 - 17.12.2013
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.
Re: Inventory system (MySQL based) -
Deduction - 17.12.2013
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.
Re: Inventory system (MySQL based) -
Riddick94 - 17.12.2013
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?