AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detecting func_breakable destruction. & Create breakable func_pushable. (https://forums.alliedmods.net/showthread.php?t=45902)

solidsnake 10-14-2006 05:44

Detecting func_breakable destruction. & Create breakable func_pushable.
 
Dears friends : i have some trouble about detecting func_breakable destruction.

I want to do this :

When a player is breaking a windows (or other func_breakable), it trigger a event (function).

Currently i use a loop task that checking func_breakable health and start a function if under 0.Work fine, But server laaaaaaggg (task set to 0.3s).

Other request how to doing a func_pushable that a player can break ? (like sit in cs_estate) :mrgreen:

Thank you !

solidsnake 10-14-2006 12:01

Re: Detecting func_breakable destruction. & Create breakable func_pushable.
 
No body can help me ? :mrgreen:

commonbullet 10-14-2006 14:38

Re: Detecting func_breakable destruction. & Create breakable func_pushable.
 
Post your 'loop code';
To make func_pushable breakable, set spawnflags to 128 (I'm not sure if you'll have to respawn this entity in each round).

solidsnake 10-15-2006 11:09

Re: Detecting func_breakable destruction. & Create breakable func_pushable.
 
Nice work fine !!! Thx !

But how to block "Enter key", to avoid push bug (fast speed on the map for the player and object ?) :p

solidsnake 10-17-2006 04:01

Re: Detecting func_breakable destruction. & Create breakable func_pushable.
 
Hello :)

No issue for my problem ?

Rolnaaba 10-17-2006 11:17

Re: Detecting func_breakable destruction. & Create breakable func_pushable.
 
couple things:
1) post your whole code like was asked already
2) stop double posting and bumping your code that makes people not want to help you
3)JUST WAIT

XxAvalanchexX 10-17-2006 15:07

Re: Detecting func_breakable destruction. & Create breakable func_pushable.
 
Code:
#include <engine> public plugin_init() {      register_think("func_breakable","think_breakable"); } public think_breakable(ent) {      if(entity_get_float(ent,EV_FL_health) <= 0.0)      {           // dead      } }

As far as I know, registering a think doesn't lag the server very much if at all. And of course if you don't want to use the evil, despicable, dreaded, hellspawn, engine module (or at least that's what everyone else thinks), I can show you how to do this with Fakemeta as well.

As for actual functionality, hopefully a think gets called when the breakable is at or below 0.0 HP. In fact, I think a special one is called when it dies, so this should work.

solidsnake 10-18-2006 05:24

Re: Detecting func_breakable destruction. & Create breakable func_pushable.
 
XxAvalanchexX, i love you lol :mrgreen: :mrgreen: :mrgreen:

Karma for you !!!!

Edit : Why FakeMeta is better than Engine ? :mrgreen:

P34nut 10-18-2006 09:12

Re: Detecting func_breakable destruction. & Create breakable func_pushable.
 
func_breakables use as overridden takedamage..

temporary entity 108 (TE_BREAKMODEL) is only used when a breakable "died"

maybe you can do something with this info

btw i found this in HLSDK (dlls/func_break.cpp)

XxAvalanchexX his way should work to

Zenith77 10-18-2006 12:05

Re: Detecting func_breakable destruction. & Create breakable func_pushable.
 
Quote:

Originally Posted by solidsnake (Post 392474)
XxAvalanchexX, i love you lol :mrgreen: :mrgreen: :mrgreen:

Karma for you !!!!

Edit : Why FakeMeta is better than Engine ? :mrgreen:

It's just more efficente, more power, etc. You don't really need to worry about it if you're begining since the engine is just fine. Fakemeta is typically for coders who want to have "better" code (in terms of power and efficency).


All times are GMT -4. The time now is 04:53.

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