[Half-Life AMXX] / dmgdoors.sma Repository:
ViewVC logotype

Annotation of /dmgdoors.sma

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : ian 1 /*
2 :     DMG Doors v0.1
3 :     Copyright (C) 2007 Ian (Juan) Cammarata
4 :    
5 :     This program is free software; you can redistribute it and/or modify it under
6 :     the terms of the GNU General Public License as published by the Free Software
7 :     Foundation; either version 2 of the License, or (at your option) any later
8 :     version.
9 :    
10 :     This program is distributed in the hope that it will be useful, but WITHOUT ANY
11 :     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 :     PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 :    
14 :     You should have received a copy of the GNU General Public License along with
15 :     this program; go to http://www.opensource.org/licenses/gpl-license.php
16 :    
17 :     Created by Ian (Juan) Cammarata
18 :     http://ian.cammarata.us
19 :     AMXX 1.76d
20 :     5/2/2007 5:34:33 AM
21 :    
22 :     Description:
23 :     When enabled this plugin adds damage to sliding doors, or sliding and hinged
24 :     doors. The amount of damage dealt is also configurable. The main purpose for
25 :     the writing of the plugin was to prevent message flooding caused by players
26 :     getting stuck in a door, which sometimes results in all nearby players getting
27 :     dropped from the server, but it's also just kinda fun.
28 :    
29 :     Cvars (First value is default):
30 :     dmgdoors < 2 (all doors) | 0 (disabled) | 1 (only sliding doors) >
31 :     dmgdoors_dmg < 9999 | ... > : How much damage the doors will do.
32 :    
33 :     Notes:
34 :     Changes to cvars only take affect after a map change.
35 :    
36 :     Change Log:
37 :     Key (+ added | - removed | c changed | f fixed)
38 :    
39 :     V? (June 06, 2007)
40 :    
41 :     -: Removed debug message
42 :     V0.1 (June 02, 2007)
43 :     !Initial Release
44 :     */
45 :     #include <amxmodx>
46 :     #include <engine>
47 :    
48 :     #define VERSION "0.1"
49 :    
50 :     public pfn_keyvalue(ent){
51 :     static old_ent=0,key_val[20],mode,dmg[6]
52 :     new ent_class[1],key_name[1]
53 :    
54 :     if(!old_ent){
55 :     mode=get_cvar_num("dmgdoors")
56 :     get_cvar_string("dmgdoors_dmg",dmg,5)
57 :     }
58 :     else if(ent!=old_ent){
59 :     if(equal(key_val,"func_door")&&mode>0)
60 :     DispatchKeyValue(old_ent,"dmg",dmg)
61 :     else if(equal(key_val,"func_door_rotating")&&mode>1)
62 :     DispatchKeyValue(old_ent,"dmg",dmg)
63 :     copy_keyvalue(ent_class,0,key_name,0,key_val,19)
64 :     }
65 :    
66 :     old_ent=ent
67 :     }
68 :    
69 :     public plugin_init(){
70 :     register_plugin("DMG Doors",VERSION,"Ian Cammarata")
71 :     register_cvar("dmgdoors_version",VERSION,FCVAR_SERVER)
72 :     register_cvar("dmgdoors","2")
73 :     register_cvar("dmgdoors_dmg","9999")
74 :     }

Contact
ViewVC Help
Powered by ViewVC 1.0.4