-
Автор темы
- #1
I am trying to make a discord RPC that shows live matches like In: Main Menu -> connecting -> then the map name but its being stuck on (In: main menu )
Plz send the help to my Discord thx cl_show_team_equipment
Plz send the help to my Discord thx cl_show_team_equipment
DiscordRpc.cpp:
#include "discord_rpc_init.h"
#include <ctime>
#include "../Configuration/Config.h"
#include "utils/csgo.hpp"
#include "..\sdk\interfaces\IVEngineClient.hpp"
#include "..\includes.hpp"
void Discord::Initialize()
{
DiscordEventHandlers Handle;
memset(&Handle, 0, sizeof(Handle));
Discord_Initialize("", &Handle, 1, NULL);
}
void Discord::Update()
{
DiscordRichPresence discordPresence;
memset(&discordPresence, 0, sizeof(discordPresence));
static auto elapsed = std::time(nullptr);
std::string current_status = "in: main menu";
if (!m_engine()->IsInGame() && m_engine()->IsConnected()) {
current_status = "loading into game...";
}
else if (m_engine()->IsInGame()) {
current_status = "playing on: ";
current_status += m_engine()->GetLevelNameShort();
}
discordPresence.details = "";
discordPresence.state = "";
discordPresence.state = current_status.c_str();
//discordPresence.startTimestamp = elapsed;
discordPresence.largeImageKey = "";
discordPresence.smallImageKey = "";
discordPresence.button1_label = "";
discordPresence.button1_url = "";
discordPresence.button2_label = "";
discordPresence.button2_url = "";
Discord_UpdatePresence(&discordPresence);
}