This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Kill bonus HP for "Zombie Panic Source"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ORdli
Member
Join Date: Nov 2021
Old 12-18-2022 , 09:09   Kill bonus HP for "Zombie Panic Source"
Reply With Quote #1

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

}
ORdli is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-18-2022 , 11:47   Re: Kill bonus HP for "Zombie Panic Source"
Reply With Quote #2

In forum post, go advance
And here some forum tags.
https://forums.alliedmods.net/misc.php?do=bbcode


Look code tag
__________________
Do not Private Message @me
Bacardi is offline
ORdli
Member
Join Date: Nov 2021
Old 12-18-2022 , 13:37   Re: Kill bonus HP for "Zombie Panic Source"
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
In forum post, go advance
And here some forum tags.
https://forums.alliedmods.net/misc.php?do=bbcode


Look code tag
I don't always have time to deal with English and translate it, translators sometimes don't understand it, but thanks for uploading this, I didn't even know about the existence of any tags, I also don't know how other people insert files into their messages..

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

Last edited by ORdli; 12-18-2022 at 13:59. Reason: ancient
ORdli is offline
ORdli
Member
Join Date: Nov 2021
Old 12-18-2022 , 13:48   Re: Kill bonus HP for "Zombie Panic Source"
Reply With Quote #4

quote

Last edited by ORdli; 12-18-2022 at 13:50. Reason: lol can't delete posts here...
ORdli is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-18-2022 , 15:23   Re: Kill bonus HP for "Zombie Panic Source"
Reply With Quote #5

...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:
    if(id == || !IsClientInGame(id) || GetClientTeam(id) != 2)
        return 
Plugin_Handled
If you have trouble to make plugin, ask help of your second forum account (Gummy6eaR) #10

I believe it can help you.

If you want more help by chit chat in moder way,
SourceMod Discord
__________________
Do not Private Message @me

Last edited by Bacardi; 12-18-2022 at 15:24.
Bacardi is offline
ORdli
Member
Join Date: Nov 2021
Old 12-18-2022 , 16:20   Re: Kill bonus HP for "Zombie Panic Source"
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
...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:
    if(id == || !IsClientInGame(id) || GetClientTeam(id) != 2)
        return 
Plugin_Handled
If you have trouble to make plugin, ask help of your second forum account (Gummy6eaR) #10

I believe it can help you.

If you want more help by chit chat in moder way,
SourceMod Discord
LOL WHAT?! where did you get that this is my account? If I could make plugins, what would be the point? you can consult a psychologist if you have signs of paranoia, I'm sure that you, as the creator of the plugin, have enough money for this, secondly, this can be seen by the date, my account was created in 2021, that is, do you think that I have been waiting for a whole year to create a second account? you really need a doctor, and don't worry when you think that someone is taking away your precious time, your greatness, this is also a mental disorder, A good doctor will also help you remove the imaginary crown from your head.

and yes your line breaks the plugin, it stops compiling, nice try

by the way, you are really a f00l if you think that someone is responding to necro posts from 2007...

Last edited by ORdli; 12-18-2022 at 17:19.
ORdli 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 05:30.


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