Hello!
I'm so f*king nervous because I'm trying to make the In-App-Purchases work. I have a Kismet node for it, but when I press the "buy" button it crashes the game.
Here's the code for the kismet node:
If anybody could help me, or anybody could write a step-by-step tutorial...I swear I'll pay him a lot of money! NO JOKE!
PLEASE HELP ME!!!!
I'm so f*king nervous because I'm trying to make the In-App-Purchases work. I have a Kismet node for it, but when I press the "buy" button it crashes the game.
Here's the code for the kismet node:
Code:
class SeqAct_MicroTrans extends SequenceAction; var MicroTransactionBase MicroTrans; var int IsHidden[2]; var bool isHiddenOne; var bool isHiddenTwo; event Activated() { OnInit(); CheckHidden(); if (InputLinks[0].bHasImpulse) // Refresh { MicroTrans.QueryForAvailablePurchases(); CheckHidden(); } else if (InputLinks[1].bHasImpulse) // Product 1 { MicroTrans.BeginPurchase(0); } else if (InputLinks[2].bHasImpulse) // Product 2 { MicroTrans.BeginPurchase(1); } MicroTrans.ClearDelegate(MTD_PurchaseQueryComplete, OnProductQueryComplete); MicroTrans.ClearDelegate(MTD_PurchaseComplete, OnProductPurchaseComplete); //PC.SaveVariables(); } function OnInit() { MicroTrans = class'PlatformInterfaceBase'.static.GetMicroTransactionInterface(); MicroTrans.AddDelegate(MTD_PurchaseQueryComplete, OnProductQueryComplete); MicroTrans.AddDelegate(MTD_PurchaseComplete, OnProductPurchaseComplete); } function CheckHidden() { if(isHiddenOne == true) { ActivateOutputLink(0); } if(isHiddenTwo == true) { ActivateOutputLink(0); } } function OnProductQueryComplete(const out PlatformInterfaceDelegateResult Result) { local int Index; local PurchaseInfo Info; for (Index = 0; Index < MicroTrans.AvailableProducts.length; Index++) { Info = MicroTrans.AvailableProducts[Index]; if (Index < 2) { IsHidden[Index] = 0; } isHiddenOne = bool(IsHidden[0]); isHiddenTwo = bool(IsHidden[1]); `log("Purchase " $ Index $ ":"); `log(" " $ Info.Identifier $ " - " $ Info.DisplayName $ " / " $ Info.DisplayPrice $ " - " $ Info.DisplayDescription); } } function OnProductPurchaseComplete(const out PlatformInterfaceDelegateResult Result) { `log("Purchase complete:"); `log(" Product = " $ Result.Data.StringValue); `log(" bSuccess = " $ Result.bSuccessful); `log(" Result = " $ Result.Data.IntValue); if (Result.Data.IntValue == MTR_Failed) { `log(" Error: " $ MicroTrans.LastError); `log(" Solution: " $ MicroTrans.LastErrorSolution); ActivateOutputLink(2); // Failed } else { ActivateOutputLink(1); // Successful } } defaultproperties { ObjName="In App Purchases" ObjCategory="Sim" InputLinks(0)=(LinkDesc="Refresh") InputLinks(1)=(LinkDesc="Product 1") InputLinks(2)=(LinkDesc="Product 2") OutputLinks(0)=(LinkDesc="Hide") OutputLinks(1)=(LinkDesc="Successful") OutputLinks(2)=(LinkDesc="Failure") }
PLEASE HELP ME!!!!
Comment