Bag system help
#8

This would be more easier if you would have an array instead of a simple variable. For example:

pawn Код:
new pBagSlot[5];
In this case, it is possible to loop through all of the bag slots, this would probably improve some (or maybe all of your current) functions and would open more abbilities in future coding. Not to mention that a dynamic system like this should be coded following these basics. (Just pointing out if you are going to create something in near future)

pawn Код:
stock addItemToBag(playerid, itemid) {
   for (new i = 0; i < 5; i++) {
       if (pBagSlot[i] != 0) continue;

       pBagSlot[i] = itemid;
   }
}
Isnt this easier?

After all, its just a free advice.
Reply


Messages In This Thread
Bag system help - by sim_sima - 18.10.2011, 18:27
Re: Bag system help - by sim_sima - 19.10.2011, 11:10
Re: Bag system help - by sim_sima - 23.10.2011, 10:57
Re: Bag system help - by Zonoya - 23.10.2011, 11:12
Re: Bag system help - by sim_sima - 23.10.2011, 11:27
Re: Bag system help - by MrVicky - 09.04.2013, 18:09
Re: Bag system help - by sim_sima - 09.04.2013, 18:35
Re: Bag system help - by Universal - 09.04.2013, 20:12
Re: Bag system help - by MrVicky - 09.04.2013, 20:53
Re: Bag system help - by MrVicky - 11.04.2013, 15:23

Forum Jump:


Users browsing this thread: 1 Guest(s)