Raised This Month: $32 Target: $400
 8% 

Anti - Speed Hack Standalone plugin The Ship game


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
u3er
New Member
Join Date: Jul 2018
Old 07-18-2018 , 02:00   Anti - Speed Hack Standalone plugin The Ship game
Reply With Quote #1

PLease need help i need simple anti speed hack plugin! SMAC dont work on my server help me to edit this source code smac_speedhack.sp to workable plugin for the Ship game cause dont work in game the ship!
only Antiflood spam works! I need simple plugin speed hack protect For the game The Ship
I can not make the plugin work!
Source of plugin


#pragma semicolon 1

/* SM Includes */
#include <sourcemod>
#include <sdktools>
#include <smac>
#undef REQUIRE_PLUGIN
#tryinclude <updater>

/* Plugin Info */
public Plugin:myinfo =
{
name = "SMAC Anti-Speedhack",
author = SMAC_AUTHOR,
description = "Prevents speedhack cheats from working",
version = SMAC_VERSION,
url = SMAC_URL
};

/* Globals */
#define UPDATE_URL "http://********/updater/smac_speedhack.txt"

new g_iTicksLeft[MAXPLAYERS+1];
new g_iMaxTicks;

#define MAX_DETECTIONS 30
new g_iDetections[MAXPLAYERS+1];
new Float:g_fDetectedTime[MAXPLAYERS+1];
new Float:g_fPrevLatency[MAXPLAYERS+1];

/* Plugin Functions */
public OnPluginStart()
{
LoadTranslations("smac.phrases");

// The server's tickrate * 2.0 as a buffer zone.
g_iMaxTicks = RoundToCeil(1.0 / GetTickInterval() * 2.0);

for (new i = 0; i < sizeof(g_iTicksLeft); i++)
{
g_iTicksLeft[i] = g_iMaxTicks;
}

CreateTimer(0.1, Timer_AddTicks, _, TIMER_REPEAT);

#if defined _updater_included
if (LibraryExists("updater"))
{
Updater_AddPlugin(UPDATE_URL);
}
#endif
}

public OnLibraryAdded(const String:name[])
{
#if defined _updater_included
if (StrEqual(name, "updater"))
{
Updater_AddPlugin(UPDATE_URL);
}
#endif
}

public OnClientConnected(client)
{
g_iTicksLeft[client] = g_iMaxTicks;
g_iDetections[client] = 0;
g_fDetectedTime[client] = 0.0;
g_fPrevLatency[client] = 0.0;
}

public Action:Timer_AddTicks(Handle:timer)
{
static Float:fLastProcessed;
new iNewTicks = RoundToCeil((GetEngineTime() - fLastProcessed) / GetTickInterval());

for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && !IsFakeClient(i))
{
// Make sure latency didn't spike more than 5ms.
// We want to avoid writing a lagging client to logs.
new Float:fLatency = GetClientLatency(i, NetFlow_Outgoing);

if (!g_iTicksLeft[i] && FloatAbs(g_fPrevLatency[i] - fLatency) <= 0.005)
{
if (++g_iDetections[i] >= MAX_DETECTIONS && GetGameTime() > g_fDetectedTime[i])
{
if (SMAC_CheatDetected(i, Detection_Speedhack, INVALID_HANDLE) == Plugin_Continue)
{
SMAC_PrintAdminNotice("%t", "SMAC_SpeedhackDetected", i);

// Only log once per connection.
if (g_fDetectedTime[i] == 0.0)
{
SMAC_LogAction(i, "is suspected of using speedhack.");
}
}

g_fDetectedTime[i] = GetGameTime() + 30.0;
}
}
else if (g_iDetections[i])
{
g_iDetections[i]--;
}

g_fPrevLatency[i] = fLatency;
}

if ((g_iTicksLeft[i] += iNewTicks) > g_iMaxTicks)
{
g_iTicksLeft[i] = g_iMaxTicks;
}
}

fLastProcessed = GetEngineTime();
return Plugin_Continue;
}

public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if (!g_iTicksLeft[client])
return Plugin_Handled;

if (IsPlayerAlive(client))
g_iTicksLeft[client]--;

return Plugin_Continue;
}
u3er is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-19-2018 , 18:10   Re: Anti - Speed Hack Standalone plugin The Ship game
Reply With Quote #2

Lol.

SMAC isnt on the forums for a reason.

Seek help elsewhere and place the copyright comment back in ur code.
__________________
Neuro Toxin is offline
thedudeguy1
Senior Member
Join Date: Oct 2014
Location: 127.0.0.1
Old 07-20-2018 , 15:43   Re: Anti - Speed Hack Standalone plugin The Ship game
Reply With Quote #3

Sorry but SMAC is not allowed to be linked to, uploaded, or otherwise be provided through the forums. Additionally, please place the copyright statement back in SMAC's header. I recommend not using parts of SMAC's code for your own plugin as you may end up in legal trouble with Kigen much like the creators of SMAC.
__________________
A computer is like an Old Testament god, with a lot of rules and no mercy. -Joseph Campbell
thedudeguy1 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-20-2018 , 16:00   Re: Anti - Speed Hack Standalone plugin The Ship game
Reply With Quote #4

Quote:
Originally Posted by thedudeguy1 View Post
Sorry but SMAC is not allowed to be linked to, uploaded, or otherwise be provided through the forums. Additionally, please place the copyright statement back in SMAC's header. I recommend not using parts of SMAC's code for your own plugin as you may end up in legal trouble with Kigen much like the creators of SMAC.
This is long resolved and compliant code is available from http://smac.sx/, as allowed by the license terms any derivative works are fine as long as they maintain all copyright notices.

EDIT: Haha, time for that filter to be removed...
EDIT 2: Restored link.
__________________

Last edited by asherkin; 07-20-2018 at 16:02.
asherkin is online now
thedudeguy1
Senior Member
Join Date: Oct 2014
Location: 127.0.0.1
Old 07-20-2018 , 16:23   Re: Anti - Speed Hack Standalone plugin The Ship game
Reply With Quote #5

Oh I had no idea that got resolved. I guess I've been away from the SRCDS/SM scene for too long. Thanks, asherkin!
__________________
A computer is like an Old Testament god, with a lot of rules and no mercy. -Joseph Campbell
thedudeguy1 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode