Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
8 years ago
Diff never expires
Clear
Export
Share
Explain
3 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
221 lines
Copy
3 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
220 lines
Copy
#include <sourcemod>
#include <sourcemod>
#include <sdktools>
#include <sdktools>
#include <sdkhooks>
#include <sdkhooks>
#define NAZWA "AutoStrafes by NWayne based on TechSupportJosh"
#define NAZWA "AutoStrafes by NWayne based on TechSupportJosh"
#define AUTOR "NWayne"
#define AUTOR "NWayne"
#define DEBUG
#define DEBUG
#pragma semicolon 1
#pragma semicolon 1
#pragma newdecls required
#pragma newdecls required
/*
/*
<-- based on TechSupportJosh -->
<-- based on TechSupportJosh -->
*/
*/
public Plugin myinfo =
public Plugin myinfo =
{
{
name = NAZWA,
name = NAZWA,
author = AUTOR,
author = AUTOR,
description = "AutoStrafe by NWayne (based on TechSupportJosh)",
description = "AutoStrafe by NWayne (based on TechSupportJosh)",
version = "1.0",
version = "1.0",
url = "based on TechSupportJosh"
url = "based on TechSupportJosh"
};
};
/* <-- Zmienne --> */
/* <-- Zmienne --> */
bool g_bStrafeEnabled[MAXPLAYERS + 1];
bool g_bStrafeEnabled[MAXPLAYERS + 1];
float g_flLastGain[MAXPLAYERS + 1];
float g_flLastGain[MAXPLAYERS + 1];
float g_flSidespeed = 510.0;
float g_flSidespeed = 510.0;
/* <-- Na Polaczeniu --> */
/* <-- Na Polaczeniu --> */
public void OnClientConnected(int client)
public void OnClientConnected(int client)
{
{
g_bStrafeEnabled[client] = true;
g_bStrafeEnabled[client] = true;
}
}
public void Warotsc (int client) {
public void Warotsc (int client) {
}
}
/* <-- Menu --> */
/* <-- Menu --> */
public Action MenuToogle (int client) {
public Action MenuToogle (int client) {
// Wartosc(client);
// Wartosc(client);
Copy
Copied
Copy
Copied
char sts[32]
char sts[32]
;
{
if (g_bStrafeEnabled[client] == true)
if (g_bStrafeEnabled[client] == true)
{
{
Format(sts, sizeof(sts), "ON");
Format(sts, sizeof(sts), "ON");
}
}
if (g_bStrafeEnabled[client] == false)
if (g_bStrafeEnabled[client] == false)
{
{
Format(sts, sizeof(sts), "OFF");
Format(sts, sizeof(sts), "OFF");
}
}
Copy
Copied
Copy
Copied
}
if(!IsValidClient(client))
if(!IsValidClient(client))
return;
return;
Handle MenuHandle = CreateMenu(handlermenu);
Handle MenuHandle = CreateMenu(handlermenu);
SetMenuTitle(MenuHandle, "~ AutoStrafe ~ \n\n --> Ustawienia <--");
SetMenuTitle(MenuHandle, "~ AutoStrafe ~ \n\n --> Ustawienia <--");
AddMenuItem(MenuHandle, ">%s<", sts, ITEMDRAW_DEFAULT);
AddMenuItem(MenuHandle, ">%s<", sts, ITEMDRAW_DEFAULT);
DisplayMenu(MenuHandle, client, 30);
DisplayMenu(MenuHandle, client, 30);
}
}
public int handlermenu (Menu menu, MenuAction action, int client, int itemNum) {
public int handlermenu (Menu menu, MenuAction action, int client, int itemNum) {
if (action == MenuAction_Select)
if (action == MenuAction_Select)
{
{
if(g_bStrafeEnabled[client] == true)
if(g_bStrafeEnabled[client] == true)
{
{
/*
/*
SetHudTextParams(-1.0, 1, 4, 255, 0, 0);
SetHudTextParams(-1.0, 1, 4, 255, 0, 0);
ShowHudText(client, "Poprawnie wylaczyles autostrafe! ");
ShowHudText(client, "Poprawnie wylaczyles autostrafe! ");
*/
*/
g_bStrafeEnabled[client] = false;
g_bStrafeEnabled[client] = false;
}
}
if (g_bStrafeEnabled[client] == false)
if (g_bStrafeEnabled[client] == false)
{
{
///SetHudTextParams(-1.0, 1, 4, 255, 0, 0);
///SetHudTextParams(-1.0, 1, 4, 255, 0, 0);
///ShowHudText(client, "Poprawnie wlaczyles autostrafe! ");
///ShowHudText(client, "Poprawnie wlaczyles autostrafe! ");
g_bStrafeEnabled[client] = true;
g_bStrafeEnabled[client] = true;
}
}
}
}
else if (action == MenuAction_End) {
else if (action == MenuAction_End) {
CloseHandle(menu);
CloseHandle(menu);
}
}
}
}
public void OnPluginStart()
public void OnPluginStart()
{
{
if(GetEngineVersion() == Engine_CSGO)
if(GetEngineVersion() == Engine_CSGO)
{
{
g_flSidespeed = 510.0;
g_flSidespeed = 510.0;
}
}
else if(GetEngineVersion() == Engine_CSS)
else if(GetEngineVersion() == Engine_CSS)
{
{
g_flSidespeed = 400.0;
g_flSidespeed = 400.0;
}
}
else
else
{
{
/* <-- Zmienne (Wiadomosci) --> */
/* <-- Zmienne (Wiadomosci) --> */
char error[32];
char error[32];
char disable[32];
char disable[32];
Format(error, sizeof(error), "[AutoStafe] Error plugin does not work because engine is incompatible!");
Format(error, sizeof(error), "[AutoStafe] Error plugin does not work because engine is incompatible!");
Format(disable, sizeof(disable), "[AutoStrafe] PLugin has been disabled!");
Format(disable, sizeof(disable), "[AutoStrafe] PLugin has been disabled!");
/* <-- Wiadomosci --> */
/* <-- Wiadomosci --> */
LogError(error);
LogError(error);
SetFailState(disable);
SetFailState(disable);
}
}
}
}
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3])
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3])
{
{
if (!IsClientInGame(client) || !IsPlayerAlive(client))
if (!IsClientInGame(client) || !IsPlayerAlive(client))
return Plugin_Continue;
return Plugin_Continue;
if (IsFakeClient(client))
if (IsFakeClient(client))
return Plugin_Continue;
return Plugin_Continue;
if (g_bStrafeEnabled[client])
if (g_bStrafeEnabled[client])
{
{
ApplyAutoStrafe(client, buttons, vel, angles);
ApplyAutoStrafe(client, buttons, vel, angles);
return Plugin_Changed;
return Plugin_Changed;
}
}
return Plugin_Continue;
return Plugin_Continue;
}
}
stock void ApplyAutoStrafe(int client, int &buttons, float vel[3], float angles[3])
stock void ApplyAutoStrafe(int client, int &buttons, float vel[3], float angles[3])
{
{
if (GetEntityMoveType(client) & MOVETYPE_LADDER)
if (GetEntityMoveType(client) & MOVETYPE_LADDER)
return;
return;
if (buttons & IN_MOVELEFT || buttons & IN_MOVERIGHT || buttons & IN_FORWARD || buttons & IN_BACK)
if (buttons & IN_MOVELEFT || buttons & IN_MOVERIGHT || buttons & IN_FORWARD || buttons & IN_BACK)
{
{
return;
return;
}
}
float flVelocity[3];
float flVelocity[3];
GetEntPropVector(client, Prop_Data, "m_vecVelocity", flVelocity);
GetEntPropVector(client, Prop_Data, "m_vecVelocity", flVelocity);
float flYVel = RadToDeg(ArcTangent2(flVelocity[1], flVelocity[0]));
float flYVel = RadToDeg(ArcTangent2(flVelocity[1], flVelocity[0]));
float flDiffAngle = NormalizeAngle(angles[1] - flYVel);
float flDiffAngle = NormalizeAngle(angles[1] - flYVel);
vel[1] = g_flSidespeed;
vel[1] = g_flSidespeed;
if (flDiffAngle > 0.0)
if (flDiffAngle > 0.0)
vel[1] = -g_flSidespeed;
vel[1] = -g_flSidespeed;
float flLastGain = g_flLastGain[client];
float flLastGain = g_flLastGain[client];
float flAngleGain = RadToDeg(ArcTangent(vel[1] / vel[0]));
float flAngleGain = RadToDeg(ArcTangent(vel[1] / vel[0]));
if (!((flLastGain < 0.0 && flAngleGain < 0.0) || (flLastGain > 0.0 && flAngleGain > 0.0)))
if (!((flLastGain < 0.0 && flAngleGain < 0.0) || (flLastGain > 0.0 && flAngleGain > 0.0)))
angles[1] -= flDiffAngle;
angles[1] -= flDiffAngle;
g_flLastGain[client] = flAngleGain;
g_flLastGain[client] = flAngleGain;
}
}
/* <--- Stocks --> */
/* <--- Stocks --> */
public float NormalizeAngle(float angle)
public float NormalizeAngle(float angle)
{
{
float temp = angle;
float temp = angle;
while (temp <= -240.0)
while (temp <= -240.0)
{
{
temp += 420.0;
temp += 420.0;
}
}
while (temp > 240.0)
while (temp > 240.0)
{
{
temp -= 420.0;
temp -= 420.0;
}
}
return temp;
return temp;
}
}
Copy
Copied
Copy
Copied
bool IsValidClient(int client)
stock
bool IsValidClient(int client)
{
{
if (client <= 0 || client > MaxClients) {
if (client <= 0 || client > MaxClients) {
return false;
return false;
}
}
if (!IsClientInGame(client)) {
if (!IsClientInGame(client)) {
return false;
return false;
}
}
if (IsFakeClient(client)) {
if (IsFakeClient(client)) {
return false;
return false;
}
}
return true;
return true;
}
}
Saved diffs
Original text
Open file
#include <sourcemod> #include <sdktools> #include <sdkhooks> #define NAZWA "AutoStrafes by NWayne based on TechSupportJosh" #define AUTOR "NWayne" #define DEBUG #pragma semicolon 1 #pragma newdecls required /* <-- based on TechSupportJosh --> */ public Plugin myinfo = { name = NAZWA, author = AUTOR, description = "AutoStrafe by NWayne (based on TechSupportJosh)", version = "1.0", url = "based on TechSupportJosh" }; /* <-- Zmienne --> */ bool g_bStrafeEnabled[MAXPLAYERS + 1]; float g_flLastGain[MAXPLAYERS + 1]; float g_flSidespeed = 510.0; /* <-- Na Polaczeniu --> */ public void OnClientConnected(int client) { g_bStrafeEnabled[client] = true; } public void Warotsc (int client) { } /* <-- Menu --> */ public Action MenuToogle (int client) { // Wartosc(client); char sts[32] { if (g_bStrafeEnabled[client] == true) { Format(sts, sizeof(sts), "ON"); } if (g_bStrafeEnabled[client] == false) { Format(sts, sizeof(sts), "OFF"); } } if(!IsValidClient(client)) return; Handle MenuHandle = CreateMenu(handlermenu); SetMenuTitle(MenuHandle, "~ AutoStrafe ~ \n\n --> Ustawienia <--"); AddMenuItem(MenuHandle, ">%s<", sts, ITEMDRAW_DEFAULT); DisplayMenu(MenuHandle, client, 30); } public int handlermenu (Menu menu, MenuAction action, int client, int itemNum) { if (action == MenuAction_Select) { if(g_bStrafeEnabled[client] == true) { /* SetHudTextParams(-1.0, 1, 4, 255, 0, 0); ShowHudText(client, "Poprawnie wylaczyles autostrafe! "); */ g_bStrafeEnabled[client] = false; } if (g_bStrafeEnabled[client] == false) { ///SetHudTextParams(-1.0, 1, 4, 255, 0, 0); ///ShowHudText(client, "Poprawnie wlaczyles autostrafe! "); g_bStrafeEnabled[client] = true; } } else if (action == MenuAction_End) { CloseHandle(menu); } } public void OnPluginStart() { if(GetEngineVersion() == Engine_CSGO) { g_flSidespeed = 510.0; } else if(GetEngineVersion() == Engine_CSS) { g_flSidespeed = 400.0; } else { /* <-- Zmienne (Wiadomosci) --> */ char error[32]; char disable[32]; Format(error, sizeof(error), "[AutoStafe] Error plugin does not work because engine is incompatible!"); Format(disable, sizeof(disable), "[AutoStrafe] PLugin has been disabled!"); /* <-- Wiadomosci --> */ LogError(error); SetFailState(disable); } } public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3]) { if (!IsClientInGame(client) || !IsPlayerAlive(client)) return Plugin_Continue; if (IsFakeClient(client)) return Plugin_Continue; if (g_bStrafeEnabled[client]) { ApplyAutoStrafe(client, buttons, vel, angles); return Plugin_Changed; } return Plugin_Continue; } stock void ApplyAutoStrafe(int client, int &buttons, float vel[3], float angles[3]) { if (GetEntityMoveType(client) & MOVETYPE_LADDER) return; if (buttons & IN_MOVELEFT || buttons & IN_MOVERIGHT || buttons & IN_FORWARD || buttons & IN_BACK) { return; } float flVelocity[3]; GetEntPropVector(client, Prop_Data, "m_vecVelocity", flVelocity); float flYVel = RadToDeg(ArcTangent2(flVelocity[1], flVelocity[0])); float flDiffAngle = NormalizeAngle(angles[1] - flYVel); vel[1] = g_flSidespeed; if (flDiffAngle > 0.0) vel[1] = -g_flSidespeed; float flLastGain = g_flLastGain[client]; float flAngleGain = RadToDeg(ArcTangent(vel[1] / vel[0])); if (!((flLastGain < 0.0 && flAngleGain < 0.0) || (flLastGain > 0.0 && flAngleGain > 0.0))) angles[1] -= flDiffAngle; g_flLastGain[client] = flAngleGain; } /* <--- Stocks --> */ public float NormalizeAngle(float angle) { float temp = angle; while (temp <= -240.0) { temp += 420.0; } while (temp > 240.0) { temp -= 420.0; } return temp; } bool IsValidClient(int client) { if (client <= 0 || client > MaxClients) { return false; } if (!IsClientInGame(client)) { return false; } if (IsFakeClient(client)) { return false; } return true; }
Changed text
Open file
#include <sourcemod> #include <sdktools> #include <sdkhooks> #define NAZWA "AutoStrafes by NWayne based on TechSupportJosh" #define AUTOR "NWayne" #define DEBUG #pragma semicolon 1 #pragma newdecls required /* <-- based on TechSupportJosh --> */ public Plugin myinfo = { name = NAZWA, author = AUTOR, description = "AutoStrafe by NWayne (based on TechSupportJosh)", version = "1.0", url = "based on TechSupportJosh" }; /* <-- Zmienne --> */ bool g_bStrafeEnabled[MAXPLAYERS + 1]; float g_flLastGain[MAXPLAYERS + 1]; float g_flSidespeed = 510.0; /* <-- Na Polaczeniu --> */ public void OnClientConnected(int client) { g_bStrafeEnabled[client] = true; } public void Warotsc (int client) { } /* <-- Menu --> */ public Action MenuToogle (int client) { // Wartosc(client); char sts[32]; if (g_bStrafeEnabled[client] == true) { Format(sts, sizeof(sts), "ON"); } if (g_bStrafeEnabled[client] == false) { Format(sts, sizeof(sts), "OFF"); } if(!IsValidClient(client)) return; Handle MenuHandle = CreateMenu(handlermenu); SetMenuTitle(MenuHandle, "~ AutoStrafe ~ \n\n --> Ustawienia <--"); AddMenuItem(MenuHandle, ">%s<", sts, ITEMDRAW_DEFAULT); DisplayMenu(MenuHandle, client, 30); } public int handlermenu (Menu menu, MenuAction action, int client, int itemNum) { if (action == MenuAction_Select) { if(g_bStrafeEnabled[client] == true) { /* SetHudTextParams(-1.0, 1, 4, 255, 0, 0); ShowHudText(client, "Poprawnie wylaczyles autostrafe! "); */ g_bStrafeEnabled[client] = false; } if (g_bStrafeEnabled[client] == false) { ///SetHudTextParams(-1.0, 1, 4, 255, 0, 0); ///ShowHudText(client, "Poprawnie wlaczyles autostrafe! "); g_bStrafeEnabled[client] = true; } } else if (action == MenuAction_End) { CloseHandle(menu); } } public void OnPluginStart() { if(GetEngineVersion() == Engine_CSGO) { g_flSidespeed = 510.0; } else if(GetEngineVersion() == Engine_CSS) { g_flSidespeed = 400.0; } else { /* <-- Zmienne (Wiadomosci) --> */ char error[32]; char disable[32]; Format(error, sizeof(error), "[AutoStafe] Error plugin does not work because engine is incompatible!"); Format(disable, sizeof(disable), "[AutoStrafe] PLugin has been disabled!"); /* <-- Wiadomosci --> */ LogError(error); SetFailState(disable); } } public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3]) { if (!IsClientInGame(client) || !IsPlayerAlive(client)) return Plugin_Continue; if (IsFakeClient(client)) return Plugin_Continue; if (g_bStrafeEnabled[client]) { ApplyAutoStrafe(client, buttons, vel, angles); return Plugin_Changed; } return Plugin_Continue; } stock void ApplyAutoStrafe(int client, int &buttons, float vel[3], float angles[3]) { if (GetEntityMoveType(client) & MOVETYPE_LADDER) return; if (buttons & IN_MOVELEFT || buttons & IN_MOVERIGHT || buttons & IN_FORWARD || buttons & IN_BACK) { return; } float flVelocity[3]; GetEntPropVector(client, Prop_Data, "m_vecVelocity", flVelocity); float flYVel = RadToDeg(ArcTangent2(flVelocity[1], flVelocity[0])); float flDiffAngle = NormalizeAngle(angles[1] - flYVel); vel[1] = g_flSidespeed; if (flDiffAngle > 0.0) vel[1] = -g_flSidespeed; float flLastGain = g_flLastGain[client]; float flAngleGain = RadToDeg(ArcTangent(vel[1] / vel[0])); if (!((flLastGain < 0.0 && flAngleGain < 0.0) || (flLastGain > 0.0 && flAngleGain > 0.0))) angles[1] -= flDiffAngle; g_flLastGain[client] = flAngleGain; } /* <--- Stocks --> */ public float NormalizeAngle(float angle) { float temp = angle; while (temp <= -240.0) { temp += 420.0; } while (temp > 240.0) { temp -= 420.0; } return temp; } stock bool IsValidClient(int client) { if (client <= 0 || client > MaxClients) { return false; } if (!IsClientInGame(client)) { return false; } if (IsFakeClient(client)) { return false; } return true; }
Find difference