Raised This Month: $ Target: $400
 0% 

help with set_user_health


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 07-01-2009 , 11:34   help with set_user_health
Reply With Quote #1

Hi, i using code set_user_health:
PHP Code:
cvar_health_hunter register_cvar("hunter_health""200"
PHP Code:
set_user_health(id,(get_pcvar_float(cvar_health_hunter))) 
but i have 6546466565 HP whats can help with this ?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
larito
Veteran Member
Join Date: Nov 2008
Location: Argentina- Mendoza
Old 07-01-2009 , 11:38   Re: help with set_user_health
Reply With Quote #2

Quote:
Originally Posted by ~Ice*shOt View Post
Hi, i using code set_user_health:
PHP Code:
cvar_health_hunter register_cvar("hunter_health""200"
PHP Code:
set_user_health(id,(get_pcvar_float(cvar_health_hunter))) 
but i have 6546466565 HP whats can help with this ?
The error is because you are seting a float on health, the form is this

PHP Code:
set_user_health(idget_pcvar_num(cvar_health_hunter)) 


Sorry for my bad english
__________________
Facebook: Ariel Berardi
larito is offline
Send a message via MSN to larito
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-01-2009 , 11:38   Re: help with set_user_health
Reply With Quote #3

Just because you are idiot. set_user_health doesn`t uses float, guess what you need todo !!
__________________
xPaw is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 07-01-2009 , 13:44   Re: help with set_user_health
Reply With Quote #4

Yes, but example: i using "get_pcvar_num" but this works not good! works not good = BAD!
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-01-2009 , 13:48   Re: help with set_user_health
Reply With Quote #5

Just you fail
__________________
xPaw is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 07-01-2009 , 14:12   Re: help with set_user_health
Reply With Quote #6

help!
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 07-01-2009 , 15:15   Re: help with set_user_health
Reply With Quote #7

Code:
#include <engine>
Code:
cvar_health_hunter = register_cvar("hunter_health", "200");
Code:
entity_set_float(id, EV_FL_health, get_pcvar_float(cvar_health_hunter))
FTW.
__________________
hleV is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 07-02-2009 , 02:26   Re: help with set_user_health
Reply With Quote #8

Quote:
Originally Posted by hleV View Post
Code:
#include <engine>
Code:
cvar_health_hunter = register_cvar("hunter_health", "200");
Code:
entity_set_float(id, EV_FL_health, get_pcvar_float(cvar_health_hunter))
FTW.
PHP Code:
public fw_PlayerPreThink(id
{
    if(!
is_user_alive(id)) 
        return 
FMRES_IGNORED
     
    static 
Floatvelocity[3], FloatTime 
    
static buttonflag 
    button 
pev(idpev_button
    
flag pev(idpev_flags
    
Time get_gametime()
     
    if (
g_zombie[id] && PlayerClass[id] == 0
    { 
        if ( (!
g_infreezetime) && (button IN_DUCK) && (button IN_ATTACK) && (flag FL_ONGROUND)) 
        { 
            static 
FloatcooldownFloatlheightlforce 
            cooldown 
get_pcvar_float(cvar_cooldown
            
lforce get_pcvar_num(cvar_lforce
            
lheight get_pcvar_float(cvar_lheight
            if (
Time cooldown g_LastLeap[id]) 
            {  
                
emit_sound(idCHAN_ITEMHunterLeap1.0ATTN_NORM0PITCH_NORM); 
                
set_pev(idpev_buttonbutton & ~IN_ATTACK
                
velocity_by_aim(idlforcevelocity
                
velocity[2] = lheight 
                set_pev
(idpev_velocityvelocity
                
g_LastLeap[id] = Time 
            

        } 
    }
    if (!
g_infreezetime && g_zombie[id] && PlayerClass[id] == 0)
    {
        
set_user_health(id,(get_pcvar_float(cvar_health_hunter))) 
        
set_user_gravity(id,(get_pcvar_float(cvar_gravity_hunter)))
        
set_user_maxspeed(id,(get_pcvar_float(cvar_speed_hunter)))

          
copy(player_model[id], 31HUNTER_MODEL)
    } 

i think spawn is bad ? but gravity and speed are works only health not works

Last edited by ~Ice*shOt; 07-02-2009 at 08:38.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 07-02-2009 , 06:38   Re: help with set_user_health
Reply With Quote #9

I can't see anything that sets player's health in your code.
__________________
hleV is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 07-02-2009 , 08:37   Re: help with set_user_health
Reply With Quote #10

see now.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
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 15:35.


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