Advertisement
bombillo

Case System #2

Dec 13th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.20 KB | None | 0 0
  1. void FrontendWarZ::eventBuyItem(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
  2. {
  3.     mStore_BuyItemID    = args[0].GetUInt(); // legsID
  4.     mStore_BuyPrice        = args[1].GetInt();
  5.     mStore_BuyPriceGD    = args[2].GetInt();
  6.     //mStore_BuyPriceSC    = args[3].GetInt();
  7.  
  8.  
  9.     if(gUserProfile.ProfileData.GameDollars < mStore_BuyPriceGD || gUserProfile.ProfileData.GamePoints < mStore_BuyPrice /*|| gUserProfile.ProfileData.GameCells < mStore_BuyPriceSC*/)
  10.     {
  11.         Scaleform::GFx::Value var[2];
  12.         var[0].SetString(gLangMngr.getString("NotEnougMoneyToBuyItem"));
  13.         var[1].SetBoolean(true);
  14.         gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
  15.         return;
  16.     }
  17.  
  18.  
  19.     const BaseItemConfig* itemConfig = g_pWeaponArmory->getAccountItemConfig(mStore_BuyItemID);
  20.     if(itemConfig && itemConfig->category == storecat_LootBox)
  21.     {
  22.         if(gUserProfile.haveFreeInventorySlot(false) == false)
  23.         {
  24.             Scaleform::GFx::Value var[2];
  25.             var[0].SetString(gLangMngr.getString("InGameUI_ErrorMsg_NoInventorySpace"));
  26.             var[1].SetBoolean(true);
  27.             gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
  28.             return;
  29.         }
  30.  
  31.  
  32.         Scaleform::GFx::Value var[2];
  33.         var[0].SetString(gLangMngr.getString("OneMomentPlease"));
  34.         var[1].SetBoolean(false);
  35.         gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
  36.  
  37.  
  38.         StartAsyncOperation(&FrontendWarZ::as_BuyLootBoxThread, &FrontendWarZ::OnBuyLootBoxSuccess);
  39.     }
  40.     else
  41.     {        
  42.         if(gUserProfile.haveFreeInventorySlot(false) == false)
  43.         {
  44.             Scaleform::GFx::Value var[2];
  45.             var[0].SetString(gLangMngr.getString("InGameUI_ErrorMsg_NoInventorySpace"));
  46.             var[1].SetBoolean(true);
  47.             gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
  48.             return;
  49.         }
  50.  
  51.  
  52.         Scaleform::GFx::Value var[2];
  53.         var[0].SetString(gLangMngr.getString("OneMomentPlease"));
  54.         var[1].SetBoolean(false);
  55.         gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
  56.  
  57.  
  58.         StartAsyncOperation(&FrontendWarZ::as_BuyItemThread, &FrontendWarZ::OnBuyItemSuccess);
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement