Working sourcebans system (yes, you need MySQL server and web server with PHP). Currently supported versions 1.4.* (and 1.5.0 for sourcebans plugin). Integration into sourcebans 2.0 currently in development.
SM version 1.5.0-hg3761 or higher
SourceMod version 1.5.3 or 1.6 is required to compile the plugin (compiled plugin also works on sm 1.5)
Plugin based on ExtendedComms (Twisted|Panda) & SourceBans (SourceBans Development Team) plugins. Thanks them for code and idea. :wink:
Features:
Provides a straightforward category in the sm_admin menu where administrators can punish players as well as view current comm punishments.
The original BaseComm menu option still exist, and will still function. SourceComms plugin support storing history of punishments from BaseComm and another plugins
The category provides options for issuing new punishments, removing and viewing current punishments (categorized based on the punishment), as well as a List feature that provides information about current punishments.
The category also modifies the player's names in all of the options to show what their current punishment is. [ ] = None, [G] = Gagged, [M] = Muted, [S] = Silenced. I used Twisted|Panda menu code :oops:
All punishments (temporary, extended or permanent) are saved in MySQL database and are automatically reapplied (except temporary) when the punished player connects to the server. This allows punishments to be applied across multiple servers.
Extended punishments will automatically expire in-game at the designated time.
Permanent punishments remain on the player until an administrator removes them.
If the server has problems with access to the database, the punishments will store in SQLite database and would be added in the main database when connection is restored. (like in sourcebans plugin, yes)
Also you could apply punishments to multi-targets (such as `@all`, `@ct`, `@blue`, etc...)
Multi-target punishments will not be saved in db.
Removing punishments from multi-targets will removed punishments temporary (not from db).
Allowed session (temporary) punishments and extended with length less than 30 minutes and less than DefaultTime setting.
Permanent multi-target punishments is not available.
SourceComms has support for protecting current punishments based on immunity levels.
When a punishment is issued, the administrator responsible has their immunity level attached to the punishment. In order to remove that punishment, the second administrator must have higher immunity level or special admin flag (ADMFLAG_CUSTOM2 by default. You may change it in sourcecode). Also, punishment can be removed by console or his author.
Punishments issued by CONSOLE has some immunity level (which is set in config).
Immunity checking system could be disabled by setting "DisableUnblockImmunityCheck" to value 1 in config file.
One more important moment. When somebody removes punishment - plugin retrieves "punishment issuer admin id" from database. If the request fails - punishment could be temporary removed (on server, not in database) only by console, admin with special flag or with higher immunity.
Plugin has Servers White List feature. If enabled, plugin will apply on players punishments only from current server or servers listed in White List.
Punishments reasons and times stored in config. More details about config listed below.
Full punishments history (includes time, server, admin, reason, block length, comments, etc)
Showing type of block as icon in first column
Showing count of other blocks for this player (steam-id) at the right end of 'Player Name' column (This allows you to quickly identify regular offenders)
Admins with necessary rights could edit, delete blocks, and also "ungag" or "umnute" (like unban) player.
If the block is still in effect, during unblocking or deleting, web-part sends command for ungag or unmute player to all servers
Search field for quick punishments search on all pages and advanced search options on Comms page.
Admin-page 'Comms' for adding new punishments.
Command 'Block comms' in player context menu on servers page (sweet :) )
Commands:
The time parameter controls how long the player is punished. (< 0 == Temporary, 0 == Permanent, # == Minutes). If not specified it will be "DefaultTime" minutes (30 by default)
The player parameter could be Name (only as single word, without whitespaces), UserID (`#127`) or *magic* targets (like `@all` or `@red`). Look at sourcemod wiki for more details about targets.
sm_comms
Shows to player their communications status. (Also may used in chat)
Removes a player's ability to use in-game voice and chat.
sm_unmute <player> <optional:reason>
Restores a player's ability to use in-game voice.
sm_ungag <player> <optional:reason>
Restores a player's ability to use in-game chat.
sm_unsilence <player> <optional:reason>
Restores a player's ability to use in-game voice and chat.
Cvars:
sourcecomms_version - plugin version
Config settings:
DefaultTime. When admin run sm_gag (mute, silence) command only with player name - player will be gagged on DefaultTime value minutes. (if DefaultTime setted in -1 -> player will be blocked only on session (until reconnect)). Value 0(permanent)is not allowed.
DisableUnblockImmunityCheck (0, 1). Default value is 0. If setted to 1, player can be ungagged only by issuer admin, console or admin with special flag. Also, If 0 player maybe unblocked by Admin with higher immunity level than issuer admin had.
ConsoleImmunity. Default value is 0. Immunity Level of server console.
MaxLength, which works following way: Plugin will hide (for admins without ADMFLAG_CUSTOM 2) from menu all durations more than MaxLength and restricts punishments commands with time > MaxLength argument (or permanent).
OnlyWhiteListServers. Default value is 0. Set this option to 1 to applying on players punishments only from this server and servers listed in WhiteList. Value 0 applies on players punishments from any server.
Installation instructions Installation of server part
A sourcecomms-srv.zip file that provide all the necessary files, which can simply be extracted to your SourceMod directory. However, this is where the files go:
Code:
- sourcecomms.smx into /sourcemod/plugins/
- sourcecomms.phrases.txt into /sourcemod/translations/
- sourcecomms.cfg into /sourcemod/configs/sourcebans/
You need to add database record "sourcecomms" to your /sourcemod/configs/databases.cfg
Database Config (sample):
Installation of database part
Execute the following query below (but first - check your table prefix!! replace sb to yours, if you uses another) on your sourcebans database:
Also, you could import attached sb_comms.sql.txt file instead of copying code from this post.
After this, If you want to import punishments from ExtendedComm plugin, execute folowing queries on your sourcebans database (check sourcebans table prefix and extendedcomm table name. If you have different prefix or table_name - replace their in code below to your values. if extendedcomm table is in a different database - replace in code below extendedcomm to 'database_with_table'.'name_of_extendedcomm_t able'):
Code:
INSERT INTO sb_comms (authid, name, created, length, ends, reason, type) SELECT steam_id, "", mute_time, mute_length, mute_time+mute_length, mute_reason, 1 FROM extendedcomm WHERE (mute_type='1' OR mute_type='2');
INSERT INTO sb_comms (authid, name, created, length, ends, reason, type) SELECT steam_id, "", gag_time, gag_length, gag_time+gag_length, gag_reason, 2 FROM extendedcomm WHERE (gag_type='1' OR gag_type='2');
Also, you could import attached import.sql.txt file instead of copying code from this post.
Installation of Web part
Place files from sourcecomms-web.zip archive to your sourcebans web folder. Then you need to edit a few files (make backup before you doing this!!!) Instructions for edit are placed in files_to_edit.txt or under spoiler below
Spoiler
Code:
\filepath\filename
At line XXX -- code on this line for simple search --
Add AFTER/BEFORE/REPLACE
New code here
------------------------------------------------------------------------------------------------------------------------------------
\includes\admin.php
At line 315 -- elseif($_GET['c'] == "mods") --
Add BEFORE
elseif($_GET['c'] == "comms")
// ###################[ Comms ]##################################################################
{
CheckAdminAccess( ADMIN_OWNER|ADMIN_ADD_BAN|ADMIN_EDIT_OWN_BANS|ADMIN_EDIT_ALL_BANS );
if(!isset($_GET['o']))
{
// ====================[ ADMIN SIDE MENU START ] ===================
$banTabMenu = new CTabsMenu();
if($userbank->HasAccess(ADMIN_OWNER|ADMIN_ADD_BAN ) ) {
$banTabMenu->addMenuItem("Add a block", 0);
}
$banTabMenu->addMenuItem("Comms list", 1, "", "index.php?p=commslist",true);
$banTabMenu->outputMenu();
// ====================[ ADMIN SIDE MENU END ] ===================
include TEMPLATES_PATH . "/admin.comms.php";
if(isset($_GET['mode']) && $_GET['mode'] == "delete")
echo "<script>ShowBox('Ban Deleted', 'The ban has been deleted from SourceBans', 'green', '', true);</script>";
elseif(isset($_GET['mode']) && $_GET['mode']=="unban")
echo "<script>ShowBox('Player Unbanned', 'The Player has been unbanned from SourceBans', 'green', '', true);</script>";
RewritePageTitle("Comms");
}
elseif($_GET['o'] == 'edit')
{
$banTabMenu = new CTabsMenu();
$banTabMenu->addMenuItem("Back", 0,"", "javascript:history.go(-1);", true);
$banTabMenu->outputMenu();
include TEMPLATES_PATH . "/admin.edit.comms.php";
RewritePageTitle("Edit Block Details");
}
}
------------------------------------------------------------------------------------------------------------------------------------
\includes\page-builder.php
At line 38 -- case "servers": --
Add BEFORE
case "commslist":
RewritePageTitle("Communications Block List");
$page = TEMPLATES_PATH ."/page.commslist.php";
break;
------------------------------------------------------------------------------------------------------------------------------------
\includes\sb-callback.php
At line 2969 (end of file) -- ?> --
Add BEFORE
function AddBlock($nickname, $type, $steam, $length, $reason)
{
$objResponse = new xajaxResponse();
global $userbank, $username;
if(!$userbank->HasAccess(ADMIN_OWNER|ADMIN_ADD_BAN))
{
$objResponse->redirect("index.php?p=login&m=no_access", 0);
$log = new CSystemLog("w", "Hacking Attempt", $username . " tried to add a block, but doesnt have access.");
return $objResponse;
}
$steam = trim($steam);
$error = 0;
// If they didnt type a steamid
if(empty($steam))
{
$error++;
$objResponse->addAssign("steam.msg", "innerHTML", "You must type a Steam ID or Community ID");
$objResponse->addScript("$('steam.msg').setStyle('display', 'block');");
}
else if((!is_numeric($steam)
&& !validate_steam($steam))
|| (is_numeric($steam)
&& (strlen($steam) < 15
|| !validate_steam($steam = FriendIDToSteamID($steam)))))
{
$error++;
$objResponse->addAssign("steam.msg", "innerHTML", "Please enter a valid Steam ID or Community ID");
$objResponse->addScript("$('steam.msg').setStyle('display', 'block');");
}
else
{
$objResponse->addAssign("steam.msg", "innerHTML", "");
$objResponse->addScript("$('steam.msg').setStyle('display', 'none');");
}
if($error > 0)
return $objResponse;
$nickname = RemoveCode($nickname);
$reason = RemoveCode($reason);
if(!$length)
$len = 0;
else
$len = $length*60;
// prune any old bans
PruneComms();
$typeW = "";
switch ((int)$type)
{
case 1:
$typeW = "type = 1";
break;
case 2:
$typeW = "type = 2";
break;
case 3:
$typeW = "(type = 1 OR type = 2)";
break;
default:
$typeW = "";
break;
}
// Check if the new steamid is already banned
$chk = $GLOBALS['db']->GetRow("SELECT count(bid) AS count FROM ".DB_PREFIX."_comms WHERE authid = ? AND (length = 0 OR ends > UNIX_TIMESTAMP()) AND RemovedBy IS NULL AND ".$typeW, array($steam));
if(intval($chk[0]) > 0)
{
$objResponse->addScript("ShowBox('Error', 'SteamID: $steam is already blocked.', 'red', '');");
return $objResponse;
}
// Check if player is immune
$admchk = $userbank->GetAllAdmins();
foreach($admchk as $admin)
if($admin['authid'] == $steam && $userbank->GetProperty('srv_immunity') < $admin['srv_immunity'])
{
$objResponse->addScript("ShowBox('Error', 'SteamID: Admin ".$admin['user']." ($steam) is immune.', 'red', '');");
return $objResponse;
}
if((int)$type == 1 || (int)$type == 3)
{
$pre = $GLOBALS['db']->Prepare("INSERT INTO ".DB_PREFIX."_comms(created,type,authid,name,ends,length,reason,aid,adminIp ) VALUES
(UNIX_TIMESTAMP(),1,?,?,(UNIX_TIMESTAMP() + ?),?,?,?,?)");
$GLOBALS['db']->Execute($pre,array($steam,
$nickname,
$length*60,
$len,
$reason,
$userbank->GetAid(),
$_SERVER['REMOTE_ADDR']));
}
if ((int)$type == 2 || (int)$type ==3)
{
$pre = $GLOBALS['db']->Prepare("INSERT INTO ".DB_PREFIX."_comms(created,type,authid,name,ends,length,reason,aid,adminIp ) VALUES
(UNIX_TIMESTAMP(),2,?,?,(UNIX_TIMESTAMP() + ?),?,?,?,?)");
$GLOBALS['db']->Execute($pre,array($steam,
$nickname,
$length*60,
$len,
$reason,
$userbank->GetAid(),
$_SERVER['REMOTE_ADDR']));
}
$objResponse->addScript("ShowBlockBox('".$steam."', '".(int)$type."', '".(int)$len."');");
$objResponse->addScript("TabToReload();");
$log = new CSystemLog("m", "Block Added", "Block against (" . $steam . ") has been added, reason: $reason, length: $length", true, $kickit);
return $objResponse;
}
function PrepareReblock($bid)
{
$objResponse = new xajaxResponse();
$ban = $GLOBALS['db']->GetRow("SELECT name, authid, type, length, reason FROM ".DB_PREFIX."_comms WHERE bid = '".$bid."';");
// clear any old stuff
$objResponse->addScript("$('nickname').value = ''");
$objResponse->addScript("$('steam').value = ''");
$objResponse->addScript("$('txtReason').value = ''");
$objResponse->addAssign("txtReason", "innerHTML", "");
// add new stuff
$objResponse->addScript("$('nickname').value = '" . $ban['name'] . "'");
$objResponse->addScript("$('steam').value = '" . $ban['authid']. "'");
$objResponse->addScriptCall("selectLengthTypeReason", $ban['length'], $ban['type']-1, addslashes($ban['reason']));
$objResponse->addScript("SwapPane(0);");
return $objResponse;
}
function PrepareBlockFromBan($bid)
{
$objResponse = new xajaxResponse();
// clear any old stuff
$objResponse->addScript("$('nickname').value = ''");
$objResponse->addScript("$('steam').value = ''");
$objResponse->addScript("$('txtReason').value = ''");
$objResponse->addAssign("txtReason", "innerHTML", "");
$ban = $GLOBALS['db']->GetRow("SELECT name, authid FROM ".DB_PREFIX."_bans WHERE bid = '".$bid."';");
// add new stuff
$objResponse->addScript("$('nickname').value = '" . $ban['name'] . "'");
$objResponse->addScript("$('steam').value = '" . $ban['authid']. "'");
$objResponse->addScript("SwapPane(0);");
return $objResponse;
}
function PasteBlock($sid, $name)
{
$objResponse = new xajaxResponse();
global $userbank, $username;
$sid = (int)$sid;
if(!$userbank->HasAccess(ADMIN_OWNER|ADMIN_ADD_BAN))
{
$objResponse->redirect("index.php?p=login&m=no_access", 0);
$log = new CSystemLog("w", "Hacking Attempt", $username . " tried paste a block, but doesn't have access.");
return $objResponse;
}
require INCLUDES_PATH.'/CServerRcon.php';
//get the server data
$data = $GLOBALS['db']->GetRow("SELECT ip, port, rcon FROM ".DB_PREFIX."_servers WHERE sid = ?;", array($sid));
if(empty($data['rcon'])) {
$objResponse->addScript("$('dialog-control').setStyle('display', 'block');");
$objResponse->addScript("ShowBox('Error', 'No RCON password for server ".$data['ip'].":".$data['port']."!', 'red', '', true);");
return $objResponse;
}
$r = new CServerRcon($data['ip'], $data['port'], $data['rcon']);
if(!$r->Auth())
{
$GLOBALS['db']->Execute("UPDATE ".DB_PREFIX."_servers SET rcon = '' WHERE sid = ?;", array($sid));
$objResponse->addScript("$('dialog-control').setStyle('display', 'block');");
$objResponse->addScript("ShowBox('Error', 'Wrong RCON password for server ".$data['ip'].":".$data['port']."!', 'red', '', true);");
return $objResponse;
}
$ret = $r->rconCommand("status");
$search = preg_match_all(STATUS_PARSE,$ret,$matches,PREG_PATTERN_ORDER);
$i = 0;
$found = false;
$index = -1;
foreach($matches[2] AS $match) {
if($match == $name) {
$found = true;
$index = $i;
break;
}
$i++;
}
if($found) {
$steam = $matches[3][$index];
$name = $matches[2][$index];
$objResponse->addScript("$('nickname').value = '" . addslashes($name) . "'");
$objResponse->addScript("$('steam').value = '" . $steam . "'");
} else {
$objResponse->addScript("ShowBox('Error', 'Can\'t get player info for ".addslashes(htmlspecialchars($name)).". Player is not on the server (".$data['ip'].":".$data['port'].") anymore!', 'red', '', true);");
$objResponse->addScript("$('dialog-control').setStyle('display', 'block');");
return $objResponse;
}
$objResponse->addScript("SwapPane(0);");
$objResponse->addScript("$('dialog-control').setStyle('display', 'block');");
$objResponse->addScript("$('dialog-placement').setStyle('display', 'none');");
return $objResponse;
}
******************************************************************
At line 2477-2478 -- if($ctype=="B")
$redir = "?p=banlist".$pagelink; --
Add AFTER
elseif($ctype=="C")
$redir = "?p=commslist".$pagelink;
******************************************************************
At line 2448-2449 -- elseif($ctype=="P")
$redir = "?p=admin&c=bans#^1"; --
Add AFTER
elseif($ctype=="C")
$redir = "?p=commslist".$pagelink;
******************************************************************
At line 2410-2411 -- elseif($ctype=="P")
$redir = "?p=admin&c=bans#^1"; --
ADD AFTER
elseif($ctype=="C")
$redir = "?p=commslist".$pagelink;
******************************************************************
At line 1348 -- {name: "Kick", callback: function(){KickPlayerConfirm('.$sid.', "'.str_replace('"', '\"', $player["name"]).'", 0);}}, --
Add AFTER
{name: "Block comms", callback: function(){window.location = "index.php?p=admin&c=comms&action=pasteBan&sid='.$sid.'&pName='.str_replace('"', '\"', $player["name"]).'"}},
******************************************************************
At line 66 -- $xajax->registerFunction("SendMail"); --
Add AFTER
$xajax->registerFunction("AddBlock");
$xajax->registerFunction("PrepareReblock");
$xajax->registerFunction("PrepareBlockFromBan");
$xajax->registerFunction("PasteBlock");
------------------------------------------------------------------------------------------------------------------------------------
\includes\system-functions.php
At line 765 -- function GetSVNRev() --
Add BEFORE
function PruneComms()
{
global $userbank;
$res = $GLOBALS['db']->Execute('UPDATE `'.DB_PREFIX.'_comms` SET `RemovedBy` = 0, `RemoveType` = \'E\', `RemovedOn` = UNIX_TIMESTAMP() WHERE `length` != 0 and `ends` < UNIX_TIMESTAMP() and `RemoveType` IS NULL');
return $res?true:false;
}
******************************************************************
At line 218 -- case "groups": --
Add BEFORE
case "comms":
$cat = "Communication blocks management";
break;
******************************************************************
At line 187 -- $submenu->addMenuItem("Bans", 0,"", "index.php?p=admin&c=bans", true); --
Add AFTER
if($userbank->HasAccess( ADMIN_OWNER|ADMIN_ADD_BAN|ADMIN_EDIT_OWN_BANS|ADMIN_EDIT_ALL_BANS))
$submenu->addMenuItem("Comms", 0,"", "index.php?p=admin&c=comms", true);
******************************************************************
At line 169 -- AddTab("Ban List", "index.php?p=banlist", "All of the bans in the database can be viewed from here."); --
Add AFTER
AddTab("Comm List", "index.php?p=commslist", "All of the communication bans (such as chat gags and voice mutes) in the database can be viewed from here.");
******************************************************************
At line 135-137 -- $tab_arr[2] = "Servers";
$tab_arr[3] = "Submit a ban";
$tab_arr[4] = "Protest a ban"; --
REPLACE
$tab_arr[2] = "Comm List";
$tab_arr[3] = "Servers";
$tab_arr[4] = "Submit a ban";
$tab_arr[5] = "Protest a ban";
------------------------------------------------------------------------------------------------------------------------------------
\pages\page.banlist.php
At line 470 -- $data['details_link'] = CreateLinkR('click','getdemo.php?type=B&id='.$res->fields['ban_id']); --
ADD BEFORE
$data['blockcomm_link'] = CreateLinkR('<img src="images/forbidden.png" border="0" alt="" style="vertical-align:middle" /> Block Comms',"index.php?p=admin&c=comms".$pagelink."&blockfromban=".$res->fields['ban_id']."&key=".$_SESSION['banlist_postkey']."#^0");
******************************************************************
At line 345 -- $where = "WHERE CO.commenttxt LIKE ?"; --
REPLACE
$where = "WHERE CO.type = 'B' AND CO.commenttxt LIKE ?";
------------------------------------------------------------------------------------------------------------------------------------
\scripts\sourcebans.js
At line 1473 (end of file) -- } --
Add AFTER
function RemoveBlock(id, key, page, name, confirm)
{
if(confirm==0) {
ShowBox('Delete Block', 'Are you sure you want to delete the block for '+ name + '?', 'blue', '', true);
$('dialog-control').setHTML('<input type="button" onclick="RemoveBlock(\''+id+'\', \''+key+'\', \''+page+'\', \''+addslashes(name.replace(/\'/g,'\\\''))+'\', \'1\''+');" name="rban" class="btn ok" onmouseover="ButtonOver(\'rban\')" onmouseout="ButtonOver(\'rban\')" id="rban" value="Remove Block" /> <input type="button" onclick="closeMsg(\'\');$(\'bulk_action\').options[0].selected=true;" name="astop" class="btn cancel" onmouseover="ButtonOver(\'astop\')" onmouseout="ButtonOver(\'astop\')" id="astop" value="Cancel" />');
} else if(confirm==1) {
if(page != "")
var pagelink = page;
else
var pagelink = "";
window.location = "index.php?p=commslist" + pagelink + "&a=delete&id="+ id +"&key="+ key;
}
}
function UnGag(id, key, page, name, popup)
{
if(popup==1) {
ShowBox('UnGag Reason', '<b>Please give a short comment, why you are going to ungag '+"\'"+ name +"\'"+'!</b><br><textarea rows="3" cols="40" name="ureason" id="ureason" style="overflow:auto;"></textarea><br><div id="ureason.msg" class="badentry"></div>', 'blue', '', true);
$('dialog-control').setHTML('<input type="button" onclick="UnGag(\''+id+'\', \''+key+'\', \''+page+'\', \''+addslashes(name.replace(/\'/g,'\\\''))+'\', \'0\''+');" name="uban" class="btn ok" onmouseover="ButtonOver(\'uban\')" onmouseout="ButtonOver(\'uban\')" id="uban" value="UnGag Player" /> <input type="button" onclick="closeMsg(\'\');" name="astop" class="btn cancel" onmouseover="ButtonOver(\'astop\')" onmouseout="ButtonOver(\'astop\')" id="astop" value="Cancel" />');
} else if(popup==0) {
if(page != "")
var pagelink = page;
else
var pagelink = "";
reason = $('ureason').value;
if(reason == "") {
$('ureason.msg').setHTML("Please leave a comment.");
$('ureason.msg').setStyle('display', 'block');
return;
} else {
$('ureason.msg').setHTML('');
$('ureason.msg').setStyle('display', 'none');
}
window.location = "index.php?p=commslist" + pagelink + "&a=ungag&id="+ id +"&key="+ key +"&ureason="+ reason;
}
}
function UnMute(id, key, page, name, popup)
{
if(popup==1) {
ShowBox('UnMute Reason', '<b>Please give a short comment, why you are going to unmute '+"\'"+ name +"\'"+'!</b><br><textarea rows="3" cols="40" name="ureason" id="ureason" style="overflow:auto;"></textarea><br><div id="ureason.msg" class="badentry"></div>', 'blue', '', true);
$('dialog-control').setHTML('<input type="button" onclick="UnMute(\''+id+'\', \''+key+'\', \''+page+'\', \''+addslashes(name.replace(/\'/g,'\\\''))+'\', \'0\''+');" name="uban" class="btn ok" onmouseover="ButtonOver(\'uban\')" onmouseout="ButtonOver(\'uban\')" id="uban" value="UnMute Player" /> <input type="button" onclick="closeMsg(\'\');" name="astop" class="btn cancel" onmouseover="ButtonOver(\'astop\')" onmouseout="ButtonOver(\'astop\')" id="astop" value="Cancel" />');
} else if(popup==0) {
if(page != "")
var pagelink = page;
else
var pagelink = "";
reason = $('ureason').value;
if(reason == "") {
$('ureason.msg').setHTML("Please leave a comment.");
$('ureason.msg').setStyle('display', 'block');
return;
} else {
$('ureason.msg').setHTML('');
$('ureason.msg').setStyle('display', 'none');
}
window.location = "index.php?p=commslist" + pagelink + "&a=unmute&id="+ id +"&key="+ key +"&ureason="+ reason;
}
}
function UnSilence(id, key, page, name, popup)
{
if(popup==1) {
ShowBox('UnSilence Reason', '<b>Please give a short comment, why you are going to unmute&ungag '+"\'"+ name +"\'"+'!</b><br><textarea rows="3" cols="40" name="ureason" id="ureason" style="overflow:auto;"></textarea><br><div id="ureason.msg" class="badentry"></div>', 'blue', '', true);
$('dialog-control').setHTML('<input type="button" onclick="UnSilence(\''+id+'\', \''+key+'\', \''+page+'\', \''+addslashes(name.replace(/\'/g,'\\\''))+'\', \'0\''+');" name="uban" class="btn ok" onmouseover="ButtonOver(\'uban\')" onmouseout="ButtonOver(\'uban\')" id="uban" value="UnSilence Player" /> <input type="button" onclick="closeMsg(\'\');" name="astop" class="btn cancel" onmouseover="ButtonOver(\'astop\')" onmouseout="ButtonOver(\'astop\')" id="astop" value="Cancel" />');
} else if(popup==0) {
if(page != "")
var pagelink = page;
else
var pagelink = "";
reason = $('ureason').value;
if(reason == "") {
$('ureason.msg').setHTML("Please leave a comment.");
$('ureason.msg').setStyle('display', 'block');
return;
} else {
$('ureason.msg').setHTML('');
$('ureason.msg').setStyle('display', 'none');
}
window.location = "index.php?p=commslist" + pagelink + "&a=unsilence&id="+ id +"&key="+ key +"&ureason="+ reason;
}
}
function search_blocks()
{
var type = "";
var input = "";
if($('name').checked)
{
type = "name";
input = $('nick').value;
}
if($('steam_').checked)
{
type = (document.getElementById('steam_match').value == "1" ? "steam" : "steamid");
input = $('steamid').value;
}
if($('reason_').checked)
{
type = "reason";
input = $('ban_reason').value;
}
if($('date').checked)
{
type = "date";
input = $('day').value + "," + $('month').value + "," + $('year').value;
}
if($('length_').checked)
{
type = "length";
if($('length').value=="other")
var length = $('other_length').value;
else
var length = $('length').value
input = $('length_type').value + "," + length;
}
if($('ban_type_').checked)
{
type = "btype";
input = $('ban_type').value;
}
if($('bancount').checked)
{
type = "bancount";
input = $('timesbanned').value;
}
if($('admin').checked)
{
type = "admin";
input = $('ban_admin').value;
}
if($('where_banned').checked)
{
type = "where_banned";
input = $('server').value;
}
if($('comment_').checked)
{
type = "comment";
input = $('ban_comment').value;
}
if(type!="" && input!="")
window.location = "index.php?p=commslist&advSearch=" + input + "&advType=" + type;
}
function ShowBlockBox(check, type, length)
{
ShowBox('Block Added', 'The block has been successfully added<br><iframe id="srvkicker" frameborder="0" width="100%" src="pages/admin.blockit.php?check='+check+'&type='+type+'&length='+length+'"></iframe>', 'green', 'index.php?p=admin&c=comms', true);
}
******************************************************************
At line 1197 -- window.location = "index.php?p=banlist"+searchlink+"&page="+nextPage; --
Add AFTER
if(type == "C")
window.location = "index.php?p=commslist"+searchlink+"&page="+nextPage;
------------------------------------------------------------------------------------------------------------------------------------
\themes\**\css\css.php
At line 496-501 -- #search {
width: 300px;
float: right;
padding: 2px 0 0 0;
text-align: right;
} --
REPLACE
#search2 {
width: 300px;
float: right;
padding: 2px 0 0 0;
text-align: right;
}
#search {
width: 200px;
float: right;
margin: auto 14px 0 auto;
margin-right: 14;
margin-bottom: -10px;
padding: 0 0 0 0;
text-align: right;
}
******************************************************************
At line 334-339 -- .searchbox {
width:105px;
height:14px;
background-color:#d7d7d7;
border:0;
} --
REPLACE
.searchbox {
width:230px;
height:14px;
background-color:#fdeaa8;
border:0;
}
.searchbox2 {
width:105px;
height:14px;
background-color:#fdeaa8;
border:0;
}
------------------------------------------------------------------------------------------------------------------------------------
\themes\**\page_bans.tpl
At line 138 -- <li>{$ban.demo_link}</li> --
ADD BEFORE
<li>{$ban.blockcomm_link}</li>
Plugin tested and works fine on TF2, CS:S, CS:Go servers.
Last edited by ppalex; 03-20-2016 at 10:21.
Reason: updated to 0.9.266
Client index. Client index must be valid (0 < client < MaxClients) and client must be in game (IsClientInGame(client) == true).
boolmuteState | gagState
true to mute (or gag) client, false to unmute (ungag).
Next parameters applies only for muting or gagging (muteState==true or gagState==true).
muteLength | gagLength
length of punishment in minutes. Value < 0 muting (gagging) client for session (until reconnect). Permanent (0) is not allowed. Default value is -1.
boolsaveToDB
if true - punishment will be saved in DB (maybe not immediately). Default value is false.
Stringreason
reason of punishment which will displayed and (possibly) saved into DB. Default value is Muted through natives or Gagged through natives.
Natives returns true if this caused a change in mute or gag state, false otherwise.
It's recommended to use these natives instead of BaseComm_SetClientMute or BaseComm_SetClientGag.
For example, equivalent of BaseComm_SetClientMute(client, true) is SourceComms_SetClientMute(client, true, -1, false); also it may be SourceComms_SetClientMute(client, true, _, _) or simple SourceComms_SetClientMute(client, true).
Removing player's punishments from DB through natives are not available at this moment.
client - Client index, it must be valid and client must be in game.
Natives returns one of enum bType values, which can be:
bNot - Player chat or voice is not blocked.
bSess - Player chat or voice is blocked for player session (until reconnect) (like in basecomm plugin).
bTime - Player chat or voice is blocked for some time.
bPerm - Player chat or voice is permanently blocked.
Changelog
Spoiler
Code:
* **0.9.266** - Added Spanish translation. Thanks to Sarona.
* **0.9.265** - Updater's url changed to the new domain.
* **0.9.264** - Updated English translation. Thanks to Nomy.
* **0.9.263** - Fixed SourceComms_SetClientMute params description. Thanks to Bara.
* **0.9.262** - Fixed plugin include file to prevent compiling errors when twice included.
* **0.9.260** - Added Deutsch translation. Thanks to winter
* **0.9.259** - Fixed bug with loading issuer admin's authid.
* **0.9.257** - Fixed bug (creating unused file %s is gagged from web on server) with logging gags from web. Thanks to reji.
* **0.9.256**
* Added Portuguese translation. Thanks to StayOx.
* Removing quotes and whitespaces from reason.
* Fixed reason loss in ungag/unmute console commands.
* Fixed wrong fail state messages.
* Fixed memory leak in unblock function.
* Fixed bug with showing "unblocked" message if player wasn't unblocked.
* **0.9.242** - Fixed bug with removing temporary punishments by admins without special flag and greather immunity level. Thanks to White Wolf for reporting and fix testing.
* **0.9.233**
* Added ability to use @all, @blue, @ct, etc. as punishment target (without saving to DB).
* Added ability to temporary mass-removing punishements (with @all, @blue, @ct, etc targets) - without removing from DB.
* Fixed bugs with permissions check on removing punishments.
* Fixed bug with unsilence on players which has combination of temp and time/perm punishments.
* Fixed bug with broken mysql connection encoding after reconnect. Supported on SM builds greather than **1.6.0-dev+3947**.
* Now plugin uses common sourcemode logs for errors and messages. You can delete sourcecomms.log file from your sourcemod logs folder.
* Removed ServerID auto-detection. You must specify it in the sourcebans config.
* Some bugs fixes.
* Code improvements.
* **0.9.9** - Added Polish translation. Thanks to killerps.
* **0.9.7** - Added the ability to use the player's name in quotes in console commands. Request from lyric.
* **0.9.1**
* Plugin was approved! Many thanks to alongub.
* No changes were made, only version bump.
* **0.8.257**
* Now already punished players are hided from menu. Thanks for idea to wingblack.
* Allowed to use serverID = 0. Request from bottiger.
* **0.8.253**
* A lot of code was refactored.
* Added *Servers White List* feature. More details in README.
* Fixed console immunity value for punishments received from web.
* Added **natives** for . More details in README.
* Fixed bug with unblocking commands, if they were called by console.
* **0.8.158**
* Fixed `Unknown command` reply in client console.
* Fixed/added SQL-escaping to prevent SQL-injections.
* Changed way of connecting to database, added checking for *connection lost*.
* Fixed bug with unicode symbols in entries from queue.
* Fixed bug with only one punishment per steam-id could be saved in queue.
* Fixed bug with `MaxLength` checking, which doesn't work correctly for admins with `UNBLOCK_FLAG`.
* Some optimizations of SQL-queries.
* Improved plugin state *consistency* with unstable database connection.
* Other code improvements. Thanks to alongub.
* **0.8.89** - Fixed bug with MaxLength checking in console commands.
* **0.8.88**
* Added `MaxLength` option to config. See plugin config for mor details.
* Fixed admin immunity determination in sql queries.
* Added setting up console immunity on block fetching.
* **0.8.79** - Added colored prefix to all output messages.
* **0.8.75**
* Code improvements.
* Fixed some mistakes in actions logging.
* **0.8.65**
* Code improvements.
* Fixed bug with unicode arguments in punishment commands.
* Added command `sm_comms` for players, which provides viewing communications status of himself.
* Bots are now removed from menu targets list.
* **0.8.1**
* Fixed bug with *player's name in the database sometimes was a part of another "sql-query"*
* Code improvements to avoid similar bugs in the future.
* Disabled sql-queries log.
* **0.7.122**
* Fixed bug: punishments were recorded into the database twice.
* Removed "select from queue" query from logging.
* Fixed bug with wrong logging comms actions in SM logs.
* Enabled sql-queries log.
* **0.7.114**
* Fixed some flaws in the sql queries.
* Small code improvements.
* **0.7.111** - First release on AlliedMods.
* **0.7.97**
* Minor bugs fixed.
* DEBUG info now disabled by default.
* Now plugin is "beta".
* **0.7.60**
* Changed internal data structure.
* Added to Menu List of Current players punishments (from original ExtendedComms plugin).
* Added "ConsoleImmunity" and "DisableUnblockImmunityCheck" variables to config.
* **0.6.52**
* Now plugin will auto-reloads after update.
* Little changes in translation.
* **0.6.51** - Added temporary punishments.
* **0.6.44** - Added "DefaultTime" variable to config.
* **0.6.42** - In debug mode, text of all sql queries will stored in separate log.
* **0.6.37** - Added console commands that provides unblocking player comms via web.
* **0.6.34** - Added Updater support.
* **0.6.20** - Fixed bug: "after restoring a database connection expired punishments were not added to main database".
* **0.6.19** - Fixed bug with displaying admin activity after restoring a database connection, but not immediately.
* **0.6.14** - Added console commands that provides blocking player comms via web.
* **0.5.30** - First public alpha.
Last edited by ppalex; 11-22-2014 at 13:10.
Reason: upd 0.9.265
Nice userful thingy it seems to be . I'il check it out soon and you should attach compiled .smx file. If Get Plugin is not working because of non-sm original include files
Nice userful thingy it seems to be . I'il check it out soon and you should attach compiled .smx file. If Get Plugin is not working because of non-sm original include files
Interesting idea!
I'd recommend you to disable basecomm plugin at all (ie move to disabled folder), and add gag/mute/silence functions in this plugin (and possibly add menu with 'for how long time punish player')
I havent tested it yet, but I think when you will choose a player from a menu, it will block player only for session (aka default one) or will reply 'usage: sm_command userid time reason'
Interesting idea!
I'd recommend you to disable basecomm plugin at all (ie move to disabled folder), and add gag/mute/silence functions in this plugin (and possibly add menu with 'for how long time punish player')
I havent tested it yet, but I think when you will choose a player from a menu, it will block player only for session (aka default one) or will reply 'usage: sm_command userid time reason'
I thought about it. It would be difficult and inappropriate - i would need to re-implement all the functionality of the plugin basecomm. In addition to basecomm plugin version 1.5.0-hg3761 or newer should work well.
Spoiler
несколько забавно видеть ответы из России на английском, хотя и не удивительно
Revienting a wheel isnt very motivated. However, I think plugin will be more popular if you will implement it. I seen a plugin that showing additional menu on stock sourcemod command (kick?) so just take a look at this, and if possible implement an additional menu to it
Revienting a wheel isnt very motivated. However, I think plugin will be more popular if you will implement it. I seen a plugin that showing additional menu on stock sourcemod command (kick?) so just take a look at this, and if possible implement an additional menu to it
I do not understand the meaning of integration basecomm in my plugin.
functionality of one or two plug-in aggregate - the same
Also I think, that replacement the default plugin is a bad thing for most of admins.