Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 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; }
비교하기