Thread: hp problem
View Single Post
Author Message
generals
Senior Member
Join Date: Aug 2018
Old 01-04-2020 , 11:01   hp problem
Reply With Quote #1

hi

I have no idea how to make for one player with variable damage reduced by 40%. Can u tell me how?

I want do this work when player switch weapon to knife (for css)

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdkhooks>

new bool:adminabuser[MAXPLAYERS+1];

public 
OnClientPutInServer(client) {

    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamagePre);
}

public 
Action:OnTakeDamagePre(victim, &attacker, &inflictor, &Float:damage, &damagetype) {

    if (
victim && victim <= MAXPLAYERS) {
        if (
adminabuser[victim]) {
            
damage -= damage 0.4// Reduce damage by 40%
            
return Plugin_Changed;
        }
    }


Last edited by generals; 01-08-2020 at 05:27.
generals is offline