Cash ticket
#25

Hello, I wanted to share a small change to the code that /index.php?/profile/20534-veni/&do=hovercard" data-mentionid="20534" href="/index.php?/profile/20534-veni/" rel="">@Veni shared

 

Replacing this:

CLCString message(1024);
    message.Format("Wow, you just recieved %d cash!", amount);

    CNetMsg::SP clientMsg(new CNetMsg);
    SayMsg(clientMsg, MSG_CHAT_NOTICE, 0, "", "", message);
    SEND_Q(clientMsg, ch->m_desc);

 

By this:

CNetMsg::SP clientMsg(new CNetMsg);
    SysMsg(clientMsg, MSG_SYS_CASH_TICKET);
    SEND_Q(clientMsg, ch->m_desc);
    return;

 

And adding this to SharedLib/MessageType.h -> typedef enum _tagMsgSysType

MSG_SYS_CASH_TICKET, // NICOLASG MARK (CASH TICKET)

 

And adding this to Engine/Network/MessageDefine.h -> typedef enum _tagMsgSysType

MSG_SYS_CASH_TICKET, // NICOLASG MARK (CASH TICKET)

 

And adding this to Engine/Network/SessionState.cpp -> void CSessionState::ReceiveSystemMessage( CNetworkMessage *istr )

Note : it is necessary to create a new row in t_string (In this case I assigned the id 6515)

Note 2: i use SYSMSG_NOTIFY, available options: NORMAL, ATTACK, ATTACKED, ERROR, NOTIFY, USER

// NICOLASG MARK (CASH TICKET)
    case MSG_SYS_CASH_TICKET:
        pUIManager->GetChattingUI()->AddSysMessage(_S(6515, "CASH TICKET USED."), SYSMSG_NOTIFY);
        break;
    // NICOLASG MARK (CASH TICKET)

 

you can make the message appear in the system section and not in the player chat, thus being more original to the messaging system designed by the game developers, like:



 

p.s: the usefulness of this is to be able to change the message from database, in case u have have a server with multiple languages.



Messages In This Thread
[No subject] - by Matt Hias - 04-13-2021, 06:16 AM
[No subject] - by Joker - 04-13-2021, 02:22 PM
[No subject] - by Matt Hias - 04-13-2021, 03:42 PM
[No subject] - by Veni - 04-13-2021, 06:55 PM
[No subject] - by Matt Hias - 04-14-2021, 07:54 AM
[No subject] - by Veni - 04-14-2021, 08:04 AM
[No subject] - by Matt Hias - 04-14-2021, 08:25 AM
[No subject] - by Veni - 04-14-2021, 08:34 AM
[No subject] - by Matt Hias - 04-14-2021, 09:01 AM
[No subject] - by Scura - 04-14-2021, 09:13 AM
[No subject] - by Matt Hias - 04-14-2021, 09:23 AM
[No subject] - by Matt Hias - 04-14-2021, 10:37 AM
[No subject] - by Veni - 04-14-2021, 10:52 AM
[No subject] - by Matt Hias - 04-15-2021, 11:22 AM
[No subject] - by Veni - 04-15-2021, 12:11 PM
[No subject] - by Matt Hias - 04-15-2021, 12:56 PM
[No subject] - by Matt Hias - 04-22-2021, 08:33 PM
[No subject] - by Scura - 04-22-2021, 10:26 PM
[No subject] - by rondo157 - 04-23-2021, 02:34 AM
[No subject] - by Matt Hias - 04-23-2021, 08:01 AM
[No subject] - by Matt Hias - 04-23-2021, 08:17 AM
[No subject] - by Scura - 04-23-2021, 08:41 AM
[No subject] - by Matt Hias - 04-23-2021, 08:53 AM
[No subject] - by rondo157 - 04-23-2021, 02:26 PM
[No subject] - by nicolasg - 05-04-2022, 10:37 PM
[No subject] - by Veni - 05-05-2022, 06:23 AM
[No subject] - by rondo157 - 05-06-2022, 07:17 AM
[No subject] - by Scura - 05-06-2022, 10:18 AM
[No subject] - by nicolasg - 05-06-2022, 02:30 PM
[No subject] - by Scura - 05-06-2022, 02:38 PM
[No subject] - by nicolasg - 05-06-2022, 02:43 PM
[No subject] - by Scura - 05-06-2022, 03:10 PM
[No subject] - by Desarija - 05-06-2022, 03:12 PM
[No subject] - by Scura - 05-06-2022, 03:17 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)