Parent Directory | Revision Log
Revision 1 - (view) (download)
1 : | ian | 1 | /* |
2 : | No Water Draw | ||
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 : | Server cvars: | ||
18 : | |||
19 : | // Enabled/Disables the plugin | ||
20 : | // 0 = disabled | ||
21 : | // 1 = enabled | ||
22 : | nowater_draw "1" | ||
23 : | |||
24 : | Greets to: | ||
25 : | |||
26 : | VipKiller & BalkY who took an exact unmodified copy of code from my plugin and tried to take credit for writing it (oh, they did change the cvar, but doesn't count as an original work, it's still my code). Read the GPL2 and copyright law. | ||
27 : | |||
28 : | */ | ||
29 : | #include <amxmodx> | ||
30 : | #include <amxmisc> | ||
31 : | #include <engine> | ||
32 : | |||
33 : | #define PLUGIN "No Water Draw" | ||
34 : | #define VERSION "1.0" | ||
35 : | #define AUTHOR "Ian Cammarata" | ||
36 : | |||
37 : | |||
38 : | new nowater_draw | ||
39 : | |||
40 : | |||
41 : | public plugin_init() | ||
42 : | { | ||
43 : | register_plugin(PLUGIN, VERSION, AUTHOR) | ||
44 : | |||
45 : | nowater_draw = register_cvar("nowater_draw","1") | ||
46 : | set_task( 5.0, "check_cvars", _, _, _, "b" ) | ||
47 : | } | ||
48 : | public plugin_cfg() | ||
49 : | { | ||
50 : | new ent | ||
51 : | |||
52 : | //If Cvar set, set func_water ents to no draw, helps many peoples FPS | ||
53 : | if( get_pcvar_num( nowater_draw ) ) | ||
54 : | { | ||
55 : | ent = find_ent_by_class( -1, "func_water" ) | ||
56 : | while( ent > 0 ) | ||
57 : | { | ||
58 : | set_entity_visibility( ent, 0 ) | ||
59 : | ent=find_ent_by_class( ent, "func_water" ) | ||
60 : | } | ||
61 : | } | ||
62 : | } | ||
63 : | |||
64 : | public check_cvars() | ||
65 : | { | ||
66 : | static bool:nodraw | ||
67 : | if( get_pcvar_num( nowater_draw ) && !nodraw ) | ||
68 : | { | ||
69 : | new ent = find_ent_by_class( -1, "func_water" ) | ||
70 : | while( ent > 0 ) | ||
71 : | { | ||
72 : | set_entity_visibility( ent, 0 ) | ||
73 : | ent = find_ent_by_class( ent, "func_water" ) | ||
74 : | } | ||
75 : | nodraw = true | ||
76 : | } | ||
77 : | else if( !get_pcvar_num( nowater_draw ) && nodraw ) | ||
78 : | { | ||
79 : | new ent = find_ent_by_class( -1, "func_water" ) | ||
80 : | while( ent > 0 ) | ||
81 : | { | ||
82 : | set_entity_visibility( ent, 1 ) | ||
83 : | ent = find_ent_by_class( ent, "func_water" ) | ||
84 : | } | ||
85 : | nodraw = false | ||
86 : | } | ||
87 : | } |
Contact | ViewVC Help |
Powered by ViewVC 1.0.4 |