removed unused plugins

updated custom-chatcolors
This commit is contained in:
BotoX 2016-05-09 21:25:04 +02:00
parent 574eba7ee5
commit b44b24149e
4 changed files with 74 additions and 176 deletions

View File

@ -1,44 +0,0 @@
#pragma semicolon 1
#include <sourcemod>
#include <sdkhooks>
#include <zombiereloaded>
public Plugin:myinfo =
{
name = "KevlarEquip",
author = "BotoX",
description = "Equip players with kevlar when they spawn, unglitch kevlar and strip it when you get infected",
version = "2.0",
url = ""
};
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_SpawnPost, Hook_OnPlayerSpawn);
}
public Hook_OnPlayerSpawn(client)
{
if(IsPlayerAlive(client) && ZR_IsClientHuman(client))
{
SetEntProp(client, Prop_Send, "m_ArmorValue", 100, 1);
SetEntProp(client, Prop_Send, "m_bHasHelmet", 1);
// Reset last hitgroup to generic - fixes kevlar bug
// Example: You get hit in the head by a bullet as a zombie
// the round ends, you spawn as a human.
// You get damaged by a trigger, the game still thinks you
// are getting damaged in the head hitgroup, >mfw source engine.
// Thanks to leaked 2007 Source Engine Code.
SetEntData(client, 4444, 0, 4);
}
}
public ZR_OnClientInfected(client, attacker, bool:motherInfect, bool:respawnOverride, bool:respawn)
{
if(IsPlayerAlive(client))
{
SetEntProp(client, Prop_Send, "m_ArmorValue", 0, 1);
SetEntProp(client, Prop_Send, "m_bHasHelmet", 0);
}
}

View File

@ -1,62 +0,0 @@
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#include <zombiereloaded>
#pragma newdecls required
Handle g_hCvar_WeaponSecondary = INVALID_HANDLE;
Handle g_hCvar_WeaponPrimary = INVALID_HANDLE;
public Plugin myinfo =
{
name = "WeaponEquip",
author = "zaCade + BotoX",
description = "Equip players with weapons when they spawn",
version = "2.0",
url = ""
};
public void OnPluginStart()
{
g_hCvar_WeaponSecondary = CreateConVar("sm_weaponequip_secondary", "weapon_elite", "The name of the secondary weapon to give.");
g_hCvar_WeaponPrimary = CreateConVar("sm_weaponequip_primary", "weapon_p90", "The name of the secondary weapon to give.");
AutoExecConfig(true, "plugin.WeaponEquip");
}
public void OnClientPutInServer(int client)
{
SDKHook(client, SDKHook_SpawnPost, Hook_OnPlayerSpawn);
}
public void Hook_OnPlayerSpawn(int client)
{
if(IsPlayerAlive(client) && ZR_IsClientHuman(client))
{
static char sSecondary[32];
GetConVarString(g_hCvar_WeaponSecondary, sSecondary, sizeof(sSecondary));
static char sPrimary[32];
GetConVarString(g_hCvar_WeaponPrimary, sPrimary, sizeof(sPrimary));
int Secondary = -1;
if((Secondary = GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY)) != -1)
RemoveEdict(Secondary);
int Primary = -1;
if((Primary = GetPlayerWeaponSlot(client, CS_SLOT_SECONDARY)) != -1)
RemoveEdict(Primary);
int Grenade = -1;
while((Grenade = GetPlayerWeaponSlot(client, CS_SLOT_GRENADE)) != -1)
RemoveEdict(Grenade);
GivePlayerItem(client, sSecondary);
GivePlayerItem(client, sPrimary);
GivePlayerItem(client, "weapon_hegrenade");
}
}

View File

@ -1 +0,0 @@
../../../includes/zombiereloaded.inc

View File

@ -10,7 +10,7 @@
#include <ccc>
#define PLUGIN_VERSION "6.1.0"
#define PLUGIN_VERSION "6.1.4"
#define MAX_CHAT_LENGTH 192
public Plugin myinfo =
@ -637,7 +637,7 @@ public Action Command_Say(int client, const char[] command, int argc)
char text[MAX_CHAT_LENGTH];
GetCmdArgString(text, sizeof(text));
if (client && !HasFlag(client, Admin_Generic))
if (client && IsClientInGame(client) && !HasFlag(client, Admin_Generic))
{
if (MakeStringPrintable(text, sizeof(text), ""))
{
@ -659,7 +659,7 @@ public Action Command_Say(int client, const char[] command, int argc)
g_bWaitingForChatInput[client] = false;
ReplaceString(g_sReceivedChatInput[client], sizeof(g_sReceivedChatInput), "\"", "'");
if (g_sReceivedChatInput[client][0] != '#')
if (g_sReceivedChatInput[client][0] != '#' && !StrEqual(g_sInputType[client], "ChangeTag") && !StrEqual(g_sInputType[client], "MenuForceTag"))
Format(g_sReceivedChatInput[client], sizeof(g_sReceivedChatInput[]), "#%s", g_sReceivedChatInput[client]);
if (StrEqual(g_sInputType[client], "ChangeTag"))
@ -780,67 +780,6 @@ public Action Command_Say(int client, const char[] command, int argc)
return Plugin_Continue;
}
public Action Event_PlayerSay(Handle event, const char[] name, bool dontBroadcast)
{
if (g_msgAuthor == -1 || GetClientOfUserId(GetEventInt(event, "userid")) != g_msgAuthor)
{
return;
}
int[] players = new int[MaxClients + 1];
int playersNum = 0;
if (g_msgIsTeammate && g_msgAuthor > 0)
{
int team = GetClientTeam(g_msgAuthor);
for (int client = 1; client <= MaxClients; client++)
{
if (IsClientInGame(client) && GetClientTeam(client) == team)
{
if(!g_Ignored[client * (MAXPLAYERS + 1) + g_msgAuthor])
players[playersNum++] = client;
}
}
}
else
{
for (int client = 1; client <= MaxClients; client++)
{
if (IsClientInGame(client))
{
if(!g_Ignored[client * (MAXPLAYERS + 1) + g_msgAuthor])
players[playersNum++] = client;
}
}
}
if (!playersNum)
{
g_msgAuthor = -1;
return;
}
Handle SayText2 = StartMessage("SayText2", players, playersNum, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS);
if (GetFeatureStatus(FeatureType_Native, "GetUserMessageType") == FeatureStatus_Available && GetUserMessageType() == UM_Protobuf)
{
PbSetInt(SayText2, "ent_idx", g_msgAuthor);
PbSetBool(SayText2, "chat", g_msgIsChat);
PbSetString(SayText2, "text", g_msgFinal);
EndMessage();
}
else
{
BfWriteByte(SayText2, g_msgAuthor);
BfWriteByte(SayText2, g_msgIsChat);
BfWriteString(SayText2, g_msgFinal);
EndMessage();
}
g_msgAuthor = -1;
}
////////////////////////////////////////////
//Force Tag /////
////////////////////////////////////////////
@ -2599,12 +2538,17 @@ public Action Hook_UserMessage(UserMsg msg_id, Handle bf, const players[], int p
BfReadString(bf, g_msgSender, sizeof(g_msgSender), false);
BfReadString(bf, g_msgText, sizeof(g_msgText), false);
if (strlen(g_msgName) == 0 || strlen(g_msgSender) == 0 || strlen(g_msgText) == 0)
if (strlen(g_msgName) == 0 || strlen(g_msgSender) == 0)
return Plugin_Continue;
if (!strcmp(g_msgName, "#Cstrike_Name_Change"))
return Plugin_Continue;
TrimString(g_msgText);
if (strlen(g_msgText) == 0)
return Plugin_Handled;
CCC_GetTag(g_msgAuthor, sAuthorTag, sizeof(sAuthorTag));
bool bNameAlpha;
@ -2615,8 +2559,6 @@ public Action Hook_UserMessage(UserMsg msg_id, Handle bf, const players[], int p
int xiChatColor = CCC_GetColor(g_msgAuthor, view_as<CCC_ColorType>(CCC_ChatColor), bChatAlpha);
int xiTagColor = CCC_GetColor(g_msgAuthor, view_as<CCC_ColorType>(CCC_TagColor), bTagAlpha);
TrimString(g_msgText);
if (!strncmp(g_msgText, "/me", 3, false))
{
strcopy(g_msgName, sizeof(g_msgName), "Cstrike_Chat_Me");
@ -2713,7 +2655,6 @@ public Action Hook_UserMessage(UserMsg msg_id, Handle bf, const players[], int p
}
else if (xiChatColor == COLOR_NONE || g_bTagToggled[g_msgAuthor])
{
Format(g_msgText, sizeof(g_msgText), "\x01%s", g_msgText);
}
else if (xiChatColor == COLOR_TEAM)
{
@ -2742,6 +2683,70 @@ public Action Hook_UserMessage(UserMsg msg_id, Handle bf, const players[], int p
return Plugin_Handled;
}
public Action Event_PlayerSay(Handle event, const char[] name, bool dontBroadcast)
{
if (g_msgAuthor == -1 || GetClientOfUserId(GetEventInt(event, "userid")) != g_msgAuthor)
{
return;
}
if (strlen(g_msgText) == 0)
return;
int[] players = new int[MaxClients + 1];
int playersNum = 0;
if (g_msgIsTeammate && g_msgAuthor > 0)
{
int team = GetClientTeam(g_msgAuthor);
for (int client = 1; client <= MaxClients; client++)
{
if (IsClientInGame(client) && GetClientTeam(client) == team)
{
if(!g_Ignored[client * (MAXPLAYERS + 1) + g_msgAuthor])
players[playersNum++] = client;
}
}
}
else
{
for (int client = 1; client <= MaxClients; client++)
{
if (IsClientInGame(client))
{
if(!g_Ignored[client * (MAXPLAYERS + 1) + g_msgAuthor])
players[playersNum++] = client;
}
}
}
if (!playersNum)
{
g_msgAuthor = -1;
return;
}
Handle SayText2 = StartMessage("SayText2", players, playersNum, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS);
if (GetFeatureStatus(FeatureType_Native, "GetUserMessageType") == FeatureStatus_Available && GetUserMessageType() == UM_Protobuf)
{
PbSetInt(SayText2, "ent_idx", g_msgAuthor);
PbSetBool(SayText2, "chat", g_msgIsChat);
PbSetString(SayText2, "text", g_msgFinal);
EndMessage();
}
else
{
BfWriteByte(SayText2, g_msgAuthor);
BfWriteByte(SayText2, g_msgIsChat);
BfWriteString(SayText2, g_msgFinal);
EndMessage();
}
g_msgAuthor = -1;
}
// 888b 888 d8888 88888888888 8888888 888 888 8888888888 .d8888b.
// 8888b 888 d88888 888 888 888 888 888 d88P Y88b
// 88888b 888 d88P888 888 888 888 888 888 Y88b.
@ -3086,4 +3091,4 @@ public int Native_UpdateIgnoredArray(Handle plugin, int numParams)
GetNativeArray(1, g_Ignored, sizeof(g_Ignored));
return 1;
}
}