Would be good to add server support to callback Command_GetBossIndexes (and perhaps to other debug commands) because when you run sm_sf2_getbossindexes command from server console (or via rcon), SM throws this error:
L 01/24/2021 - 15:15:28: [SM] Exception reported: Client index 0 is invalid
L 01/24/2021 - 15:15:28: [SM] Blaming: disabled/sf2.smx
L 01/24/2021 - 15:15:28: [SM] Call stack trace:
L 01/24/2021 - 15:15:28: [SM] [0] ClientCommand
Code snippet:
public Action Command_GetBossIndexes(int iClient,int args)
{
if (!g_bEnabled) return Plugin_Continue;
char sMessage[512];
char sProfile[SF2_MAX_PROFILE_NAME_LENGTH];
if ( iClient == 0 )
PrintToServer( "Active Boss Indexes:\n----------------------------" );
else {
ClientCommand(iClient, "echo Active Boss Indexes:");
ClientCommand(iClient, "echo ----------------------------");
}
for (int i = 0; i < MAX_BOSSES; i++)
{
if (NPCGetUniqueID(i) == -1) continue;
NPCGetProfile(i, sProfile, sizeof(sProfile));
FormatEx(sMessage, sizeof(sMessage), "%d - %s", i, sProfile);
if (NPCGetFlags(i) & SFF_FAKE)
{
StrCat(sMessage, sizeof(sMessage), " (fake)");
}
if (g_iSlenderCopyMaster[i] != -1)
{
char sCat[64];
FormatEx(sCat, sizeof(sCat), " (copy of %d)", g_iSlenderCopyMaster[i]);
StrCat(sMessage, sizeof(sMessage), sCat);
}
if ( iClient == 0 )
PrintToServer( "%s", sMessage );
else
ClientCommand(iClient, "echo %s", sMessage);
}
if ( iClient != 0 ) {
ClientCommand(iClient, "echo ----------------------------");
ReplyToCommand(iClient, "Printed active boss indexes to your console!");
}
return Plugin_Handled;
}
EDIT: Also you should disable DEBUG macro by default.
Would be good to add server support to callback
Command_GetBossIndexes
(and perhaps to other debug commands) because when you runsm_sf2_getbossindexes
command from server console (or via rcon), SM throws this error:Code snippet:
EDIT: Also you should disable
DEBUG
macro by default.