SHARE
TWEET

Untitled

a guest May 21st, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void SetViewModelSequence2(const SDK::CRecvProxyData *pDataConst, void *pStruct, void *pOut)
  2. {
  3.  
  4.     // Make the incoming data editable.
  5.     SDK::CRecvProxyData* pData = const_cast<SDK::CRecvProxyData*>(pDataConst);
  6.  
  7.     // Confirm that we are replacing our view model and not someone elses.
  8.     SDK::CBaseViewModel* pViewModel = static_cast<SDK::CBaseViewModel*>(pStruct);
  9.  
  10.     if (pViewModel)
  11.     {
  12.         SDK::CBaseEntity* pOwner = static_cast<SDK::CBaseEntity*>(INTERFACES::ClientEntityList->GetClientEntity(pViewModel->GetOwner() & 0xFFF));
  13.  
  14.         // Compare the owner entity of this view model to the local player entity.
  15.         if (pOwner && pOwner->GetIndex() == INTERFACES::Engine->GetLocalPlayer())
  16.         {
  17.             // Get the filename of the current view model.
  18.             std::string szModel = INTERFACES::ModelInfo->GetModelName(INTERFACES::ModelInfo->GetModel(pViewModel->GetModelIndex()));
  19.  
  20.             // Store the current sequence.
  21.             int m_nSequence = pData->m_Value.m_Int;
  22.             if (szModel == "models/weapons/v_knife_butterfly.mdl")
  23.             {
  24.                 // Fix animations for the Butterfly Knife.
  25.                 switch (m_nSequence)
  26.                 {
  27.                 case SEQUENCE_DEFAULT_DRAW:
  28.                     m_nSequence = RandomInt(SEQUENCE_BUTTERFLY_DRAW, SEQUENCE_BUTTERFLY_DRAW2);
  29.                     break;
  30.                 case SEQUENCE_DEFAULT_LOOKAT01:
  31.                     m_nSequence = RandomInt(SEQUENCE_BUTTERFLY_LOOKAT01, SEQUENCE_BUTTERFLY_LOOKAT03);
  32.                     break;
  33.                 default:
  34.                     m_nSequence++;
  35.                 }
  36.             }
  37.             else if (szModel == "models/weapons/v_knife_falchion_advanced.mdl")
  38.             {
  39.                 // Fix animations for the Falchion Knife.
  40.                 switch (m_nSequence)
  41.                 {
  42.                 case SEQUENCE_DEFAULT_IDLE2:
  43.                     m_nSequence = SEQUENCE_FALCHION_IDLE1; break;
  44.                 case SEQUENCE_DEFAULT_HEAVY_MISS1:
  45.                     m_nSequence = RandomInt(SEQUENCE_FALCHION_HEAVY_MISS1, SEQUENCE_FALCHION_HEAVY_MISS1_NOFLIP);
  46.                     break;
  47.                 case SEQUENCE_DEFAULT_LOOKAT01:
  48.                     m_nSequence = RandomInt(SEQUENCE_FALCHION_LOOKAT01, SEQUENCE_FALCHION_LOOKAT02);
  49.                     break;
  50.                 case SEQUENCE_DEFAULT_DRAW:
  51.                 case SEQUENCE_DEFAULT_IDLE1:
  52.                     break;
  53.                 default:
  54.                     m_nSequence--;
  55.                 }
  56.             }
  57.             else if (szModel == "models/weapons/v_knife_push.mdl")
  58.             {
  59.                 // Fix animations for the Shadow Daggers.
  60.                 switch (m_nSequence)
  61.                 {
  62.                 case SEQUENCE_DEFAULT_IDLE2:
  63.                     m_nSequence = SEQUENCE_DAGGERS_IDLE1; break;
  64.                 case SEQUENCE_DEFAULT_LIGHT_MISS1:
  65.                 case SEQUENCE_DEFAULT_LIGHT_MISS2:
  66.                     m_nSequence = RandomInt(SEQUENCE_DAGGERS_LIGHT_MISS1, SEQUENCE_DAGGERS_LIGHT_MISS5);
  67.                     break;
  68.                 case SEQUENCE_DEFAULT_HEAVY_MISS1:
  69.                     m_nSequence = RandomInt(SEQUENCE_DAGGERS_HEAVY_MISS2, SEQUENCE_DAGGERS_HEAVY_MISS1);
  70.                     break;
  71.                 case SEQUENCE_DEFAULT_HEAVY_HIT1:
  72.                 case SEQUENCE_DEFAULT_HEAVY_BACKSTAB:
  73.                 case SEQUENCE_DEFAULT_LOOKAT01:
  74.                     m_nSequence += 3; break;
  75.                 case SEQUENCE_DEFAULT_DRAW:
  76.                 case SEQUENCE_DEFAULT_IDLE1:
  77.                     break;
  78.                 default:
  79.                     m_nSequence += 2;
  80.                 }
  81.             }
  82.             else if (szModel == "models/weapons/v_knife_survival_bowie.mdl")
  83.             {
  84.                 // Fix animations for the Bowie Knife.
  85.                 switch (m_nSequence)
  86.                 {
  87.                 case SEQUENCE_DEFAULT_DRAW:
  88.                 case SEQUENCE_DEFAULT_IDLE1:
  89.                     break;
  90.                 case SEQUENCE_DEFAULT_IDLE2:
  91.                     m_nSequence = SEQUENCE_BOWIE_IDLE1;
  92.                     break;
  93.                 default:
  94.                     m_nSequence--;
  95.                 }
  96.             }
  97.             else if (szModel == "models/weapons/v_knife_ursus.mdl")
  98.             {
  99.                 // Fix animations for the Bowie Knife.
  100.                 switch (m_nSequence)
  101.                 {
  102.                 case SEQUENCE_DEFAULT_DRAW:
  103.                     m_nSequence = RandomInt(SEQUENCE_BUTTERFLY_DRAW, SEQUENCE_BUTTERFLY_DRAW2);
  104.                     break;
  105.                 case SEQUENCE_DEFAULT_LOOKAT01:
  106.                     m_nSequence = RandomInt(SEQUENCE_BUTTERFLY_LOOKAT01, SEQUENCE_BUTTERFLY_LOOKAT03);
  107.                     break;
  108.                 default:
  109.                     m_nSequence++;
  110.                     break;
  111.                 }
  112.             }
  113.             else if (szModel == "models/weapons/v_knife_stiletto.mdl")
  114.             {
  115.                 // Fix animations for the Bowie Knife.
  116.                 switch (m_nSequence)
  117.                 {
  118.                 case SEQUENCE_DEFAULT_LOOKAT01:
  119.                     m_nSequence = RandomInt(12, 13);
  120.                     break;
  121.                 }
  122.             }
  123.             else if (szModel == "models/weapons/v_knife_widowmaker.mdl")
  124.             {
  125.                 // Fix animations for the Bowie Knife.
  126.                 switch (m_nSequence)
  127.                 {
  128.                 case SEQUENCE_DEFAULT_LOOKAT01:
  129.                     m_nSequence = RandomInt(14, 15);
  130.                     break;
  131.                 }
  132.             }
  133.             pData->m_Value.m_Int = m_nSequence;
  134.         }
  135.     }
  136.     fnSequenceProxyFn(pData, pStruct, pOut);
  137. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top