Title is pretty self-explanatory. I would like to recreate
Arkshine's dhudmessage.inc in CPP and tried doing like in the presented code. I've tried both
MSG_ONE and
MSG_ONE_UNRELIABLE.
Code:
void DHudMessage(CBasePlayer* pPlayer, hudtextparms_t textparms, std::string text) {
MESSAGE_BEGIN(MSG_ONE_UNRELIABLE, SVC_DIRECTOR, nullptr, pPlayer->pev);
WRITE_BYTE(strlen(text.c_str()) + 31);
WRITE_BYTE(DRC_CMD_MESSAGE);
WRITE_BYTE(textparms.effect);
WRITE_LONG(textparms.b1 + (textparms.g1 << 8) + (textparms.r1 << 16));
WRITE_LONG(textparms.x);
WRITE_LONG(textparms.y);
WRITE_LONG(textparms.fadeinTime);
WRITE_LONG(textparms.fadeoutTime);
WRITE_LONG(textparms.holdTime);
WRITE_LONG(textparms.fxTime);
WRITE_STRING(text.c_str());
MESSAGE_END();
}
This is supposed to print a dhudmessage, without success.