AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   AIMing detector .. ADVANCED FF (https://forums.alliedmods.net/showthread.php?t=12017)

KaOs 04-02-2005 23:09

AIMing detector .. ADVANCED FF
 
I want to create a plugin that will NOT allow a user to shoot if he is aiming at a teammate..

The way I figured to do this, get_user_origin() and get_user_aiming() .. somehow..

But what message is user shot or something like that? Or even better, before a user shoots?

Twilight Suzuka 04-02-2005 23:46

There is no such thing.

amxxsean 04-03-2005 00:14

Dunno, complete noob here but what about the HUD message, like FRIENDLY: or Friend: or whatever.

KaOs 04-03-2005 00:35

There's absolutely no way to call a function when a user shoots? That's pathetic

twistedeuphoria 04-03-2005 03:01

client_PreThink -> IN_ATTACK -> check reload state etc etc if you use get_user_button and not get_user_oldbutton it should call before the shot is fired. I think that's correct.

Twilight Suzuka 04-03-2005 12:12

No, that will be called when they are pressing FIRE button. They could be holding the button when its on semi, they could be between full auto firing sequences, etc etc.

There is no real good way to get when a bullet comes out of the players gun, because the FM trace_line doesnt work apparently.

twistedeuphoria 04-03-2005 13:02

I believe if you are holding down the button it repeatedly sends the button throughout the time you hold it down. While that would be overkill if they are just holding down on a semi it would solve the automatic problem and overkill is better than not working completely.

Twilight Suzuka 04-03-2005 13:38

Not working properly is not working at all.

Also, in the HL SDK, things like the mp5, full auto so to speak, do NOT repeatedly send the button, they do something like this:

Code:

button_pressed_at = game_time() + 0.5
and then make it fire again as soon as button_pressed_at is below game_time();

So, your method is really really flawed.

twistedeuphoria 04-03-2005 14:43

Ah, I see. It was worth a shot.

XxAvalanchexX 04-03-2005 15:29

Quote:

Originally Posted by Twilight Suzuka
FM trace_line doesnt work apparently.

Certainly works for me.


All times are GMT -4. The time now is 10:01.

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