View Single Post
Author Message
Mr.J
Senior Member
Join Date: Sep 2017
Location: cs_assault
Old 01-02-2018 , 07:52   Need help for powers code
Reply With Quote #1

Hi, sorry for my bad english
im using zombie mod with class, can anyone help me with this code :
PHP Code:
public AddHealth(id)
{
    
set_user_health(idget_user_health(id) + (20*HealthLevel[id]));
    
    if(
get_user_health(id) > 100.0)
        
MaxHealth[id] = get_user_health(id);
        
    else
        
MaxHealth[id] = 100;
        
    
Refreshing[id] = false;
}
public 
NeverEndingRegen()
{
    new 
players[32], num;
    
get_players(playersnum"ach");
    
    for(new 
id;id num;id++)
    {
        new 
players[id];
        if(
RegenLevel[i] > && !Refreshing[id])
        {
            if((
get_user_health(i) + RegenLevel[i]) > MaxHealth[i]) set_user_health(iMaxHealth[i]);
            else 
set_user_health(iget_user_health(i) + RegenLevel[i]);
        }
    }

when i buy this power (HP regenaration) , when i become zombie my HP set to 100 and to know that my zombie HP are 5000 ,and every class have her own health
Note : there is no include file for this mod.
Mr.J is offline