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.
- amx_unlockatstart [0-1]
Set the script to unlock doors when map is loaded.
Unlock triggered doors
Doors back to default
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,
Not all doors that have a targetname should be replaced; sometimes func_doors are used to trigger a muilti-manager or other entity at spawn for example. So the plugin looks for buttons that are triggering a specific door targetname and if it finds one, the door will be respawned.
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.
last version downloads: 668
Hook function provided by