Raised This Month: $32 Target: $400
 8% 

remove damage knife e zeus.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thekings4fun
Member
Join Date: Apr 2020
Old 12-21-2020 , 08:21   remove damage knife e zeus.
Reply With Quote #1

hello, i need a plugin that really works, i need to remove the damage from the knife and zeus on my servers, leaving only damage from the grenades, molotov. this and to prevent teammates from rushing on the companion molotov without suffering damage. I did some research and found 3 plugins for this purpose but none of them are working.
thekings4fun is offline
PeterPan
Junior Member
Join Date: Mar 2020
Old 01-05-2021 , 22:32   Re: remove damage knife e zeus.
Reply With Quote #2

Not convinced I understood what you were asking but this should do what you want

There are also probably better ways of doing it but like I said it should work

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdkhooks>

#define DMG_SLASH (1 << 2)
#define DMG_SHOCK (1 << 8)

public void OnClientPostAdminCheck(int client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
}

public 
Action OnTakeDamage(int clientint &attackerint &inflictorfloat &damageint &damagetype)
{
    if (
damagetype DMG_SHOCK)
    {
        return 
Plugin_Handled;
    }
    if (
damagetype DMG_SLASH)
    {
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;


Last edited by PeterPan; 01-05-2021 at 22:32.
PeterPan is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 01-06-2021 , 07:49   Re: remove damage knife e zeus.
Reply With Quote #3

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

public void OnClientPostAdminCheck(int client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
}

public 
Action SDK_OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
{
    if (
weapon != -1)
    {
        if (
damagetype DMG_SHOCK)
        {
            return 
Plugin_Handled;
        }
        else if (
damagetype DMG_SLASH)
        {
            return 
Plugin_Handled;
        }

        return 
Plugin_Continue;
    }

Check if there's a valid weapon, trigger_hurts can do these types of damage.
__________________
Ilusion9 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 20:33.


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