AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Making a window unbreakable... (https://forums.alliedmods.net/showthread.php?t=27373)

TiToTal 04-21-2006 00:52

Making a window unbreakable...
 
Is there a way to set just one window unbreakable with the entID?
If there is, could you please tell me how?
Thanks :wink:

FatalisDK 04-21-2006 01:28

Code:
DispatchKeyValue(Ent, "spawnflags", "1") // 1 = Trigger Only DispatchSpawn(Ent)

Batman/Gorlag 04-21-2006 03:52

Code:
set_pev(entid, pev_takedamage, 0.0)
If you use fakemeta.
Code:
entity_set_float(entid, EV_FL_takedamage, 0.0)
If you use engine.

I think that the entity's setting resets to its default after the end of a round, so you might want to set the window to be unbreakable, everytime a new round starts. So you might need to use this code:
Code:
register_logevent("set_unbreakable", 2, "0=World triggered", "1=Round_Start") public set_unbreakable() {    set_pev(entid, pev_takedamage, 0.0)  //Makes window unbreakable. }

FatalisDK 04-21-2006 04:00

takedamage was the first thing I tried, and it didn't work. Also with my way it doesn't reset after new round.

TiToTal 04-21-2006 16:03

I will try... thx =D

Should I put this piece of code in public client_putinserver ?

FatalisDK 04-21-2006 16:37

Put it in plugin_cfg() or plugin_init().
Also, ent id's change on mapchange.

Des12 04-21-2006 22:10

If a window respawns, will it still be invincible? I tried that once and if you did force_use on it, it would respawn as breakable.


All times are GMT -4. The time now is 05:12.

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