Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!entitylist->GetClientEntityFromHandle((void*)localplayer->GetWearables())) // Needs to be from Handle, otherwise it returns for CWorld because CEconWearable is not already in the Enum
- {
- for (ClientClass* pClass = client->GetAllClasses(); pClass; pClass = pClass->m_pNext) // Cycles through classes.
- if (pClass->m_ClassID == CEconWearable) // Stops until the class is CEconWearable
- {
- int iEntry = (entitylist->GetHighestEntityIndex() + 1), iSerial = RandomInt(0x0, 0xFFF); // Gets last entityindex entry and just adds 1 | Random Serial.
- pClass->m_pCreateFn(iEntry, iSerial);
- localplayer->GetWearables()[0] = (iEntry | (iSerial << 16));
- cvar->ConsoleColorPrintf(ColorRGBA(255, 255, 255, 255), "Found Class ID: %s\n", pClass->m_pNetworkName); // Ensures we have the correct Class ID
- break;
- }
- 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.
- if(!gloves) // Redundancy
- return;
- IEngineClient::player_info_t localplayer_info;
- *gloves->GetAccountID() = localplayer_info.xuidlow;
- *gloves->GetItemIDHigh() = -1;
- *gloves->GetItemDefinitionIndex() = 5027;
- gloves->SetModelIndex(modelInfo->GetModelIndex("models/weapons/v_models/arms/glove_bloodhound/v_glove_bloodhound.mdl"));
- *gloves->GetFallbackPaintKit() = 10007;
- *gloves->GetEntityQuality() = 4;
- *gloves->GetFallbackSeed() = 0;
- *gloves->GetFallbackStatTrak() = -1;
- *gloves->GetFallbackWear() = 0.00000001f;
- gloves->PreDataUpdate(DATA_UPDATE_CREATED);
- 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
- 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
- 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.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement