From 2f654c5d9271f0aa15497f70aef0385f54ee31d2 Mon Sep 17 00:00:00 2001 From: Huoji's <1296564236@qq.com> Date: Tue, 10 Oct 2023 22:11:01 +0800 Subject: [PATCH] fix steamid type --- csgo2/events.cpp | 3 +-- csgo2/script_apis.cpp | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/csgo2/events.cpp b/csgo2/events.cpp index 146609e..208b725 100644 --- a/csgo2/events.cpp +++ b/csgo2/events.cpp @@ -162,8 +162,7 @@ auto OnPlayerDeathEvent(IGameEvent* event) -> void { const auto attackerIndex = attacker->GetRefEHandle().GetEntryIndex(); ScriptCallBacks::luaCall_onPlayerDeath(victimIndex, attackerIndex, isHeadShot); - // printf("player[%p] %s kill[%p] %llu\n", attacker, - // &attacker->m_iszPlayerName(), victim, &victim->m_steamID()); + //printf("player[%p] %s kill[%p] %llu\n", attacker, &attacker->m_iszPlayerName(), victim, &victim->m_steamID()); } auto OnPlayerChat(CCSPlayerController* player, std::string message) -> bool { auto [procesChatSuccess, chatType, chatCtx] = diff --git a/csgo2/script_apis.cpp b/csgo2/script_apis.cpp index a50d598..10f8833 100644 --- a/csgo2/script_apis.cpp +++ b/csgo2/script_apis.cpp @@ -716,12 +716,12 @@ auto luaApi_RunServerCommand(lua_State* luaVm) -> int { } auto luaApi_GetPlayerSteamId(lua_State* luaVm) -> int { const auto playerIndex = lua_tointeger(luaVm, 1); - uint64_t steamid; + std::string steamid; ExcutePlayerAction(playerIndex, [&](CCSPlayerController* playerController) { - steamid = playerController->m_steamID(); + steamid = std::to_string(playerController->m_steamID()); }); lua_pop(luaVm, 1); - lua_pushinteger(luaVm, steamid); + lua_pushstring(luaVm, steamid.c_str()); return 1; } auto luaApi_KickPlayer(lua_State* luaVm) -> int {