Raised This Month: $51 Target: $400
 12% 

Removing Bomb Damage Completely


Post New Thread Reply   
 
Thread Tools Display Modes
eyal282
Veteran Member
Join Date: Aug 2011
Old 03-10-2019 , 06:55   Re: Removing Bomb Damage Completely
Reply With Quote #11

Quote:
Originally Posted by Drumanid View Post
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
eyal282 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:54.


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