Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP4.3 + ZP5.0] Addon: Auto Health v1.1 (Calculated by Number of Player and Zombie)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 11-26-2011 , 13:47   Re: [ZP] Addon: Auto Health v1.0 (Calculated by Number of Player and Zombie)
Reply With Quote #1

Some fix, hope you like it.
PHP Code:
#include <amxmodx>
#include <fun>
#include <zombieplague>

#define PLUGIN "[ZP] Addon: Auto Health"
#define VERSION "1.0"
#define AUTHOR "Dias"

new cvar_auto_healthcvar_stock_health
new g_maxplayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_maxplayers get_maxplayers()
    
    
cvar_auto_health register_cvar("zp_auto_health""1")
    
cvar_stock_health register_cvar("zp_stock_health""1000")
}

public 
zp_user_infected_post(id)
{
    
// Nemesis? no need la
    
if(zp_get_user_nemesis(id)) return;
    
    if(
get_pcvar_num(cvar_auto_health))
    {
        new 
health
        health 
= (get_player_count() / get_zombie_count()) * get_pcvar_num(cvar_stock_health)
        
set_user_health(idhealth)
    }
}

get_zombie_count()
{
    new 
count
    
for(new 0g_maxplayersi++)
    {
        if(
is_user_connected(i) && zp_get_user_zombie(i))
            
count++
    }
    
    return 
count
}

get_player_count()
{
    new 
count
    
for(new 0g_maxplayersi++)
    {
        if(
is_user_connected(i))
            
count++
    }
    
    return 
count

__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
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 16:20.


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