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

CS:GO slow when hit


Post New Thread Reply   
 
Thread Tools Display Modes
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 03-20-2018 , 00:31   Re: CS:GO slow when hit
Reply With Quote #11

Code:
public Event_Player_Hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (GetEntPropFloat(victim, Prop_Send, "m_flVelocityModifier") < 0.6) SetEntPropFloat(victim, Prop_Send, "m_flVelocityModifier", 0.6);
}

Last edited by Indarello; 03-20-2018 at 00:32.
Indarello is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 03-20-2018 , 09:17   Re: CS:GO slow when hit
Reply With Quote #12

Quote:
Originally Posted by Indarello View Post
Code:
public Event_Player_Hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (GetEntPropFloat(victim, Prop_Send, "m_flVelocityModifier") < 0.6) SetEntPropFloat(victim, Prop_Send, "m_flVelocityModifier", 0.6);
}
Maybe you should post complete code that actually works?

Last edited by Visual77; 03-20-2018 at 09:17.
Visual77 is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 03-21-2018 , 00:04   Re: CS:GO slow when hit
Reply With Quote #13

Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public OnPluginStart()
{	
	HookEvent("player_hurt", EventPlayerHurt, EventHookMode_Pre);
}	

public Action:EventPlayerHurt(Handle:event, const String:name[],bool:dontBroadcast)
{
	new i = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if(i == 0) return Plugin_Continue;
	if (GetEntPropFloat(i, Prop_Send, "m_flVelocityModifier") < 0.6) SetEntPropFloat(i, Prop_Send, "m_flVelocityModifier", 0.6);

	return Plugin_Continue;
}

Last edited by Indarello; 03-21-2018 at 00:05.
Indarello is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 03-21-2018 , 03:33   Re: CS:GO slow when hit
Reply With Quote #14

What if the client disconnects or something.
Visual77 is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 03-21-2018 , 06:26   Re: CS:GO slow when hit
Reply With Quote #15

Quote:
Originally Posted by Visual77 View Post
What if the client disconnects or something.
Blackhole will spawn and destroy our galaxy

Last edited by Indarello; 03-21-2018 at 06:27.
Indarello is offline
Berva
Member
Join Date: Feb 2018
Old 03-21-2018 , 09:12   Re: CS:GO slow when hit
Reply With Quote #16

Mr. Indarello,
what does that code do excatly? (:
Berva is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 03-21-2018 , 11:56   Re: CS:GO slow when hit
Reply With Quote #17

Quote:
Originally Posted by Berva View Post
Mr. Indarello,
what does that code do excatly? (:
m_flVelocityModifier is your speed modifier after somebody shoot you, we dont let it be less then 0.6
it increase by engine to 1 since some time after somebody hit you
it can be even 0.2 in some cases so you will be very slow
Indarello is offline
Berva
Member
Join Date: Feb 2018
Old 03-21-2018 , 14:21   Re: CS:GO slow when hit
Reply With Quote #18

I've tested it while I was bunnyhopping (sv_enablebunnyhopping 1, sv_autobunnyhopping 1) and it did not work, but when I was walking it worked :p
Thanks for your work anyway <3
Berva is offline
srvmil
Senior Member
Join Date: Oct 2010
Old 03-22-2018 , 02:24   Re: CS:GO slow when hit
Reply With Quote #19

Quote:
Originally Posted by Berva View Post
I've tested it while I was bunnyhopping (sv_enablebunnyhopping 1, sv_autobunnyhopping 1) and it did not work
So you are saying when you are jumping around, it is slowing you down? But running (by default) does work? If that is the case, as least running and silent walking both kept you going.

Maybe someone who is knowledgeable with jumping thing could add to Indarello's code then this will be a sweet plugin for anyone who is looking for it too.

Last edited by srvmil; 03-22-2018 at 02:24.
srvmil is offline
bebe9b
Veteran Member
Join Date: May 2009
Location: Romania
Old 03-23-2018 , 17:23   Re: CS:GO slow when hit
Reply With Quote #20

Hi,
Your plugin failed to compile! Read the errors below:
SourcePawn Compiler 1.7.1
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

/home/groups/sourcemod/upload_tmp/phpgk6wFL.sp(13) : error 017: undefined symbol "victim"
/home/groups/sourcemod/upload_tmp/phpgk6wFL.sp(13) : error 017: undefined symbol "victim"
/home/groups/sourcemod/upload_tmp/phpgk6wFL.sp(15) : warning 213: tag mismatch
/home/groups/sourcemod/upload_tmp/phpgk6wFL.sp(17) : warning 225: unreachable code
/home/groups/sourcemod/upload_tmp/phpgk6wFL.sp(17) : warning 213: tag mismatch

2 Errors.
__________________
respecta si vei fi respectat
bebe9b 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 07:51.


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