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

Airblast prevention


Post New Thread Reply   
 
Thread Tools Display Modes
BloodyNightmare
Member
Join Date: Aug 2012
Location: Ontario, Canada
Old 01-16-2014 , 10:58   Re: Airblast prevention
Reply With Quote #21

Thank you for the help Mitchell, and Dr. Greg House. Trying to learn a new way of programming isn't easy when there's no help. ;-; Indentation has always been a problem of mine.
__________________
BloodyNightmare is offline
BloodyNightmare
Member
Join Date: Aug 2012
Location: Ontario, Canada
Old 01-16-2014 , 11:27   Re: Airblast prevention
Reply With Quote #22

Quote:
Originally Posted by friagram View Post
You do realize its dodgeball..
You could just set fl_notarget on their client entity.
The server I host isn't a Dodge-ball server. It's a Trade server, running a custom map that I've made. Airblast spam is a problem though, but people want to keep the map.

Quote:
Originally Posted by Dr. Greg House View Post
Code:
 406  399 CTFFlameThrower::DeflectPlayer(CTFPlayer *, CTFPlayer *, Vector &, Vector &, Vector &)
Hook and block this.
Note that the other checks are moot because there seem to be other methods for projectiles and entities (not sure if separated or altogether to be honest).

Two things to note about Mitchel's solution of which either one of them will become true:
1.) The player will be stopped entirely, so he'd have to accelerate again. In mid-air this would mean that he would drop like a stone.
2.) If you look up what the hl2sdk does in "TeleportEntity", you'll see that the given velocity will be kind of added up to the current entity's velocity. That way you can use "TeleportEntity" to apply multiple push-forces. That is why jumps work and won't stop your other movements for example.
Player does not get stopped entirely, it doesn't appear to affect acceleration. I've just tested it several times, jumping off ledges, etc. Doesn't make any difference when airblasted.

Also, the compiled plugin test came back with positive and negative results. Positive: it works! No airblast has no knockback. Negative? The toggle is useless. Whether or not you type the command, nobody can air blast anybody. Which I guess isn't too bad concidering. But I'm thinking there's something else I need to add to fix.
__________________
BloodyNightmare is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-16-2014 , 12:29   Re: Airblast prevention
Reply With Quote #23

Quote:
Originally Posted by BloodyNightmare View Post
The toggle is useless.
post your code, maybe theres something we missed
Mitchell is offline
BloodyNightmare
Member
Join Date: Aug 2012
Location: Ontario, Canada
Old 01-16-2014 , 13:25   Re: Airblast prevention
Reply With Quote #24

Code:
#include <sourcemod>
#include <sdktools>
#include <tf2_stocks>
#include <colors>

//Is Airblast Enabled
new bool:Airblast[MAXPLAYERS + 1]	= {false,...};
 
public Plugin:myinfo =
{
	name = "No Airblasting",
	author = "Nightmare",
	description = "Prevents users from airblasting.",
	version = "1.0",
	url = "http://www.thenightclan.org"
};

public OnPluginStart() 
{ 
    HookEvent("object_deflected", Event_ObjectDeflected);

    RegAdminCmd("sm_airblast", OnToggleAirblast, ADMFLAG_ROOT, "Toggles airblast on/off");
    RegAdminCmd("sm_ab", OnToggleAirblast, ADMFLAG_ROOT, "Toggles airblast on/off");
} 

public Action:Event_ObjectDeflected(Handle:event, const String:name[], bool:dontBroadcast)
{
	new object = GetEventInt(event, "object_entindex");
	if ((object>=1) && (object<=MaxClients))
	{
		
		if(Airblast[object] == true)
		{
			new Float:Vel[3];
			TeleportEntity(object, NULL_VECTOR, NULL_VECTOR, Vel); // Stops knockback
			TF2_RemoveCondition(object, TFCond_Dazed); // Stops slowdown
			SetEntPropVector(object, Prop_Send, "m_vecPunchAngle", Vel);
			SetEntPropVector(object, Prop_Send, "m_vecPunchAngleVel", Vel); // Stops screen shake  
		}
	}
	return Plugin_Continue;
}

public Action:OnToggleAirblast( client, args ) 
{ 
	if(Airblast[client]) 
	{
		Airblast[client] = false;
		CPrintToChat(client, "[SM] {lightgreen}Airblast Prevention {green}Disabled{lightgreen}!");
	}
	else 
	{
		Airblast[client] = true;
		CPrintToChat(client, "[SM] {lightgreen}Airblast Prevention {green}Enabled{lightgreen}!");
	}
	return Plugin_Handled; 
}


public OnClientDisconnect(client)
{
    Airblast[client] = false;
}
__________________
BloodyNightmare is offline
BloodyNightmare
Member
Join Date: Aug 2012
Location: Ontario, Canada
Old 01-16-2014 , 13:27   Re: Airblast prevention
Reply With Quote #25

As soon as I load the plugin, air blast is disabled for everybody. I don't have to enter the command what-so-ever. Trying to type in the command doesn't effect whether or not it works.
__________________
BloodyNightmare is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-16-2014 , 13:47   Re: Airblast prevention
Reply With Quote #26

Hmm weird, the variable seems to be okay, and does show that it should work
Mitchell is offline
BloodyNightmare
Member
Join Date: Aug 2012
Location: Ontario, Canada
Old 01-16-2014 , 13:49   Re: Airblast prevention
Reply With Quote #27

Could
Code:
	if ((object>=1) && (object<=MaxClients))
Be the problem?
__________________
BloodyNightmare is offline
arthurdead
Senior Member
Join Date: Jul 2013
Old 01-16-2014 , 14:20   Re: Airblast prevention
Reply With Quote #28

Quote:
Originally Posted by BloodyNightmare View Post
Could
Code:
	if ((object>=1) && (object<=MaxClients))
Be the problem?
no this checks if the object is a client
arthurdead is offline
BloodyNightmare
Member
Join Date: Aug 2012
Location: Ontario, Canada
Old 01-16-2014 , 19:14   Re: Airblast prevention
Reply With Quote #29

Ah, well there goes what I was thinking.
__________________
BloodyNightmare is offline
BloodyNightmare
Member
Join Date: Aug 2012
Location: Ontario, Canada
Old 01-17-2014 , 10:21   Re: Airblast prevention
Reply With Quote #30

After having this run in the server for a bit, I noticed something. Those who have access to sourcemod commands via any flag can't airblast, but those who don't have any flags can. All of my what? goes into why...
__________________
BloodyNightmare 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 15:29.


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