Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Untitled diff
建立於
8 年前
差異永不過期
清除
匯出
分享
解釋
3 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
221 行
全部複製
3 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
220 行
全部複製
#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);
複製
已複製
複製
已複製
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");
}
}
複製
已複製
複製
已複製
}
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;
}
}
複製
已複製
複製
已複製
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;
}
}
已保存差異
原始文本
開啟檔案
#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; }
更改後文本
開啟檔案
#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; }
尋找差異