28.07.2016, 05:42
I am creating items system, every people have items which they can use (eg. m4,pizza,driving licence etc).
when somebody choose some item from dialog, for example it is m4.
i check witch category is this item, because it is weapons category i know i have to give player weapon (for example for food i restore player's health)
Next i check the type, so i know it is m4 and send message that he is using m4 (name) and set item "InUse".
I have to know id of item to update it in database.
Код:
enum e_Przedmioty { ID, // id of item Nazwa[34], // name of item (like "Deasert Eagle") Kategoria, // category (weapons,drugs etc) Typ, (type - for example weapon id) War[100], (description, for example description of id card is "John Smith born 1993") Miejsce, // owner id InUse // is in use };
i check witch category is this item, because it is weapons category i know i have to give player weapon (for example for food i restore player's health)
Next i check the type, so i know it is m4 and send message that he is using m4 (name) and set item "InUse".
I have to know id of item to update it in database.