Raised This Month: $ Target: $400
 0% 

Health display admins only.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
poliisi299
Senior Member
Join Date: May 2011
Old 05-13-2012 , 12:56   Health display admins only.
Reply With Quote #1

how i can to do admins only can see other players HP ??

here is the plugin i already added ADMIN_LEVEL ADMIN_CHAT but dont work, other can see HP
PHP Code:
#include <amxmodx>
 
#define ADMIN_LEVEL ADMIN_CHAT
 
public plugin_init() {
    
register_plugin("HP On Damage""1.0""poliisi299...")
    
register_event("Damage","event_damage","b","2!0","3=0","4!0")
}
 
public 
event_damage(id)
{
    new 
killer get_user_attacker(id)
    if(
is_user_connected(killer) && is_user_alive(id)) client_print(killer,print_center,"Health: %i",get_user_health(id))
     return 
PLUGIN_HANDLED


Last edited by poliisi299; 05-13-2012 at 13:00.
poliisi299 is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-13-2012 , 13:08   Re: Health display admins only.
Reply With Quote #2

Include amxmisc and change the check like this:

PHP Code:
if(is_user_connected(killer) && is_user_alive(id)) 
->

PHP Code:
if(is_user_connected(killer) && is_user_alive(id) && (get_user_flags(killer) & ADMIN_LEVEL)) 
__________________

Last edited by <VeCo>; 05-13-2012 at 13:44.
<VeCo> is offline
poliisi299
Senior Member
Join Date: May 2011
Old 05-13-2012 , 13:40   Re: Health display admins only.
Reply With Quote #3

Thank you, i think about this , do you know how can set the "Health: %i" show in HUD ??
poliisi299 is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-13-2012 , 13:45   Re: Health display admins only.
Reply With Quote #4

PHP Code:
#include <amxmodx>
 
#define ADMIN_LEVEL ADMIN_CHAT
 
 
new g_synchud
public plugin_init() {
    
register_plugin("HP On Damage""1.0""<VeCo>")
    
register_event("Damage","event_damage","b","2!0","3=0","4!0")
    
    
g_synchud CreateHudSyncObj()
}
 
public 
event_damage(id)
{
    static 
i_killer
    i_killer 
get_user_attacker(id)
    
    if(
is_user_connected(i_killer) && (get_user_flags(i_killer) & ADMIN_LEVEL) && is_user_alive(id))
    {
 
set_hudmessage(25500, -1.0, -1.0,  .holdtime 1.0)
 
ShowSyncHudMsg(i_killer,g_synchud"Health: %i",get_user_health(id))
    }

__________________

Last edited by <VeCo>; 05-13-2012 at 13:46.
<VeCo> is offline
poliisi299
Senior Member
Join Date: May 2011
Old 05-13-2012 , 13:53   Re: Health display admins only.
Reply With Quote #5

thank you so much (:

Last edited by poliisi299; 05-13-2012 at 14:00.
poliisi299 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 00:23.


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