Hello,
I use this plugin :
https://forums.alliedmods.net/showthread.php?p=1164669
But the author doesn't reply of my request.
I use the last sourcebans plugin :
http://forums.alliedmods.net/showthread.php?t=207840
When a players are disconnect in terrorist the players are automatic banned, but that is doesn't works.
That is the code for that in deathrun_manager.sp
PHP Code:
public OnAllPluginsLoaded()
if (LibraryExists("sourcebans"))
g_bSBAvailable = true;
public OnLibraryAdded(const String:name[])
if (StrEqual(name, "sourcebans"))
g_bSBAvailable = true;
public OnLibraryRemoved(const String:name[])
if (StrEqual(name, "sourcebans"))
g_bSBAvailable = false;
public Action:PlayerDisconnect_Event(Handle:event, const String:name[], bool:dontBroadcast) {
if (!GetConVarBool(_active) || !GetConVarBool(_tb))
return Plugin_Continue;
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (!client)
return Plugin_Continue;
if (IsClientInGame(client)) {
if (GetClientTeam(client) == CS_TEAM_T) {
if (GetTeamClientCount(CS_TEAM_CT) > 2) {
decl String:reason[128], String:steamid[64], String:cname[32];
GetEventString(event, "reason", reason, sizeof(reason));
if (StrEqual(reason, "Disconnect by user.", false)) {
GetEventString(event, "networkid", steamid, sizeof(steamid));
if(!GetClientName(client, cname, sizeof(cname)))
Format(cname, sizeof(cname), "Unconnected");
if (g_bSBAvailable)
SBBanPlayer(0, client, GetConVarInt(_bt), "Deathrun: Disconnected by terrorist");
else
BanClient(client, GetConVarInt(_bt), BANFLAG_AUTHID, "DEATHRUN: Terrorist can't disconnect", "DEATHRUN: Terrorist can't disconnect");
PrintToChatAll("\x04%t \x01>\x03 %t", "deathrun", "terr disconnected", cname, GetConVarInt(_bt));
}
}
PrintToChatAll("\x04%t \x01>\x03 %t", "deathrun", "selecting random terrorist");
CreateTimer(2.0, select_rt);
}
}
return Plugin_Continue;
}
Error :
PHP Code:
L 05/20/2013 - 20:17:38: [SM] Native "SBBanPlayer" reported:
L 05/20/2013 - 20:17:38: [SM] Displaying call stack trace for plugin "deathrun_manager.smx":
L 05/20/2013 - 20:17:38: [SM] [0] Line 161, deathrun_manager.sp::PlayerDisconnect_Event()
Can you help me for fix that ?
thanks