sourcemod/plugins/basecommands/reloadadmins.sp
David Anderson 5600942b3c experimental commit of a menu attachment for sm_reloadadmins
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401524
2007-10-02 01:02:40 +00:00

38 lines
825 B
SourcePawn

PerformReloadAdmins(client)
{
/* Dump it all! */
DumpAdminCache(AdminCache_Groups, true);
DumpAdminCache(AdminCache_Overrides, true);
LogAction(client, -1, "\"%L\" refreshed the admin cache.", client);
ReplyToCommand(client, "[SM] %t", "Admin cache refreshed");
}
public AdminMenu_ReloadAdmins(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
{
if (action == TopMenuAction_DrawOption)
{
Format(buffer, maxlength, "%T", "Kick player", param);
}
else if (action == TopMenuAction_SelectOption)
{
PerformReloadAdmins(param);
RedisplayAdminMenu(topmenu, param);
}
}
public Action:Command_ReloadAdmins(client, args)
{
PerformReloadAdmins(client);
return Plugin_Handled;
}