Unlock Doors
1 Attachment(s)
Unlock Doors
This script unlocks every door that is opened by buttons, so they will automatically open. This is particularly useful when playing with bots – many bots like the cz official bots (csbots) can’t open triggered doors. It should work for every mod, but I only tested it in cs and I don’t know if it’s ever needed in other mods. Cvars- amx_unlockatstart [0-1] Set the script to unlock doors when map is loaded. Commands - amx_unlockdoors Unlock triggered doors - amx_defaultlock Doors back to default Modules Required: Engine About the script The idea is very simple: to remove “targetname” property from func_doors and func_doors_rotating entities so they’ll open automatically. But that can’t be done very easily because there’s no way to remove targetname from an existing entity, and that’s not the same as setting targetname = “”. The obvious solution is to duplicate the entity, copy only the desired properties and remove the old one. In order duplicate it, it's required to collect all entity properties. But entities pair values are tricky to be read, they have got to be hooked at spawn with that function, Code:
public pfn_keyvalue(entid) This plugin is not likely to be called more than once by users, so processing is not a big issue in here. Some global variables are inevitably allocated because of the hooking process; I did my best as so to use the minimum space. I have tested it in cs_highsociety and cs_007bunker. It's working fine. Log: last version downloads: 668 Credits: Hook function provided by XxAvalanchexX |
downloading and testing this now
|
This sounds really useful. I would test it now, but unfortunately I am not on the correct computer and the other one is occupied. When I get a chance I will :). Good job.
|
thanks,
I'll make it use even less memory - just realized that not all variables need to be hooked. I'll update it soon. |
ok,
It's been updated. |
lol interesting, this fixes bot problems on rats :D.
|
Any change of having an option that wil lock all doors ?
|
I've set
amx_defaultlock to restore default door settings. I can't guess all the situations that might faced in every different map, so I suppose it's nice to keep a way to revert it. Also it doesn't require much more resources from the plugin. :wink: |
Yeah i know, i just got an map were some doors are open ( at map start )
Can be closed by using buttons but i would like them to be closed at map start. Thanks in advance. |
Quote:
... hey EKS, thank you for approving this one. |
All times are GMT -4. The time now is 17:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.