| 1034 | } |
| 1035 | |
| 1036 | void ListPluginsToClient(CPlayer *player, const CCommand &args) |
| 1037 | { |
| 1038 | char buffer[256]; |
| 1039 | edict_t *e = player->GetEdict(); |
| 1040 | |
| 1041 | AutoPluginList plugins(scripts); |
| 1042 | if (!plugins->size()) |
| 1043 | { |
| 1044 | ClientConsolePrint(e, "[SM] No plugins found."); |
| 1045 | return; |
| 1046 | } |
| 1047 | |
| 1048 | SourceHook::List<SMPlugin *> m_FailList; |
| 1049 | |
| 1050 | size_t i = 0; |
| 1051 | for (; i < plugins->size(); i++) |
| 1052 | { |
| 1053 | SMPlugin *pl = plugins->at(i); |
| 1054 | |
| 1055 | if (pl->GetStatus() != Plugin_Running) |
| 1056 | { |
| 1057 | continue; |
| 1058 | } |
| 1059 | |
| 1060 | size_t len; |
| 1061 | const sm_plugininfo_t *info = pl->GetPublicInfo(); |
| 1062 | len = ke::SafeSprintf(buffer, sizeof(buffer), " \"%s\"", (IS_STR_FILLED(info->name)) ? info->name : pl->GetFilename()); |
| 1063 | if (IS_STR_FILLED(info->version)) |
| 1064 | { |
| 1065 | len += ke::SafeSprintf(&buffer[len], sizeof(buffer)-len, " (%s)", info->version); |
| 1066 | } |
| 1067 | if (IS_STR_FILLED(info->author)) |
| 1068 | { |
| 1069 | ke::SafeSprintf(&buffer[len], sizeof(buffer)-len, " by %s", info->author); |
| 1070 | } |
| 1071 | else |
| 1072 | { |
| 1073 | ke::SafeSprintf(&buffer[len], sizeof(buffer)-len, " %s", pl->GetFilename()); |
| 1074 | } |
| 1075 | ClientConsolePrint(e, "%s", buffer); |
| 1076 | } |
| 1077 | } |
| 1078 | |
| 1079 | #if SOURCE_ENGINE >= SE_ORANGEBOX |
| 1080 | void PlayerManager::OnClientCommand(edict_t *pEntity, const CCommand &args) |
no test coverage detected