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

/health need help


Post New Thread Reply   
 
Thread Tools Display Modes
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-03-2012 , 08:46   Re: /health need help
Reply With Quote #11

let the hudmessage display longer and set the value of the seconds in the set_task longer.

for example, 3 seconds for the hudmessage and 3.1 seconds for the set_task
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 08:50   Re: /health need help
Reply With Quote #12

Quote:
Originally Posted by Torge View Post
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 );
    }

thanks work gr8
__________________
hannes is offline
HKAnson
Member
Join Date: Oct 2011
Location: Hong Kong
Old 10-03-2012 , 08:54   Re: /health need help
Reply With Quote #13

Quote:
Originally Posted by hannes View Post
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 );
        }
    }


You loop your hud a lot
the set_task i gave have looped it

when you do more of this
it means a lot of 0.1 set task making (THIS MUST CRASHS!!!)

By the way , why don't make when user is spawns to make this hud
__________________
HKAnson is offline
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 09:25   Re: /health need help
Reply With Quote #14

PHP Code:
public Spawn(id)
{
    if( 
is_user_alive(id) )
    {
        {
            
set_task(0.1"ShowHud"id__"b");
                 }
    }

i did something like this
__________________
hannes is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 10-03-2012 , 09:45   Re: /health need help
Reply With Quote #15

Try this
PHP Code:
set_task0.1"ShowHud"id, .flags "b" ); 
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 10-03-2012 , 09:46   Re: /health need help
Reply With Quote #16

Why a task with 0.1 sec? Is too much fast. Use 1.0
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 09:49   Re: /health need help
Reply With Quote #17

why not just
PHP Code:
public Spawn(id

    if( 
is_user_alive(id) ) 
    { 
        { 
            
set_task(0.1"ShowHud"id__"b"); 
        } 
    } 

__________________
hannes is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 10-03-2012 , 09:57   Re: /health need help
Reply With Quote #18

Quote:
Originally Posted by hannes View Post
why not just
PHP Code:
public Spawn(id

    if( 
is_user_alive(id) ) 
    { 
        { 
            
set_task(0.1"ShowHud"id__"b"); 
        } 
    } 

You should set a random task id...
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
quilhos
Veteran Member
Join Date: Jun 2010
Old 10-03-2012 , 12:24   Re: /health need help
Reply With Quote #19

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
Why a task with 0.1 sec? Is too much fast. Use 1.0
Because he want 0.1 --'.
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 16:59   Re: /health need help
Reply With Quote #20

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
You should set a random task id...
what u mean im no good scripter just done some easy things..
__________________
hannes 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 20:48.


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