Raised This Month: $ Target: $400
 0% 

get_user_health


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-30-2009 , 11:08   get_user_health
Reply With Quote #1

its easy but i need a mini help.

if(get_user_health(id) >= 1000)
{
client_print(id,chat_print,"hp = over 1000")
}

so the user hp can be changed every time. how can i get user health every 5 sec. for example?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 05-30-2009 , 11:15   Re: get_user_health
Reply With Quote #2

PHP Code:
// ...
set_task(5.0"get_health"id__"b")

//...

public get_health(id)
{
      if(
get_user_health(id) >= 1000)
      {
            
client_print(id,chat_print,"hp = over 1000")
      }

???
__________________
alan_el_more is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-30-2009 , 11:21   Re: get_user_health
Reply With Quote #3

What exacly you want to do ?

You can hook Health message and manage health there if you want whenever health changes
__________________
Hunter-Digital is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-30-2009 , 11:22   Re: get_user_health
Reply With Quote #4

tried the same before i posted but after the player get hp over 1000 this prints every 5 sec. the text.

edit : i want just get player health. if the hp is more then 1000, player become new model & willbe stripped + cant peak weapons & other player become for example 300 hp & maybe more things. the problem is, i dont like to repeat the hp check after anyone has more 1000. all this must be reseted after roundend. when i check the hp after every 5 sec. & a player got more 1000, this checks again if anyone has more 1000 ... u know what i mean? no repeat after checked
__________________

Last edited by One; 05-30-2009 at 11:28.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-30-2009 , 11:31   Re: get_user_health
Reply With Quote #5

make some bool... like gHadMore1000HP or smth =\
__________________
xPaw is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-30-2009 , 11:36   Re: get_user_health
Reply With Quote #6

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


public plugin_init() 
{
    
register_plugin("Hulk mod""1.0""One")
    
set_task(5.0"check_hulk"1__"b")
}
public 
plugin_precache()
{        
    
precache_model("models/player/hulk/hulk.mdl")
}
public 
check_hulk(id)
{
    if(
get_user_health(id) >= 1000)
    {
        
cs_set_user_model(id"models/player/hulk/hulk.mdl")
        if(
get_user_health(id) <= 100)
        {
            
not_hulked(id)
        }
    }
    
}
public 
not_hulked(id)
{
    
set_user_health(id300)

hehe what/how u mean? i think its same if i use bool or not. when the hulk become damages & the hp get under 1000, the model must be same. the plugin must be restarted after round end. u know what i mean? or when a playe with <= 100 hp, become +300 & become damages & the HP get under 100, he become again +300. this is not correct
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 05-30-2009 , 11:55   Re: get_user_health
Reply With Quote #7

Hook the event Health
__________________
IneedHelp is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-30-2009 , 12:39   Re: get_user_health
Reply With Quote #8

haha the question is how ?! never tried before need some tuts or help.

ty in ad.
__________________

Last edited by One; 05-30-2009 at 12:44.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 05-30-2009 , 13:20   Re: get_user_health
Reply With Quote #9

Aint it

PHP Code:
client_print(idprint_chat"hp = over 1000"
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-30-2009 , 13:30   Re: get_user_health
Reply With Quote #10

heh? was this a question? if yea : yea its so right. but its not the problem. this was just to see if my if works & yea i writed this wrong.

still need help.

nothing works ((

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <screenfade_util>
#include <fakemeta>
#define FLARE_MODEL "models/w_flare.mdl"

#define is_ent_flare(%1) (pev(%1, pev_iuser4) == 1333) ? 1 : 0
new cvar_smokeflare_dur
new 
iconstatus  
new cvar_smokeflare 0
public plugin_init() 
{
    
register_plugin("Hulk mod""1.0""One")
    
set_task(5.0"check_hulk"1__"b")
    
iconstatus get_user_msgid("StatusIcon")  
    
register_forward(FM_SetModel,    "fwd_setmodel");
    
register_forward(FM_Think,    "fwd_think");
    
cvar_smokeflare_dur    register_cvar("flare_duration""999.9"); 
}
public 
plugin_precache()
{        
    
precache_model("models/player/hulk/hulk.mdl")
    
precache_model(FLARE_MODEL);
}
public 
check_hulk(id)
{
    if(
get_user_health(id) >= 1000)
    {
        
cs_set_user_model(id"models/player/hulk/hulk.mdl")
        
set_user_gravity(id0.7)
        
strip_user_weapons(id)
        
give_item(id"weapon_knife")
        
UTIL_ScreenFade(id,{0,255,0},1.0,99.0,30)
        
cs_set_user_team(id1)
        
message_begin(MSG_ONE,iconstatus,{0,0,0},id);
        
write_byte(1); 
        
write_string("dmg_gas");
        
write_byte(0); 
        
write_byte(255); 
        
write_byte(0);
        
message_end();
        
cvar_smokeflare 1
        
if(get_user_health(id) <= 100)
        {
            
not_hulked(id)
        }
    }
    
}
public 
not_hulked(id)
{
    
set_user_health(id300)
    
set_user_gravity(id400.0)
    
cs_set_user_team(id2)
    

}
public 
fwd_setmodel(ent, const model[]) 
{
    if(!
pev_valid(ent) || !equal(model[9], "smokegrenade.mdl"))
    return 
FMRES_IGNORED;

    static 
classname[32]; pev(entpev_classnameclassname31);
    if(
equal(classname"grenade") && cvar_smokeflare == 1) {
    
engfunc(EngFunc_SetModelentFLARE_MODEL);
    
set_pev(entpev_effectsEF_BRIGHTLIGHT);
    
set_pev(entpev_iuser4,   1333);
    
set_pev(entpev_nextthinkget_gametime() + get_pcvar_float(cvar_smokeflare_dur));
    
fm_set_rendering(entkRenderFxGlowShell150150250kRenderNormal16);
  
    return 
FMRES_SUPERCEDE;
    }
    return 
FMRES_IGNORED;
}
public 
fwd_think(ent)
{
    if(
pev_valid(ent) && is_ent_flare(ent))
    
engfunc(EngFunc_RemoveEntityent);
}

stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16
{
    static 
Float:color[3]; color[2] = float(b), color[0] = float(r), color[1] = float(g);

    
set_pev(entitypev_renderfx,    fx);
    
set_pev(entitypev_rendercolorcolor);
    
set_pev(entitypev_rendermode,    render);
    
set_pev(entitypev_renderamt,    float(amount));
    return 
1;

the flaer must be enabled after hulk activate. but its still on.
only i willbe stripped & other hulks, have still weapons.
the model works not. cl_minmodel still on 0 but same models.
the Ts. will not be transfered after hukl activation. where are/is my problem/s??
__________________

Last edited by One; 05-30-2009 at 14:08.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 13:58.


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