Raised This Month: $ Target: $400
 0% 

FM_Touch help me?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
felipemilralze
Senior Member
Join Date: Jul 2011
Location: Brazil
Old 05-14-2014 , 15:52   Re: FM_Touch help me?
Reply With Quote #3

Quote:
Originally Posted by meTaLiCroSS View Post
"Touch" is called whenever an entities touchs another entity (or world itself).

It has 2 arguments:

1) "pentTouched" which is the touched entity
2) "pentOther" which is the toucher, this one can be the world

Whenever "touch" is called, you must guess that 2 touch forwards will be called. The second callback will have the args flipped.

If ent1 touches ent2 and ent2 is not world:

Touch(ent1, ent2)
Touch(ent2, ent1)

Use register_touch instead of using Fakemeta's FM_Touch because you'll hook many touch callback, when you'll just check for an specific entity touch. (if it's the case)

PHP Code:
public fw_touch(enttouched)
{
    if (!
pev_valid(ent)) 
        return 
FMRES_IGNORED
    
    
static entclass[32], entclass2[32]
    
pev(entpev_classnameentclasscharsmax(entclass))
    
pev(touchedpev_classnameentclass2charsmax(entclass2))

    if(
equali(entclass"amxx_pallets") && equali(entclass2"player") && is_user_alive(touched))
    {
                
set_pev(ent ,pev_solidSOLID_NOT)
    }
    return 
FMRES_IGNORED

I'm having trouble.

"ent" is doing fusion with the "touched"
felipemilralze is offline
Send a message via MSN to felipemilralze Send a message via Skype™ to felipemilralze
 



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


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