Raised This Month: $ Target: $400
 0% 

register_touch.. in fakemeta?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 01-09-2009 , 19:39   register_touch.. in fakemeta?
Reply With Quote #1

Hi i want to convert this in fakemeta or hamsandwich

PHP Code:
register_touch("func_breakable""player""something"); 
how :-?
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
zwfgdlc
Senior Member
Join Date: May 2006
Old 01-09-2009 , 19:46   Re: register_touch.. in fakemeta?
Reply With Quote #2

PHP Code:
#include <fakemeta>
register_forward(FM_Touch,"fw_Touch"); 
PHP Code:
#include <hamsandwich>
RegisterHam(Ham_Touch,"player","fw_Touch"
zwfgdlc is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-09-2009 , 19:47   Re: register_touch.. in fakemeta?
Reply With Quote #3

Fakemeta:

Code:
public plugin_init() {     register_forward(FM_Touch, "FwdTouch"); } public FwdTouch(ptr, ptd) {     if( pev_valid(ptr) && pev_valid(ptd) )     {         static classname1[32], classname2[32];         pev(ptr, pev_classname, classname1, sizeof(classname1) - 1);         pev(ptd, pev_classname, classname2, sizeof(classname2) - 1);                 if( equali(classname1, "Your classname") && equali(classname2, "Your classname 2") )         {             // your code         }     } }

If you're detecting the ground, the entity will not be vaild.
The entity id will be 0, and there will be no classname for it.


HamSandwich:

Code:
public plugin_init() {     RegisterHam(Ham_Touch, "your classname", "FwdTouch"); } public FwdTouch(entity, client) {     // your code }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 01-09-2009 at 19:49.
Exolent[jNr] is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 01-09-2009 , 19:47   Re: register_touch.. in fakemeta?
Reply With Quote #4

EDIT: Damn Exo, you're fast.

PHP Code:
public plugin_init()
{
    
register_forward(FM_Touch"OnEntTouch"1)
}

public 
OnEntTouch(entToucherentTouched)
{
    if(
is_user_connected(entToucher))
    {
        static 
szClassname[32]
        
pev(entTouchedszClassnamecharsmax(szClassname))

        if(!
equal(szClassname"func_breakable"))
            return 
FMRES_IGNORED
        
        
// your code goes here
    
}
    return 
FMRES_IGNORED

__________________

Community / No support through PM
danielkza is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 01-09-2009 , 20:08   Re: register_touch.. in fakemeta?
Reply With Quote #5

ty all
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 01-10-2009 , 08:33   Re: register_touch.. in fakemeta?
Reply With Quote #6

Quote:
How to search before posting?!
http://forums.alliedmods.net/showthr...ighlight=touch
__________________

anakin_cstrike is offline
Reply


Thread Tools
Display Modes

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:10.


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