Original Tutorial Mysterious BOX - Credits in post
http://forum.ragezone.com/f790/relea...=similar+crate
Origianal Tutorial Buy itens quantity - Credits in post
http://forum.ragezone.com/f790/relea...place-1087620/
Sorry my bad english, i use google translate
By adding the function to purchase items in quantity the mysterious boxes stopped working. This easy FIX is to correct that and allow to buy in quantity and have the mysterious boxes.
In warz.sln
Search for:
Code:int apiCode = gUserProfile.ApiLootBoxBuy(This->mStore_BuyItemID, buyIdx);
Add section in red
Code:int apiCode = gUserProfile.ApiLootBoxBuy(This->mStore_BuyItemID, buyIdx, This->mStore_BuyQuantity);
Now search for:
Code:void FrontendWarZ::eventBuyItem(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount) { mStore_BuyItemID = args[0].GetUInt(); // legsID mStore_BuyPrice = args[1].GetInt(); mStore_BuyPriceGD = args[2].GetInt(); //mStore_BuyPriceSC = args[3].GetInt();
add section in red
Code:void FrontendWarZ::eventBuyItem(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount) { mStore_BuyItemID = args[0].GetUInt(); // legsID mStore_BuyPrice = args[1].GetInt(); mStore_BuyPriceGD = args[2].GetInt(); //mStore_BuyPriceSC = args[3].GetInt(); mStore_BuyQuantity = args[3].GetInt(); // Fix By Jailson mendes mStore_BuyPrice *= mStore_BuyQuantity; // Fix By Jailson mendes mStore_BuyPriceGD *= mStore_BuyQuantity; // Fix By Jailson mendes
Is now in data base...
Opem navicat and replace or create new function
Download API FIXED! Buy Box misteryousCode:CREATE PROCEDURE [dbo].[FN_AddItemToUserCase] @in_CustomerID int, @in_ItemID int, @in_ExpDays int, @in_Qty int AS BEGIN SET NOCOUNT ON; select 0 as ResultCode select @in_ItemID as ItemID declare @inventoryID bigint = 0 declare @LeasedUntil datetime declare @CurDate datetime = GETDATE() -- check if this is stackable item, if so - get buying stack size. -- stackable item defined where NumClips>0, Quantity is ClipSize declare @BuyStackSize int = 1 select @BuyStackSize=ClipSize from Items_Weapons where ItemID=@in_ItemID and NumClips>0 -- see if we already have that item in inventory without modification vars select @inventoryID=InventoryID, @LeasedUntil=LeasedUntil from UsersInventory where (CustomerID=@in_CustomerID and CharID=0 and ItemID=@in_ItemID and Var1<0 and Var2<0 and Var3=10000000) if @inventoryID = 0) begin INSERT INTO UsersInventory ( CustomerID, CharID, ItemID, LeasedUntil, Quantity ) VALUES ( @in_CustomerID, 0, @in_ItemID, DATEADD(day, @in_ExpDays, @CurDate), @BuyStackSize ) return end if @LeasedUntil < @CurDate) set @LeasedUntil = DATEADD(day, @in_ExpDays, @CurDate) else set @LeasedUntil = DATEADD(day, @in_ExpDays, @LeasedUntil) if @LeasedUntil > '2020-1-1') set @LeasedUntil = '2020-1-1' -- all items is stackable by default UPDATE UsersInventory SET LeasedUntil= @LeasedUntil, Quantity=(Quantity+@BuyStackSize) WHERE InventoryID = @inventoryID return END
api_MysteryBox
Note: A remark made by buying the box, buy a box at a time if more than one unit will tell only one.
Credits fix it's me and others credits in originals posts.
Byebye !!!



Reply With Quote![[Tutorial] Easy FIX Buy Mysterious BOX + Buy Item quantity](http://ragezone.com/hyper728.png)


