Raised This Month: $51 Target: $400
 12% 

[REQ] Deny Knife-Backstab


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kurtan
AlliedModders Donor
Join Date: Feb 2016
Location: Sweden
Old 07-11-2016 , 00:07   [REQ] Deny Knife-Backstab
Reply With Quote #1

Hello!

I was wondering of a nice fellow would like to help me with a "Deny Knife-Backstab" plugin.

I'm hosting HnS, and in CS:GO you get "backstabbed" from every single angle and its quite a pain.

What this plugin should do: Make it impossible to one stab kill. The HnS plugin that I am using forces the client to only be able to stab(Right click), even though you're using left click. I'm not sure if this information is needed, but I felt like adding it.

Feel free to ask any questions if there are any uncertainties.

Contact: Kurt

Thanks in advance!

EDIT: This plugin should deal 55 damage of hp from each side you stab from, HnS only uses a knife so there no need to worry about other weapons. I'm sorry if I was unclear about this!
__________________

Last edited by Kurtan; 07-11-2016 at 13:40. Reason: Left out important information
Kurtan is offline
CowGod
Senior Member
Join Date: Feb 2015
Old 07-11-2016 , 00:58   Re: [REQ] Deny Knife-Backstab
Reply With Quote #2

Would make it for you but our last incident was meh so here you are.

1) Hook player_death, look for weapon backstab.
CowGod is offline
Send a message via Skype™ to CowGod
Kurtan
AlliedModders Donor
Join Date: Feb 2016
Location: Sweden
Old 07-11-2016 , 01:40   Re: [REQ] Deny Knife-Backstab
Reply With Quote #3

It's not my fault that you scam people.
__________________
Kurtan is offline
CowGod
Senior Member
Join Date: Feb 2015
Old 07-11-2016 , 02:04   Re: [REQ] Deny Knife-Backstab
Reply With Quote #4

Give me proof of me scamming anyone please I would appreciate the read.
CowGod is offline
Send a message via Skype™ to CowGod
CowGod
Senior Member
Join Date: Feb 2015
Old 07-11-2016 , 02:04   Re: [REQ] Deny Knife-Backstab
Reply With Quote #5

Learn some morals and to respect people that have went out of their way to help you without anything in return.
CowGod is offline
Send a message via Skype™ to CowGod
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 07-11-2016 , 02:17   Re: [REQ] Deny Knife-Backstab
Reply With Quote #6

Anyways... Here is this:
Code:
#include <sourcemod>
#include <sdkhooks>
#include <cstrike>

public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
    if (victim < 1 || victim > MaxClients || attacker < 1 || attacker > MaxClients)
        return Plugin_Continue;

    if (damage > 55.0)
    {
        char weapon[64];
        GetClientWeapon(attacker, weapon, sizeof(weapon));
        if (StrEqual(weapon, "weapon_knife"))
        {
            PrintToChat(attacker, "\x04[HNS] Backstab denied!");
            return Plugin_Handled;
        }
    }
    return Plugin_Continue;
}
You weren't very clear on what you wanted the outcome to be, so please go into to detail if the outcome isn't what was desired.

Last edited by Maxximou5; 07-11-2016 at 05:12. Reason: splchk
Maxximou5 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 07-11-2016 , 04:57   Re: [REQ] Deny Knife-Backstab
Reply With Quote #7

@Maxximou5
Code:
if (damage > 55.0)
Out of curiosity, why do you do that ? To save a bit of process time ?
__________________
Want to check my plugins ?
Arkarr is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 07-11-2016 , 05:06   Re: [REQ] Deny Knife-Backstab
Reply With Quote #8

Standard stab damage is 55, which is why I picked it, and from the sound of it they will mostly only be using knives. Anything above 55 will most likely be a knife in the back and would kill the player. Also declaring anything isn't necessary unless there is a damage value above 55. If there's a better way of doing it, I too would like to know.
Source: https://www.reddit.com/r/GlobalOffen...e1_and_mouse2/
Maxximou5 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 07-11-2016 , 07:15   Re: [REQ] Deny Knife-Backstab
Reply With Quote #9

Alright, alright, I was just curious, thanks.
__________________
Want to check my plugins ?
Arkarr is offline
Kurtan
AlliedModders Donor
Join Date: Feb 2016
Location: Sweden
Old 07-11-2016 , 12:46   Re: [REQ] Deny Knife-Backstab
Reply With Quote #10

Quote:
Originally Posted by Maxximou5 View Post
Anyways... Here is this:
Code:
#include <sourcemod>
#include <sdkhooks>
#include <cstrike>

public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
    if (victim < 1 || victim > MaxClients || attacker < 1 || attacker > MaxClients)
        return Plugin_Continue;

    if (damage > 55.0)
    {
        char weapon[64];
        GetClientWeapon(attacker, weapon, sizeof(weapon));
        if (StrEqual(weapon, "weapon_knife"))
        {
            PrintToChat(attacker, "\x04[HNS] Backstab denied!");
            return Plugin_Handled;
        }
    }
    return Plugin_Continue;
}
You weren't very clear on what you wanted the outcome to be, so please go into to detail if the outcome isn't what was desired.
I am using the HnS Plugin which was mentioned above, this it probably what I need, I will test it and I'll return with feedback. Thanks!
__________________
Kurtan 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 01:17.


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