Function export request
-
Hi, I’m trying to make a plugin for a player to player private messaging command, and I’ve run into a little bit of trouble in that none of the HkMsg functions support specifying the “from” clientid (they all use 0 = CONSOLE) ??.
I’m looking for something like this.
HK_ERROR HkP2PMsg(int fromID, int toID, wstring wscMessage)
{
struct CHAT_ID ci = {fromID};
struct CHAT_ID ciClient = {toID};wstring wscXML = L"<tra data=“"0x19BD3A00"” mask=“"-1"/”><text>" + XMLText(wscMessage) + L"</text>";
uint iRet;
char szBuf[1024];
HkFMsgEncodeXML(wscXML, szBuf, sizeof(szBuf), iRet);
g_bMsg = true;
Server.SubmitChat(ci, iRet, szBuf, ciClient, -1);
g_bMsg = false;return HKE_OK;
}For now, I mostly have that function in my own plugin, but I can’t set g_bMsg from there.
I also copied the def for HkFMsgEncodeXML into my plugin for it to compile… so it would be nice to have it just in flhook instead.</tra> -
I see your problem, without the g_bMsg and activated chatfont feature, the pm color will not be green right?
Yeah, I will see to export the g_bMsg var in the next version.
What you could also do would be to use HkFMsg(uint iClientID, wstring wscXML) and completely pre-format your XML string (so you have to include the senders name as well - PlayerXY: text).
oh and yeah I will export the xml encode function as well