Raised This Month: $ Target: $400
 0% 

Get user health


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zerko
New Member
Join Date: Jul 2013
Old 07-16-2013 , 09:26   Get user health
Reply With Quote #1

Hello, i have this code:

Code:
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)

{

for(new i=1; i<gMaxplayers; i++)

if (victim == g_Zxc[i])

new victim_hp = get_user_health(victim);



if (victim_hp < 0)



victim_hp = 0;



new name[33];

get_user_name(victim, name, 32);

client_print(attacker, print_center, "%s^nHP: %d", name, victim_hp);

}
And i want if player got bool g_Zxc then in center screen will be hes hp.
Zerko is offline
Old 07-16-2013, 10:00
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: troll, or posting random confusing code, or posting for posts count
Zerko
New Member
Join Date: Jul 2013
Old 07-16-2013 , 10:36   Re: Get user health
Reply With Quote #2

I have now code:
Code:
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if (victim == attacker || !is_user_alive(attacker) || !is_user_connected(victim) || !is_user_zombie(victim))
return

new victim_hp = get_user_health(victim)
if (victim_hp < 0)
victim_hp = 0
client_print(attacker, print_center, "Health: %d", victim_hp) 

}
I want to ALL PLAYERS SEE HP ZOMBIE
On map is one zombie.
Zerko is offline
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 07-16-2013 , 11:11   Re: Get user health
Reply With Quote #3

PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type) {
    if (
victim == attacker || !is_user_alive(attacker) || !is_user_connected(victim) || !is_user_zombie(victim))
        return
    
    new 
zmName[32];
    
get_user_name(victimzmName31);
    
    if(!
is_user_zombie(attacker)) {
        
client_print(attackerprint_center"ZM: %s & Health: %d"zmNameget_user_health(victim))
    }

__________________
I Hate people who can hate me !

Last edited by K1d0x; 07-16-2013 at 11:17.
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 07-17-2013 , 13:02   Re: Get user health
Reply With Quote #4

I think it isn't necessary to check if victim is connected
baneado is offline
Reply


Thread Tools
Display Modes

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 06:31.


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