--[[
    Item presets to be used globally
]]

presetItems = {

    --[[
        YOUR BASIC ASS ITEMS
    ]]

	["bandage"] = {
		index = 'bandage',
		name = 'Bandage',
		data = {
			weight = 0.4
		},
	},
	["painkillers"] = {
		index = 'painkillers',
		name = 'Pain Killers',
		data = {
			weight = 0.4
		},
	},
	["morphine"] = {
		index = 'morphine',
		name = 'Morphine',
		data = {
			weight = 0.4
		},
	},
	["radio_receiver"] = {
		index = 'radio_receiver',
		name = 'Radio Receiver',
		data = {
			weight = 0.4
		},
	},
	["repair_kit"] = {
		index = 'repair_kit',
		name = 'Repair Kit',
		data = {
			weight = 0.2
		},
	},
	["uncooked_meat"] = {
		index = 'uncooked_meat',
		name = 'Uncooked Meat',
		data = {
			weight = 2
		},
	},
	["cooked_meat"] = {
		index = 'cooked_meat',
		name = 'Cooked Meat',
		data = {
			weight = 0.3
		},
	},
	["minced_meat"] = {
		index = 'minced_meat',
		name = 'Minced Meat',
		data = {
			weight = 0.3
		},
	},
	["dirty_money"] = {
		index = 'dirty_money',
		name = 'Dirty money',
	},
	["beef_jerky"] = {
		index = 'beef_jerky',
		name = 'Beef Jerky',
		data = {
			weight = 0.5
		},
	},
	["cupcake"] = {
		index = 'cupcake',
		name = 'Cupcake',
		data = {
			weight = 0.3
		},
	},
	["burger"] = {
		index = 'burger',
		name = 'Burger Supreme',
		data = {
			weight = 1.5
		},
	},
	["microwave_burrito"] = {
		index = 'microwave_burrito',
		name = 'Microwave Burrito',
		data = {
			weight = 1.5
		},
	},
	["panini"] = {
		index = 'panini',
		name = 'Panini',
		data = {
			weight = 1
		},
	},
	["pepsi"] = {
		index = 'pepsi',
		name = 'Pepsi',
		data = {
			weight = 1
		},
	},
	["pepsi_max"] = {
		index = 'pepsi_max',
		name = 'Pepsi Max',
		data = {
			weight = 1
		},
	},
	["water"] = {
		index = 'water',
		name = 'Water',
		data = {
			weight = 1
		},
	},
	["coffee"] = {
		index = 'coffee',
		name = 'Coffee',
		data = {
			weight = 1
		},
	},
	["drill"] = {
		index = 'drill',
		name = 'Drill',
		data = {
			weight = 15
		},
	},
	["lockpick"] = {
		index = 'lockpick',
		name = 'Lockpick',
		data = {
			weight = 1.5
		},
	},
	["modified_drillbit"] = {
		index = 'modified_drillbit',
		name = 'Modified Drillbit',
		data = {
			weight = 10
		},
	},
	["zipties"] = {
		index = 'zipties',
		name = 'Zip Ties',
		data = {
			weight = 3
		},
	},
	["phone"] = {
		index = 'phone',
		name = 'Phone',
		data = {
			weight = 1
		},
	},
	["2g_weed"] = {
		index = '2g_weed',
		name = '2G Weed',
		data = {
			weight = 2
		},
	},
	["joint"] = {
		index = 'joint',
		name = 'Joint',
		data = {
			weight = 0.6
		},
	},
	["cigarette"] = {
		index = 'cigarette',
		name = 'Cigarette',
		data = {
			weight = 0.6
		},
	},
	["acetone"] = {
		index = 'acetone',
		name = 'Acetone',
		data = {
			weight = 1.5
		},
	},
	["phosphorus"] = {
		index = 'phosphorus',
		name = 'Phosphorus',
		data = {
			weight = 1.5
		},
	},
	["meth_rocks"] = {
		index = 'meth_rocks',
		name = 'Meth Rocks',
		data = {
			weight = 0.6
		},
	},
	["packaged_cocaine"] = {
		index = 'packaged_cocaine',
		name = 'Packaged Cocaine',
		data = {
			weight = 0.3
		},
	},
	["binoculars"] = {
		index = 'binoculars',
		name = 'Binoculars',
		data = {
			weight = 3
		},
	},
	["frozen_fries"] = {
		index = 'frozen_fries',
		name = 'Frozen Fries',
		data = {
			weight = 1
		},
	},
	["fries"] = {
		index = 'fries',
		name = 'Fries',
		data = {
			weight = 1
		},
	},
	["frozen_patty"] = {
		index = 'frozen_patty',
		name = 'Frozen Patty',
		data = {
			weight = 1
		},
	},
	["cooked_patty"] = {
		index = 'cooked_patty',
		name = 'Cooked Patty',
		data = {
			weight = 1
		},
	},
	["burger_bun"] = {
		index = 'burger_bun',
		name = 'Burger Bun',
		data = {
			weight = 1
		},
	},
	["ecola_drink"] = {
		index = 'ecola_drink',
		name = 'eCola',
		data = {
			weight = 1
		},
	},
	["keycard"] = {
		index = 'keycard',
		name = 'Key Card',
		data = {
			weight = 0.6
		},
	},
	["empty_canister"] = {
		index = 'empty_canister',
		name = 'Empty Canister',
		data = {
			weight = 5
		},
	},
	["gas_canister"] = {
		index = 'gas_canister',
		name = 'Gas Canister',
		data = {
			weight = 5
		},
	},
	["vpn1"] = {
		index = 'vpn1',
		name = 'VPN v1.0',
		data = {
			weight = 5
		},
	},
	["vpn2"] = {
		index = 'vpn2',
		name = 'VPN v2.0',
		data = {
			weight = 5
		},
    },

    ['scuba_gear'] = {
        index = 'scuba',
        name = 'Scuba Gear',
        data = {
            weight = 6.0
        },
    },
    --[[
        END YOUR BASIC ASS ITEMS
    ]]

    --[[
        WEAPONS AND AMMO AND ARMOR
    ]]
    ['weapon_stungun'] = {
        index = "weapon_stungun",
        name = "Stun Gun",
        amt = 1,
        customData = {
            weapon = 'true',
            ammo = 0,
            ammotype = 'none',
            quality = 'normal'
        }
    },

    ['weapon_flashlight'] = {
        index = "weapon_flashlight",
        name = "Flashlight",
        amt = 1,
        customData = {
            weapon = 'true',
            ammo = 0,
            ammotype = 'none',
            quality = 'normal'
        }
    },

    ['weapon_flare'] = {
        index = "weapon_flare",
        name = "Flare",
        amt = 1,
        customData = {
            weapon = 'true',
            ammo = 100,
            ammotype = 'none',
            quality = 'normal'
        }
    },

    ['weapon_nightstick'] = {
        index = "weapon_nightstick",
        name = "Nightstick",
        amt = 1,
        customData = {
            weapon = 'true',
            ammo = 0,
            ammotype = 'none',
            quality = 'normal'
        }
    },

    ['weapon_fireextinguisher'] = {
        index = "weapon_fireextinguisher",
        name = "Fire Extinguisher",
        amt = 1,
        customData = {
            weapon = 'true',
            ammo = 200,
            ammotype = 'none',
            quality = 'normal'
        }
    },

    ['weapon_pistol'] = {
        index = "weapon_pistol",
        name = "Pistol",
        amt = 1,
        customData = {
            weapon = 'true',
            ammo = 200,
            ammotype = 'pistol_ammo',
            quality = 'normal'
        }
    },

	['weapon_combatpistol'] = {
        index = "weapon_combatpistol",
        name = "Combat Pistol",
        data = {
            weight = 9,
        },
        customData = {
            weapon = 'true',
            ammo = 200,
            ammotype = 'ammo_pistol',
            quality = 'normal'
        }
	},
	['weapon_smg'] = {
        index = "weapon_smg",
        name = "SMG",
        data = {
            weight = 9,
        },
        customData = {
            weapon = 'true',
            ammo = 200,
            ammotype = 'ammo_smg',
            quality = 'normal'
        }
    },

    ['weapon_pumpshotgun'] = {
        index = "weapon_pumpshotgun",
        name = "Pump Shotgun",
        amt = 1,
        customData = {
            weapon = 'true',
            ammo = 200,
            ammotype = '12gauge_ammo',
            quality = 'normal'
        }
    },
    
    ['weapon_assaultrifle'] = {
        index = "weapon_assaultrifle",
        name = "Assault Rifle",
        amt = 1,
        customData = {
            weapon = 'true',
            ammo = 200,
            ammotype = 'rifle_ammo',
            quality = 'normal'
        }
    },

    ['weapon_carbinerifle'] = {
        index = "weapon_carbinerifle",
        name = "Carbine Rifle",
        amt = 1,
        customData = {
            weapon = 'true',
            ammo = 200,
            ammotype = 'rifle_ammo',
            quality = 'normal'
        }
    },

	['ammo_pistol'] = {
        index = 'ammo_pistol',
        name = "Pistol Ammo",
		data = {
			weight = 5.5
		},
    },
    ['ammo_pistol_large'] = {
        index = 'ammo_pistol_large',
        name = "Large Pistol Ammo",
		data = {
			weight = 8.5
		},
    },
    ['ammo_smg'] = {
        index = 'ammo_smg',
        name = "SMG Ammo",
		data = {
			weight = 5.5
		},
    },
    ['ammo_smg_large'] = {
        index = 'ammo_smg_large',
        name = "Large SMG Ammo",
		data = {
			weight = 8.5
		},
    },
    ['ammo_shotgun'] = {
        index = 'ammo_shotgun',
        name = "Shotgun Ammo",
		data = {
			weight = 6.5
		},
    },
    ['ammo_shotgun_large'] = {
        index = 'ammo_shotgun_large',
        name = "Large Shotgun Ammo",
		data = {
			weight = 9.5
		},
    },
    ['ammo_rifle'] = {
        index = 'ammo_rifle',
        name = "Rifle Ammo",
		data = {
			weight = 6.5
		},
    },
    ['ammo_rifle_large'] = {
        index = 'ammo_rifle_large',
        name = "Large Rifle Ammo",
		data = {
			weight = 9.5
		},
    },
    ['ammo_sniper'] = {
        index = 'ammo_sniper',
        name = "Sniper Ammo",
		data = {
			weight = 6.5
		},
    },
    ['ammo_sniper_large'] = {
        index = 'ammo_sniper_large',
        name = "Large Sniper Ammo",
		data = {
			weight = 9.5
		},
    },

    ['armor'] = {
        index = 'armor',
        name = "Kevlar",
		data = {
			weight = 13.5
		},
    },

    --[[
        END WEAPONS AND AMMO AND ARMOR
    ]]


}


--[[
    Begin Functions
]]

function fsn_itemStock()
    return presetItems
end

--[[
    End Functions
]]

--[[
    Begin Events
]]

RegisterServerEvent('fsn_inventory:sendItems')
AddEventHandler('fsn_inventory:sendItems', function(source)
	print('^5Sending presetItems over to cl_presets^0')
	TriggerClientEvent('fsn_inventory:recieveItems', -1, presetItems)
end)

RegisterNetEvent('fsn_inventory:sendItemsToStore')
AddEventHandler('fsn_inventory:sendItemsToStore', function()
	print('^6Sending the pesky items to the store^0')
    TriggerEvent('fsn_store:recieveItemsForStore', presetItems)
end)

RegisterNetEvent('fsn_inventory:sendItemsToArmory')
AddEventHandler('fsn_inventory:sendItemsToArmory', function()
	print('^6Sending the pesky items to the police armory^0')
    TriggerEvent('fsn_police:armory:recieveItemsForArmory', presetItems)
end)

--[[
AddEventHandler('onResourceStart', function(resourceName)
    if (GetCurrentResourceName() ~= resourceName) then
        return
	end
	print('^5' .. resourceName .. ' has started. Requesting presetsItems for clients^0')
	--sendItems(presetItems)
	--TriggerEvent('fsn_inventory:sendItems')
end)
]]
--[[
    End Events
]]