Kill bonus HP for "Zombie Panic Source"
There is a plugin that gives health after killing players, but I would like to know if it is possible to edit it somehow so that only the Survivors team gets health?
#include <sourcemod> new Handle:Enabled new Handle:HsAdd new Handle:HpAdd new Handle:MaxHp public Plugin:myinfo = { name = "Kill Bonus", author = "Fredd", description = "Gives someone Hp on a kill", version = "1.0", url = "www.sourcemod.net" } public OnPluginStart() { CreateConVar("kb_version", "1.0", "Kill Bonus Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FC VAR_NOTIFY) Enabled = CreateConVar("kb_enabled", "1", "Enables - Disables the Kill bonus plugin", FCVAR_NOTIFY) HsAdd = CreateConVar("kb_headshot", "30", "value # equals the amount of hp to add, when attacker headshots", FCVAR_NOTIFY) HpAdd = CreateConVar("kb_hp", "20", "value # equals the amount of hp to add, when the someone kills someone", FCVAR_NOTIFY) MaxHp = CreateConVar("kb_maxhp", "100", "value # equals the max hp that the attacker could get", FCVAR_NOTIFY) HookEvent("player_death", hookPlayerDie, EventHookMode_Post) } public Action:hookPlayerDie(Handle:event, const String:name[], bool:dontBroadcast) { new attacker = GetEventInt(event, "attacker") new id = GetClientOfUserId(attacker) new bool:headshot = GetEventBool(event, "headshot") new Hs = GetConVarInt(HsAdd) new Hp = GetConVarInt(HpAdd) new Max = GetConVarInt(MaxHp) new CurrentHp = GetClientHealth(id) if(GetConVarInt(Enabled) == 0) return Plugin_Handled if(CurrentHp == Max) return Plugin_Handled if(headshot) { if((CurrentHp + Hs) > Max) { SetEntProp(id, Prop_Send, "m_iHealth", Max, 1) PrintToChat(id, "You been giving %i hp, for getting a headshot kill", (Max - CurrentHp)) } else { SetEntProp(id, Prop_Send, "m_iHealth", Hs + CurrentHp, 1) PrintToChat(id, "You been giving %i hp, for getting a headshot kill", Hs) } } else if(!headshot) { if((CurrentHp + Hp) > Max) { SetEntProp(id, Prop_Send, "m_iHealth", Max, 1) PrintToChat(id, "You been giving %i hp, for getting a kill", (Max - CurrentHp)) } else { SetEntProp(id, Prop_Send, "m_iHealth", Hp + CurrentHp, 1) PrintToChat(id, "You been giving %i hp, for getting a kill", Hp) } } return Plugin_Continue } |
Re: Kill bonus HP for "Zombie Panic Source"
In forum post, go advance
And here some forum tags. https://forums.alliedmods.net/misc.php?do=bbcode Look code tag |
Re: Kill bonus HP for "Zombie Panic Source"
Quote:
P.S and yes, usually the code is formatted automatically by the /code command or similar, but I see that this forum is very old, probably from the 2000s when cs 1.6 and Half-life were popular, lol. and if everyone does this by manually editing their text, then the creators should pay users not for convenience, and not vice versa, because the forum has not changed since those years, both in functionality and visually, it looks like a feeder to raise money, who are the people sponsoring this? for 23 years or 25 years, I don’t know the date of creation of this site, it was possible to make a cool site, with their donation, but apparently they are fed just like that! Oh my god it's true I found it downstairs lmao... Powered by vBulletin® Copyright ©2000 - 2022, vBulletin Solutions, Inc. Theme made by Freecode |
Re: Kill bonus HP for "Zombie Panic Source"
quote
|
Re: Kill bonus HP for "Zombie Panic Source"
...anyway.
You could also add link to original plugin in post. https://forums.alliedmods.net/showthread.php?p=522264 Add this in code, line 33. PHP Code:
I believe it can help you. If you want more help by chit chat in moder way, SourceMod Discord |
Re: Kill bonus HP for "Zombie Panic Source"
Quote:
and yes your line breaks the plugin, it stops compiling, nice try :D by the way, you are really a f00l if you think that someone is responding to necro posts from 2007... |
| All times are GMT -4. The time now is 05:02. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.