AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Breakable entity (https://forums.alliedmods.net/showthread.php?t=293979)

xTr3m3r 02-16-2017 13:47

Breakable entity
 
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? :D

Thanks!

edon1337 02-16-2017 14:00

Re: Breakable entity
 
Set its class name to func_breakable ?

HamletEagle 02-16-2017 15:20

Re: Breakable entity
 
Make it func_breakable and execute Use() on it.

edon1337 02-16-2017 16:00

Re: Breakable entity
 
Quote:

Originally Posted by HamletEagle (Post 2495954)
Make it func_breakable and execute Use() on it.

I think he just wants to create and let the player break it.

HamletEagle 02-16-2017 16:03

Re: Breakable entity
 
If so, making it a func_breakable is enough. Once it's health is 0, it will break.

xTr3m3r 02-16-2017 16:42

Re: Breakable entity
 
So how do I turn

PHP Code:

entity_get_int(entEV_INT_body); 

(this is a block)

into func_breakable?
I have no idea..

Natsheh 02-16-2017 17:43

Re: Breakable entity
 
PHP Code:


set_pev
(iEntpev_classname"func_breakable")
set_pev(iEntpev_health1.0)
set_pev(iEntpev_takedamage1.0


klippy 02-16-2017 18:36

Re: Breakable entity
 
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")); 


Natsheh 02-16-2017 18:44

Re: Breakable entity
 
Ur right. But we can break it in the ent think forward

HamletEagle 02-17-2017 01:04

Re: Breakable entity
 
Quote:

Originally Posted by Natsheh (Post 2495992)
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?


All times are GMT -4. The time now is 20:49.

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