增加loader
This commit is contained in:
@@ -1,6 +1,48 @@
|
||||
#include "events.h"
|
||||
|
||||
namespace events {
|
||||
auto OnRoundEndEvent(IGameEvent* event) -> void {
|
||||
/*
|
||||
"winner" "byte" // winner team/user i
|
||||
"reason" "byte" // reson why team won
|
||||
"message" "string" // end round message
|
||||
*/
|
||||
|
||||
UnkGameEventStruct_t winnerNameParams{0};
|
||||
UnkGameEventStruct_t reasonNameParams{0};
|
||||
UnkGameEventStruct_t messageNameParams{0};
|
||||
|
||||
static const auto winnerStr = "winner";
|
||||
static const auto reasonStr = "reason";
|
||||
static const auto messageStr = "message";
|
||||
|
||||
winnerNameParams.m_Unk = Offset::FnServerHashFunction(
|
||||
winnerStr, sizeof winnerStr, SERVER_HASH_FUCNTION_KEY);
|
||||
winnerNameParams.m_Key = winnerStr;
|
||||
|
||||
reasonNameParams.m_Unk = Offset::FnServerHashFunction(
|
||||
reasonStr, sizeof reasonStr, SERVER_HASH_FUCNTION_KEY);
|
||||
reasonNameParams.m_Key = reasonStr;
|
||||
|
||||
messageNameParams.m_Unk = Offset::FnServerHashFunction(
|
||||
messageStr, sizeof messageStr, SERVER_HASH_FUCNTION_KEY);
|
||||
messageNameParams.m_Key = messageStr;
|
||||
|
||||
const auto message = event->GetString(&messageNameParams);
|
||||
const auto winner = event->GetInt(&winnerNameParams);
|
||||
const auto reason = event->GetInt(&reasonNameParams);
|
||||
|
||||
ScriptCallBacks::luaCall_onRoundEnd(winner, reason, message);
|
||||
}
|
||||
auto OnRoundStartEvent(IGameEvent* event) -> void {
|
||||
UnkGameEventStruct_t timelimitNameParams{0};
|
||||
static const auto timelimitStr = "timelimit";
|
||||
timelimitNameParams.m_Unk = Offset::FnServerHashFunction(
|
||||
timelimitStr, sizeof timelimitStr, SERVER_HASH_FUCNTION_KEY);
|
||||
timelimitNameParams.m_Key = timelimitStr;
|
||||
const auto timelimit = event->GetInt(&timelimitNameParams);
|
||||
ScriptCallBacks::luaCall_onRoundStart(timelimit);
|
||||
}
|
||||
auto OnPlayerSpawnEvent(IGameEvent* event) -> void {
|
||||
UnkGameEventStruct_t userIdNameParams{"userid"};
|
||||
const auto playerPawn = reinterpret_cast<CCSPlayerPawn*>(
|
||||
|
||||
Reference in New Issue
Block a user