Approved Break Message

Gameplay Addons
Post Reply
User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

Break Message

#1

Post by Raheem » 2 Years Ago

Break Message

Description:
  • This plugin will print Message in Chat or Hud if player break anything in the map. This is improved version so if server break anything it won't print message. This may be useful in some cases for admins to know who break rules.
Cvars:
  • ze_message_type 1 0 = Disabled | 1 = Chat | 2 = Hud | 3 = Console
Installation & Instructions:
  • Simply install it like any plugin.
Changelog:
  • Spoiler!
    Version: 1.0
    • First Release.
    Version: 1.1
    • Some Optimization by using fakemeta rather than engine.
    • Added support for console message.
    Version: 1.2 [Current Version]
    • Code optimized to use ReAPI engine functions.
Screenshots:
  • ImageImageImage
Downloads:
You don't know? Learn and you will know.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#2

Post by Raheem » 2 Years Ago

Updated to version 1.1
You don't know? Learn and you will know.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#3

Post by Raheem » 2 Years Ago

New version available: 1.2
You don't know? Learn and you will know.

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

#4

Post by ArminC » 1 Year Ago

For normal mod (or other):

Code: Select all

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <reapi>

new cvars_message_type

public plugin_init()
{
	
    register_plugin("Break Message","1.2","Raheem")
    
	// Ham
    RegisterHam(Ham_TakeDamage, "func_breakable", "Fw_HamBreakableKilled_Post", 1)
	
	// Cvars
    cvars_message_type = register_cvar("message_type", "1")
}

public Fw_HamBreakableKilled_Post(iEnt, iWeapon, iKiller)
{
    if(get_entvar(iEnt, var_health) < 0)
    {
		static szName[32]
		get_user_name(iKiller, szName, charsmax(szName))
		
		if(iKiller == 0)
			return HAM_IGNORED
		
		if (get_pcvar_num(cvars_message_type) == 1)
		{
			client_print_color(0, print_team_default,"^1[^4ZPNM^1] ^3Player ^4%s ^3broke something^1.", szName)
		}
		else if (get_pcvar_num(cvars_message_type) == 2)
		{
			set_hudmessage(random(256), random(256), random(256), -1.0, 0.21, 0, 4.0, 4.0)
			show_hudmessage(0, "Player %s broke something!", szName)
		}
		else if (get_pcvar_num(cvars_message_type) == 3)
		{
			client_print(0, print_console, "Player %s broke something!", szName)
		}
    }
    return HAM_IGNORED
}

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest