添加项目文件。

This commit is contained in:
Huoji's
2023-10-01 02:28:13 +08:00
parent ee12160e20
commit effb823be9
73 changed files with 7735 additions and 0 deletions

28
csgo2/events.cpp Normal file
View File

@@ -0,0 +1,28 @@
#include "events.h"
#include "native_sdk/entity/cbaseplayercontroller.h"
#include "player.h"
namespace events {
auto OnPlayerDeathEvent(IGameEvent* event) -> void {
UnkGameEventStruct_t userIdNameParams{ "userid" };
UnkGameEventStruct_t attackerNameParams{ "attacker" };
const auto victim = reinterpret_cast<CCSPlayerController*>(event->GetPlayerPawn(&userIdNameParams));
const auto attacker = reinterpret_cast<CCSPlayerController*>(event->GetPlayerPawn(&attackerNameParams));
auto victimName = &victim->m_iszPlayerName();
//victimBasePlayer->ForceRespawn();
printf("victim %s\n", victimName);
printf("attacker %s\n", attacker->m_iszPlayerName());
}
auto OnPlayerChat(IGameEvent* event) -> void
{
UnkGameEventStruct_t userIdNameParams{ "userid" };
const auto chater = reinterpret_cast<CCSPlayerController*>(event->GetPlayer(&userIdNameParams));
const auto text = event->GetString("text");
const auto chaterName = chater->m_iszPlayerName();
LOG("player: %s say: %s \n", chaterName, text);
}
}