-
Notifications
You must be signed in to change notification settings - Fork 3
/
PlayerModelList.as
32 lines (23 loc) · 1.22 KB
/
PlayerModelList.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
CClientCommand g_ListModels("listmodels", "List model names and colors of the current players", @ListModels);
void PluginInit() {
g_Module.ScriptInfo.SetAuthor("incognico");
g_Module.ScriptInfo.SetContactInfo("https://discord.gg/qfZxWAd");
}
void ListModels(const CCommand@ pArgs) {
CBasePlayer@ pCaller = g_ConCommandSystem.GetCurrentPlayer();
g_PlayerFuncs.ClientPrint(pCaller, HUD_PRINTCONSOLE, "PLAYERNAME ==> MODELNAME (TOPCOLOR, BOTTOMCOLOR)\n");
g_PlayerFuncs.ClientPrint(pCaller, HUD_PRINTCONSOLE, "------------------------------------------------\n");
array<string> tmp;
for (int i = 1; i <= g_Engine.maxClients; ++i) {
CBasePlayer@ pPlayer = g_PlayerFuncs.FindPlayerByIndex(i);
if (pPlayer !is null && pPlayer.IsConnected()) {
KeyValueBuffer@ pInfos = g_EngineFuncs.GetInfoKeyBuffer(pPlayer.edict());
tmp.insertLast("" + pPlayer.pev.netname + " ==> " + pInfos.GetValue("model") + " (" + pInfos.GetValue("topcolor") + ", " + pInfos.GetValue("bottomcolor") + ")");
}
}
tmp.sort(function(a,b) { return a.ICompareN(b, 64) < b.ICompareN(a, 64); });
for (uint i = 0; i < tmp.length(); i++) {
g_PlayerFuncs.ClientPrint(pCaller, HUD_PRINTCONSOLE, tmp[i] + "\n");
}
tmp.resize(0);
}