Raised This Month: $32 Target: $400
 8% 

[ANY] Button Watcher (see who pressed a button)


Post New Thread Reply   
 
Thread Tools Display Modes
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 12-21-2015 , 18:21   Re: [ANY] Button Watcher (see who pressed a button) v1.1
Reply With Quote #11

Quote:
Originally Posted by pubhero View Post
You try this plugin with CS:S? It seems like not work for me. No chat messages, no log or error entryes.
Or i am not see something?
I not tested it in CS:S

Quote:
Originally Posted by MarvinV2 View Post
Hi,
I use your Plugin in csgo.
Is there a way to make the "[BW] xxxx pressed button xxxx" just visible to Admins?
Because I want to make the Chat clean for the normal Players.
Thanks
Maybe for next updates
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 12-21-2015 at 18:21.
Franc1sco is offline
Send a message via MSN to Franc1sco
SztangaBiceps
Junior Member
Join Date: Nov 2015
Old 12-23-2015 , 17:10   Re: [ANY] Button Watcher (see who pressed a button) v1.1
Reply With Quote #12

Quote:
Originally Posted by MarvinV2 View Post
Hi,
I use your Plugin in csgo.
Is there a way to make the "[BW] xxxx pressed button xxxx" just visible to Admins?
Because I want to make the Chat clean for the normal Players.
Thanks
Find:
Code:
PrintToChatAll(" \x02[BW] \x0C%N \x04pressed button\x0C %i %s", activator, caller, entity);
Replace to:
Code:
for(new admins = 1; admins <= MaxClients; admins++)
    {
        if(IsValidClient(admins) && (GetUserFlagBits(admins) & ADMFLAG_GENERIC))
        {
            PrintToChat(admins, " \x02[BW] \x0C%N \x04pressed button\x0C %i %s", activator, caller, entity);
        }
    }
ADMFLAG_GENERIC = flag B, you can change, it for what you want.
SztangaBiceps is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 12-24-2015 , 02:29   Re: [ANY] Button Watcher (see who pressed a button) v1.1
Reply With Quote #13

Quote:
Originally Posted by SztangaBiceps View Post
Find:
Code:
PrintToChatAll(" \x02[BW] \x0C%N \x04pressed button\x0C %i %s", activator, caller, entity);
Replace to:
Code:
for(new admins = 1; admins <= MaxClients; admins++)
    {
        if(IsValidClient(admins) && (GetUserFlagBits(admins) & ADMFLAG_GENERIC))
        {
            PrintToChat(admins, " \x02[BW] \x0C%N \x04pressed button\x0C %i %s", activator, caller, entity);
        }
    }
ADMFLAG_GENERIC = flag B, you can change, it for what you want.

Don't do so bad implementations. Use CheckCommandAccess!
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Dunciboy
New Member
Join Date: Dec 2015
Old 12-27-2015 , 14:54   Re: [ANY] Button Watcher (see who pressed a button) v1.1
Reply With Quote #14

Levers are sadly not printed to the chat would be nice to be able to configure that or just implement it.
Dunciboy is offline
Fikus1337
New Member
Join Date: Dec 2015
Old 12-27-2015 , 18:25   Re: [ANY] Button Watcher (see who pressed a button) v1.1
Reply With Quote #15

Quote:
Originally Posted by MarvinV2 View Post
Hi,
I use your Plugin in csgo.
Is there a way to make the "[BW] xxxx pressed button xxxx" just visible to Admins?
Because I want to make the Chat clean for the normal Players.
Thanks
Please!
Fikus1337 is offline
bebe9b
Veteran Member
Join Date: May 2009
Location: Romania
Old 01-03-2016 , 11:46   Re: [ANY] Button Watcher (see who pressed a button) v1.1
Reply With Quote #16

Franc pls fix:
L 01/03/2016 - 184:07: [SM] Plugin encountered error 15: Array index is out of bounds
L 01/03/2016 - 184:07: [SM] Displaying call stack trace for plugin "buttonwatcher.smx":
L 01/03/2016 - 184:07: [SM] [0] Line 25, /home/forums/content/files/9/4/2/7/7/149818.attach:resionado()
__________________
respecta si vei fi respectat
bebe9b is offline
Fikus1337
New Member
Join Date: Dec 2015
Old 01-04-2016 , 07:22   Re: [ANY] Button Watcher (see who pressed a button) v1.1
Reply With Quote #17

Visible to admins only:

Code:
#include <sourcemod>
#include <sdktools>

new bool:espresionado[2048];

public Plugin:myinfo =
{
    name = "Button Watcher",
    author = "Franc1sco franug",
    description = "Generates an output when a button is pressed",
    version = "1.1",
    url = "http://www.zeuszombie.com/"
};

public OnPluginStart()
{
    HookEntityOutput("func_button", "OnPressed", Presionado);
    CreateConVar("sm_buttonwatcher", "1.1", "", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
}

public Presionado(const String:output[], caller, activator, Float:delay)
{
    if(!IsValidClient(activator)) return;
    
    if(espresionado[caller]) return;
    
    decl String:entity[512];
    GetEntPropString(caller, Prop_Data, "m_iName", entity, sizeof(entity));

    for(new admins = 1; admins <= MaxClients; admins++)
    {
            if(IsValidClient(admins))
            {
                if (CheckCommandAccess(admins, "", ADMFLAG_GENERIC)) 
                {
                    PrintToChat(admins, " \x02[BW] \x0C%N \x04pressed button\x0C %i %s", activator, caller, entity);
                }
            }
    }
    
    LogMessage("[BW] %L pressed the button %i %s", activator, caller, entity)
    
    espresionado[caller] = true;
    CreateTimer(5.0, Pasado, caller);
}

public Action:Pasado(Handle:timer, any:entity)
{
    espresionado[entity] = false;
}

public IsValidClient( client ) 
{ 
    if ( !( 1 <= client <= MaxClients ) || !IsClientInGame(client) || !IsPlayerAlive(client) ) 
        return false; 
     
    return true; 
}
Attached Files
File Type: smx ButtonWatcher.smx (5.1 KB, 324 views)

Last edited by Fikus1337; 01-04-2016 at 07:24.
Fikus1337 is offline
B_CANSIN
Senior Member
Join Date: Aug 2011
Location: B_CANSIN's SERVERS
Old 01-05-2016 , 18:08   Re: [ANY] Button Watcher (see who pressed a button) v1.1
Reply With Quote #18

I could say its awesome plunig but when players not press hit the butten with weapon you can't see is there way to make it visble it could be ultra awesome. Because lots buttens in tf2 doesn't need to press because you need to bind that f so veryone so lazy to press like that so they decide hit it with melee weapons hmm mmh.
B_CANSIN is offline
EnT3R
Junior Member
Join Date: Jan 2016
Location: Brazil
Old 01-08-2016 , 16:55   Re: [ANY] Button Watcher (see who pressed a button) v1.1
Reply With Quote #19

Nice work Franc1sco, but is there some way to make it only display the entity name instead of also showing the button ID at the message?

Like this: [BW] player has pressed the button buttonname

Edit: I edited some things and got it working as i need..

Last edited by EnT3R; 01-08-2016 at 22:04. Reason: add info
EnT3R is offline
Bad Cold Man
Senior Member
Join Date: Apr 2014
Old 02-29-2016 , 03:24   Re: [ANY] Button Watcher (see who pressed a button) v1.1
Reply With Quote #20

The plugin does not show who presses levers (ze_alien_mountain_escape_p3). It shows only who presses the button.
__________________

Last edited by Bad Cold Man; 03-13-2016 at 15:44.
Bad Cold Man 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 18:11.


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