designer1337 / csgo-cheat-base

simple csgo internal base.
MIT License
245 stars 48 forks source link

Skinchanger help #121

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hello! I tried to make a skinchanger, however it doesn't apply the skins. If you could help me that would be great! Code:

void visuals::skinchanger(c_usercmd* cmd){ if (!variables::skinchanger::bSkinchanger) return;

const auto& weapon = csgo::local_player->active_weapon();
if (!weapon)
    return;
if (const auto paint = variables::skinchanger::skins[weapon->item_definition_index()])
{
    const bool shouldUpdate = weapon->fall_back_kit() != paint;

    if (shouldUpdate)
    {
        weapon->item_id_high() = -1;
        weapon->fall_back_kit() = paint;
        weapon->fall_back_wear() = 0.01f;
        interfaces::clientstate->full_update();
    }
}

}

The fall_back_kit, item_id_high, and fall_back_wear were added by me to "weapon_t": NETVAR("DT_BaseAttributableItem", "m_iItemIDHigh", item_id_high, int); NETVAR("DT_BaseCombatWeapon", "m_nFallbackPaintKit", fall_back_kit, int); NETVAR("DT_BaseCombatWeapon", "m_flFallbackWear", fall_back_wear, float);

"skins" variable is a std::map<int, int> that stores the weapon id as a key.

puppygirlcoded commented 2 years ago

https://github.com/ChoZenTime/aristois-pasted-by-choZen

ghost commented 2 years ago

Thank you