Raised This Month: $ Target: $400
 0% 

Detecting a button press (not a key press)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MALON
Member
Join Date: Jan 2008
Old 09-08-2008 , 00:25   Re: Detecting a button press (not a key press)
Reply With Quote #7

So this is what I tried:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

new bool:IAmUsed[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Use,"counter_start","event_hostage_used",1)//possible button name
    
RegisterHam(Ham_Use,"clockstartbutton","event_hostage_used",1)//possible button name
    
RegisterHam(Ham_Use,"firsttimerelay","event_hostage_used",1)//possible button name
    
RegisterHam(Ham_Use,"gogogo","event_hostage_used",1)//possible button name
    
RegisterHam(Ham_Use,"multi_start","event_hostage_used",1)//possible button name
    
RegisterHam(Ham_Use,"func_button","event_hostage_used",1)//the entire button class
}

public 
event_hostage_used(hostageid) {
    
client_print(idprint_chat"HI")

I tried it with and without the func_button one, but alas, failure. Sorry I'm so not awesome with HamSandwich.



EDIT
--------------------------

D'OH...I didn't try just plain old func_button. I'm stupid. I didn't read classname and I thought entity name. So once I call the function (in this case event_hostage_used), I have to check what entities are within a sphere of the player? Or can I send the entity that called the function TO the function and then extract the entity name from there?

Thanks again!

--MALON

Last edited by MALON; 09-08-2008 at 00:31.
MALON is offline
 



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 03:14.


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