Approved Break Message

Gameplay Addons
Post Reply
User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2211
Joined: 6 Years Ago
Has thanked: 55 times
Been thanked: 176 times
Age: 25
Contact:

Break Message

#1

Post by Raheem » 5 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:
He who fails to plan is planning to fail

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2211
Joined: 6 Years Ago
Has thanked: 55 times
Been thanked: 176 times
Age: 25
Contact:

#2

Post by Raheem » 5 Years Ago

Updated to version 1.1
He who fails to plan is planning to fail

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2211
Joined: 6 Years Ago
Has thanked: 55 times
Been thanked: 176 times
Age: 25
Contact:

#3

Post by Raheem » 5 Years Ago

New version available: 1.2
He who fails to plan is planning to fail

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 5 Years Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 20
Contact:

#4

Post by ArminC » 5 Years 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
}

User avatar
Amnesia
Member
Member
Posts: 27
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 4 times
Contact:

#5

Post by Amnesia » 1 Month Ago

how i can make it when someone break something show only to the admin (special flag) , a guy broke something...

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 257
Joined: 5 Years Ago
Has thanked: 17 times
Been thanked: 21 times
Age: 23
Contact:

#6

Post by sPe3doN » 1 Month Ago

Amnesia wrote:
1 Month Ago
how i can make it when someone break something show only to the admin (special flag) , a guy broke something...

Code: Select all

#include <zombie_escape>
#include <engine>

#define ADMIN_ACCESS ADMIN_CHAT

public plugin_init() 
{
	register_plugin("Brea info","1.0","sPe3d*oN.")
	RegisterHam(Ham_TakeDamage,"func_breakable","FwdHamBreakableKilled",1)
}

public FwdHamBreakableKilled(ent, weapon, killer)
{
	if(entity_get_float(ent,EV_FL_health)<0 && is_user_alive(killer))
	{
        	static name[ 33 ],players[32],num,index
		get_players(players,num,"ch")
		for(new i;i<num;i++)
		{
			index=players[i]
			if(!(get_user_flags(index)&ADMIN_ACCESS)) 	continue
			get_user_name( killer, name, charsmax( name ) )
			ze_colored_print(index, "!y*** PLAYER !g%s !yHAS BROKEN!t/!yDESTROYED SOMETHING !y***",name)
		}
        	return(HAM_IGNORED)
    	}
    	return(HAM_IGNORED)
}
Image

User avatar
Amnesia
Member
Member
Posts: 27
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 4 times
Contact:

#7

Post by Amnesia » 1 Month Ago

sPe3doN wrote:
1 Month Ago
Amnesia wrote:
1 Month Ago
how i can make it when someone break something show only to the admin (special flag) , a guy broke something...

Code: Select all

#include <zombie_escape>
#include <engine>

#define ADMIN_ACCESS ADMIN_CHAT

public plugin_init() 
{
	register_plugin("Brea info","1.0","sPe3d*oN.")
	RegisterHam(Ham_TakeDamage,"func_breakable","FwdHamBreakableKilled",1)
}

public FwdHamBreakableKilled(ent, weapon, killer)
{
	if(entity_get_float(ent,EV_FL_health)<0 && is_user_alive(killer))
	{
        	static name[ 33 ],players[32],num,index
		get_players(players,num,"ch")
		for(new i;i<num;i++)
		{
			index=players[i]
			if(!(get_user_flags(index)&ADMIN_ACCESS)) 	continue
			get_user_name( killer, name, charsmax( name ) )
			ze_colored_print(index, "!y*** PLAYER !g%s !yHAS BROKEN!t/!yDESTROYED SOMETHING !y***",name)
		}
        	return(HAM_IGNORED)
    	}
    	return(HAM_IGNORED)
}
give your discord mate

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 257
Joined: 5 Years Ago
Has thanked: 17 times
Been thanked: 21 times
Age: 23
Contact:

#8

Post by sPe3doN » 1 Month Ago

Amnesia wrote:
1 Month Ago
sPe3doN wrote:
1 Month Ago
Amnesia wrote:
1 Month Ago
how i can make it when someone break something show only to the admin (special flag) , a guy broke something...

Code: Select all

#include <zombie_escape>
#include <engine>

#define ADMIN_ACCESS ADMIN_CHAT

public plugin_init() 
{
	register_plugin("Brea info","1.0","sPe3d*oN.")
	RegisterHam(Ham_TakeDamage,"func_breakable","FwdHamBreakableKilled",1)
}

public FwdHamBreakableKilled(ent, weapon, killer)
{
	if(entity_get_float(ent,EV_FL_health)<0 && is_user_alive(killer))
	{
        	static name[ 33 ],players[32],num,index
		get_players(players,num,"ch")
		for(new i;i<num;i++)
		{
			index=players[i]
			if(!(get_user_flags(index)&ADMIN_ACCESS)) 	continue
			get_user_name( killer, name, charsmax( name ) )
			ze_colored_print(index, "!y*** PLAYER !g%s !yHAS BROKEN!t/!yDESTROYED SOMETHING !y***",name)
		}
        	return(HAM_IGNORED)
    	}
    	return(HAM_IGNORED)
}
give your discord mate
sPe3d^oN.#8748
Image

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 1 guest