Member
Join Date: Sep 2016
Location: Turkey
|
08-01-2017
, 03:28
Re: [CS:GO/CS:S] No-Scope Detector
|
#77
|
Quote:
Originally Posted by Abusador
This code : (in line 106 and 111)
Spoiler
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
#include <clientprefs>
#include <multicolors>
static char TAG[] = "☆"; // Example: "{darkred}[www.FrmAkDaG.Com] "
int kills[MAXPLAYERS+1], headshots[MAXPLAYERS+1];
bool enabled, debugmsg, allcsgo, enablesounds;
#define SOUND_ULTRAKILL_REL "*anormais_quake/holyshit.mp3"
#define SOUND_ULTRAKILL "sound/anormais_quake/holyshit.mp3"
#define SOUND_GODLIKE_REL "*/anormais_quake/holyshit.mp3"
#define SOUND_GODLIKE "sound/anormais_quake/holyshit.mp3"
public Plugin myinfo =
{
name = "[AWP] No-Scope Detector",
author = "Ak0 (improved by Grey83 & onehand)",
description = "Awp Maping No-Scope Detector",
version = "1.2.5_debug2",
url = "https://forums.alliedmods.net/showthread.php?t=290241"
}
public void OnPluginStart()
{
if(GetEngineVersion() != Engine_CSGO && GetEngineVersion() != Engine_CSS) SetFailState("Plugin supports CSS and CS:GO only.");
LoadTranslations("core.phrases");
LoadTranslations("noscope_gotcha.phrases");
ConVar CVar;
HookConVarChange((CVar = CreateConVar("sm_noscope_enable", "1", "0/1 - Disable/Enable messages", FCVAR_NOTIFY, true, 0.0, true, 1.0)), CVarChange);
enabled = CVar.BoolValue;
HookConVarChange((CVar = CreateConVar("sm_noscope_debug", "1", "0/1 - Disable/Enable debug messages", FCVAR_NOTIFY, true, 0.0, true, 1.0)), CVarChangeDebug);
debugmsg = CVar.BoolValue;
HookConVarChange((CVar = CreateConVar("sm_noscope_allcsgoguns", "0", "0/1 - Disable/Enable no-scope detection for all CS:GO weapons w/o crosshairs (g3sg1, scar20, awp, ssg08)", FCVAR_NOTIFY, true, 0.0, true, 1.0)), CVarChangeCsgo);
allcsgo = CVar.BoolValue;
HookConVarChange((CVar = CreateConVar("sm_noscope_enablesounds", "1", "0/1 - Disable/Enable quake announcer sounds on a no-scope kill", FCVAR_NOTIFY, true, 0.0, true, 1.0)), CVarChangeSounds);
enablesounds = CVar.BoolValue;
HookEvent("player_death", OnPlayerDeath);
}
public void CVarChange(ConVar CVar, const char[] oldValue, const char[] newValue)
{
enabled = CVar.BoolValue;
}
public void CVarChangeDebug(ConVar CVar, const char[] oldValue, const char[] newValue)
{
debugmsg = CVar.BoolValue;
}
public void CVarChangeCsgo(ConVar CVar, const char[] oldValue, const char[] newValue)
{
allcsgo = CVar.BoolValue;
}
public void CVarChangeSounds(ConVar CVar, const char[] oldValue, const char[] newValue)
{
enablesounds = CVar.BoolValue;
}
public void OnClientConnected(int client)
{
kills[client] = headshots[client] = 0;
}
public void OnPlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
int attacker = GetClientOfUserId(event.GetInt("attacker"));
int victim = GetClientOfUserId(GetEventInt(event, "userid"));
if(debugmsg) PrintToServer(" Attacker: %i", attacker);
if(!(0 < attacker <= MaxClients && IsClientInGame(attacker))) return;
char weapon[16];
event.GetString("weapon", weapon, sizeof(weapon));
ReplaceString(weapon, 16, "weapon_", "");
if(debugmsg) PrintToServer(" Weapon: %s\n FOV: %i", weapon, GetEntProp(attacker, Prop_Data, "m_iFOV"));
if(debugmsg) PrintToServer(" DefFOV: %i", GetEntProp(attacker, Prop_Data, "m_iDefaultFOV"));
if(((StrContains(weapon, "awp") != -1 || StrContains(weapon, "ssg08") != -1 || StrContains(weapon, "scout") != -1) ||
(allcsgo && (StrContains(weapon, "g3sg1") != -1 || StrContains(weapon, "scar20") != -1))) &&
(GetEntProp(attacker, Prop_Data, "m_iFOV") <= 0 || GetEntProp(attacker, Prop_Data, "m_iFOV") == GetEntProp(attacker, Prop_Data, "m_iDefaultFOV")))
{
char sName[MAX_NAME_LENGTH];
char vName[MAX_NAME_LENGTH];
GetClientName(attacker, sName, sizeof(sName));
GetClientName(victim, vName, sizeof(vName));
kills[attacker]++;
static bool bHS;
if((bHS = event.GetBool("headshot"))) headshots[attacker]++;
if(enabled)
{
if(bHS)
{
PrintCenterText("%t", "HS2All", TAG, sName, vName, weapon);
if(enablesounds) playSound(SOUND_GODLIKE_REL);
}
else
{
PrintCenterText("%t", "Kill2All", TAG, sName, vName, weapon);
if(enablesounds) playSound(SOUND_ULTRAKILL_REL);
}
}
}
}
public void playSound(const char[] filelocation)
{
char target_soundPath[200];
Format(target_soundPath, sizeof(target_soundPath), "playgamesound %s", filelocation);
for (int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i))
{
ClientCommand(i, target_soundPath);
}
}
}
|
There is i changed PrintCenterText to PrintCenterTextAll
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
#include <clientprefs>
#include <multicolors>
static char TAG[] = "☆"; // Example: "{darkred}[www.FrmAkDaG.Com] "
int kills[MAXPLAYERS+1], headshots[MAXPLAYERS+1];
bool enabled, debugmsg, allcsgo, enablesounds;
#define SOUND_ULTRAKILL_REL "*anormais_quake/holyshit.mp3"
#define SOUND_ULTRAKILL "sound/anormais_quake/holyshit.mp3"
#define SOUND_GODLIKE_REL "*/anormais_quake/holyshit.mp3"
#define SOUND_GODLIKE "sound/anormais_quake/holyshit.mp3"
public Plugin myinfo =
{
name = "[AWP] No-Scope Detector",
author = "Ak0 (improved by Grey83 & onehand)",
description = "Awp Maping No-Scope Detector",
version = "1.2.5_debug2",
url = "https://forums.alliedmods.net/showthread.php?t=290241"
}
public void OnPluginStart()
{
if(GetEngineVersion() != Engine_CSGO && GetEngineVersion() != Engine_CSS) SetFailState("Plugin supports CSS and CS:GO only.");
LoadTranslations("core.phrases");
LoadTranslations("noscope_gotcha.phrases");
ConVar CVar;
HookConVarChange((CVar = CreateConVar("sm_noscope_enable", "1", "0/1 - Disable/Enable messages", FCVAR_NOTIFY, true, 0.0, true, 1.0)), CVarChange);
enabled = CVar.BoolValue;
HookConVarChange((CVar = CreateConVar("sm_noscope_debug", "1", "0/1 - Disable/Enable debug messages", FCVAR_NOTIFY, true, 0.0, true, 1.0)), CVarChangeDebug);
debugmsg = CVar.BoolValue;
HookConVarChange((CVar = CreateConVar("sm_noscope_allcsgoguns", "0", "0/1 - Disable/Enable no-scope detection for all CS:GO weapons w/o crosshairs (g3sg1, scar20, awp, ssg08)", FCVAR_NOTIFY, true, 0.0, true, 1.0)), CVarChangeCsgo);
allcsgo = CVar.BoolValue;
HookConVarChange((CVar = CreateConVar("sm_noscope_enablesounds", "1", "0/1 - Disable/Enable quake announcer sounds on a no-scope kill", FCVAR_NOTIFY, true, 0.0, true, 1.0)), CVarChangeSounds);
enablesounds = CVar.BoolValue;
HookEvent("player_death", OnPlayerDeath);
}
public void CVarChange(ConVar CVar, const char[] oldValue, const char[] newValue)
{
enabled = CVar.BoolValue;
}
public void CVarChangeDebug(ConVar CVar, const char[] oldValue, const char[] newValue)
{
debugmsg = CVar.BoolValue;
}
public void CVarChangeCsgo(ConVar CVar, const char[] oldValue, const char[] newValue)
{
allcsgo = CVar.BoolValue;
}
public void CVarChangeSounds(ConVar CVar, const char[] oldValue, const char[] newValue)
{
enablesounds = CVar.BoolValue;
}
public void OnClientConnected(int client)
{
kills[client] = headshots[client] = 0;
}
public void OnPlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
int attacker = GetClientOfUserId(event.GetInt("attacker"));
int victim = GetClientOfUserId(GetEventInt(event, "userid"));
if(debugmsg) PrintToServer(" Attacker: %i", attacker);
if(!(0 < attacker <= MaxClients && IsClientInGame(attacker))) return;
char weapon[16];
event.GetString("weapon", weapon, sizeof(weapon));
ReplaceString(weapon, 16, "weapon_", "");
if(debugmsg) PrintToServer(" Weapon: %s\n FOV: %i", weapon, GetEntProp(attacker, Prop_Data, "m_iFOV"));
if(debugmsg) PrintToServer(" DefFOV: %i", GetEntProp(attacker, Prop_Data, "m_iDefaultFOV"));
if(((StrContains(weapon, "awp") != -1 || StrContains(weapon, "ssg08") != -1 || StrContains(weapon, "scout") != -1) ||
(allcsgo && (StrContains(weapon, "g3sg1") != -1 || StrContains(weapon, "scar20") != -1))) &&
(GetEntProp(attacker, Prop_Data, "m_iFOV") <= 0 || GetEntProp(attacker, Prop_Data, "m_iFOV") == GetEntProp(attacker, Prop_Data, "m_iDefaultFOV")))
{
char sName[MAX_NAME_LENGTH];
char vName[MAX_NAME_LENGTH];
GetClientName(attacker, sName, sizeof(sName));
GetClientName(victim, vName, sizeof(vName));
kills[attacker]++;
static bool bHS;
if((bHS = event.GetBool("headshot"))) headshots[attacker]++;
if(enabled)
{
if(bHS)
{
PrintCenterTextAll("%t", "HS2All", TAG, sName, vName, weapon);
if(enablesounds) playSound(SOUND_GODLIKE_REL);
}
else
{
PrintCenterTextAll("%t", "Kill2All", TAG, sName, vName, weapon);
if(enablesounds) playSound(SOUND_ULTRAKILL_REL);
}
}
}
}
public void playSound(const char[] filelocation)
{
char target_soundPath[200];
Format(target_soundPath, sizeof(target_soundPath), "playgamesound %s", filelocation);
for (int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i))
{
ClientCommand(i, target_soundPath);
}
}
}
|
|