AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   hitting question (https://forums.alliedmods.net/showthread.php?t=20618)

haimmaik 11-12-2005 15:43

hitting question
 
how do i do that if some1 is getting hit.. he wont slow down or lose his aim?

i mean.. when im getting hit in counterstike my walkingspeed is slowing down for a second and my aim is moving ... how can i disable it (more like when im getting hit.. i wont feel it..)
(xpt that my hp will get low)

v3x 11-12-2005 21:09

I suck at explaining things, so try this:
Code:
#include <amxmodx> #include <fun> public plugin_init() {   register_event("Damage", "Event_Damage", "b", "2!0");   register_event("CurWeapon", "Event_CurWeapon", "be");   register_event("ResetHUD", "Event_ResetHUD", "b"); } #define MIN_DAMAGE 25 // minimum amount of damage before player slows down #define SLOW_SPEED 200.0 // max speed of injured players new bool:g_bSlow[33] = { false, ... }; public client_connect( id )   g_bSlow[id] = false; public Event_Damage( id ) {   new dmg = read_data(2); // get the damage recieved   // if the damage is greater than or equal to the defined value..   if(dmg >= MIN_DAMAGE)   {     set_user_maxspeed(id, SLOW_SPEED); // set his maxspeed     g_bSlow[id] = true; // set the bool to true   } } public Event_CurWeapon( id ) {   // if the bool is true..   if(g_bSlow[id] == true)     set_user_maxspeed(id, SLOW_SPEED); // set his speed } public Event_ResetHUD( id )   g_bSlow[id] = false; // set the bool to false when the player spawns again

XxAvalanchexX 11-12-2005 21:17

Does a user's maxspeed really change when he gets hit? I know when you jump off of a big ledge, and you take damage which makes you walk slower momentarily, your maxspeed remains the same. I would assume it is the same for getting shot.

v3x 11-12-2005 21:18

Now that I think about it, I think it does ;)

:oops:

haimmaik 11-13-2005 00:09

Quote:

Originally Posted by XxAvalanchexX
Does a user's maxspeed really change when he gets hit? I know when you jump off of a big ledge, and you take damage which makes you walk slower momentarily, your maxspeed remains the same. I would assume it is the same for getting shot.

yeah ur right... and same happens when some1 is shooting at u...
my question was how to DISABLE this? i want it to move normally on those situations.

v3x your code will just make it worse..
but u gave me an idea.. maybe i can rais the minspeed into something higher than the normal one.. and it'll work... if it really changes the maxspeed... then it should work.. but im almost sure it doesnt.. which makes me to belive that this probably wont work.. well.. ill try :)

Xanimos 11-13-2005 00:13

maybe
Code:
public client_PreThink(id) {     if (!get_cvar_num("bh_enabled"))         return PLUGIN_CONTINUE     entity_set_float(id, EV_FL_fuser2, 0.0)     // Disable slow down after jumping
taken from bunny hop enable plugin?

haimmaik 11-13-2005 00:14

yep! good.. that will do half of the job.. :)

haimmaik 11-13-2005 00:21

HAY i found this -
EV_FL_pain_finished

what does it do?

Cheap_Suit 11-13-2005 02:09

Quote:

Originally Posted by Suicid3
maybe
Code:
public client_PreThink(id) {     if (!get_cvar_num("bh_enabled"))         return PLUGIN_CONTINUE     entity_set_float(id, EV_FL_fuser2, 0.0)     // Disable slow down after jumping
taken from bunny hop enable plugin?

I did use entity_set_float(id, EV_FL_fuser2, 0.0) when trying to slow down when getting damage, it didnt work too well. :oops:

haimmaik 11-13-2005 02:32

no thats for the jumping part...
i still need something to disable the damage slow
(also fall damage)


All times are GMT -4. The time now is 23:59.

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