-- Context Server 
-- Gives a loadout to a player based on the loadout name
-- @param Player player
-- @param String loadoutName

function APILoadout.GiveLoadout(player,loadoutName)
	
	-- Remove all weapons from the player
	APIEquipment.RemoveWeapons(player)
	
	local loadoutData = APILoadout.GetLoadoutFromName(loadoutName)
	
	local primaryName = loadoutData.PrimaryEquipment
	local secondaryName = loadoutData.SecondaryEquipment
	local tertiaryName = loadoutData.TertiaryEquipment
	
	-- Give the equipment to the player
	APIEquipment.GiveWeapon(player,primaryName,true)	
	APIEquipment.GiveWeapon(player,secondaryName,false)	
	APIEquipment.GiveWeapon(player,tertiaryName,false)	
end


return APILoadout
