Raised This Month: $89 Target: $400
 22% 

[HELP] Print Fall Damage Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xantis
New Member
Join Date: Feb 2019
Old 08-14-2019 , 10:42   [HELP] Print Fall Damage Plugin
Reply With Quote #1

Hello, i found a plugin from this thread:
https://forums.alliedmods.net/showthread.php?t=287004

and i want to edit this plugin for print fall and vehicle damage to chat for my hns server.

for example:
[TAG] (player) took (number) fall damage.

Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "boomix && Grey83"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdkhooks>

#define LoopAllPlayers(%1) for(int %1=1;%1<=MaxClients;++%1)\
if(IsClientInGame(%1))

public Plugin myinfo = 
{
	name = "Warning: shooting others",
	author = PLUGIN_AUTHOR,
	description = "Warns in chat, that player is shooting others",
	version = PLUGIN_VERSION,
	url = "http://forums.alliedmods.net"
};

public void OnPluginStart()
{
	LoopAllPlayers(i)
		SDKHook(i, SDKHook_OnTakeDamage, Event_OnTakeDamage);
	
}

public void OnClientPutInServer(int client)
{
	SDKHook(client, SDKHook_OnTakeDamage, Event_OnTakeDamage);
}

public Action Event_OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype) 
{
	
    if(damagetype & DMG_FALL || damagetype & DMG_VEHICLE)
    {
    	PrintToChatAll("\x1 \x2 Warning:\x1 Player\x3 %N\x1 is shooting others!", attacker);
    	return Plugin_Handled; 
    }
    
    return Plugin_Continue;
}
im stuck in here.
xantis is offline
Cruze
Veteran Member
Join Date: May 2017
Old 08-14-2019 , 11:31   Re: [HELP] Print Fall Damage Plugin
Reply With Quote #2

PHP Code:
public Plugin myinfo 
{
    
name "Warning: shooting others",
    
author PLUGIN_AUTHOR,
    
description "Warns in chat, that player is shooting others",
    
version PLUGIN_VERSION,
    
url "http://forums.alliedmods.net"
};

public 
void OnPluginStart()
{
    
LoopAllPlayers(i)
        
SDKHook(iSDKHook_OnTakeDamageEvent_OnTakeDamage);
    
}

public 
void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_OnTakeDamageEvent_OnTakeDamage);
}

public 
Action Event_OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype
{
    
    if(
damagetype DMG_FALL || damagetype DMG_VEHICLE)
    {
        
PrintToChatAll("Player\x3 %N took %d fall damage."victimRoundFloat(damage));
        return 
Plugin_Handled
    }
    
    return 
Plugin_Continue;

__________________
Taking paid private requests! Add me on steam!

Discord: Cruze#4947 | AlliedModders Releases | Github | Steam | PayPal
Cruze is offline
Reply


Thread Tools
Display Modes

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 14:04.


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