Resolved Break entity just for breakable?

Coding Help/Re-API Supported
Post Reply
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:

Break entity just for breakable?

#1

Post by ArminC » 1 Year Ago

I just wana to test the plugins on a local server then I saw that it says to de_dust2 bomb plant box that they can be breakable but they are just by the bomb borken..
Can you make a detect for these types of "breakable just by bomb/server" type?

Code: Select all

#include <amxmodx>
#include <engine>
#include <reapi>

// Defines
#define AIMTASK 500

// Cvars
new cvar_message_type

public plugin_init()
{
	register_plugin("Breakable Hint", "1.1", "Raheem")
	
	// Cvars
	cvar_message_type = register_cvar("break_hint_type", "2")
	
	// Tasks
	set_task(0.5, "Check_AimTask", AIMTASK, _, _, "b")
}

public Check_AimTask()
{
	if (get_pcvar_num(cvar_message_type) == 0)
	{
		remove_task(AIMTASK, 0)
		return
	}
	
	for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
	{
		if (!is_user_alive(id))
			continue
		
		new iEntIndex, iBody
		get_user_aiming(id, iEntIndex, iBody)
		
		if(is_valid_ent(iEntIndex) && !is_user_connected(iEntIndex))
		{
			new szClassName[32]
			
			get_entvar(iEntIndex, var_classname, szClassName, charsmax(szClassName))
			
			if(equal(szClassName, "func_breakable"))
			{
				if (get_pcvar_num(cvar_message_type) == 1)
				{
					set_hudmessage(random(256), random(256), random(256), 0.1, -0.3, 2, 2.0, 2.0)
					show_hudmessage(id, "You can break this entity!")
				}
				else if (get_pcvar_num(cvar_message_type) == 2)
				{
					client_print(id, print_center, "You can break this entity!")
				}
			}
		}
	}
}
Last edited by ArminC on 04 Feb 2018, 13:14, edited 1 time in total.

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 622
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#2

Post by Mohamed Alaa » 1 Year Ago

Explain.
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

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:

#3

Post by ArminC » 1 Year Ago

So.. in Zombie Escape/ZombieBio/ZP or whatever.. you can break some woods for some reasons.. to block a ramp trough you can jump over something or as that.. but
in de_dust2 this plugin says that I can break that bomb site "green box" (see this: https://www.johnsto.co.uk/i/design/maki ... a_b_01.jpg) but these are breakable just for the bomb, not by us. So how I can ignore that types of situation??

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: 21
Contact:

#4

Post by Raheem » 1 Year Ago

It's already breakable but only BOMB and RPG can break it. You speak about de_dust2 and forget that we are a community for Zombie Escape.
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:

#5

Post by ArminC » 1 Year Ago

I know that's only by bomb and rpg.. and I know it's about de_Dust2 (I have zm mod installed) but there isn't a check for this, like it's annoying?

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: 21
Contact:

#6

Post by Raheem » 1 Year Ago

ZM? Why there is these boxes in zm mods?
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:

#7

Post by ArminC » 1 Year Ago

Hmm.. I don't reffer exactly to a map to have these boxes.. just to avoid this types of scenarios.. but if I think... I think that I know a map with this boxes..

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: 21
Contact:

#8

Post by Raheem » 1 Year Ago

Remove this map easier than i ReWrite or fix this for normal mods.
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:

#9

Post by ArminC » 1 Year Ago

I'll remove anyway (I don't have installed the zm maps) but I'am afraid of some entities like these wich aren't meant to be broke but they will apear.. I already imagine some players that shot some box and don't work :lol:

-- It's possible anyway to ignore?? How? Based on entity hp or ?

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:

#10

Post by ArminC » 1 Year Ago

Solved on alliedmodders. Here is the fix:

Instead of

if(equal(szClassName, "func_breakable"))

put

if(equal(szClassName, "func_breakable") && !(entity_get_int(iEntIndex, EV_INT_flags) & SF_BREAK_TRIGGER_ONLY))

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests