PDA

View Full Version : Anti AMX Tk punishment code



P47R!CK
03-14-2005, 03:48 AM
bool __stdcall new_DispatchUserMessage ( int msg_type, bf_read &msg_data )
{
if ( msg_type == 12 && gCvars.antipunish )
if ( gMe.bAmAlive() && gCvars.antipunish->GetBool() )
return false;

return gClientFuncs.DispatchUserMessage( msg_type , msg_data );
}


not tested but should work

Ap0calipz
03-14-2005, 12:08 PM
right GJ first of all but instead of c+p code i think people would benefit from an explanation so tell me if im warm here...

when amx gives you a tk'ing punishment it sends message from the server to your client.. this i take it detects when that message is being sent (can u please tell me where u got the number 12 from) and makes it false before its been executed on the client

right? im still learning remeber :knocked_o well i guess we all are

P47R!CK
03-14-2005, 12:35 PM
right GJ first of all but instead of c+p code i think people would benefit from an explanation so tell me if im warm here...

when amx gives you a tk'ing punishment it sends message from the server to your client.. this i take it detects when that message is being sent (can u please tell me where u got the number 12 from) and makes it false before its been executed on the client

right? im still learning remeber :knocked_o well i guess we all are


AMX makes your screen black if you tk someone. They do set by sending the usermessage Fade which has the index 12. All i do is not to dispatch to usermessage so the screen still looks okay. :D

RunningBon
03-14-2005, 12:37 PM
Nice & simple, are there any other useful msg_types ?

sp0rky
03-14-2005, 01:57 PM
AMX makes your screen black if you tk someone. They do set by sending the usermessage Fade which has the index 12. All i do is not to dispatch to usermessage so the screen still looks okay. :D

Haha I think the mani admin plugin can do something similar. I remember on one server I was blinded by an admin but I could see just fine. After seeing this I think it probably does the same thing by sending a Fade msg to blind you. Also if you return false it will put msgs in your console that say "Could not dispatch msg: blah" I think, so you can just return true and that should work as well.

P47R!CK
05-11-2005, 06:49 AM
Haha I think the mani admin plugin can do something similar. I remember on one server I was blinded by an admin but I could see just fine. After seeing this I think it probably does the same thing by sending a Fade msg to blind you. Also if you return false it will put msgs in your console that say "Could not dispatch msg: blah" I think, so you can just return true and that should work as well.
yeah i know... :/