Let's make this forum active again
ZChat_Cmds.cpp
ZConfiguration.hCode:void ChatCmd_AdminAnnounce(const char* line, const int argc, char **const argv) { if (argc < 2) { OutputCmdWrongArgument(argv[0]); return; } char szConfirm[1500]; sprintf(szConfirm,"^1Announce: ^2%s ?",argv[1]); memcpy(ZGetConfiguration()->GetEtc()->szAnnounce, argv[1], sizeof(argv[1]) + 64); ZApplication::GetGameInterface()->ShowConfirmMessage(szConfirm, ZGetPostAdminWall()); }
InterfaceListener.cppCode:struct ZCONFIG_ETC{ char szAnnounce[1500]; }; #define Z_ETC_ANNOUNCE (ZGetConfiguration()->GetEtc()->szAnnounce)
ZInterfaceListener.hCode:class ZPostAdminWall : public MListener{ public: virtual bool OnCommand(MWidget* pWidget, const char* szMessage){ if(MWidget::IsMsg(szMessage, MMSGBOX_YES)== true){ char szMsg[1000]; sprintf(szMsg,"%s : %s",ZGetMyInfo()->GetCharName(),ZGetConfiguration()->GetEtc()->szAnnounce); ZPostAdminAnnounce(ZGetGameClient()->GetPlayerUID(), szMsg, ZAAT_CHAT); } else { } pWidget->Show(false); return false; } } g_ConfirmAdminWall; MListener* ZGetPostAdminWall() { return &g_ConfirmAdminWall; }
Code:DECLARE_LISTENER(ZGetPostAdminWall);
![]()




Reply With Quote


