View Single Post
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 02-09-2012 , 03:48   Re: SourceBans 1.4.9 (Updated 2011/11/18)
#2785

Quote:
Originally Posted by Horsedick View Post
aww awesome Peace.. so I just basically copied the same line right below that one and replaced the sm_rehash with sm_reloadscc

great!

Edit: Nope didn't work... I get this error in the server that user is in if I add them while they are in it which I have to unload and reload the simple-chat colors plugin to get it to work after that.
Hm, that seems to be a problem with simple-chatcolors. Thinking of it - you'll have to delay the sm_reloadscc command until the sourcebans plugin fetched the updated admins list. You should probably do that with a small plugin.
PHP Code:
new Handle:g_hReloadSCC INVALID_HANDLE;
public 
OnPluginStart()
{
  
AddCommandListener("sm_rehash"Cmd_Rehash);
}

public 
Action:Cmd_Rehash(client, const String:command[], argc)
{
  if(
g_hReloadSCC != INVALID_HANDLE)
    
KillTimer(g_hReloadSCC);
  
g_hReloadSCC CreateTimer(5.0Timer_ReloadSCC);
  return 
Plugin_Continue;
}

public 
Action:Timer_ReloadSCC(Handle:timerany:data)
{
  
ServerCommand("sm_reloadscc");
  
g_hReloadSCC INVALID_HANDLE;
  return 
Plugin_Stop;

This assumes, that sourcebans will have the admins fetched within 5 seconds. I think that sounds reasonable

If you still got problems with sm_reloadscc, try adding
PHP Code:
g_aPlayers[client] = INVALID_HANDLE
in line 189.
__________________
Peace-Maker is offline