Available Damage boost

Unpaid Requests, Public Plugins
Post Reply
Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

Damage boost

#1

Post by Rain1153 » 6 years ago

what you think of this guys? This is little complex :(
Original plugin= https://forums.alliedmods.net/showthread.php?t=217496
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 6 years ago

He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#3

Post by Rain1153 » 6 years ago

I'm not talking about health bar....
I'm talking about a plugin for humans if they do cvar damage to zombies a "hud will appear i guess showing how much damage is needed for an individual to get 2x damage for cvar seconds". Can you please read the original plugin. I think it'll make the gameplay cool.
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#4

Post by Raheem » 6 years ago

Ah, Here you are:

Code: Select all

#include <zombie_escape>

new iDamage[33]
new bool:is_in_dd[33]
new g_MsgSync
new cvar_reduce_time, cvar_reduce_amount, cvar_dd_duration

public plugin_init()
{
       register_plugin("[ZE] Addon: Damage Bar","1.2","Catastrophe")
       register_cvar("ZE_DAMAGE_BAR","1",(FCVAR_SERVER|FCVAR_SPONLY))
 
       RegisterHam(Ham_TakeDamage, "player", "fw_damage") 
       RegisterHam(Ham_Killed, "player", "fw_killed") 

       cvar_reduce_time = register_cvar("ze_db_reduce_time","20") 
       cvar_reduce_amount = register_cvar("ze_db_reduce_amount","10")
       cvar_dd_duration = register_cvar("ze_dd_duration", "30.0")


       g_MsgSync = CreateHudSyncObj() 
}

public client_putinserver(id)
{

       iDamage[id] = 0
       is_in_dd[id] = false
       set_task(1.0, "checkhudmessage", id+672)       
       set_task(get_pcvar_float(cvar_reduce_time), "reddam", id+673)
       
}


public client_disconnected(id)
{
             
       iDamage[id] = 0
       is_in_dd[id] = false
       remove_task(id+672)

}


public ze_user_humanized(id)
{

      iDamage[id] = 0
      is_in_dd[id] = false

}

public ze_user_infected(iVictim, iInfector)
{

      iDamage[iVictim] = 0
      is_in_dd[iVictim] = false

}

public fw_damage(victim, inflictor, attacker, Float:damage, damage_bits)
{


    if(is_user_connected(victim) && is_user_connected(attacker) && !ze_is_user_zombie(attacker) && is_user_alive(victim) && is_in_dd[attacker])
    {


    SetHamParamFloat(4, damage * 2)

    }        

}

public fw_killed(victim, attacker, shoudgib)
{

    if(is_user_connected(victim) && is_user_connected(attacker) && iDamage[attacker] < 100 && !is_in_dd[attacker] &&  !ze_is_user_zombie(attacker) )
    {

    iDamage[attacker] += 10
    checkdd(attacker)
  

    }

}

public checkhudmessage(id)
{
    id -= 672; 
       
    if(is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && is_in_dd[id])
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + 100 %%]^n[Double damage Enabled]");   
    
    }

    else if(is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && iDamage[id] == 90)
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + %d %%]^n[|||||||||-]",  iDamage[id]);   
    
    }

    else if(is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && iDamage[id] == 80)
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + %d %%]^n[||||||||--]",  iDamage[id]);   
    
    }

    else if( is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && iDamage[id] == 70)
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + %d %%]^n[|||||||---]",  iDamage[id]);   
    
    }

    else if(is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && iDamage[id] == 60)
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + %d %%]^n[||||||----]",  iDamage[id]);   
    
    }

    else if(is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && iDamage[id] == 50)
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + %d %%]^n[|||||-----]",  iDamage[id]);   
    
    }

    else if(is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && iDamage[id] == 40)
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + %d %%]^n[||||------]",  iDamage[id]);   
    
    }
 
    else if(is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && iDamage[id] == 30)
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + %d %%]^n[|||-------]",  iDamage[id]);   
    
    }

    else if(is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && iDamage[id] == 20)
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + %d %%]^n[||--------]",  iDamage[id]);   
    
    }

    else if(is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && iDamage[id] == 10)
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + %d %%]^n[|---------]",  iDamage[id]);   
    
    }

    else if(is_user_connected(id) && is_user_alive(id) && !ze_is_user_zombie(id) && iDamage[id] == 0 && !is_in_dd[id])
    {


      set_hudmessage(255, 255, 0, -1.0, 0.85, 0, 6.0, 1.1, 0.0, 0.0, -1);  
      ShowSyncHudMsg(id, g_MsgSync, "[Damage Status: + %d %%]^n[----------]",  iDamage[id]);   
    
    }
 
 
    set_task(0.1, "checkhudmessage", id+672); 
 


}

public reddam(id)
{ 
    id -= 673;  

    if(get_pcvar_num(cvar_reduce_time) > 0 && iDamage[id] > 0)
    {  
    iDamage[id] -= get_pcvar_num(cvar_reduce_amount) 
    }
  
    set_task(get_pcvar_float(cvar_reduce_time), "reddam", id+673)

}

public checkdd(id)
{

       if(iDamage[id] == 100 && !is_in_dd[id])
       {

       iDamage[id] = 0 
      
       is_in_dd[id] = true
       set_task(get_pcvar_float(cvar_dd_duration),"removedd", id)
 
       }
  

}

public removedd(id)
{

      if( !is_in_dd[id])
          return;

      is_in_dd[id] = false

      set_hudmessage(180, 0, 0, -1.0, -1.0, 0, 6.0, 5.0)
      show_hudmessage(id, "Double damage Disabled !")

}
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#5

Post by Rain1153 » 6 years ago

thanks :*..testing it now!
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#6

Post by Rain1153 » 6 years ago

the bar +0 never gets upto 100 :/.Since zombies cant be killed in zombie escape :/
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#7

Post by Raheem » 6 years ago

LOL, Low the zombies health and NOTE ZE idea is to escape not kill zombies.
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#8

Post by Rain1153 » 6 years ago

No i wont lower it :/,,,i wanted u to make the damage 2 x whenever we do cvar damage to zombies thats all :/
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#9

Post by Raheem » 6 years ago

You need when you hit zombies your weapon make ×2 Damage?
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#10

Post by Rain1153 » 6 years ago

yes i mean when i do "x" damage X= 1 to n
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#11

Post by Raheem » 6 years ago

Not good but ok i'll write it for you.
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#12

Post by Rain1153 » 6 years ago

ok thanks
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#13

Post by Raheem » 6 years ago

OK here it's:

Code: Select all

#include <zombie_escape>

// Pointers
new g_pCvarDmgMultiplier

public plugin_init()
{
	register_plugin("Damage Control", "1.0", "Raheem")
	
	// HookChains
	RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_TakeDamage_Post", 1)
	
	// Cvars
	g_pCvarDmgMultiplier = register_cvar("ze_multiplier_damage_factor", "2") // Multiplie Weapon Damage
}

public Fw_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:flDamage, bitsDamageType)
{
	if (!is_user_alive(iVictim) || !is_user_alive(iAttacker))
		return HC_CONTINUE
	
	if (iVictim == iAttacker)
		return HC_CONTINUE
	
	if (get_member(iAttacker, m_iTeam) == get_member(iVictim, m_iTeam))
		return HC_CONTINUE
	
	if (get_member(iAttacker, m_iTeam) == TEAM_TERRORIST)
		return HC_CONTINUE
	
	SetHookChainArg(4 , ATYPE_FLOAT, flDamage * get_pcvar_num(g_pCvarDmgMultiplier))

	return HC_CONTINUE
}
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#14

Post by Rain1153 » 6 years ago

there is no code for a status? :/ I wanted players to know what he/she is doing
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#15

Post by Raheem » 6 years ago

Explain
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#16

Post by Rain1153 » 6 years ago

i mean there is no hud msg to show the damage done! or left to gain 2x dmg
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#17

Post by Rain1153 » 6 years ago

you don't get the idea bro... The plugin is to multiply damage when the dmg done is equal to "cvar" And it should show a hud msg or stat to show how much damage is remaining to be done to gain 2x dmg and it must reset in cvar time if no additional damage is done!
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#18

Post by Raheem » 6 years ago

I don't understand now what to do, What relation between this plugin that make ×2 damage and damage bar? Also explain with examples what you need i don't get you well.
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#19

Post by Rain1153 » 6 years ago

I mean look, We can do damages to zombies right?
so we make the plugin read the damages done and when the damage done reaches a required damage "set in cvars example 5000 dmg " the damage doer must get 2x dmg after that after that if he doesnt do additional damage the damage status decreases for example he did 6000 damage > 5k dmg so he got 2x and now he doesnt do any damage so the damage status decreases after a " cvar time" . Also i wanted to see a hud messsage showing the damage like in the original plugin of damage boost.Please read the original plugin.Idea is same as the original but only you have to do is that remove the killiing zombie and get 2x thing and add "cvar damage " so when the damage done by us reaches "cvar damage" then we get 2x only!
LOL

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: Bing [Bot] and 1 guest