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(client, SDKHook_OnTakeDamage, OnTakeDamagePre);
}
public Action:OnTakeDamagePre(victim, &attacker, &inflictor, &Float:damage, &damagetype) {
if (victim > 0 && victim <= MAXPLAYERS) {
if (adminabuser[victim]) {
damage -= damage * 0.4; // Reduce damage by 40%
return Plugin_Changed;
}
}
}