Raised This Month: $51 Target: $400
 12% 

Unlock Doors


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose        Approver:   EKS (166)
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-06-2005 , 21:46   Unlock Doors
Reply With Quote #1

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)
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.

Log:
last version downloads: 668

Credits:
Hook function provided by
XxAvalanchexX
Attached Files
File Type: sma Get Plugin or Get Source (unlockdoors.sma - 4334 views - 9.2 KB)

Last edited by commonbullet; 01-24-2007 at 17:48.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
kILL-jOY
Member
Join Date: Jul 2005
Old 11-06-2005 , 21:47  
Reply With Quote #2

downloading and testing this now
__________________
**|$uperHero|** Free level 8 / 75+ Heroes / BuyXP at 68.191.146.3:27015 - CS 1.6


kILL-jOY is offline
uTg | bigpapajiggs
Senior Member
Join Date: Sep 2005
Location: Bellingham, WA
Old 11-06-2005 , 22:24  
Reply With Quote #3

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.
__________________
What's my confidence level? I do crossword puzzles with a pen.
uTg | bigpapajiggs is offline
Send a message via AIM to uTg | bigpapajiggs Send a message via MSN to uTg | bigpapajiggs Send a message via Yahoo to uTg | bigpapajiggs
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-07-2005 , 06:53  
Reply With Quote #4

thanks,
I'll make it use even less memory - just realized that not all variables need to be hooked. I'll update it soon.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-07-2005 , 17:22  
Reply With Quote #5

ok,
It's been updated.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 11-07-2005 , 23:18  
Reply With Quote #6

lol interesting, this fixes bot problems on rats .
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
NedStar
Senior Member
Join Date: Apr 2005
Location: The Netherlands
Old 11-08-2005 , 05:56  
Reply With Quote #7

Any change of having an option that wil lock all doors ?
__________________
NedStar is offline
Send a message via MSN to NedStar
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-08-2005 , 06:37  
Reply With Quote #8

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.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
NedStar
Senior Member
Join Date: Apr 2005
Location: The Netherlands
Old 11-08-2005 , 10:17  
Reply With Quote #9

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.
__________________
NedStar is offline
Send a message via MSN to NedStar
commonbullet
Veteran Member
Join Date: Oct 2005
Old 11-08-2005 , 20:40  
Reply With Quote #10

Quote:
Originally Posted by NedStar
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.
I may check it. What is the map?

...

hey EKS, thank you for approving this one.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:29.


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