Question about IDs
#2

Make a item type definition include for example.....

This is from my DayZ script it defines items.

pawn Код:
#define ITEM_TYPE_NONE 0
#define ITEM_TYPE_MEDKIT 1
#define ITEM_TYPE_BLOODBAG 1
#define ITEM_TYPE_PAINKILLERS 1

enum ItemSpawnData {
    Float:ItemSpawnOffsetX,
    Float:ItemSpawnOffsetY,
    Float:ItemSpawnOffsetZ,
    Float:ItemSpawnRX,
    Float:ItemSpawnRY,
    Float:ItemSpawnRZ,
    ItemModelid,
    ItemTexture,
    ItemNewColor,
    ItemVW,
    ItemInt,
    ItemType
}

enum LOOTDATA { LootType, LootAmount, LootRarity }

#define         RARITY_LEVEL_2          2
#define         RARITY_LEVEL_3          3
#define         RARITY_LEVEL_4          4
#define         RARITY_LEVEL_5          5
#define         RARITY_LEVEL_6          6
#define         RARITY_LEVEL_7          7
#define         RARITY_LEVEL_8          8
#define         RARITY_LEVEL_9          9

stock const ItemSpawnInfo[][ItemSpawnData] = {

    // Items
    { 0.000000, 0.000000, -1.039999, 0.000000, 0.000000, 0.000000, 1575, 291, 0, 0, 0, ITEM_TYPE_MEDKIT },
    { 0.000000, 0.000000, -0.970000, 0.000000, 0.000000, 0.000000, 1580, 213, 0, 0, 0, ITEM_TYPE_BLOODBAG },
    { 0.000000, 0.000000, -0.850000, 0.000000, 0.000000, 0.000000, 2709, 299, 0, 0, 0, ITEM_TYPE_PAINKILLERS }
};
Now you can reference item types by using the #define names example....
pawn Код:
if(PlayerItems[playerid][ItemType][ItemSlot] == ITEM_TYPE_MEDKIT) { SetPlayerHealth(playerid, 100.0); }
Reply


Messages In This Thread
Question about IDs - by Kreatyve - 09.09.2013, 22:28
Re: Question about IDs - by Pottus - 09.09.2013, 22:38
Re: Question about IDs - by Kreatyve - 09.09.2013, 22:39
Re: Question about IDs - by Pottus - 09.09.2013, 22:41
Re: Question about IDs - by Kreatyve - 09.09.2013, 22:48
Re: Question about IDs - by Vince - 10.09.2013, 00:00
Re: Question about IDs - by Kreatyve - 10.09.2013, 02:51

Forum Jump:


Users browsing this thread: 1 Guest(s)