added cs: go support to SelfMute, WeaponCleaner and voiceannounce_ex

fixed sourcebans version by request
fixed awful bug in spectate plugin
This commit is contained in:
BotoX 2016-05-19 16:12:34 +02:00
parent 8d50f9f849
commit 5ba8cae70a
8 changed files with 110 additions and 41 deletions

View File

@ -4,6 +4,8 @@
#include <sdkhooks> #include <sdkhooks>
#include <zombiereloaded> #include <zombiereloaded>
#pragma newdecls required
public Plugin myinfo = public Plugin myinfo =
{ {
name = "PlayerVisibility", name = "PlayerVisibility",

View File

@ -18,8 +18,9 @@ bool g_Plugin_ccc = false;
bool g_Plugin_zombiereloaded = false; bool g_Plugin_zombiereloaded = false;
bool g_Plugin_voiceannounce_ex = false; bool g_Plugin_voiceannounce_ex = false;
bool g_Plugin_AdvancedTargeting = false; bool g_Plugin_AdvancedTargeting = false;
bool g_bIsProtoBuf = false;
#define PLUGIN_VERSION "2.1" #define PLUGIN_VERSION "2.2"
public Plugin myinfo = public Plugin myinfo =
{ {
@ -62,6 +63,9 @@ public void OnPluginStart()
HookEvent("round_end", Event_Round); HookEvent("round_end", Event_Round);
HookEvent("player_team", Event_TeamChange); HookEvent("player_team", Event_TeamChange);
if(GetFeatureStatus(FeatureType_Native, "GetUserMessageType") == FeatureStatus_Available && GetUserMessageType() == UM_Protobuf)
g_bIsProtoBuf = true;
UserMsg RadioText = GetUserMessageId("RadioText"); UserMsg RadioText = GetUserMessageId("RadioText");
if(RadioText == INVALID_MESSAGE_ID) if(RadioText == INVALID_MESSAGE_ID)
SetFailState("This game doesn't support RadioText user messages."); SetFailState("This game doesn't support RadioText user messages.");
@ -81,7 +85,8 @@ public void OnAllPluginsLoaded()
g_Plugin_zombiereloaded = LibraryExists("zombiereloaded"); g_Plugin_zombiereloaded = LibraryExists("zombiereloaded");
g_Plugin_voiceannounce_ex = LibraryExists("voiceannounce_ex"); g_Plugin_voiceannounce_ex = LibraryExists("voiceannounce_ex");
g_Plugin_AdvancedTargeting = LibraryExists("AdvancedTargeting"); g_Plugin_AdvancedTargeting = LibraryExists("AdvancedTargeting");
LogMessage("CCC: %s\nZombieReloaded: %s\nVoiceAnnounce: %s\nAdvancedTargeting: %s", LogMessage("SelfMute capabilities:\nProtoBuf: %s\nCCC: %s\nZombieReloaded: %s\nVoiceAnnounce: %s\nAdvancedTargeting: %s",
(g_bIsProtoBuf ? "yes" : "no"),
(g_Plugin_ccc ? "loaded" : "not loaded"), (g_Plugin_ccc ? "loaded" : "not loaded"),
(g_Plugin_zombiereloaded ? "loaded" : "not loaded"), (g_Plugin_zombiereloaded ? "loaded" : "not loaded"),
(g_Plugin_voiceannounce_ex ? "loaded" : "not loaded"), (g_Plugin_voiceannounce_ex ? "loaded" : "not loaded"),
@ -817,6 +822,18 @@ int g_MsgPlayersNum;
int g_MsgPlayers[MAXPLAYERS + 1]; int g_MsgPlayers[MAXPLAYERS + 1];
public Action Hook_UserMessageRadioText(UserMsg msg_id, Handle bf, const int[] players, int playersNum, bool reliable, bool init) public Action Hook_UserMessageRadioText(UserMsg msg_id, Handle bf, const int[] players, int playersNum, bool reliable, bool init)
{
if(g_bIsProtoBuf)
{
g_MsgDest = PbReadInt(bf, "msg_dst");
g_MsgClient = PbReadInt(bf, "client");
PbReadString(bf, "msg_name", g_MsgName, sizeof(g_MsgName));
PbReadString(bf, "params", g_MsgParam1, sizeof(g_MsgParam1), 0);
PbReadString(bf, "params", g_MsgParam2, sizeof(g_MsgParam2), 1);
PbReadString(bf, "params", g_MsgParam3, sizeof(g_MsgParam3), 2);
PbReadString(bf, "params", g_MsgParam4, sizeof(g_MsgParam4), 3);
}
else
{ {
g_MsgDest = BfReadByte(bf); g_MsgDest = BfReadByte(bf);
g_MsgClient = BfReadByte(bf); g_MsgClient = BfReadByte(bf);
@ -825,6 +842,7 @@ public Action Hook_UserMessageRadioText(UserMsg msg_id, Handle bf, const int[] p
BfReadString(bf, g_MsgParam2, sizeof(g_MsgParam2), false); BfReadString(bf, g_MsgParam2, sizeof(g_MsgParam2), false);
BfReadString(bf, g_MsgParam3, sizeof(g_MsgParam3), false); BfReadString(bf, g_MsgParam3, sizeof(g_MsgParam3), false);
BfReadString(bf, g_MsgParam4, sizeof(g_MsgParam4), false); BfReadString(bf, g_MsgParam4, sizeof(g_MsgParam4), false);
}
// Check which clients need to be excluded. // Check which clients need to be excluded.
g_MsgPlayersNum = 0; g_MsgPlayersNum = 0;
@ -857,6 +875,9 @@ public Action Hook_UserMessageSendAudio(UserMsg msg_id, Handle bf, const int[] p
else if(g_MsgClient == -2) else if(g_MsgClient == -2)
return Plugin_Handled; return Plugin_Handled;
if(g_bIsProtoBuf)
PbReadString(bf, "radio_sound", g_MsgRadioSound, sizeof(g_MsgRadioSound));
else
BfReadString(bf, g_MsgRadioSound, sizeof(g_MsgRadioSound), false); BfReadString(bf, g_MsgRadioSound, sizeof(g_MsgRadioSound), false);
if(StrEqual(g_MsgRadioSound, "radio.locknload")) if(StrEqual(g_MsgRadioSound, "radio.locknload"))
@ -904,6 +925,18 @@ public void OnPlayerRadio(DataPack pack)
CloseHandle(pack); CloseHandle(pack);
Handle RadioText = StartMessage("RadioText", g_MsgPlayers, playersNum, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS); Handle RadioText = StartMessage("RadioText", g_MsgPlayers, playersNum, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS);
if(g_bIsProtoBuf)
{
PbSetInt(RadioText, "msg_dst", g_MsgDest);
PbSetInt(RadioText, "client", g_MsgClient);
PbSetString(RadioText, "msg_name", g_MsgName);
PbSetString(RadioText, "params", g_MsgParam1, 0);
PbSetString(RadioText, "params", g_MsgParam2, 1);
PbSetString(RadioText, "params", g_MsgParam3, 2);
PbSetString(RadioText, "params", g_MsgParam4, 3);
}
else
{
BfWriteByte(RadioText, g_MsgDest); BfWriteByte(RadioText, g_MsgDest);
BfWriteByte(RadioText, g_MsgClient); BfWriteByte(RadioText, g_MsgClient);
BfWriteString(RadioText, g_MsgName); BfWriteString(RadioText, g_MsgName);
@ -911,9 +944,13 @@ public void OnPlayerRadio(DataPack pack)
BfWriteString(RadioText, g_MsgParam2); BfWriteString(RadioText, g_MsgParam2);
BfWriteString(RadioText, g_MsgParam3); BfWriteString(RadioText, g_MsgParam3);
BfWriteString(RadioText, g_MsgParam4); BfWriteString(RadioText, g_MsgParam4);
}
EndMessage(); EndMessage();
Handle SendAudio = StartMessage("SendAudio", g_MsgPlayers, playersNum, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS); Handle SendAudio = StartMessage("SendAudio", g_MsgPlayers, playersNum, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS);
if(g_bIsProtoBuf)
PbSetString(SendAudio, "radio_sound", g_MsgRadioSound);
else
BfWriteString(SendAudio, g_MsgRadioSound); BfWriteString(SendAudio, g_MsgRadioSound);
EndMessage(); EndMessage();
} }

View File

@ -11,7 +11,7 @@ public Plugin myinfo =
name = "Spectate", name = "Spectate",
description = "Adds a command to spectate specific players and removes broken spectate mode.", description = "Adds a command to spectate specific players and removes broken spectate mode.",
author = "Obus + BotoX", author = "Obus + BotoX",
version = "1.0", version = "1.0.1",
url = "" url = ""
} }
@ -49,7 +49,7 @@ public void OnClientSettingsChanged(int client)
if (iObserverMode == OBS_MODE_POI) if (iObserverMode == OBS_MODE_POI)
{ {
ClientCommand(client, "cl_spec_mode %d", OBS_MODE_ROAMING); ClientCommand(client, "cl_spec_mode %d", OBS_MODE_ROAMING);
if(IsClientInGame(client)) if(IsClientInGame(client) && !IsPlayerAlive(client))
SetEntProp(client, Prop_Send, "m_iObserverMode", OBS_MODE_ROAMING); SetEntProp(client, Prop_Send, "m_iObserverMode", OBS_MODE_ROAMING);
} }
} }

View File

@ -127,6 +127,8 @@ public void OnEntityDestroyed(int entity)
public void OnWeaponSpawned(int entity) public void OnWeaponSpawned(int entity)
{ {
SDKUnhook(entity, SDKHook_Spawn, OnWeaponSpawned);
int HammerID = GetEntProp(entity, Prop_Data, "m_iHammerID"); int HammerID = GetEntProp(entity, Prop_Data, "m_iHammerID");
// Should not be cleaned since it's a map spawned weapon // Should not be cleaned since it's a map spawned weapon
if(HammerID) if(HammerID)

View File

@ -25,7 +25,7 @@
// ************************************************************************* // *************************************************************************
#include <sourcemod> #include <sourcemod>
#define VERSION "(SB++) 1.5.5" #define VERSION "(SB++) 1.5.5-dev"
#define LISTBANS_USAGE "sm_listsbbans <#userid|name> - Lists a user's prior bans from Sourcebans" #define LISTBANS_USAGE "sm_listsbbans <#userid|name> - Lists a user's prior bans from Sourcebans"
#define INVALID_TARGET -1 #define INVALID_TARGET -1

View File

@ -32,8 +32,8 @@
#include <adminmenu> #include <adminmenu>
//#tryinclude <updater> //#tryinclude <updater>
#define SB_VERSION "1.5.5F" #define SB_VERSION "1.5.5F-dev"
#define SBR_VERSION "1.5.5" #define SBR_VERSION "1.5.5-dev"
#if defined _updater_included #if defined _updater_included
#define UPDATE_URL "https://sarabveer.github.io/SourceBans-Fork/updater/updatefile.txt" #define UPDATE_URL "https://sarabveer.github.io/SourceBans-Fork/updater/updatefile.txt"

View File

@ -42,7 +42,7 @@
// Do not edit below this line // // Do not edit below this line //
//-----------------------------// //-----------------------------//
#define PLUGIN_VERSION "(SB++) 1.5.6" #define PLUGIN_VERSION "(SB++) 1.5.5-dev"
#define PREFIX "\x04[SourceComms]\x01 " #define PREFIX "\x04[SourceComms]\x01 "
#define MAX_TIME_MULTI 30 // maximum mass-target punishment length #define MAX_TIME_MULTI 30 // maximum mass-target punishment length

View File

@ -159,6 +159,7 @@
} }
} }
} }
"csgo" "csgo"
{ {
"Offsets" "Offsets"
@ -167,6 +168,33 @@
{ {
"windows" "513" "windows" "513"
"linux" "514" "linux" "514"
"mac" "514"
}
}
}
"left4dead"
{
"Offsets"
{
"OnVoiceTransmit"
{
"windows" "461"
"linux" "462"
"mac" "462"
}
}
}
"left4dead2"
{
"Offsets"
{
"OnVoiceTransmit"
{
"windows" "485"
"linux" "486"
"mac" "486"
} }
} }
} }