AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   remove damage knife e zeus. (https://forums.alliedmods.net/showthread.php?t=329375)

thekings4fun 12-21-2020 08:21

remove damage knife e zeus.
 
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.

PeterPan 01-05-2021 22:32

Re: remove damage knife e zeus.
 
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;



Ilusion9 01-06-2021 07:49

Re: remove damage knife e zeus.
 
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.


All times are GMT -4. The time now is 05:46.

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