09.09.2013, 22:38
Make a item type definition include for example.....
This is from my DayZ script it defines items.
Now you can reference item types by using the #define names 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 }
};
pawn Код:
if(PlayerItems[playerid][ItemType][ItemSlot] == ITEM_TYPE_MEDKIT) { SetPlayerHealth(playerid, 100.0); }