Raised This Month: $ Target: $400
 0% 

Breakable entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xTr3m3r
Member
Join Date: Feb 2010
Old 02-16-2017 , 13:47   Breakable entity
Reply With Quote #1

Its me again! (stop it)

I was wondering how can I make a creatable entity (like in blockmaker) to be breakable?
Do I have to hook player's movement and touch? And if yes, how do I do it more properly?

Thanks!
xTr3m3r is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-16-2017 , 14:00   Re: Breakable entity
Reply With Quote #2

Set its class name to func_breakable ?
__________________
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-16-2017 , 15:20   Re: Breakable entity
Reply With Quote #3

Make it func_breakable and execute Use() on it.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-16-2017 , 16:00   Re: Breakable entity
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
Make it func_breakable and execute Use() on it.
I think he just wants to create and let the player break it.
__________________

Last edited by edon1337; 02-16-2017 at 16:01.
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-16-2017 , 16:03   Re: Breakable entity
Reply With Quote #5

If so, making it a func_breakable is enough. Once it's health is 0, it will break.
__________________
HamletEagle is offline
xTr3m3r
Member
Join Date: Feb 2010
Old 02-16-2017 , 16:42   Re: Breakable entity
Reply With Quote #6

So how do I turn

PHP Code:
entity_get_int(entEV_INT_body); 
(this is a block)

into func_breakable?
I have no idea..
xTr3m3r is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-16-2017 , 17:43   Re: Breakable entity
Reply With Quote #7

PHP Code:

set_pev
(iEntpev_classname"func_breakable")
set_pev(iEntpev_health1.0)
set_pev(iEntpev_takedamage1.0
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-16-2017 , 18:36   Re: Breakable entity
Reply With Quote #8

Just setting the classname will do nothing. You have to create the entity as func_breakable.

PHP Code:
new entity engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"func_breakable")); 
klippy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-16-2017 , 18:44   Re: Breakable entity
Reply With Quote #9

Ur right. But we can break it in the ent think forward
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-17-2017 , 01:04   Re: Breakable entity
Reply With Quote #10

Quote:
Originally Posted by Natsheh View Post
Ur right. But we can break it in the ent think forward
Why would you do that when game has code to deal with it?
__________________
HamletEagle is offline
Reply



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 20:49.


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