AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Loosing healthpack on healerblock. (https://forums.alliedmods.net/showthread.php?t=109792)

D-TOX 11-21-2009 13:54

Loosing healthpack on healerblock.
 
Hi ! I'm just curious how to fix so you won't loose any HP if we say you get a healthpack with 200 HP and you walk onto a healer block, and it drops down to 100 HP. I use a modified version of Necros 3.60 BM.
The healing code aint modified.


Any helpful answer would be great !

ConnorMcLeod 11-21-2009 14:00

Re: Loosing healthpack on healerblock.
 
What kind of healer ?
Map healer ?
Plugin healer ?

I guess you have to fix your necro plugin.

Backstabnoob 11-21-2009 16:58

Re: Loosing healthpack on healerblock.
 
How is that done?
Does it give you instantly 100 HP, or is it healing you for example for 5hp/sec?

D-TOX 11-22-2009 11:46

Re: Loosing healthpack on healerblock.
 
Quote:

Originally Posted by Backstabnoob (Post 995330)
How is that done?
Does it give you instantly 100 HP, or is it healing you for example for 5hp/sec?


1 HP per second, and there is a cvar for how much HP you should get per second.

Quote:

Originally Posted by ConnorMcLeod (Post 995171)
What kind of healer ?
Map healer ?
Plugin healer ?

I guess you have to fix your necro plugin.


And I don't know what you mean by fixing the blockmaker, I haven't touched the healer code, nor made anything that should harm the healing block.
You can read on the Blockmaker 4.01 thread how it works if you don't know what the healing block does.

PHP Code:

actionHeal(id)
{
    if (
halflife_time() >= gfNextHealTime[id])
    {
        new 
hp get_user_health(id);
        new 
amount floatround(get_cvar_float("bm_healamount"), floatround_floor);
        new 
sum = (hp amount);
        
        if (
sum 100)
        {
            
set_user_health(idsum);
        }
        else
        {
            
set_user_health(id100);
        }
        
        
gfNextHealTime[id] = halflife_time() + 0.5;
    }



ConnorMcLeod 11-22-2009 12:50

Re: Loosing healthpack on healerblock.
 
Update the code with that one and recompile :

PHP Code:

actionHeal(id)
{
    new 
Float:fGameTime get_gametime()
    if(
fGameTime gfNextHealTime[id])
    {
        new 
iHealth get_user_health(id);
        if( 
iHealth 100 )
        {
            static 
pCvarBmHealAmount;
            if( !
pCvarBmHealAmount )
            {
                
pCvarBmHealAmount get_cvar_pointer("bm_healamount");
            }
            
iHealth += get_pcvar_num(pCvarBmHealAmount);
            if( 
iHealth 100 )
            {
                
iHealth 100;
            }
            
set_user_health(idiHealth);
            
gfNextHealTime[id] = fGameTime 0.5;
        }
    }



D-TOX 11-22-2009 13:51

Re: Loosing healthpack on healerblock.
 
Quote:

Originally Posted by ConnorMcLeod (Post 996028)
Update the code with that one and recompile :

PHP Code:

actionHeal(id)
{
    new 
Float:fGameTime get_gametime()
    if(
fGameTime gfNextHealTime[id])
    {
        new 
iHealth get_user_health(id);
        if( 
iHealth 100 )
        {
            static 
pCvarBmHealAmount;
            if( !
pCvarBmHealAmount )
            {
                
pCvarBmHealAmount get_cvar_pointer("bm_healamount");
            }
            
iHealth += get_pcvar_num(pCvarBmHealAmount);
            if( 
iHealth 100 )
            {
                
iHealth 100;
            }
            
set_user_health(idiHealth);
            
gfNextHealTime[id] = fGameTime 0.5;
        }
    }



Didnt work.


//// ijump_ibcm.sma
// C:\Program Files\Steam\steamapps\anton_sexy\counter-strike\cstrike\addons\amx
modx\Copy of scripting\ijump_ibcm.sma(1476) : error 001: expected token: ";", bu
t found "if"
//
// 1 Error.
// Could not locate output file compiled\ijump_ibcm.amx (compile failed).

Press enter to exit ...


Row 1476 : if(fGameTime > gfNextHealTime[id])

Backstabnoob 11-22-2009 14:56

Re: Loosing healthpack on healerblock.
 
Just read.
Add ; at the end of
new Float:fGameTime = get_gametime()

D-TOX 11-22-2009 17:37

Re: Loosing healthpack on healerblock.
 
Quote:

Originally Posted by Backstabnoob (Post 996188)
Just read.
Add ; at the end of
new Float:fGameTime = get_gametime()

Still didnt work, got errors on all blockfunctions if i add new Float:fGameTime = get_gametime();

ConnorMcLeod 11-22-2009 18:10

Re: Loosing healthpack on healerblock.
 
You failed.

D-TOX 11-22-2009 18:14

Re: Loosing healthpack on healerblock.
 
Quote:

Originally Posted by ConnorMcLeod (Post 996332)
You failed.

I did actually fail O.O Thanx alot and my apologies if I hurt your feelings :(
Excellent use of your brain i may say :D


All times are GMT -4. The time now is 13:42.

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