Finding if player is aiming @ teammate...
How would I go about finding if a player is aiming at a teammate BEFORE he shoots?
Also, how would I block his shoot event from happening and deal the damage to him? I'm having problems with a simple mirrordmg because AWP to the head, registers the death event pretty quickly and my spawn protect plugin, and mirrordmg plugin end up letting the user kill his teammate/opponent sometimes. I'm looking for a way to combat this. As of right now, I have a mirrordmg plugin that works...but I'd like a more refined one. Im taking dmg and healing the attacked player back and dealing damage to the attacker... I'd like to be able to not even let the shot happen because AWPs seem to cause the deathevent to happen before dmg event. |
of course u could get the damage event and the message arguments with the attacker and victim and use register_message like b4 and set_msg_block( get_user_msgid ( "Damage" ), BLOCK_ONCE )
and all this goes in a register_message ( which is a bit buggy coz it makes my server crash on map change ) |
get_user_aiming(id,personaimedat,whereheaims, distance)
|
Quote:
|
server_frame or set_task
|
Stay far away from server_frame, unless set_task wouldnt work
|
Actually, I think I can try blocking the event. Thats actually what I need.
How would I go about checking and blocking the event? I just want to block it if they're trying to shoot a teammate. Also, I'm trying to block death so just in case it is teammate, it doesn't kill them. |
u can't block death unless ur god
|
I could have sworn there was an old amx plugin that blocked the death event for clan practices.
|
Well maybe : If it checked if an admin put in some sort of a command that let the server/plugin know that they were practacing then it would give everyone godmode untill the round ended and then so on. Or maybe : I'm crazy. :)
|
I have kind of a problem though. Why the hell does the deathevent happen BEFORE the dmgevent? -- is that just something AMX isn't handling correctly?
Is there a way to make sure it handles dmg events before deathevents? |
just block the tk deathmessage with register_message...u can catch the message before the event is sent....I tried it b4 and it worked like a charm....only 1 problem....I got crashes every map change when I had the register_message in my plugin
|
Yes ts2do I also had that problem. A temporary fix (temporary because BAILOPAN has rewritten the Engine module, the bug should be fixed) is to block the message and register_event it. Works nicely for me :)
|
Someone mind showing me an example of the register_message event? This is a relatively new function and not many plugins out there that use it.
and how to pass or not pass altered data? and how to find out what events I can register?...this sounds VERY interesting and VERY useful. |
Code:
That will effectively dump the contents of any message... it's broken in 0.16, fixed in 0.20 Using the other functions you can find the definitive types and make new messages or edit the current one in real time. That way you can actively block a message, for example: if (get_msg_arg_int(2) == get_msg_arg_int(1)) return PLUGIN_HANDLED block the message if the killer and victim are the same person |
does returning it 1 actually block it? I thot u had to use set_msg_block( get_user_msgid ( "Damage" ), BLOCK_ONCE )
|
wow, THANK YOU BAILO!
Thats some pretty sweet schtuff... Can't wait for .20 |
yes that blocks it
|
| All times are GMT -4. The time now is 15:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.