void sendChatMessage(std::string message)
{
std::string strOpcode = "0C8F: samp process_chat_input \"" + message + "\"";
SF->getCLEO()->callOpcode(strOpcode.c_str());
}
void __stdcall cmdCallback(std::string param)
{
if (param.empty()) return;
sendChatMessage(param);
}
void __stdcall mainloop()
{
static bool initialized = false;
if (!initialized)
{
if (GAME && GAME->GetSystemState() == eSystemState::GS_PLAYING_GAME && SF->getSAMP()->IsInitialized())
{
SF->getSAMP()->registerChatCommand("sendchatmessage", cmdCallback);
initialized = true;
}
}
}