HisaoShou 3 Posted September 23, 2018 Share Posted September 23, 2018 Hello everyone. I need a little help here: I need quest function which checks how many players are in certain maps. Does someone know any way do check this? Link to comment Share on other sites More sharing options...
Active Member Exygo 1091 Posted September 23, 2018 Active Member Share Posted September 23, 2018 There is no function like that https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
HisaoShou 3 Posted September 23, 2018 Author Share Posted September 23, 2018 Acum 5 minute, Exygo a spus: There is no function like that Then is there any way to check how many players are in certain map? Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted September 23, 2018 Premium Share Posted September 23, 2018 struct FPlayerCounter { int nCount; void operator () (LPENTITY ent) { if (ent->IsType(ENTITY_CHARACTER)) { LPCHARACTER pChar = static_cast<LPCHARACTER>(ent); if (pChar->IsPC() == true) { nCount++; } } } }; ACMD(do_get_player_count) { LPSECTREE_MAP pSectree = SECTREE_MANAGER::instance().GetMap(ch->GetMapIndex()); if (pSectree == NULL) return; FPlayerCounter f; f.nCount = 0; pSectree->for_each(f); ch->ChatPacket(CHAT_TYPE_INFO, "MapIndex: %d PlayerCount %d", ch->GetMapIndex(), f.nCount); } 2 Link to comment Share on other sites More sharing options...
HisaoShou 3 Posted September 23, 2018 Author Share Posted September 23, 2018 Acum 22 minute, Dobrescu Sebastian a spus: struct FPlayerCounter { int nCount; void operator () (LPENTITY ent) { if (ent->IsType(ENTITY_CHARACTER)) { LPCHARACTER pChar = static_cast<LPCHARACTER>(ent); if (pChar->IsPC() == true) { nCount++; } } } }; ACMD(do_get_player_count) { LPSECTREE_MAP pSectree = SECTREE_MANAGER::instance().GetMap(ch->GetMapIndex()); if (pSectree == NULL) return; FPlayerCounter f; f.nCount = 0; pSectree->for_each(f); ch->ChatPacket(CHAT_TYPE_INFO, "MapIndex: %d PlayerCount %d", ch->GetMapIndex(), f.nCount); } Wow, thank you very much! But can you please tell me where to put these? And can it be used as a quest function? I want to check the number of players from a map with a quest 1 Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted September 23, 2018 Premium Share Posted September 23, 2018 Struct you put at the top of cmd_general after the includes. Acmd you put at the end of file. If you want by quest you use the acmd code in questlua_pc.cpp Link to comment Share on other sites More sharing options...
HisaoShou 3 Posted September 23, 2018 Author Share Posted September 23, 2018 Acum 33 minute, Dobrescu Sebastian a spus: Struct you put at the top of cmd_general after the includes. Acmd you put at the end of file. If you want by quest you use the acmd code in questlua_pc.cpp Thank you sir! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now