In char.h, class CHARACTER
Code
Example usage:
cmd.cpp, struct command_info cmd_info[]
{ "map_info", do_map_info, 0, POS_DEAD, GM_IMPLEMENTOR},
above struct:
ACMD(do_map_info);
file cmd_gm.cpp, new function:
Code
- ACMD(do_map_info)
- {
- LPSECTREE_MAP pMap = SECTREE_MANAGER::instance().GetMap(ch->GetMapIndex());
- if (pMap != NULL)
- {
- CHARACTER::FFindPC f;
- pMap->for_each(f);
- if (f.m_mapPC.size() > 0)
- {
- std::map<DWORD, LPCHARACTER>::iterator pc = f.m_mapPC.begin();
- while (pc != f.m_mapPC.end())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "%s", pc->second->GetName());
- pc++;
- }
- }
- }
- }
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Edit:
ACMD = #define ACMD(name) void (name)(LPCHARACTER ch, const char *argument, int cmd, int subcmd) in cmd.h