Raised This Month: $ Target: $400
 0% 

How to hook tempentities proberly?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tolsty
Senior Member
Join Date: Feb 2008
Location: Latvia
Old 10-04-2009 , 09:19   How to hook tempentities proberly?
Reply With Quote #1

i want to block these messages, but i had no luck
TE_GUNSHOT 2
TE_SPARKS 9
TE_GUNSHOTDECAL 109
TE_ARMOR_RICOCHET 111
TE_MULTIGUNSHOT 126

PHP Code:
new const BULLETMSG = (TE_GUNSHOT TE_SPARKS TE_GUNSHOTDECAL TE_ARMOR_RICOCHET TE_MULTIGUNSHOT)
public 
plugin_init() {
 
register_messageSVC_TEMPENTITY ,"hidebullet"
}

public 
hidebullet msg_idmsg_typemsg_entity)
{

   if ( 
get_msg_arg_int ) == BULLETMSG )
   {
      
// Block
   

Please show me a full example how to Hook those messages and block them .

P.S. Admins, please correct the typo in the thread title
__________________
[IMG]http://img2.**************/img2/7173/signfp.jpg[/IMG]

Last edited by tolsty; 10-04-2009 at 09:25.
tolsty is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-04-2009 , 13:45   Re: How to hook tempentities proberly?
Reply With Quote #2

Code:
#include < amxmodx > new const g_iBlockMessages[ ] = {     TE_GUNSHOT,     TE_SPARKS,     TE_GUNSHOTDECAL,     TE_ARMOR_RICOCHET,     TE_MULTIGUNSHOT }; new Trie:g_tBlockMessages; public plugin_init( ) {     g_tBlockMessages = TrieCreate( );         new szMessage[ 2 ];     for( new i = 0; i < sizeof( g_iBlockMessages ); i++ ) {         szMessage[ 0 ] = g_iBlockMessages[ i ];         TrieSetCell( g_tBlockMessages, szMessage, i );     }         register_message( SVC_TEMPENTITY, "MessageTempEntity" ); } public plugin_end( ) {     TrieDestroy( g_tBlockMessages ); } public MessageTempEntity( ) {     static szMessage[ 2 ];     szMessage[ 0 ] = get_msg_arg_int( 1 );         if( TrieKeyExists( g_tBlockMessages, szMessage ) ) {         return PLUGIN_HANDLED;     }         return PLUGIN_CONTINUE; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 10-04-2009 at 13:53.
Exolent[jNr] is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 10-04-2009 , 13:51   Re: How to hook tempentities proberly?
Reply With Quote #3

I don't think trie is a good way to do this
Jon is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-04-2009 , 13:52   Re: How to hook tempentities proberly?
Reply With Quote #4

Quote:
Originally Posted by Jon View Post
I don't think trie is a good way to do this
Why?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-04-2009 , 13:59   Re: How to hook tempentities proberly?
Reply With Quote #5

Quote:
Originally Posted by Jon View Post
I don't think trie is a good way to do this
I am affraid that Exolents way is the only way because tempents don't exist as ents do.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
tolsty
Senior Member
Join Date: Feb 2008
Location: Latvia
Old 10-04-2009 , 14:55   Re: How to hook tempentities proberly?
Reply With Quote #6

Thanx, but it didnt work
what i need is to hide the bullet effects, but leave the model animations
__________________
[IMG]http://img2.**************/img2/7173/signfp.jpg[/IMG]
tolsty is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-04-2009 , 15:01   Re: How to hook tempentities proberly?
Reply With Quote #7

Use FM_TraceLine.
__________________
Arkshine is offline
Old 10-04-2009, 15:34
ConnorMcLeod
This message has been deleted by ConnorMcLeod.
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-04-2009 , 15:42   Re: How to hook tempentities proberly?
Reply With Quote #8

BULLETMSG are not a bits sum.
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-04-2009 , 15:45   Re: How to hook tempentities proberly?
Reply With Quote #9

Quote:
Originally Posted by Arkshine View Post
BULLETMSG are not a bits sum.
OMG edited.
I guess we can't make it a bitsum due to max cell value.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
tolsty
Senior Member
Join Date: Feb 2008
Location: Latvia
Old 10-04-2009 , 17:21   Re: How to hook tempentities proberly?
Reply With Quote #10

i tried using traceline but it didnt work,
the trace gets redirected, but the gunfire decal and the sparks stays right where they should normaly be
example:
PHP Code:
public plugin_init()
    
register_forward(FM_TraceLine,"fw_traceline");

public 
fw_traceline(Float:start[3], Float:end[3], conditionsidtrace)
{
    
set_tr2(traceTR_pHitid)

i redirected every hit to my self, if i shoot i loose hp and everything, but the effect is on the wall
__________________
[IMG]http://img2.**************/img2/7173/signfp.jpg[/IMG]
tolsty is offline
Reply



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 22:40.


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