Raised This Month: $ Target: $400
 0% 

changing player 'pain' sounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-11-2013 , 03:37   Re: changing player 'pain' sounds
Reply With Quote #1

FM_Touch is not efficient to hook, you should never hook it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 11-11-2013 , 13:18   Re: changing player 'pain' sounds
Reply With Quote #2

Quote:
Originally Posted by ConnorMcLeod View Post
FM_Touch is not efficient to hook, you should never hook it.
Ham_Touch does not register my custom entities.. or any entities at all for that matter.

PHP Code:
//public Hook_Touch(ent, id)//Ham Hook.. idthis, idother??
public Hook_Touch(ident)
{
    
//
    
client_print(0print_chat"%d -> %d"ident);
    
    if(!
pev_valid(ent))
        return 
FMRES_HANDLED;
    if(!
is_user_alive(id))
        return 
FMRES_HANDLED;
    
    
//client_print(0, print_chat, "%d -> %d", id, ent);
    
client_print(0print_chat"Touch Post Checks");//I never get this far, I have only seen when I touch world
    
new className[64];
    
pev(entpev_classnameclassNamecharsmax(className)); 
EDIT: im using register_touch now, is this more efficient?

PHP Code:
register_touch("*""player""Hook_Touch"); 
__________________
+|- KARMA Respectively


Last edited by HLM; 11-11-2013 at 15:10.
HLM is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-11-2013 , 16:08   Re: changing player 'pain' sounds
Reply With Quote #3

If you still need to figure out what is the touched class, would be more efficient to register only wanted classes. But it is better.
You don't get the log because you have commented the correct way :
PHP Code:
//public Hook_Touch(ent, id)//Ham Hook.. idthis, idother??
public Hook_Touch(ident
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 23:13.


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