Example #1
0
void CCheatMenu::Render(void)
{
	gInts.Engine->GetScreenSize(ScreenW, ScreenH);

	int i = 0;

	i = AddItem(i, "Aimbot", &gCvars.aimbot_switch, 0, 1, 1, true);
	if (gCvars.aimbot_switch)
	{
		i = AddItem(i, " - Enabled", &gCvars.aimbot_active, 0, 1, 1, false);
		i = AddItem(i, " - Key", &gCvars.aimbot_key, 0, 8, 1, false);
		i = AddItem(i, " - Hitscan", &gCvars.aimbot_hitscan, 0, 1, 1, false);
		i = AddItem(i, " - Hitbox", &gCvars.aimbot_hitbox, 0, 18, 1, false);
		i = AddItem(i, " - Autoshoot", &gCvars.aimbot_autoshoot, 0, 1, 1, false);
	}

	i = AddItem(i, "Triggerbot", &gCvars.triggerbot_switch, 0, 1, 1, true);
	if (gCvars.triggerbot_switch)
	{
		i = AddItem(i, " - Enabled", &gCvars.triggerbot_active, 0, 1, 1, false);
		i = AddItem(i, " - Key", &gCvars.triggerbot_key, 0, 8, 1, false);
		i = AddItem(i, " - Head Only", &gCvars.triggerbot_headonly, 0, 1, 1, false);
	}

	i = AddItem(i, "Player List", &gCvars.playerlist_switch, 0, 1, 1, true);
	for (int p = 1; p <= gInts.Engine->GetMaxClients(); p++)
	{
		if (p == me)
			continue;

		CBaseEntity *pPlayer = GetBaseEntity(p);

		if (pPlayer == NULL)
			continue;

		player_info_t pInfo;
		gInts.Engine->GetPlayerInfo(p, &pInfo);

		char szString[256];
		sprintf(szString, " - %s", pInfo.name);

		if (gCvars.playerlist_switch)
			i = AddItem(i, szString, &gCvars.PlayerMode[pPlayer->GetIndex()], 0, 2, 1, false);
	}


	i = AddItem(i, "ESP", &gCvars.esp_switch, 0, 1, 1, true);
	if (gCvars.esp_switch)
	{
		i = AddItem(i, " - Enabled", &gCvars.esp_active, 0, 1, 1, false);
		i = AddItem(i, " - Enemies Only", &gCvars.esp_enemyonly, 0, 1, 1, false);
		i = AddItem(i, " - Box", &gCvars.esp_box, 0, 1, 1, false);
		i = AddItem(i, " - Name", &gCvars.esp_name, 0, 1, 1, false);
		i = AddItem(i, " - Class", &gCvars.esp_class, 0, 1, 1, false);
		i = AddItem(i, " - Health", &gCvars.esp_health, 0, 3, 1, false);
		i = AddItem(i, " - Bones", &gCvars.esp_bones, 0, 3, 1, false);
	}

	i = AddItem(i, "Settings", &gCvars.settings_switch, 0, 1, 1, true);
	if (gCvars.settings_switch)
	{
		i = AddItem(i, " - Menu Postion X", &gCvars.iMenu_Pos_X, 0, ScreenW, 25, false);
		i = AddItem(i, " - Menu Postion Y", &gCvars.iMenu_Pos_Y, 0, ScreenH, 25, false);
	}

	i = AddItem(i, "Misc", &gCvars.misc_switch, 0, 1, 1, true);
	if (gCvars.misc_switch)
	{
		i = AddItem(i, " - Bunnyhop", &gCvars.misc_bunnyhop, 0, 1, 1, false);
		i = AddItem(i, " - Autostrafe", &gCvars.misc_autostrafe, 0, 1, 1, false);
		i = AddItem(i, " - Noisemaker Spam", &gCvars.misc_noisemaker_spam, 0, 1, 1, false);
	}

	iMenuItems = i;
}
void __stdcall FrameStageNotify(ClientFrameStage_t curStage)
{
	originalFrameStageNotify(interfaces::client, curStage);

	if (curStage == FRAME_NET_UPDATE_POSTDATAUPDATE_START)
	{
		if (cvar::misc_skinchanger)
		{
			player_info_t info;

			CBaseEntity* local = interfaces::entitylist->GetClientEntity(interfaces::engine->GetLocalPlayer());
			if (!local
				|| local->GetLifeState() != LIFE_ALIVE
				|| !interfaces::engine->GetPlayerInfo(local->GetIndex(), &info))
				return;

			for (int i = 1; i <= interfaces::entitylist->GetHighestEntityIndex(); i++)
			{
				if (i == local->GetIndex())
					continue;

				CBaseEntity* entity = interfaces::entitylist->GetClientEntity(i);
				if (!entity)
					continue;

				std::string modelName = interfaces::modelinfo->GetModelName(entity->GetModel());
				if (modelName.find(charenc("models/weapons")) == std::string::npos)
					continue;

				CBaseEntity* owner = interfaces::entitylist->GetClientEntityFromHandle(entity->GetOwner());
				if (!owner
					|| owner != local)
					continue;

				CBaseCombatWeapon* weapon = (CBaseCombatWeapon*)entity;
				if (!weapon)
					return;

				if (!weapon->IsKnife())
				{
					weapon->SetPattern(info, config.skincfg[weapon->GetItemDefinitionIndex()].skin, config.skincfg[weapon->GetItemDefinitionIndex()].wear, config.skincfg[weapon->GetItemDefinitionIndex()].seed, config.skincfg[weapon->GetItemDefinitionIndex()].stattrak, config.skincfg[weapon->GetItemDefinitionIndex()].name);
				}
				else
				{
					if (cvar::misc_knifechanger)
					{
						if (cvar::misc_knifechanger_model == 0)
						{
							*(int*)((DWORD)weapon + offsets::weapon::m_iItemDefinitionIndex) = WEAPON_KNIFE_BAYONET;
							weapon->SetPattern(info, config.skincfg[WEAPON_KNIFE_BAYONET].skin, config.skincfg[WEAPON_KNIFE_BAYONET].wear, config.skincfg[WEAPON_KNIFE_BAYONET].seed, config.skincfg[WEAPON_KNIFE_BAYONET].stattrak, config.skincfg[WEAPON_KNIFE_BAYONET].name);
						}
						else if (cvar::misc_knifechanger_model == 1)
						{
							*(int*)((DWORD)weapon + offsets::weapon::m_iItemDefinitionIndex) = WEAPON_KNIFE_FLIP;
							weapon->SetPattern(info, config.skincfg[WEAPON_KNIFE_FLIP].skin, config.skincfg[WEAPON_KNIFE_FLIP].wear, config.skincfg[WEAPON_KNIFE_FLIP].seed, config.skincfg[WEAPON_KNIFE_FLIP].stattrak, config.skincfg[WEAPON_KNIFE_FLIP].name);
						}
						else if (cvar::misc_knifechanger_model == 2)
						{
							*(int*)((DWORD)weapon + offsets::weapon::m_iItemDefinitionIndex) = WEAPON_KNIFE_GUT;
							weapon->SetPattern(info, config.skincfg[WEAPON_KNIFE_GUT].skin, config.skincfg[WEAPON_KNIFE_GUT].wear, config.skincfg[WEAPON_KNIFE_GUT].seed, config.skincfg[WEAPON_KNIFE_GUT].stattrak, config.skincfg[WEAPON_KNIFE_GUT].name);
						}
						else if (cvar::misc_knifechanger_model == 3)
						{
							*(int*)((DWORD)weapon + offsets::weapon::m_iItemDefinitionIndex) = WEAPON_KNIFE_KARAMBIT;
							weapon->SetPattern(info, config.skincfg[WEAPON_KNIFE_KARAMBIT].skin, config.skincfg[WEAPON_KNIFE_KARAMBIT].wear, config.skincfg[WEAPON_KNIFE_KARAMBIT].seed, config.skincfg[WEAPON_KNIFE_KARAMBIT].stattrak, config.skincfg[WEAPON_KNIFE_KARAMBIT].name);
						}
						else if (cvar::misc_knifechanger_model == 4)
						{
							*(int*)((DWORD)weapon + offsets::weapon::m_iItemDefinitionIndex) = WEAPON_KNIFE_M9BAYONET;
							weapon->SetPattern(info, config.skincfg[WEAPON_KNIFE_M9BAYONET].skin, config.skincfg[WEAPON_KNIFE_M9BAYONET].wear, config.skincfg[WEAPON_KNIFE_M9BAYONET].seed, config.skincfg[WEAPON_KNIFE_M9BAYONET].stattrak, config.skincfg[WEAPON_KNIFE_M9BAYONET].name);
						}
						else if (cvar::misc_knifechanger_model == 5)
						{
							*(int*)((DWORD)weapon + offsets::weapon::m_iItemDefinitionIndex) = WEAPON_KNIFE_HUNTSMAN;
							weapon->SetPattern(info, config.skincfg[WEAPON_KNIFE_HUNTSMAN].skin, config.skincfg[WEAPON_KNIFE_HUNTSMAN].wear, config.skincfg[WEAPON_KNIFE_HUNTSMAN].seed, config.skincfg[WEAPON_KNIFE_HUNTSMAN].stattrak, config.skincfg[WEAPON_KNIFE_HUNTSMAN].name);
						}
						else if (cvar::misc_knifechanger_model == 6)
						{
							*(int*)((DWORD)weapon + offsets::weapon::m_iItemDefinitionIndex) = WEAPON_KNIFE_FALCHION;
							weapon->SetPattern(info, config.skincfg[WEAPON_KNIFE_FALCHION].skin, config.skincfg[WEAPON_KNIFE_FALCHION].wear, config.skincfg[WEAPON_KNIFE_FALCHION].seed, config.skincfg[WEAPON_KNIFE_FALCHION].stattrak, config.skincfg[WEAPON_KNIFE_FALCHION].name);
						}
						else if (cvar::misc_knifechanger_model == 7)
						{
							*(int*)((DWORD)weapon + offsets::weapon::m_iItemDefinitionIndex) = WEAPON_KNIFE_BUTTERFLY;
							weapon->SetPattern(info, config.skincfg[WEAPON_KNIFE_BUTTERFLY].skin, config.skincfg[WEAPON_KNIFE_BUTTERFLY].wear, config.skincfg[WEAPON_KNIFE_BUTTERFLY].seed, config.skincfg[WEAPON_KNIFE_BUTTERFLY].stattrak, config.skincfg[WEAPON_KNIFE_BUTTERFLY].name);
						}
						else if (cvar::misc_knifechanger_model == 8)
						{
							*(int*)((DWORD)weapon + offsets::weapon::m_iItemDefinitionIndex) = WEAPON_KNIFE_DAGGER;
							weapon->SetPattern(info, config.skincfg[WEAPON_KNIFE_DAGGER].skin, config.skincfg[WEAPON_KNIFE_DAGGER].wear, config.skincfg[WEAPON_KNIFE_DAGGER].seed, config.skincfg[WEAPON_KNIFE_DAGGER].stattrak, config.skincfg[WEAPON_KNIFE_DAGGER].name);
						}
						else if (cvar::misc_knifechanger_model == 9)
						{
							*(int*)((DWORD)weapon + offsets::weapon::m_iItemDefinitionIndex) = WEAPON_KNIFE_BOWIE;
							weapon->SetPattern(info, config.skincfg[WEAPON_KNIFE_BOWIE].skin, config.skincfg[WEAPON_KNIFE_BOWIE].wear, config.skincfg[WEAPON_KNIFE_BOWIE].seed, config.skincfg[WEAPON_KNIFE_BOWIE].stattrak, config.skincfg[WEAPON_KNIFE_BOWIE].name);
						}
					}
				}
			}
		}
	}
}