Raised This Month: $ Target: $400
 0% 

func_button help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ieGaming
Junior Member
Join Date: Nov 2006
Old 11-02-2009 , 06:41   func_button help
Reply With Quote #1

I need to make a plugin where if this certain button is pressed it does a command but also calls its target at the same time.


example:

if(button triggered)
entity_remove( bleh );

how would i do this?
ieGaming is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 11-02-2009 , 07:19   Re: func_button help
Reply With Quote #2

touch only
PHP Code:
public entity_touch(entity1entity2) {
        
DoTouch(entity1,entity2)
}

public 
pfn_touch(ptr,ptd) {
        
DoTouch(ptr,ptd)
}

public 
DoTouch(pToucher,pTouched) {
    if (
pToucher == || pTouched == 0) return PLUGIN_CONTINUE
    
    
new pTouchername[32], pTouchedname[32],pToucherTarget[32],pToucherTargetname[32]
    
entity_get_string(pToucherEV_SZ_classnamepTouchername31)
    
entity_get_string(pTouchedEV_SZ_classnamepTouchedname31)
    
entity_get_string(pToucherEV_SZ_targetnamepToucherTargetname31)
    
entity_get_string(pToucherEV_SZ_targetpToucherTarget31)
    
    if(
equal(pTouchername"func_button") && equal(pTouchedname"player"))
    {
        if (
equal(pToucherTarget"buttonname"))
        { 
//
        
}
    }

__________________
I am out of order!
grimvh2 is offline
ieGaming
Junior Member
Join Date: Nov 2006
Old 11-02-2009 , 11:36   Re: func_button help
Reply With Quote #3

Tyvm for your time, if I can't trigger it then this will do =]
ieGaming is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 11-02-2009 , 17:21   Re: func_button help
Reply With Quote #4

With +use

PHP Code:
// Plugin Init
RegisterHam(Ham_Use"func_button""fwdUse"0
PHP Code:
public fwdUse(entid)
{
    
// Checks if ents are reals players
    
if(!ent || id 32 && !is_user_alive(id))
    {
        return 
FMRES_IGNORED;
    }
    
    new 
target[33]
    
peventpev_targettargetsizeof target )
 
    if( 
equalitarget"buttonname" ))
    {
         
//Your Code
    
}
    return 
FMRES_IGNORED;

__________________
I am out of order!

Last edited by grimvh2; 11-03-2009 at 04:29.
grimvh2 is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 11-02-2009 , 18:16   Re: func_button help
Reply With Quote #5

you checked "!is_user_alive(id)" twice
__________________
minimiller is offline
Send a message via MSN to minimiller
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 11-03-2009 , 04:28   Re: func_button help
Reply With Quote #6

Quote:
Originally Posted by minimiller View Post
you checked "!is_user_alive(id)" twice
woops edited
__________________
I am out of order!
grimvh2 is offline
ieGaming
Junior Member
Join Date: Nov 2006
Old 11-06-2009 , 02:07   Re: func_button help
Reply With Quote #7

thanks alot that works great =]
ieGaming is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 11-06-2009 , 02:48   Re: func_button help
Reply With Quote #8

Use HAM_ returns in ham forwards.
Jon 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 17:35.


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