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

[CSGO] bounce player back (anti rush plugin)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cristi_ip
Senior Member
Join Date: Dec 2010
Location: Bucharest
Old 02-14-2017 , 01:56   [CSGO] bounce player back (anti rush plugin)
Reply With Quote #1

Hello guys,

Can anyone help me with a solution to anti rush plugin for csgo, plugin is working, but sometimes setted zone is broken, because when I crouch I can go inside it, maybe you can help me with a solution to this problem.

Code:
// Bounce him back
		case 2:
		{
			new Float:fVelocity[3];
			fVelocity[0] = GetEntPropFloat(activator, Prop_Send, "m_vecVelocity[0]"); 
			fVelocity[1] = GetEntPropFloat(activator, Prop_Send, "m_vecVelocity[1]"); 
			fVelocity[2] = GetEntPropFloat(activator, Prop_Send, "m_vecVelocity[2]");
			
			fVelocity[0] *= -2.0;
			fVelocity[1] *= -2.0;
			// Always bounce back with at least 200 velocity
			if(fVelocity[1] > 0.0 && fVelocity[1] < 200.0)
				fVelocity[1] = 200.0;
			else if(fVelocity[1] < 0.0 && fVelocity[1] > -200.0)
				fVelocity[1] = -200.0;
			// Never push the player up.
			if(fVelocity[2] > 0.0)
				fVelocity[2] *= -1.0;

			TeleportEntity(activator, NULL_VECTOR, NULL_VECTOR, fVelocity);
		}
https://forums.alliedmods.net/showpo...&postcount=130

Thank you!

Last edited by cristi_ip; 02-14-2017 at 01:59.
cristi_ip is offline
cristi_ip
Senior Member
Join Date: Dec 2010
Location: Bucharest
Old 02-15-2017 , 12:32   Re: [CSGO] bounce player back (anti rush plugin)
Reply With Quote #2

anyone?
cristi_ip is offline
sdz
Senior Member
Join Date: Feb 2012
Old 02-15-2017 , 13:59   Re: [CSGO] bounce player back (anti rush plugin)
Reply With Quote #3

Things to note about physics:

Velocity can be positive or negative. This is because vectors have a magnitude and direction.
Ideally, this is what I would do:

PHP Code:
// Bounce him back
        
case 2:
        {
            new 
Float:fVelocity[3];
            
GetEntPropVector(activatorProp_Data"m_vecVelocity"fVelocity);  //<--- GetEntPropVector, not float.
            
            //fVelocity[0] *= -2.0;
            //fVelocity[1] *= -2.0;
            // Always bounce back with at least 200 velocity
            
            
for(new 02i++)
            {
                if(
fVelocity[i] >= 30.0fVelocity[i] = -60.0;
                if(
fVelocity[i] <= -30.0fVelocity[i] = 60.0;
            }

            
// Never push the player up.
            
if(fVelocity[2] > 0.1 || fVelocity[2] < -0.1fVelocity[2] *= -1.0;
            
TeleportEntity(activatorNULL_VECTORNULL_VECTORfVelocity);
        } 
sdz is offline
cristi_ip
Senior Member
Join Date: Dec 2010
Location: Bucharest
Old 02-15-2017 , 14:30   Re: [CSGO] bounce player back (anti rush plugin)
Reply With Quote #4

Thank you for your response, I tried your version did not work, i have changed the values and players still can pass in the zone.
cristi_ip is offline
cristi_ip
Senior Member
Join Date: Dec 2010
Location: Bucharest
Old 02-17-2017 , 16:09   Re: [CSGO] bounce player back (anti rush plugin)
Reply With Quote #5

Hello,

On crouch you can enter the zone see video:

Video 1: https://www.youtube.com/watch?v=_pVOJ62YsSs - displays fence
Video 2: https://www.youtube.com/watch?v=nfgS-fd6dSw - displays zone

Can anyone please help me to fix this bug

Thank you

Last edited by cristi_ip; 02-17-2017 at 16:11.
cristi_ip is offline
sdz
Senior Member
Join Date: Feb 2012
Old 02-17-2017 , 20:09   Re: [CSGO] bounce player back (anti rush plugin)
Reply With Quote #6

Looks like it's the speed of which you move crouched. Try this one instead.

PHP Code:
// Bounce him back
        
case 2:
        {
            new 
Float:fVelocity[3];
            
GetEntPropVector(activatorProp_Data"m_vecVelocity"fVelocity);  //<--- GetEntPropVector, not float.
            
            //fVelocity[0] *= -2.0;
            //fVelocity[1] *= -2.0;
            // Always bounce back with at least 200 velocity
            
            
for(new 02i++)
            {
                if(
fVelocity[i] >= 0.1fVelocity[i] = -60.0;
                if(
fVelocity[i] <= -0.1fVelocity[i] = 60.0;
            }

            
// Never push the player up.
            
if(fVelocity[2] > 0.1 || fVelocity[2] < -0.1fVelocity[2] *= -1.0;
            
TeleportEntity(activatorNULL_VECTORNULL_VECTORfVelocity);
        } 
sdz is offline
cristi_ip
Senior Member
Join Date: Dec 2010
Location: Bucharest
Old 02-18-2017 , 04:14   Re: [CSGO] bounce player back (anti rush plugin)
Reply With Quote #7

Players can go through the zone but changing from 60 to 200 It works and the player can not pass through area.

Code:
if(fVelocity[i] >= 0.1) fVelocity[i] = -200.0;
if(fVelocity[i] <= -0.1) fVelocity[i] = 200.0;
But i have a new bug on other maps, the restriction is on the opposite side see video:
https://www.youtube.com/watch?v=NWaa9chrlMU

I rebuilt the zone, the problem persists.

Thank you for your help EasSidezz

Last edited by cristi_ip; 02-18-2017 at 04:35.
cristi_ip is offline
sdz
Senior Member
Join Date: Feb 2012
Old 02-20-2017 , 00:42   Re: [CSGO] bounce player back (anti rush plugin)
Reply With Quote #8

Looks like it has something to do with the detection inside the Fence plugin.
That is, checking if a player has entered the zone.

Last edited by sdz; 02-20-2017 at 00:42.
sdz 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 23:06.


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