Raised This Month: $ Target: $400
 0% 

Healing always to 100 hp no matter what I change. Need 255.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-31-2009 , 00:12   Re: Healing always to 100 hp no matter what I change. Need 255.
Reply With Quote #9

Quote:
Originally Posted by cikjam View Post
tested them both, they both go back to 100
I just tested it too and it works fine. Must be something else in your code or another plugin that is causing the problem.

In chat, do the following:

say "blah" - nothing should happen
now injure yourself to any degree besides killing yourself. use a grenade on yourself or something
say "blah" - your health should now be 100
say "blah" - nothing should happen, health still at 100
say "hp" - your health should now go to 110
say "blah" - your health should now go to 255
say "blah" - nothing should happen, health still at 255

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

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "bugsy"

new FloatgfNextHealTime[33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd"say hp" "hp" );
    
    
register_clcmd"say blah" "blah" );
}

public 
hp(id)
{
    
set_user_healthid get_user_healthid ) + 10 );
}

public 
blahid )
{
    if ( 
get_gametime() >= gfNextHealTime[id] )
    {
        static 
iHealthiHealth get_user_healthid );
    
        if ( ( 
iHealth == 100 ) || ( iHealth == 255 ) )
            return 
PLUGIN_HANDLED;
    
        
set_user_healthid , ( iHealth 100 ) ? 100 255 );
    
        
gfNextHealTime[id] = get_gametime() + 0.5;
    }
    
    return 
PLUGIN_HANDLED;

__________________
Bugsy is offline
 



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:24.


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