Diff
checker
Text
Text
Bilder
Dokumente
Excel
Ordner
Legal
Enterprise
Desktop-App
Preise
Einloggen
Diffchecker Desktop herunterladen
Texte vergleichen
Finde den Unterschied zwischen zwei Textdateien
Werkzeuge
Verlauf
Live-Editor
Gleiches ausblenden
Zeilenumbruch aus
Ansicht
Zweispaltig
Einspaltig
Vergleichsgenauigkeit
Intelligent
Wort
Zeichen
Syntaxhervorhebung
Syntax auswählen
Ignorieren
Text umwandeln
Zur ersten Änderung
Eingabe bearbeiten
Diffchecker Desktop
Der sicherste Weg, Diffchecker zu nutzen. Hol dir die Desktop-App: Deine Diffs verlassen nie deinen Computer!
Desktop holen
Untitled diff
Erstellt
vor 8 Jahren
Diff läuft nie ab
Löschen
Exportieren
Teilen
Erklären
3 Entfernungen
Zeilen
Gesamt
Entfernt
Zeichen
Gesamt
Entfernt
Um diese Funktion weiterhin zu nutzen, aktualisiere auf
Diff
checker
Pro
Preise anzeigen
221 Zeilen
Kopieren
3 Hinzufügungen
Zeilen
Gesamt
Hinzugefügt
Zeichen
Gesamt
Hinzugefügt
Um diese Funktion weiterhin zu nutzen, aktualisiere auf
Diff
checker
Pro
Preise anzeigen
220 Zeilen
Kopieren
#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);
Kopieren
Kopiert
Kopieren
Kopiert
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");
}
}
Kopieren
Kopiert
Kopieren
Kopiert
}
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;
}
}
Kopieren
Kopiert
Kopieren
Kopiert
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;
}
}
Gespeicherte Diffs
Originaltext
Datei öffnen
#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; }
Bearbeitung
Datei öffnen
#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; }
Unterschied finden