AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   After death, zombies are reborn with more health than before (https://forums.alliedmods.net/showthread.php?t=346740)

Noah BR 03-14-2024 06:48

After death, zombies are reborn with more health than before
 
Gentlemen, I'm new here, if I'm in the wrong place I apologize...
I just want help on my zombie plague 5.0.8 server
I would like any class of zombie after death to revive with more life
For example: The zombie's class has 1800 health, after each death he is reborn with another 100 HP, so his next HP would be 1900, then 2000 and so on.

Or the best option would be for the zombie to gain HP in percentage of HP, for example he has 1800, the additional is 10%, so in the next life he would have 1980 and so on.

Thank you in advance for any response.

amirwolf 03-14-2024 20:50

Re: After death, zombies are reborn with more health than before
 
I have already done this in build mode
I think (not sure) the source code should be edited

Noah BR 03-15-2024 08:50

Re: After death, zombies are reborn with more health than before
 
Can you help me with this?

Noah BR 03-15-2024 14:04

Re: After death, zombies are reborn with more health than before
 
Can anyone help me? I'm willing to reward you

amirwolf 03-15-2024 21:06

Re: After death, zombies are reborn with more health than before
 
I made a hypothetical thing
PHP Code:

#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <zombieplague>

#define MAX_PLAYERS 32

new Death_Health[MAX_PLAYERS 1]

public 
plugin_init()
{
    
register_plugin("zp death Health""1.0""َAmir")
    
RegisterHam(Ham_Killed"player""ham_PlayerKilled_Post"1)
    
RegisterHam(Ham_Spawn"player""ham_PlayerSpawn_Post"1)
    
register_event("HLTV""ev_RoundStart""a""1=0""2=0")
}

public 
client_putinserver(idDeath_Health[id] = 0
public client_disconnect(idDeath_Health[id] = 0

public ham_PlayerSpawn_Post(id)
{
    if (
is_user_alive(id) && get_user_team(id) == ZP_TEAM_ZOMBIE)
    {
        
set_user_health(idget_user_health(id) + Death_Health[id])
    }
}

public 
ham_PlayerKilled_PostiVictimiKilleriShouldGib ) {

    if(
is_user_alive(iKiller) && is_user_connected(iVictim)) 
    { 
        
Death_Health[iVictim] += 100
    

}

public 
ev_RoundStart()
{
    new 
iPlayers[32], iPnum
    get_players
(iPlayersiPnum)
    for(new 
iPlayeriiPnumi++)
    {
        
iPlayer iPlayers[i]
        if( !
is_user_alive(iPlayer) || !is_user_connected(iPlayer) || is_user_hltv(iPlayer))
            continue
        
Death_Health[iPlayer] = ;
    }



Noah BR 03-17-2024 11:04

Re: After death, zombies are reborn with more health than before
 
That's great, thank you very much

amirwolf 03-17-2024 13:20

Re: After death, zombies are reborn with more health than before
 
If you want 10% HP, you can add and replace these items
HTML Code:

#include <zp50_class_zombie>
HTML Code:

Death_Health[iVictim] += (zp_get_zombie_maxhealth(iVictim) * 10) / 100

Noah BR 03-19-2024 18:00

Re: After death, zombies are reborn with more health than before
 
great work, congratulations and thank you very much!


All times are GMT -4. The time now is 19:06.

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