Raised This Month: $ Target: $400
 0% 

Show who used entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fabregas21
Junior Member
Join Date: May 2012
Old 11-02-2014 , 15:29   Show who used entity
Reply With Quote #1

Hi. I need plugin, which will be show on say, who for example destroyed func_breakable or used func_button.

Last edited by Fabregas21; 11-02-2014 at 15:33.
Fabregas21 is offline
Old 11-04-2014, 12:51
Fabregas21
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-04-2014 , 13:00   Re: Show who used entity
Reply With Quote #2

How do you want it ? When someone destroy a func_breakable ent it will show a message like "someone destroyed a func_breakable ent" ?

A direct way would be to hook with orpheu/okapi CBreakable:: Die() and to do stuffs there. For the func_button you can use Ham_Use
__________________

Last edited by HamletEagle; 11-04-2014 at 13:00.
HamletEagle is offline
Fabregas21
Junior Member
Join Date: May 2012
Old 11-04-2014 , 13:59   Re: Show who used entity
Reply With Quote #3

Yes, as you wrote, I want to showed information about this in say.
How to look like the code that describes this feature?
Fabregas21 is offline
Old 11-05-2014, 02:36
Fabregas21
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Old 11-09-2014, 08:36
Fabregas21
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Old 11-17-2014, 12:27
Fabregas21
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Fabregas21
Junior Member
Join Date: May 2012
Old 11-18-2014 , 10:10   Re: Show who used entity
Reply With Quote #4

Bump. Can anyone help me ?

UP: Wtf ? I waited 14 days and I can bump, so... (Last post 4.11.2014r)
Fabregas21 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 11-18-2014 , 11:35   Re: Show who used entity
Reply With Quote #5

Quote:
Originally Posted by Fabregas21 View Post
UP: Wtf ? I waited 14 days and I can bump, so... (Last post 4.11.2014r)
So? Rules are for everyone, as you waited, many also had to wait...
__________________
Jhob94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-18-2014 , 12:01   Re: Show who used entity
Reply With Quote #6

Test it:
Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta> new g_iMaxPlayers public plugin_init() {     g_iMaxPlayers = get_maxplayers()         RegisterHam(Ham_TakeDamage, "func_breakable", "CBaseEntity_TakeDamage", true)     RegisterHam(Ham_Use, "func_button", "CBasePlayer_ButtonUsed", true) } public CBaseEntity_TakeDamage(iVictim, iInflictor, iAttacker, Float:fDamage) {     if(iInflictor == iAttacker && 1 <=iAttacker <= g_iMaxPlayers)     {         new Float: fEntHealth; pev(iVictim, pev_health, fEntHealth)         if(!fEntHealth)         {             //a func_breakable has been destroyed there.             new szAttackerName[ 32 ]; get_user_name(iAttacker, szAttackerName, charsmax(szAttackerName))             client_print(0, print_chat, "%s destroyed a func_breakable entity", szAttackerName)         }     } } public CBasePlayer_ButtonUsed(iEnt, id, iCaller, useType, Float:flValue) {     if(1 <= id <= g_iMaxPlayers)     {         new szActivatorName[ 32 ]; get_user_name(id, szActivatorName, charsmax(szActivatorName))         client_print(0, print_chat, "%s used a func_button", szActivatorName)     } }
__________________

Last edited by HamletEagle; 11-18-2014 at 12:01.
HamletEagle is offline
Fabregas21
Junior Member
Join Date: May 2012
Old 11-21-2014 , 15:44   Re: Show who used entity
Reply With Quote #7

When I used func_button it showed up information in say, but when I destroyed func_breakable, an information didn't appear.
Fabregas21 is offline
csaba1998
Member
Join Date: Mar 2013
Old 11-22-2014 , 05:25   Re: Show who used entity
Reply With Quote #8

register_touch
csaba1998 is offline
Fabregas21
Junior Member
Join Date: May 2012
Old 11-22-2014 , 08:07   Re: Show who used entity
Reply With Quote #9

csaba1998, it must show information, when I destroyed func_breakable, not when I'm touching it.

HamletEagle, I saw that, once show information in say about destroyed func_breakable and once not.
Fabregas21 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-22-2014 , 09:25   Re: Show who used entity
Reply With Quote #10

Fixed:
Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta> new g_iMaxPlayers public plugin_init() {     g_iMaxPlayers = get_maxplayers()         RegisterHam(Ham_TakeDamage, "func_breakable", "CBaseEntity_TakeDamage", true)     RegisterHam(Ham_Use, "func_button", "CBasePlayer_ButtonUsed", true) } public CBaseEntity_TakeDamage(iVictim, iInflictor, iAttacker, Float:fDamage) {     server_print("Damage found")     if(iInflictor == iAttacker && 1 <=iAttacker <= g_iMaxPlayers)     {         new Float: fEntHealth; pev(iVictim, pev_health, fEntHealth)         if(fEntHealth <= 0.0 )         {             //a func_breakable has been destroyed there.             new szAttackerName[ 32 ]; get_user_name(iAttacker, szAttackerName, charsmax(szAttackerName))             client_print(0, print_chat, "%s destroyed a func_breakable entity", szAttackerName)         }     } } public CBasePlayer_ButtonUsed(iEnt, id, iCaller, useType, Float:flValue) {     if(1 <= id <= g_iMaxPlayers)     {         new szActivatorName[ 32 ]; get_user_name(id, szActivatorName, charsmax(szActivatorName))         client_print(0, print_chat, "%s used a func_button", szActivatorName)     } }
__________________
HamletEagle 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:43.


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