增加移除物品

This commit is contained in:
Huoji's
2023-10-05 03:24:31 +08:00
parent dd0456b064
commit c1ed6d1ad9
12 changed files with 194 additions and 38 deletions

18
csgo2/weapon.cpp Normal file
View File

@@ -0,0 +1,18 @@
#include "weapon.h"
namespace GameWeapons {
auto ParseWeaponCommand(CCSPlayerController* pController,
std::string pszWeaponName) -> bool {
if (WeaponMap.find(pszWeaponName) == WeaponMap.end()) {
return false;
}
const auto [fullWeaponName, weaponPirce] = WeaponMap.at(pszWeaponName);
auto pItemServices = reinterpret_cast<void*>(
pController->m_hPawn().Get<CCSPlayerPawn>()->m_pItemServices());
if (pItemServices == NULL) {
return false;
}
Offset::FnGiveNamedItem(pItemServices, fullWeaponName.c_str(), nullptr,
nullptr, nullptr, nullptr);
return true;
}
}; // namespace GameWeapons