Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.41 KB | None | 0 0
  1.         if(!entitylist->GetClientEntityFromHandle((void*)localplayer->GetWearables())) // Needs to be from Handle, otherwise it returns for CWorld because CEconWearable is not already in the Enum
  2.         {
  3.             for (ClientClass* pClass = client->GetAllClasses(); pClass; pClass = pClass->m_pNext) // Cycles through classes.
  4.                 if (pClass->m_ClassID == CEconWearable) // Stops until the class is CEconWearable
  5.                 {
  6.                     int iEntry = (entitylist->GetHighestEntityIndex() + 1), iSerial = RandomInt(0x0, 0xFFF); // Gets last entityindex entry and just adds 1 | Random Serial.
  7.                     pClass->m_pCreateFn(iEntry, iSerial);
  8.                     localplayer->GetWearables()[0] = (iEntry | (iSerial << 16));
  9.                     cvar->ConsoleColorPrintf(ColorRGBA(255, 255, 255, 255), "Found Class ID: %s\n", pClass->m_pNetworkName); // Ensures we have the correct Class ID
  10.                     break;
  11.                 }
  12.  
  13.             C_BaseAttributableItem* gloves = (C_BaseAttributableItem*)entitylist->GetClientEntity(localplayer->GetWearables()[0] & 0xFFF); //We can use this without FromHandle JUUUST to make sure we set the right wearable.
  14.             if(!gloves) // Redundancy
  15.                 return;
  16.  
  17.             IEngineClient::player_info_t localplayer_info;
  18.  
  19.             *gloves->GetAccountID() = localplayer_info.xuidlow;
  20.             *gloves->GetItemIDHigh() = -1;
  21.             *gloves->GetItemDefinitionIndex() = 5027;
  22.             gloves->SetModelIndex(modelInfo->GetModelIndex("models/weapons/v_models/arms/glove_bloodhound/v_glove_bloodhound.mdl"));
  23.             *gloves->GetFallbackPaintKit() = 10007;
  24.             *gloves->GetEntityQuality() = 4;
  25.             *gloves->GetFallbackSeed() = 0;
  26.             *gloves->GetFallbackStatTrak() = -1;
  27.             *gloves->GetFallbackWear() = 0.00000001f;
  28.             gloves->PreDataUpdate(DATA_UPDATE_CREATED);
  29.  
  30.             cvar->ConsoleColorPrintf(ColorRGBA(255, 255, 150, 255), "Model Index should be: %i\n", modelInfo->GetModelIndex("models/weapons/v_models/arms/glove_bloodhound/v_glove_bloodhound.mdl")); //Just to make sure we have the right SetModelIndex vfunc
  31.             cvar->ConsoleColorPrintf(ColorRGBA(255, 255, 150, 255), "Model Index actually is: %i\n", *gloves->GetModelIndex()); //Just to make sure we have the right SetModelIndex vfunc
  32.  
  33.             cvar->ConsoleColorPrintf(ColorRGBA(150, 255, 150, 255), "Successfully set Gloves with class: %s\n", entitylist->GetClientEntity(localplayer->GetWearables()[0] & 0xFFF)->GetClientClass()->m_pNetworkName); //Check if the entity exists and what its class ID is.
  34.  
  35.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement