Raised This Month: $51 Target: $400
 12% 

[L4D] Espawn Preventor


Post New Thread Reply   
 
Thread Tools Display Modes
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 08-18-2020 , 15:46   Re: [L4D] Espawn Preventor
Reply With Quote #11

You must be more away then from victim when spawned. For me it works. Do you espawn running? Jumping or standing still?

Probably we have to hook the use button press first and then do checks for lmb and block the execution of the lmb button press. Or add a delay like in the deep water jump disable plugin.

So that you cannot press the spawn button fast enough as infected.

https://forums.alliedmods.net/showthread.php?t=326618
__________________

Last edited by finishlast; 08-18-2020 at 15:50.
finishlast is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 08-18-2020 , 17:31   Re: [L4D] Espawn Preventor
Reply With Quote #12

I had a problem once while coding a plugin checking the client button in the game events (e.g. heal_begin),
which seems to have a delay to be detected, checking on "OnPlayerRunCmd" is more accurate (also expensive) but solved the issue for me.

I did some similar step to interrupt the actions, storing the "GetEngineTime" in a client float var.
So maybe check if the client has pressed E, store that time and block the left button (ATTACK) for some seconds like 1.5, this may prevent the bug
__________________

Last edited by Marttt; 08-18-2020 at 17:34.
Marttt is offline
Slaven555
Member
Join Date: Jul 2018
Old 08-19-2020 , 00:32   Re: [L4D] Espawn Preventor
Reply With Quote #13

Quote:
Originally Posted by finishlast View Post
You must be more away then from victim when spawned. For me it works. Do you espawn running? Jumping or standing still?

Probably we have to hook the use button press first and then do checks for lmb and block the execution of the lmb button press. Or add a delay like in the deep water jump disable plugin.

So that you cannot press the spawn button fast enough as infected.

https://forums.alliedmods.net/showthread.php?t=326618
I press the E button and quickly press the left button (ATTACK), appear next to the survivor and attack.
Slaven555 is offline
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 08-19-2020 , 10:41   Re: [L4D] Espawn Preventor
Reply With Quote #14

I thought mb somthing like this would fix but it does not work for some reason.

I know it is the wrong button jump and not lmb but it was supposed to be a proof of concept, so after pressing E it should disable jump.

I guess I am missing somthing obvious.

PHP Code:
#pragma semicolon 1
#pragma newdecls required 

#include <sourcemod>
#include <sdktools>

public Plugin myinfo =
{
    
name "espawndisabler",
    
author "",
    
description "Prevents espawn. ",
    
version "1.0",
    
url "https://forums.alliedmods.net/showthread.php?t=182103"
};

public 
APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max
{
    
EngineVersion test GetEngineVersion();   
    if (
test != Engine_Left4Dead && test != Engine_Left4Dead2)
    {
        
strcopy(errorerr_max"Plugin only supports Left 4 Dead 1 & 2.");
        return 
APLRes_SilentFailure;
    }
       return 
APLRes_Success;
}

public 
void OnPluginStart()
{

}

public 
Action OnPlayerRunCmd(int clientint &buttonsint &impulse)
{
    if (
IsValidClient(client) && IsClientInGame(client) && !IsFakeClient(client) && GetClientTeam(client) == 3)
    {
        if( 
buttons IN_USE 
        {   
            
PrintToChatAll("e");
            
SetEntPropFloat(clientProp_Send"m_jumpSupressedUntil",  GetGameTime() + 1.5);
        }
    }
    return 
Plugin_Continue;
}

stock bool IsValidClient(int client)
{
    return (
client && client <= MaxClients);

I can see in Chat that press e fires multiple e chat Messages, I would assume that I can't use jump then but it still works.

Btw, is there a list somewhere for these "m_jumpSupressedUntil"? What would be the equivalent for infected "spawn button"?
__________________

Last edited by finishlast; 08-19-2020 at 10:41.
finishlast is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 08-19-2020 , 11:24   Re: [L4D] Espawn Preventor
Reply With Quote #15

Do LMB and USE have to be pressed at the same time for the exploit to work? If that is the case then within onplayerruncmd check for both being pressed...if they are then just unpress use....i use a similar method to fix the heal revive exploit. Also does "m_isGhost" NetProp exist in L4D1?

Last edited by MasterMind420; 08-19-2020 at 11:29.
MasterMind420 is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 08-19-2020 , 11:37   Re: [L4D] Espawn Preventor
Reply With Quote #16

Code:
BUTTON ENUMS
IN_ATTACK = 1
IN_ATTACK2 = 2048
IN_BACK	= 16
IN_CANCEL = 64
IN_DUCK	= 4
IN_FORWARD = 8
IN_JUMP	= 2
IN_LEFT	= 512
IN_RELOAD = 8192
IN_RIGHT = 1024
IN_USE = 32
IN_SPEED = 131072
IN_ZOOM = 524288
IN_SCORE = 65536

public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
{
	if (IsValidClient(client) && IsClientInGame(client) && !IsFakeClient(client) && GetClientTeam(client) == 3)
	{
		if (GetEntProp(client, Prop_Send, "m_isGhost") > 0)
		{
			switch (buttons)
			{
				case 33: //IN_USE + IN_ATTACK
				{
					SetEntProp(client, Prop_Send, "m_ghostSpawnState", 0);
					SetEntProp(client, Prop_Send, "m_isGhost", 1); //Just in case they spawn maybe force them back to ghost?
					
					buttons &= ~IN_USE;
					return Plugin_Changed;
				}
			}
		}
	}

	return Plugin_Continue;
}
If the netprop exists in l4d1 this should prevent anyone who is ghost from pressing IN_ATTACK and IN_USE at the same time. Not 100% sure though it will stop the spawn.
Also try manipulating this entprop "m_ghostSpawnState", you can try setting them to force them to remain in ghost mode maybe...mess around with it and see if it helps.

Last edited by MasterMind420; 08-19-2020 at 11:48.
MasterMind420 is offline
Slaven555
Member
Join Date: Jul 2018
Old 08-19-2020 , 12:04   Re: [L4D] Espawn Preventor
Reply With Quote #17

Quote:
Originally Posted by MasterMind420 View Post
Do LMB and USE have to be pressed at the same time for the exploit to work? If that is the case then within onplayerruncmd check for both being pressed...if they are then just unpress use....i use a similar method to fix the heal revive exploit. Also does "m_isGhost" NetProp exist in L4D1?
Press USE and quickly press LMB to respawn next to a survivor.
Slaven555 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 08-19-2020 , 14:48   Re: [L4D] Espawn Preventor
Reply With Quote #18

You don't need to press both at same time, actually the bug works as Slaven said, you press "E" and quickly hit "LMB"
__________________

Last edited by Marttt; 08-19-2020 at 17:23.
Marttt is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 08-19-2020 , 16:37   Re: [L4D] Espawn Preventor
Reply With Quote #19

Quote:
Originally Posted by MasterMind420 View Post
Code:
BUTTON ENUMS
IN_ATTACK = 1
IN_ATTACK2 = 2048
IN_BACK	= 16
IN_CANCEL = 64
IN_DUCK	= 4
IN_FORWARD = 8
IN_JUMP	= 2
IN_LEFT	= 512
IN_RELOAD = 8192
IN_RIGHT = 1024
IN_USE = 32
IN_SPEED = 131072
IN_ZOOM = 524288
IN_SCORE = 65536

public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
{
	if (IsValidClient(client) && IsClientInGame(client) && !IsFakeClient(client) && GetClientTeam(client) == 3)
	{
		if (GetEntProp(client, Prop_Send, "m_isGhost") > 0)
		{
			switch (buttons)
			{
				case 33: //IN_USE + IN_ATTACK
				{
					SetEntProp(client, Prop_Send, "m_ghostSpawnState", 0);
					SetEntProp(client, Prop_Send, "m_isGhost", 1); //Just in case they spawn maybe force them back to ghost?
					
					buttons &= ~IN_USE;
					return Plugin_Changed;
				}
			}
		}
	}

	return Plugin_Continue;
}
This checking is all wrong you need to treat them as bitflags not ints if i were to hold IN_ZOOM anyway would bypass it ect.

PHP Code:
if(buttons & (IN_USE|IN_ATTACK))
{
    
//code

I think this should it for checking.

Here is revered bitflags for "m_ghostSpawnState".
https://github.com/LuxLuma/l4d2_stru...er.h#L745-L760
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 08-21-2020 , 10:39   Re: [L4D] Espawn Preventor
Reply With Quote #20

Hi,

try again with this.
Attached Files
File Type: sp Get Plugin or Get Source (espawndisabler.sp - 197 views - 1.3 KB)
__________________

Last edited by finishlast; 08-21-2020 at 10:41.
finishlast 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 14:10.


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