Raised This Month: $51 Target: $400
 12% 

/health need help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hannes
Member
Join Date: Sep 2010
Old 10-02-2012 , 19:17   /health need help
Reply With Quote #1

i use something like this but wen i type /health i show eg 100hp then i die 50hp then i need to type /hp again to see my hp.. its no updateing wen i die some health please help hope u understand

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

public plugin_init()
{
    
register_plugin""Version"R34Lx" )
    
    
register_clcmd("say /Health""ShowHud")
    
register_clcmd("say_team /health""ShowHud")
}

public 
ShowHud(id)
{
    new 
iHealth get_user_healthid );
    {
        
set_hudmessage(025500.010.6001.05000.05.0_1)
        
show_hudmessage(id"You have %i HP"iHealth );
    }

__________________
hannes is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-03-2012 , 07:46   Re: /health need help
Reply With Quote #2

set a task in your function for every x seconds you want to display it
__________________

Last edited by Napoleon_be; 10-03-2012 at 07:46.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 08:04   Re: /health need help
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
set a task in your function for every x seconds you want to display it
i will try, but how will i do this lol
__________________
hannes is offline
HKAnson
Member
Join Date: Oct 2011
Location: Hong Kong
Old 10-03-2012 , 08:15   Re: /health need help
Reply With Quote #4

set_task(0.1, "ShowHud", 0, "", 0, "b", 0);
__________________
HKAnson is offline
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 08:28   Re: /health need help
Reply With Quote #5

Quote:
Originally Posted by HKAnson View Post
set_task(0.1, "ShowHud", 0, "", 0, "b", 0);
i use this but its just display 0 hp all the time not my health
__________________
hannes is offline
HKAnson
Member
Join Date: Oct 2011
Location: Hong Kong
Old 10-03-2012 , 08:29   Re: /health need help
Reply With Quote #6

oh sorry SHOULD BE

set_task(0.1, "ShowHud", id, "", 0, "b", 0);

neither work or not please reply it
__________________

Last edited by HKAnson; 10-03-2012 at 08:30.
HKAnson is offline
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 08:34   Re: /health need help
Reply With Quote #7

my cs did crash

Edit:
crash
PHP Code:
set_task(0.1"ShowHud"id""0"b"0); 
__________________

Last edited by hannes; 10-03-2012 at 08:37.
hannes is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 10-03-2012 , 08:37   Re: /health need help
Reply With Quote #8

Why not ?

PHP Code:
set_task(0.1"ShowHud"id__"b"); 
?

Last edited by Torge; 10-03-2012 at 08:37.
Torge is offline
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 08:40   Re: /health need help
Reply With Quote #9

lol im doing right here just let u guys check it

its crash in 2 seck after i type /health

PHP Code:
public ShowHud(id)
{
    new 
iHealth get_user_healthid );
    {
        
set_task(0.1"ShowHud"id__"b");  
        {
            
set_hudmessage(025500.010.6001.00.95.0_1)
            
show_hudmessage(id"You have %i HP"iHealth );
        }
    }

__________________
hannes is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 10-03-2012 , 08:45   Re: /health need help
Reply With Quote #10

You made it wrong, try this:

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

public plugin_init()
{
    
register_plugin""Version"R34Lx" )
    
    
register_clcmd("say /Health""clcmd_health")
    
register_clcmd("say_team /health""clcmd_health")
}

public 
clcmd_health(id)
{
    
set_task(0.1"ShowHud"id__"b");
}

public 
ShowHud(id)
{
    new 
iHealth get_user_health(id);

    if (
is_user_alive(id))
    {
        
set_hudmessage(025500.010.6001.05000.05.0_1)
        
show_hudmessage(id"You have %i HP"iHealth );
    }


Last edited by Torge; 10-03-2012 at 08:46.
Torge 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 22:04.


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