Solved Break entity just for breakable?

Coding Help/Re-API Supported
Post Reply
User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

Break entity just for breakable?

#1

Post by ArminC » 6 years 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 6 years ago, edited 1 time in total.

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#2

Post by Night Fury » 6 years ago

Explain.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#3

Post by ArminC » 6 years 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
Posts: 2214
Joined: 7 years ago
Contact:

#4

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

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#5

Post by ArminC » 6 years 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
Posts: 2214
Joined: 7 years ago
Contact:

#6

Post by Raheem » 6 years ago

ZM? Why there is these boxes in zm mods?
He who fails to plan is planning to fail

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#7

Post by ArminC » 6 years 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
Posts: 2214
Joined: 7 years ago
Contact:

#8

Post by Raheem » 6 years ago

Remove this map easier than i ReWrite or fix this for normal mods.
He who fails to plan is planning to fail

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#9

Post by ArminC » 6 years 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: 6 years ago
Location: Bucharest
Contact:

#10

Post by ArminC » 6 years 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

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 0 guests