Raised This Month: $ Target: $400
 0% 

Custom weapon damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Gold Fish
Senior Member
Join Date: Mar 2020
Old 04-08-2020 , 16:11   Re: Custom weapon damage
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
Show your code... please.
HTML Code:
public void OnClientPutInServer(int client)
{
	SDKHook(client, SDKHook_TraceAttack, OnTakeDamage);
}
public void  OnClientDisconnect(int client)
{
	SDKUnhook(client, SDKHook_TraceAttack, OnTakeDamage);
}

public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &ammotype, int hitbox, int hitgroup)
{

	if (damage <= 0.0 || victim < 1 || victim > 2048 || attacker < 1 || attacker > MaxClients)
		return Plugin_Continue;

	damage = 100.0;
	return Plugin_Changed;
}

This is the simplest example, even after such a change in damage, when hit in the leg, less than 100 will be taken away, and when hit in the head twice as much

Last edited by Gold Fish; 04-08-2020 at 16:13.
Gold Fish is offline
 



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 23:13.


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