[HELP] 'SecurityLog' when IDENTITY_INSERT is set to OFF
https://image.ibb.co/fbL7Va/asdasd.png
Sandbag barricade okay but range finder error
Code:
WO_API: failed with error code 5 SQL Select Failed: Cannot insert explicit value for identity column in table 'SecurityLog' when IDENTITY_INSERT is set to OFF.
BuyItem FAILED, code: 5
FN_IsItemStackable
Code:
USE [WarZ]
GO
/****** Object: StoredProcedure [dbo].[FN_IsItemStackable] Script Date: 03/15/2017 22:17:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[FN_IsItemStackable]
@in_ItemID int,
@in_movingToGI int
AS
BEGIN
SET NOCOUNT ON;
-- find item category
declare @CaTegory int = 0
declare @WpnAttachType int = 0
if(@in_ItemID >= 20000 and @in_ItemID < 99999)
SELECT @CaTegory=Category FROM Items_Gear where ItemID=@in_ItemID
else
if(@in_ItemID >= 100000 and @in_ItemID < 190000)
SELECT @CaTegory=Category FROM Items_Weapons where ItemID=@in_ItemID
else
if(@in_ItemID >= 300000 and @in_ItemID < 390000)
SELECT @CaTegory=Category FROM Items_Generic where ItemID=@in_ItemID
else
if(@in_ItemID >= 400000 and @in_ItemID < 490000)
SELECT @CaTegory=Category, @WpnAttachType=Type FROM Items_Attachments where ItemID=@in_ItemID
-- everything except weapons is stackable in GI
if(@in_movingToGI > 0)
begin
-- itm->category >= storecat_ASR && itm->category <= storecat_SMG
--if @CaTegory >= 20 and @CaTegory <= 26)
-- return 0
return 1
end
--
-- moving to backpack
--
-- case storecat_FPSAttachment and WPN_ATTM_CLIP
if @CaTegory = 19 and @WpnAttachType = 4) return 1
-- case storecat_UsableItem:
if @CaTegory = 28) return 1
-- case storecat_Food:
if @CaTegory = 30) return 1
-- case storecat_Water:
if @CaTegory = 33) return 1
-- case storecat_GRENADE:
if @CaTegory = 27) return 1
-- case storecat_Components:
if @CaTegory = 50) return 1
-- case storecat_CraftRecipe:
if @CaTegory = 51) return 1
return 0
END
WZ_BuyItemFN_GetPrice
Code:
USE [WarZ]
GO
/****** Object: StoredProcedure [dbo].[WZ_BuyItemFN_GetPrice] Script Date: 03/15/2017 22:18:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[WZ_BuyItemFN_GetPrice]
@Out_FNResult int out,
@in_ItemId int,
@in_BuyDays int,
@in_Currency varchar(32),
@o_FinalPrice int out
AS
BEGIN
SET NOCOUNT ON;
--
-- get prices from table based on itemID
--
declare @price1 int = 0
declare @price7 int = 0
declare @price30 int = 0
declare @priceP int = 0
declare @GPrice1 int = 0
declare @GPrice7 int = 0
declare @GPrice30 int = 0
declare @GPriceP int = 0
declare @IsEnabled int = 1
if(@in_ItemId >= 20000 and @in_ItemId < 99999)
SELECT
@price1=Price1, @price7=Price7, @price30=Price30, @priceP=PriceP,
@GPrice1=GPrice1, @GPrice7=GPrice7, @GPrice30=GPrice30, @GPriceP=GPriceP
FROM Items_Gear where ItemID=@in_ItemID
else
if(@in_ItemId >= 100000 and @in_ItemId < 190000)
SELECT
@price1=Price1, @price7=Price7, @price30=Price30, @priceP=PriceP,
@GPrice1=GPrice1, @GPrice7=GPrice7, @GPrice30=GPrice30, @GPriceP=GPriceP
FROM Items_Weapons where ItemID=@in_ItemID
else
if(@in_ItemId >= 300000 and @in_ItemId < 390000)
SELECT
@price1=Price1, @price7=Price7, @price30=Price30, @priceP=PriceP,
@GPrice1=GPrice1, @GPrice7=GPrice7, @GPrice30=GPrice30, @GPriceP=GPriceP
FROM Items_Generic where ItemID=@in_ItemID
else
if(@in_ItemId >= 400000 and @in_ItemId < 490000)
SELECT
@price1=Price1, @price7=Price7, @price30=Price30, @priceP=PriceP,
@GPrice1=GPrice1, @GPrice7=GPrice7, @GPrice30=GPrice30, @GPriceP=GPriceP
FROM Items_Attachments where ItemID=@in_ItemID
else
begin
set @Out_FNResult = 1
return
end
if (@@RowCount = 0) begin
set @Out_FNResult = 2
return
end
if(@in_Currency = 'GP' and @in_BuyDays = 1) set @o_FinalPrice = @price1
else if(@in_Currency = 'GP' and @in_BuyDays = 7) set @o_FinalPrice = @price7
else if(@in_Currency = 'GP' and @in_BuyDays = 30) set @o_FinalPrice = @price30
else if(@in_Currency = 'GP' and @in_BuyDays = 2000) set @o_FinalPrice = @priceP
else if(@in_Currency = 'GD' and @in_BuyDays = 1) set @o_FinalPrice = @GPrice1
else if(@in_Currency = 'GD' and @in_BuyDays = 7) set @o_FinalPrice = @GPrice7
else if(@in_Currency = 'GD' and @in_BuyDays = 30) set @o_FinalPrice = @GPrice30
else if(@in_Currency = 'GD' and @in_BuyDays = 2000) set @o_FinalPrice = @GPriceP
else begin
set @Out_FNResult = 3
return
end
-- check if listed
if(@o_FinalPrice <= 0 or @IsEnabled = 0) begin
set @Out_FNResult = 4
return
end
set @Out_FNResult = 0
END
Re: [HELP] 'SecurityLog' when IDENTITY_INSERT is set to OFF
Re: [HELP] 'SecurityLog' when IDENTITY_INSERT is set to OFF
A banal mistake, you do not have an ID for a thing.As you see, each section has its own IDFor Barecade and Binocular choose from this category :thumbup1:
FROM Items_Weapons where ItemID=@in_ItemID
Re: [HELP] 'SecurityLog' when IDENTITY_INSERT is set to OFF
Quote:
Originally Posted by
Naoki Seiichi
A banal mistake, you do not have an ID for a thing.As you see, each section has its own IDFor Barecade and Binocular choose from this category :thumbup1:
FROM Items_Weapons where ItemID=@in_ItemID
What about news weapon add how to fix my problem ?