AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Kill bonus HP for "Zombie Panic Source" (https://forums.alliedmods.net/showthread.php?t=340932)

ORdli 12-18-2022 09:09

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

}

Bacardi 12-18-2022 11:47

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

ORdli 12-18-2022 13:37

Re: Kill bonus HP for "Zombie Panic Source"
 
Quote:

Originally Posted by Bacardi (Post 2795490)
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

ORdli 12-18-2022 13:48

Re: Kill bonus HP for "Zombie Panic Source"
 
quote

Bacardi 12-18-2022 15:23

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:

    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

ORdli 12-18-2022 16:20

Re: Kill bonus HP for "Zombie Panic Source"
 
Quote:

Originally Posted by Bacardi (Post 2795501)
...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 :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.