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

Fix for 5th bot/ player server hack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 04-29-2018 , 09:54   Fix for 5th bot/ player server hack
Reply With Quote #1

I am looking for a fix for this server hack.
https://steamcommunity.com/sharedfil.../?id=310224439
It creates more then 4 players / bots in game and basicially messes up the campagin.

I am decient at writing sm plugins but don't know exactly what to do to prevent this.

Since it is cause by a join "botname" command
maybe all we have to do is to disallow any joins by a person using a bot name of:
Nick,Coach,Rochelle,Ellis,Francis,Bill,Louis, Zoey

That would be fine with me since I also don't like players that have their names exactly the same as one of those bot names.
Austin is offline
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 04-29-2018 , 11:07   Re: Fix for 5th bot/ player server hack
Reply With Quote #2

He's exploiting the jointeam command, so that could work:
PHP Code:
#include <sourcemod>

public void OnPluginStart()
{
    
AddCommandListener(L4D2Fix"jointeam");
}
 
public 
Action L4D2Fix(int client, const char[] commandint argc)
{
    return 
Plugin_Handled;

__________________
PinHeaDi is offline
Austin
Senior Member
Join Date: Oct 2005
Old 04-29-2018 , 15:06   Re: Fix for 5th bot/ player server hack
Reply With Quote #3

Quote:
Originally Posted by PinHeaDi View Post
He's exploiting the jointeam command, so that could work:
I can't totally test this since I need a second human on the team, but it looks like it is working and should work. I will test it tonight and if it works maybe this should be an approved plugin?

Thanks PinHeaDi !

PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

public Plugin:myinfo =
{
    
name "FixForJoinTeamHack ",
    
author "Austinbots",
    
description "Fix for server hack Jointeam (botName)",
    
version "1.0",
    
url ""
}

new 
String:botNames[8][10] =
{
    
"Nick",
    
"Coach",
    
"Rochelle",
    
"Ellis",
    
"Francis",
    
"Bill",
    
"Louis",
    
"Zoey"
};

public 
OnPluginStart()
{
    
AddCommandListener(L4D2Fix"jointeam");
}

public 
Action L4D2Fix(int clientID, const char[] commandint argc)
{
    new 
String:clientname[64];
    
GetClientName(clientIDclientnamesizeof(clientname));

    for(new 
i=0i<=7i++)
    {
        if(
StrEqual(clientnamebotNames[i], false))
            return 
Plugin_Handled;
    }
    return 
Plugin_Continue;

Austin is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 04-29-2018 , 15:26   Re: Fix for 5th bot/ player server hack
Reply With Quote #4

That's not good. You should probably do this instead.

Code:
public Action L4D2Fix(int client, const char[] command, int argc) 
{
	if (client < 1 || client > MaxClients || !IsClientInGame(client) || IsFakeClient(client)) return Plugin_Continue; 

	char arg[32];
	GetCmdArg(1, arg, sizeof(arg));
	int team = StringToInt(arg);
		
	if (team == 2 || StrEqual(arg, "survivor", false))
	{
		if (argc > 1)   // Someone is doing 2 arguments.  jointeam <argc1_teamnumber> <argc2_botName> 
		{
			FakeClientCommand(client, "jointeam 2");               // Block the bot argument and resend jointeam 2 to client.
			return Plugin_Handled;
		}
	}

	return Plugin_Continue;
}

Last edited by Visual77; 04-29-2018 at 17:08.
Visual77 is offline
Reply



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 21:55.


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