What's new

Welcome to HvH Forum!

SignUp Now! Download Free HvH CS2/CS:GO Cheats, CFG, LUA/JS Scripts, And More!


SignUp Now!

Source Code why this trashtalk doesn`t work

Newbie HvHer
User ID
152691
Messages
7
Reactions
0
Level
1
Code:
inline void killMessage(c_game_event* event) noexcept
{

    auto localPlayer = HACKS->engine->get_local_player();
    if (g_cfg.misc.trashtalk
        && HACKS->engine->get_player_for_user_id(event->get_int(CXOR("attacker"))) == localPlayer
        && HACKS->engine->get_player_for_user_id(event->get_int(CXOR("userid"))) != localPlayer)
        HACKS->engine->execute_client_cmd(std::string{ "say " }.append(g_cfg.misc.trashtalkmsg).c_str());
}
 
PROFESSIONAL GATEKEEPER
User ID
11679
Messages
199
Reactions
57
Level
10


You are not looking for a specific event name called "player_death".

If this is for airflow:
- You can literally scroll around in the event_logs.cpp to see how anything/everything works.
- Can you refactor your code so it is easier to read?
- I dont think calling the local player through the engine class is the right way of getting the local player index.
- tfm::format exists btw.
- Why are you not writing this inside of the c_event_logs class???
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Top