本文整理汇总了C++中PlayerManager::FindPlayer方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerManager::FindPlayer方法的具体用法?C++ PlayerManager::FindPlayer怎么用?C++ PlayerManager::FindPlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerManager
的用法示例。
在下文中一共展示了PlayerManager::FindPlayer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
BOOL CMDMkbuilder::Execute(const std::string &verb, Player* mobile,std::vector<std::string> &args,int subcmd)
{
World* world = World::GetPtr();
PlayerManager* manager = world->GetPlayerManager();
Player* target = nullptr;
if (!args.size())
{
mobile->Message(MSG_ERROR,"You must specify the person that you would like to make a builder.\n");
return false;
}
target=manager->FindPlayer(args[0]);
if (target==nullptr)
{
mobile->Message(MSG_ERROR,"That person couldn't be found.");
return false;
}
if (mobile == target)
{
mobile->Message(MSG_INFO, "You may not make yourself a builder.");
return false;
}
if (BitIsSet(target->GetRank(),RANK_BUILDER))
{
mobile->Message(MSG_ERROR,"That person is already a builder.");
return false;
}
target->SetRank(BitSet(mobile->GetRank(),RANK_BUILDER));
target->Message(MSG_INFO,"You were made a builder.");
mobile->Message(MSG_INFO, Capitalize(target->GetName())+" was made a builder.");
return true;
}