Гайд Inventory/Medal/PlayerInfo Changer

в сурсе профиль и инвентарь встроен уже в сам меню? я просто обновленный код
 
How add to save?
 
Блэт
Всё подключил...
Пожалуйста, авторизуйтесь для просмотра ссылки.
 
Ребзя,как иконки фиксануть, ставлю авп,у меня дигл иконки стоит
А ещё нож,нож не ставится
иконки кешируются и потому показывает не то, что надо
на ножах и гловсах ченжер не настраивается
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
инвентарь ченжер синхронизировал с скин чунгером?
 
cce8bfa0d22ca51d272a1c489a6aff49.png



От чего такая шляпа произойти может?
 
на обычный индиго пойдёт?
 
на ayy пойдет?
 
Помогите мне как дурочку с готовым сурсом. Что именно надо добавить, чтобы скомпилировать его?
 
Здарова щеглы, сегодня мы будем добавлять инвентарь ченжер в сурс Resolve (yougame.biz/threads/35710/)
p.s. медали видят все, звание/лайки/лвл видят только ваши друзья и участники лобби, выставленные в ивенте оружия работают и в игре (кроме ножей).
Скрытое содержимое
Скачиваем
Пожалуйста, авторизуйтесь для просмотра ссылки.

Открываем свойства проекта -> включаемые каталоги -> указываем путь к папке с архива protobuf-2.5.0/src
Скрытое содержимое
Выставляем конфигурацию сборки Release и начинаем пастить код
SDK.h
после
Код:
Expand Collapse Copy
#include "CVar.h"
добавить
Код:
Expand Collapse Copy
#include "../steam_sdk/steam_api.h"
после
Код:
Expand Collapse Copy
#define INPUTSYSTEM_DLL "inputsystem.dll"
добавить
Код:
Expand Collapse Copy
#define STEAMAPI_DLL "steam_api.dll"
после
Код:
Expand Collapse Copy
static ConVar* GetConVar();
добавить
Код:
Expand Collapse Copy
static ISteamGameCoordinator* SteamGameCoordinator();
static ISteamUser* SteamUser();
после
Код:
Expand Collapse Copy
static ConVar*  g_pConVar;
добавить
Код:
Expand Collapse Copy
static ISteamGameCoordinator* g_pSteamGameCoordinator;
static ISteamUser* g_pSteamUser;
SDK.cpp
после
Код:
Expand Collapse Copy
ConVar* Interfaces::g_pConVar = nullptr;
добавить
Код:
Expand Collapse Copy
ISteamGameCoordinator* Interfaces::g_pSteamGameCoordinator = nullptr;
ISteamUser* Interfaces::g_pSteamUser = nullptr;
после
Код:
Expand Collapse Copy
ConVar* Interfaces::GetConVar()
{
    ...
}
добавить
Код:
Expand Collapse Copy
ISteamUser* Interfaces::SteamUser()
{
    if (!g_pSteamUser) {
        SteamGameCoordinator();
    }
    return g_pSteamUser;
}
ISteamGameCoordinator* Interfaces::SteamGameCoordinator()
{
if (!g_pSteamGameCoordinator) {
typedef uint32_t SteamPipeHandle;
typedef uint32_t SteamUserHandle;
SteamUserHandle hSteamUser = ((SteamUserHandle(__cdecl*)(void))GetProcAddress(GetModuleHandle("steam_api.dll"), "SteamAPI_GetHSteamUser"))();
SteamPipeHandle hSteamPipe = ((SteamPipeHandle(__cdecl*)(void))GetProcAddress(GetModuleHandle("steam_api.dll"), "SteamAPI_GetHSteamPipe"))();
auto SteamClient = ((ISteamClient*(__cdecl*)(void))GetProcAddress(GetModuleHandle("steam_api.dll"), "SteamClient"))();
auto SteamHTTP = SteamClient->GetISteamHTTP(hSteamUser, hSteamPipe, "STEAMHTTP_INTERFACE_VERSION002");
g_pSteamUser = SteamClient->GetISteamUser(hSteamUser, hSteamPipe, "SteamUser019");
auto SteamFriends = SteamClient->GetISteamFriends(hSteamUser, hSteamPipe, "SteamFriends015");
auto SteamInventory = SteamClient->GetISteamInventory(hSteamUser, hSteamPipe, "STEAMINVENTORY_INTERFACE_V002");
g_pSteamGameCoordinator = (ISteamGameCoordinator*)SteamClient->GetISteamGenericInterface(hSteamUser, hSteamPipe, "SteamGameCoordinator001");
}
return g_pSteamGameCoordinator;
}
Engine.cpp
после
Код:
Expand Collapse Copy
if ( !SDK::Interfaces::InputSystem() )
{
    return false;
}
добавить
Код:
Expand Collapse Copy
if (!SDK::Interfaces::SteamGameCoordinator())
{
    return false;
}
после
Код:
Expand Collapse Copy
if ( !CSX::Utils::IsModuleLoad( VSTDLIB_DLL ) )
    return false;
добавить
Код:
Expand Collapse Copy
if (!CSX::Utils::IsModuleLoad(STEAMAPI_DLL))
    return false;
Hook.cpp
после
Код:
Expand Collapse Copy
CSX::Hook::VTable SurfaceTable;
добавить
Код:
Expand Collapse Copy
CSX::Hook::VTable SteamGameCoordinatorTable;
после
Код:
Expand Collapse Copy
ClientModeTable.HookIndex(TABLE::IClientMode::GetViewModelFOV, Hook_GetViewModelFOV)
добавить
Код:
Expand Collapse Copy
if (!SteamGameCoordinatorTable.InitTable(Interfaces::SteamGameCoordinator()))
    return false;
SteamGameCoordinatorTable.HookIndex(0, Hook_SendMessage);
SteamGameCoordinatorTable.HookIndex(2, Hook_RetrieveMessage);
после
Код:
Expand Collapse Copy
ClientTable.UnHook();
добавить
Код:
Expand Collapse Copy
SteamGameCoordinatorTable.UnHook();
после
Код:
Expand Collapse Copy
float WINAPI Hook_GetViewModelFOV()
{
...
}
добавить
Код:
Expand Collapse Copy
EGCResults __fastcall Hook_RetrieveMessage(void* ecx, void* edx, uint32_t *punMsgType, void *pubDest, uint32_t cubDest, uint32_t *pcubMsgSize)
{
SteamGameCoordinatorTable.UnHook();
EGCResults status = Interfaces::SteamGameCoordinator()->RetrieveMessage(punMsgType, pubDest, cubDest, pcubMsgSize);
SteamGameCoordinatorTable.ReHook();
if (status != k_EGCResultOK)
return status;
Client::OnRetrieveMessage(ecx, edx, punMsgType, pubDest, cubDest, pcubMsgSize);
return status;
}
EGCResults __fastcall Hook_SendMessage(void* ecx, void* edx, uint32_t unMsgType, const void* pubData, uint32_t cubData)
{
uint32_t messageType = unMsgType & 0x7FFFFFFF;
void* pubDataMutable = const_cast<void*>(pubData);
Client::OnSendMessage(ecx, edx, unMsgType, pubData, cubData);
SteamGameCoordinatorTable.UnHook();
EGCResults status = Interfaces::SteamGameCoordinator()->SendMessage(unMsgType, pubData, cubData);
SteamGameCoordinatorTable.ReHook();
return status;
}
Settings.h
после
Код:
Expand Collapse Copy
#define MISC_TEXT "MISC"
добавить
Код:
Expand Collapse Copy
#define PROFILE_TEXT "PROFILE"
#define INVENTORY_TEXT "INVENTORY"
после
Код:
Expand Collapse Copy
#define FOV_BASE_DISTANCE 200
добавить
Код:
Expand Collapse Copy
struct k_weapon_data {
int itemDefinitionIndex;
int paintKit;
int rarity;
int seed;
float wear;
char* name = "";
};
после
Код:
Expand Collapse Copy
int TriggerCharToKey(const char* Key);
добавить
Код:
Expand Collapse Copy
namespace MedalChanger {
    extern bool enabled;
    extern std::vector<uint32_t> medals;
    extern bool equipped_medal_override;
    extern uint32_t equipped_medal;
}
namespace ProfileChanger {
    extern bool enabled;
    extern int rank_id;
    extern int wins;
    extern int cmd_friendly;
    extern int cmd_leader;
    extern int cmd_teaching;
    extern int level;
    extern int xp;
}
namespace InventoryChanger {
    extern bool enabled;
    extern std::vector<k_weapon_data> weapons;
}
Settings.cpp
перед
Код:
Expand Collapse Copy
namespace Aimbot
добавить
Код:
Expand Collapse Copy
namespace MedalChanger {
    bool enabled = false;
    std::vector<uint32_t> medals = {};
    bool equipped_medal_override = false;
    uint32_t equipped_medal = 0;
}
namespace ProfileChanger {
    bool enabled = false;
    int rank_id = 0;
    int wins = 0;
    int cmd_friendly = 0;
    int cmd_leader = 0;
    int cmd_teaching = 0;
    int level = 0;
    int xp = 0;
}
namespace InventoryChanger {
    bool enabled = false;
    std::vector<k_weapon_data> weapons = {};
}
Client.h
после
Код:
Expand Collapse Copy
#include "Skin/Skin.h"
добавить
Код:
Expand Collapse Copy
#include "InventoryChanger/InventoryChanger.h"
после
Код:
Expand Collapse Copy
class CMisc;
добавить
Код:
Expand Collapse Copy
class CInventoryChanger;
после
Код:
Expand Collapse Copy
void OnResetDevice();
добавить
Код:
Expand Collapse Copy
void OnRetrieveMessage(void* ecx, void* edx, uint32_t *punMsgType, void *pubDest, uint32_t cubDest, uint32_t *pcubMsgSize);
void OnSendMessage(void* ecx, void* edx, uint32_t unMsgType, const void* pubData, uint32_t cubData);
после
Код:
Expand Collapse Copy
void Shutdown();
добавить
Код:
Expand Collapse Copy
void SendMMHello();
void SendClientHello();
Client.cpp
после
Код:
Expand Collapse Copy
CMisc* g_pMisc = nullptr;
добавить
Код:
Expand Collapse Copy
CInventoryChanger* g_pInventoryChanger = nullptr;
после
Код:
Expand Collapse Copy
g_pMisc = new CMisc();
добавить
Код:
Expand Collapse Copy
g_pInventoryChanger = new CInventoryChanger();
перед
Код:
Expand Collapse Copy
bool Initialize(IDirect3DDevice9* pDevice)
добавить
Код:
Expand Collapse Copy
void SendMMHello()
{
    CMsgGCCStrike15_v2_MatchmakingClient2GCHello Message;
    void* ptr = malloc(Message.ByteSize() + 8);
    if (!ptr)
        return;
    auto unMsgType = k_EMsgGCCStrike15_v2_MatchmakingClient2GCHello | ((DWORD)1 << 31);
    ((uint32_t*)ptr)[0] = unMsgType;
    ((uint32_t*)ptr)[1] = 0;
    Message.SerializeToArray((void*)((DWORD)ptr + 8), Message.ByteSize());
    bool result = Interfaces::SteamGameCoordinator()->SendMessage(unMsgType, ptr, Message.ByteSize() + 8) == k_EGCResultOK;
    free(ptr);
}
void SendClientHello()
{
    CMsgClientHello Message;
    Message.set_client_session_need(1);
    Message.clear_socache_have_versions();
    void* ptr = malloc(Message.ByteSize() + 8);
    if (!ptr)
        return;
    ((uint32_t*)ptr)[0] = k_EMsgGCClientHello | ((DWORD)1 << 31);
    ((uint32_t*)ptr)[1] = 0;
    Message.SerializeToArray((void*)((DWORD)ptr + 8), Message.ByteSize());
    bool result = Interfaces::SteamGameCoordinator()->SendMessage(k_EMsgGCClientHello | ((DWORD)1 << 31), ptr, Message.ByteSize() + 8) == k_EGCResultOK;
    free(ptr);
}
это
Код:
Expand Collapse Copy
const char* tabNames[] = {
AIMBOT_TEXT , VISUAL_TEXT, MISC_TEXT , SKIN_TEXT, CONFIG_TEXT };
заменить на это
Код:
Expand Collapse Copy
const char* tabNames[] = {
AIMBOT_TEXT , VISUAL_TEXT, MISC_TEXT , SKIN_TEXT, INVENTORY_TEXT, PROFILE_TEXT, CONFIG_TEXT };
это
Код:
Expand Collapse Copy
static int tabOrder[] = { 0 , 1 , 2 , 3 , 4, 5 };
заменить на это
Код:
Expand Collapse Copy
static int tabOrder[] = { 0 , 1 , 2 , 3 , 4, 5, 6 };
это
Код:
Expand Collapse Copy
else if (tabSelected == 4)
заменить на
Код:
Expand Collapse Copy
else if (tabSelected == 6)
после
Код:
Expand Collapse Copy
else if (tabSelected == 3)
{
    ...
}
добавить
Код:
Expand Collapse Copy
else if (tabSelected == 4) { // Inventory Changer
    ImGui::Columns(2, nullptr, false);
    ImGui::Checkbox("Enabled", &Settings::InventoryChanger::enabled);
    static int itemDefinitionIndex = 0;
    static int paintKit = 0;
    static int rarity = 0;
    static int seed = 0;
    static float wear = 0.f;
    ImGui::InputInt("Item Definition Index", &itemDefinitionIndex);
    ImGui::InputInt("Paint Kit", &paintKit);
    ImGui::InputInt("Rarity", &rarity);
    ImGui::InputInt("Seed", &seed);
    ImGui::SliderFloat("Wear", &wear, FLT_MIN, 1.f, "%.10f", 5);
    if (ImGui::Button("Add")) {
        Settings::InventoryChanger::weapons.insert(Settings::InventoryChanger::weapons.end(), { itemDefinitionIndex , paintKit , rarity , seed, wear });
    } ImGui::SameLine();
    if (ImGui::Button("Apply##Skin")) {
        SendClientHello();
    }
    ImGui::NextColumn();

    ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1, 1, 1, 1));
    ImGui::ListBoxHeader("Skins");
    int weapon_index = 0;
    for (auto weapon : Settings::InventoryChanger::weapons) {
        if (ImGui::Selectable(std::string(std::to_string(weapon.itemDefinitionIndex) + " " + std::to_string(weapon.paintKit)).c_str())) {
            Settings::InventoryChanger::weapons.erase(Settings::InventoryChanger::weapons.begin() + weapon_index);
        }
        weapon_index++;
    }
    ImGui::ListBoxFooter();
    ImGui::PopStyleColor();
    ImGui::Columns(1, nullptr, false);
}
else if (tabSelected == 5) // Medal/Profile Changer
{
    ImGui::Columns(2, nullptr, false);
    ImGui::Checkbox("Enabled Medal Hack", &Settings::MedalChanger::enabled);
    static int medal_id = 0;
    ImGui::InputInt("Medal id", &medal_id);
    if (ImGui::Button("Add") && medal_id != 0) {
        Settings::MedalChanger::medals.insert(Settings::MedalChanger::medals.end(), medal_id);
        medal_id = 0;
    }
    ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1, 1, 1, 1));
    ImGui::ListBoxHeader("Medal list");
    for (int m = 0; m < Settings::MedalChanger::medals.size(); m++) {
        if (ImGui::Selectable(std::to_string(Settings::MedalChanger::medals[m]).c_str())) {
            if (Settings::MedalChanger::equipped_medal == Settings::MedalChanger::medals[m]) {
                Settings::MedalChanger::equipped_medal = 0;
                Settings::MedalChanger::equipped_medal_override = false;
            }
            Settings::MedalChanger::medals.erase(Settings::MedalChanger::medals.begin() + m);
        }
    }
    ImGui::ListBoxFooter();
    ImGui::PopStyleColor();
    ImGui::Checkbox("Equipped Medal Override", &Settings::MedalChanger::equipped_medal_override);
    if (Settings::MedalChanger::equipped_medal_override) {
        static int equipped_medal = 0;
        ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1, 1, 1, 1));
        if (ImGui::Combo("Equipped Medal", &equipped_medal, [](void* data, int idx, const char** out_text)
        {
            *out_text = std::to_string(Settings::MedalChanger::medals[idx]).c_str();
            return true;
        }, nullptr, Settings::MedalChanger::medals.size(), 5)) {
            Settings::MedalChanger::equipped_medal = Settings::MedalChanger::medals[equipped_medal];
        }
        ImGui::PopStyleColor();
    }
    if (ImGui::Button("Apply##Medals")) {
        SendClientHello();
    }
    ImGui::NextColumn();
    ImGui::Checkbox("Enabled Profile Hack", &Settings::ProfileChanger::enabled);
    static const char* ranks[] = {
        "Default",
        "Silver 1",
        "Silver 2",
        "Silver 3",
        "Silver 4",
        "Silver 5",
        "Silver 6",
        "Gold Nova 1",
        "Gold Nova 2",
        "Gold Nova 3",
        "Gold Nova 4",
        "Master Guardian 1",
        "Master Guardian 2",
        "Master Guardian Elite",
        "Distinguished Master Guardian",
        "Legendary Eagle",
        "Legendary Eagle Master",
        "Supreme Master First Class",
        "Global Elite"
    };
    ImGui::Combo("Rank", &Settings::ProfileChanger::rank_id, ranks, IM_ARRAYSIZE(ranks));
    ImGui::SliderInt("Level", &Settings::ProfileChanger::level, 0, 40);
    ImGui::SliderInt("XP", &Settings::ProfileChanger::xp, 0, 5000);
    ImGui::InputInt("Wins", &Settings::ProfileChanger::wins);
    ImGui::InputInt("CMD Friendly", &Settings::ProfileChanger::cmd_friendly);
    ImGui::InputInt("CMD Teaching", &Settings::ProfileChanger::cmd_teaching);
    ImGui::InputInt("CMD Leader", &Settings::ProfileChanger::cmd_leader);
    if (ImGui::Button("Apply##Profile")) {
        SendMMHello();
    }
    ImGui::Columns(1, nullptr, false);
}
перед
Код:
Expand Collapse Copy
void OnCreateMove(CUserCmd* pCmd)
добавить
Код:
Expand Collapse Copy
void OnRetrieveMessage(void* ecx, void* edx, uint32_t *punMsgType, void *pubDest, uint32_t cubDest, uint32_t *pcubMsgSize)
{
    g_pInventoryChanger->PostRetrieveMessage(punMsgType, pubDest, cubDest, pcubMsgSize);
}
void OnSendMessage(void* ecx, void* edx, uint32_t unMsgType, const void* pubData, uint32_t cubData)
{
    void* pubDataMutable = const_cast<void*>(pubData);
    g_pInventoryChanger->PreSendMessage(unMsgType, pubDataMutable, cubData);
}
Gui.cpp
после
Код:
Expand Collapse Copy
ImGui::PushID(i);   // otherwise two tabs with the same name would clash.
заменить строку на
Код:
Expand Collapse Copy
if (ImGui::Button(tabLabels[i], ImVec2(80.f, 50.f))) { selection_changed = (tabIndex != i); newtabIndex = i; }
Создаем InventoryChanger.h и InventoryChanger.cpp в Cheat\InventoryChanger
Код:
Expand Collapse Copy
//InventoryChanger.h
#pragma once
#include "../../Engine/Engine.h"
#include "../../protobuf/base_gcmessages.pb.h"
#include "../../protobuf/cstrike15_gcmessages.pb.h"
#include "../../protobuf/econ_gcmessages.pb.h"
#include "../../protobuf/engine_gcmessages.pb.h"
#include "../../protobuf/gcsystemmsgs.pb.h"
#include "../../protobuf/gcsdk_gcmessages.pb.h"
#include "../../protobuf/netmessages.pb.h"
#include "../../protobuf/steammessages.pb.h"
#pragma comment(lib, "libprotobuf.lib")
#pragma comment(lib, "libprotoc.lib")
class CInventoryChanger {
public:
void PostRetrieveMessage(uint32_t* punMsgType, void* pubDest, uint32_t cubDest, uint32_t* pcubMsgSize);
bool PreSendMessage(uint32_t &unMsgType, void* pubData, uint32_t &cubData);
void ApplyMedals(CMsgSOCacheSubscribed::SubscribedType* pInventoryCacheObject);
void ApplySkins(CMsgSOCacheSubscribed::SubscribedType* pInventoryCacheObject);
};
Код:
Expand Collapse Copy
//InventoryChanger.cpp
#include "InventoryChanger.h"
#include <vector>
void CInventoryChanger::PostRetrieveMessage(uint32_t* punMsgType, void* pubDest, uint32_t cubDest, uint32_t* pcubMsgSize)
{
uint32_t MessageType = *punMsgType & 0x7FFFFFFF;
if (MessageType == k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello && Settings::ProfileChanger::enabled) {
CMsgGCCStrike15_v2_MatchmakingGC2ClientHello Message;
try
{
if (!Message.ParsePartialFromArray((void*)((DWORD)pubDest + 8), *pcubMsgSize - 8))
return;
}
catch (...)
{
return;
}
if (Settings::ProfileChanger::level != 0) {
Message.set_player_level(Settings::ProfileChanger::level);
}
if (Settings::ProfileChanger::xp != 0) {
Message.set_player_cur_xp(Settings::ProfileChanger::xp);
}
PlayerRankingInfo* Ranking = Message.mutable_ranking();
Ranking->set_account_id(Interfaces::SteamUser()->GetSteamID().GetAccountID());
if (Settings::ProfileChanger::rank_id != 0) {
Ranking->set_rank_id(Settings::ProfileChanger::rank_id);
}
if (Settings::ProfileChanger::wins != 0) {
Ranking->set_wins(Settings::ProfileChanger::wins);
}
PlayerCommendationInfo* Commendation = Message.mutable_commendation();
if (Settings::ProfileChanger::cmd_friendly != 0) {
Commendation->set_cmd_friendly(Settings::ProfileChanger::cmd_friendly);
}
if (Settings::ProfileChanger::cmd_leader != 0) {
Commendation->set_cmd_leader(Settings::ProfileChanger::cmd_leader);
}
if (Settings::ProfileChanger::cmd_teaching != 0) {
Commendation->set_cmd_teaching(Settings::ProfileChanger::cmd_teaching);
}
if ((uint32_t)Message.ByteSize() <= cubDest - 8)
{
Message.SerializeToArray((void*)((DWORD)pubDest + 8), Message.ByteSize());
*pcubMsgSize = Message.ByteSize() + 8;
}
}
if (MessageType == k_EMsgGCClientWelcome) {
CMsgClientWelcome Message;
try
{
if (!Message.ParsePartialFromArray((void*)((DWORD)pubDest + 8), *pcubMsgSize - 8))
return;
}
catch (...)
{
return;
}
if (Message.outofdate_subscribed_caches_size() <= 0)
return;
CMsgSOCacheSubscribed* Cache = Message.mutable_outofdate_subscribed_caches(0);
for (int i = 0; i < Cache->objects_size(); i++)
{
CMsgSOCacheSubscribed::SubscribedType* Object = Cache->mutable_objects(i);
if (!Object->has_type_id())
continue;
if (Object->type_id() == 1) {
for (int j = 0; j < Object->object_data_size(); j++)
{
std::string* ObjectData = Object->mutable_object_data(j);
CSOEconItem Item;
if (!Item.ParseFromArray((void*)const_cast<char*>(ObjectData->data()), ObjectData->size()))
continue;
if (Item.equipped_state_size() <= 0)
continue;
if (Settings::MedalChanger::equipped_medal_override)
{
CSOEconItemEquipped* EquippedState = Item.mutable_equipped_state(0);
if (EquippedState->new_class() == 0 && EquippedState->new_slot() == 55)
{
Item.clear_equipped_state();
ObjectData->resize(Item.ByteSize());
Item.SerializeToArray((void*)const_cast<char*>(ObjectData->data()), Item.ByteSize());
}
}
}
ApplyMedals(Object);
ApplySkins(Object);
}
}
if ((uint32_t)Message.ByteSize() <= cubDest - 8)
{
Message.SerializeToArray((void*)((DWORD)pubDest + 8), Message.ByteSize());
*pcubMsgSize = Message.ByteSize() + 8;
}
}
}
bool CInventoryChanger::PreSendMessage(uint32_t &unMsgType, void* pubData, uint32_t &cubData)
{
if (!Settings::InventoryChanger::enabled)
return true;
uint32_t MessageType = unMsgType & 0x7FFFFFFF;
if (MessageType == k_EMsgGCAdjustItemEquippedState) {
CMsgAdjustItemEquippedState Message;
try
{
if (!Message.ParsePartialFromArray((void*)((DWORD)pubData + 8), cubData - 8))
return true;
}
catch (...)
{
return true;
}
if (!Message.has_item_id() || !Message.has_new_class() || !Message.has_new_slot())
return true;
uint32_t item_id = (uint32_t)Message.item_id() - 20000;
if (item_id < 1 || item_id > Settings::InventoryChanger::weapons.size()) {
return true;
}
auto weapon = Settings::InventoryChanger::weapons[item_id - 1];
g_SkinChangerCfg[weapon.itemDefinitionIndex].flFallbackWear = weapon.wear;
g_SkinChangerCfg[weapon.itemDefinitionIndex].iItemDefinitionIndex = weapon.itemDefinitionIndex;
g_SkinChangerCfg[weapon.itemDefinitionIndex].nFallbackPaintKit = weapon.paintKit;
ForceFullUpdate();
return false;
}
return true;
}
void CInventoryChanger::ApplySkins(CMsgSOCacheSubscribed::SubscribedType* pInventoryCacheObject)
{
if (!Settings::InventoryChanger::enabled) {
return;
}
int c = 20001;
for (auto weapon : Settings::InventoryChanger::weapons) {
CSOEconItem Skin;
Skin.set_id(c);
Skin.set_account_id(Interfaces::SteamUser()->GetSteamID().GetAccountID());
Skin.set_def_index(weapon.itemDefinitionIndex);
Skin.set_inventory(c);
Skin.set_origin(24);
Skin.set_quantity(1);
Skin.set_level(1);
Skin.set_style(0);
Skin.set_flags(0);
Skin.set_in_use(false);
Skin.set_original_id(0);
Skin.set_rarity(weapon.rarity);
Skin.set_quality(0);
Skin.set_custom_name("yougame.biz");
auto PaintKitAttribute = Skin.add_attribute();
float PaintKitAttributeValue = (float)weapon.paintKit;
PaintKitAttribute->set_def_index(6);
PaintKitAttribute->set_value_bytes(&PaintKitAttributeValue, 4);
auto SeedAttribute = Skin.add_attribute();
float SeedAttributeValue = (float)weapon.seed;
SeedAttribute->set_def_index(7);
SeedAttribute->set_value_bytes(&SeedAttributeValue, 4);
auto WearAttribute = Skin.add_attribute();
float WearAttributeValue = weapon.wear;
WearAttribute->set_def_index(8);
WearAttribute->set_value_bytes(&WearAttributeValue, 4);
pInventoryCacheObject->add_object_data(Skin.SerializeAsString());
c++;
}
}
void CInventoryChanger::ApplyMedals(CMsgSOCacheSubscribed::SubscribedType* pInventoryCacheObject)
{
if (!Settings::MedalChanger::enabled) {
return;
}
int c = 10001;
for (uint32_t MedalIndex : Settings::MedalChanger::medals)
{
CSOEconItem Medal;
Medal.set_account_id(Interfaces::SteamUser()->GetSteamID().GetAccountID());
Medal.set_origin(9);
Medal.set_rarity(6);
Medal.set_quantity(1);
Medal.set_quality(4);
Medal.set_level(1);
CSOEconItemAttribute* TimeAcquiredAttribute = Medal.add_attribute();
uint32_t TimeAcquiredAttributeValue = 0;
TimeAcquiredAttribute->set_def_index(222);
TimeAcquiredAttribute->set_value_bytes(&TimeAcquiredAttributeValue, 4);
Medal.set_def_index(MedalIndex);
Medal.set_inventory(c);
Medal.set_id(c);
if (Settings::MedalChanger::equipped_medal_override && Settings::MedalChanger::equipped_medal == MedalIndex)
{
CSOEconItemEquipped* EquippedState = Medal.add_equipped_state();
EquippedState->set_new_class(0);
EquippedState->set_new_slot(55);
}
pInventoryCacheObject->add_object_data(Medal.SerializeAsString());
c++;
}
}
Скачать готовый сурс:
Пожалуйста, авторизуйтесь для просмотра ссылки.
(не забыть подключить protobuf и выставить сборку release)
[/HIDE]
Результат:
Скрытое содержимое
Актуально?
 
Назад
Сверху Снизу