|
Veteran Member
|
03-10-2019
, 06:55
Re: Removing Bomb Damage Completely
|
#11
|
Quote:
Originally Posted by Drumanid
I do not think that this method is 'pathetic'.
1. What is higher? - No
Better than checking for damage every time.
2. What prevents to make a check?
There is a better option, suggest
Not agree - criticize, criticize - offer, offer - do, do - answer.
Another view implementation:
Code:
#include <sourcemod>
#include <sdkhooks>
public Plugin myinfo =
{
name = "No bomb damage",
author = "Drumanid",
version = "1.0.0",
url = "Discord: Drumanid#9108"
};
public void OnPluginStart()
{
HookEvent("bomb_exploded", view_as<EventHook>(Event_BombExploded), EventHookMode_Pre);
}
#define EVENT(%0) \
for(int iClient = 1; iClient <= MaxClients; ++iClient)\
if(IsClientInGame(iClient) && IsPlayerAlive(iClient))\
%0(iClient, SDKHook_OnTakeDamageAlive, OnTakeDamageAlive)
void Event_BombExploded()
{
EVENT(SDKHook);
RequestFrame(view_as<RequestFrameCallback>(BombExplodedFrame));
}
void BombExplodedFrame()
{
EVENT(SDKUnhook);
}
Action OnTakeDamageAlive(int iVictim, int &iAttacker, int &iInflictor, float &fDamage, int &iDamageType)
{
return iDamageType == 64 ? Plugin_Handled:Plugin_Continue;
}
|
If it doesn't do exactly what it's meant to do, it's a bad method. I added an example of what it does that shouldn't be done - removing godmode from all players. If I didn't:t add this input, the thread maker may have used a bugged plugin, which is bad.
__________________
I am available to make plugins for pay.
Discord: Eyal282#1334
|
|
|
|