1 |
/* |
/* |
2 |
SpecInfo v1.3 |
SpecInfo v1.3.1 |
3 |
Copyright (C) 2007 Ian (Juan) Cammarata |
Copyright (C) 2007-2008 Ian (Juan) Cammarata |
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
This program is free software: you can redistribute it and/or modify |
6 |
it under the terms of the GNU Affero General Public License as |
it under the terms of the GNU Affero General Public License as |
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
18 |
http://ian.cammarata.us |
http://ian.cammarata.us |
19 |
Nov 21 11:13 |
Jan 05 17:39 |
20 |
|
|
21 |
|
|
22 |
Description: |
Description: |
54 |
|
|
55 |
Supported Languages: |
Supported Languages: |
56 |
English (100%) |
English (100%) |
57 |
Spanish (100%) - Thanks to <3 Mely <3 for checking these. |
Spanish (100%) - Thanks to Mely for checking these. |
58 |
German (63%) - Thanks to [S]killer for this translation. |
German (63%) - Thanks to [S]killer for this translation. |
59 |
|
Czech (100%) - Thanks to FuGi for this translation. |
60 |
|
|
61 |
|
|
62 |
Change Log: |
Change Log: |
63 |
Key (+ added | - removed | c changed | f fixed) |
Key (+ added | - removed | c changed | f fixed) |
64 |
|
|
65 |
|
v1.3.1 (Jan 5, 2008) |
66 |
|
f: Eliminated a bug introduced in 1.3 as well as the occasional index out of bounds error it caused. |
67 |
|
|
68 |
v1.3 (Nov 21, 2007) |
v1.3 (Nov 21, 2007) |
69 |
+: Command "/showkeys" to view your own keys. |
+: Command "/showkeys" to view your own keys. |
70 |
c: Minor code optimizations. |
c: Minor code optimizations. |
92 |
#include <engine> |
#include <engine> |
93 |
#include <fakemeta> |
#include <fakemeta> |
94 |
|
|
95 |
new const VERSION[ ] = "1.3" |
new const VERSION[ ] = "1.3.1" |
96 |
new const TRKCVAR[ ] = "grab_plus_version" |
new const TRKCVAR[ ] = "specinfo_version" |
97 |
#define IMMUNE_FLAG ADMIN_IMMUNITY |
#define IMMUNE_FLAG ADMIN_IMMUNITY |
98 |
|
|
99 |
#define KEYS_STR_LEN 31 |
#define KEYS_STR_LEN 31 |
100 |
#define LIST_STR_LEN 610 |
#define LIST_STR_LEN 610 |
101 |
#define BOTH_STR_LEN KEYS_STR_LEN+LIST_STR_LEN |
#define BOTH_STR_LEN KEYS_STR_LEN+LIST_STR_LEN |
102 |
|
|
|
//cvar pointers |
|
|
new p_enabled, p_list_enabled, p_keys_enabled, p_list_default, p_keys_default |
|
|
new p_red, p_grn, p_blu, p_immunity |
|
|
|
|
|
//data arrays |
|
|
new cl_keys[33], cl_prefs[33] |
|
|
new keys_string[33][KEYS_STR_LEN+1], list_string[33][LIST_STR_LEN+1] |
|
|
new cl_names[33][21], spec_ids[33][32] |
|
|
|
|
103 |
//cl_prefs constants |
//cl_prefs constants |
104 |
#define FL_LIST (1<<0) |
#define FL_LIST (1<<0) |
105 |
#define FL_KEYS (1<<1) |
#define FL_KEYS (1<<1) |
106 |
#define FL_OWNKEYS (1<<2) |
#define FL_OWNKEYS (1<<2) |
107 |
#define FL_HIDE (1<<3) |
#define FL_HIDE (1<<3) |
108 |
|
|
109 |
|
//cvar pointers |
110 |
|
new p_enabled, p_list_enabled, p_keys_enabled, p_list_default, p_keys_default; |
111 |
|
new p_red, p_grn, p_blu, p_immunity; |
112 |
|
|
113 |
|
//data arrays |
114 |
|
new cl_keys[33], cl_prefs[33]; |
115 |
|
new keys_string[33][KEYS_STR_LEN + 1], list_string[33][LIST_STR_LEN + 1] |
116 |
|
new cl_names[33][21], spec_ids[33][33]; |
117 |
|
|
118 |
public plugin_init( ) |
public plugin_init( ) |
119 |
{ |
{ |
120 |
register_plugin( "SpecInfo", VERSION, "Ian Cammarata" ) |
register_plugin( "SpecInfo", VERSION, "Ian Cammarata" ); |
121 |
register_cvar( TRKCVAR, VERSION, FCVAR_SERVER ) |
register_cvar( TRKCVAR, VERSION, FCVAR_SERVER ); |
122 |
set_cvar_string( TRKCVAR, VERSION ) |
set_cvar_string( TRKCVAR, VERSION ); |
123 |
|
|
124 |
p_enabled = register_cvar( "si_enabled", "1" ) |
p_enabled = register_cvar( "si_enabled", "1" ); |
125 |
p_list_enabled = register_cvar( "si_list_enabled", "1" ) |
p_list_enabled = register_cvar( "si_list_enabled", "1" ); |
126 |
p_keys_enabled = register_cvar( "si_keys_enabled", "1" ) |
p_keys_enabled = register_cvar( "si_keys_enabled", "1" ); |
127 |
p_list_default = register_cvar( "si_list_default", "1" ) |
p_list_default = register_cvar( "si_list_default", "1" ); |
128 |
p_keys_default = register_cvar( "si_keys_default", "1" ) |
p_keys_default = register_cvar( "si_keys_default", "1" ); |
129 |
p_immunity = register_cvar( "si_immunity", "1" ) |
p_immunity = register_cvar( "si_immunity", "1" ); |
130 |
p_red = register_cvar( "si_msg_r", "45" ) |
p_red = register_cvar( "si_msg_r", "45" ); |
131 |
p_grn = register_cvar( "si_msg_g", "89" ) |
p_grn = register_cvar( "si_msg_g", "89" ); |
132 |
p_blu = register_cvar( "si_msg_b", "116" ) |
p_blu = register_cvar( "si_msg_b", "116" ); |
133 |
|
|
134 |
register_clcmd( "say /speclist", "toggle_list", _, "Toggle spectator list." ) |
register_clcmd( "say /speclist", "toggle_list", _, "Toggle spectator list." ); |
135 |
register_clcmd( "say /speckeys", "toggle_keys", _, "Toggle spectator keys." ) |
register_clcmd( "say /speckeys", "toggle_keys", _, "Toggle spectator keys." ); |
136 |
register_clcmd( "say /showkeys", "toggle_ownkeys", _, "Toggle viewing own keys." ) |
register_clcmd( "say /showkeys", "toggle_ownkeys", _, "Toggle viewing own keys." ); |
137 |
register_clcmd( "say /spechide", "toggle_hide", IMMUNE_FLAG, "Admins toggle being hidden from list." ) |
register_clcmd( "say /spechide", "toggle_hide", IMMUNE_FLAG, "Admins toggle being hidden from list." ); |
138 |
|
|
139 |
set_task( 1.0, "list_update", _, _, _, "b" ) |
set_task( 1.0, "list_update", _, _, _, "b" ); |
140 |
set_task( 0.1, "keys_update", _, _, _, "b" ) |
set_task( 0.1, "keys_update", _, _, _, "b" ); |
141 |
|
|
142 |
register_dictionary( "specinfo.txt" ) |
register_dictionary( "specinfo.txt" ); |
143 |
} |
} |
144 |
|
|
145 |
public client_connect( id ) |
public client_connect( id ) |
146 |
{ |
{ |
147 |
cl_prefs[id] = 0 |
cl_prefs[id] = 0; |
148 |
if( !is_user_bot( id ) ) |
if( !is_user_bot( id ) ) |
149 |
{ |
{ |
150 |
if( get_pcvar_num( p_list_default ) ) cl_prefs[id] |= FL_LIST |
if( get_pcvar_num( p_list_default ) ) cl_prefs[id] |= FL_LIST; |
151 |
if( get_pcvar_num( p_keys_default ) ) cl_prefs[id] |= FL_KEYS |
if( get_pcvar_num( p_keys_default ) ) cl_prefs[id] |= FL_KEYS; |
152 |
} |
} |
153 |
get_user_name( id, cl_names[id], 20 ) |
get_user_name( id, cl_names[id], 20 ); |
154 |
return PLUGIN_CONTINUE |
return PLUGIN_CONTINUE; |
155 |
} |
} |
156 |
|
|
157 |
public client_infochanged( id ) |
public client_infochanged( id ) |
158 |
{ |
{ |
159 |
get_user_name( id, cl_names[id], 20 ) |
get_user_name( id, cl_names[id], 20 ); |
160 |
return PLUGIN_CONTINUE |
return PLUGIN_CONTINUE; |
161 |
} |
} |
162 |
|
|
163 |
public list_update( ) |
public list_update( ) |
164 |
{ |
{ |
165 |
if( get_pcvar_num( p_enabled ) && get_pcvar_num ( p_list_enabled ) ) |
if( get_pcvar_num( p_enabled ) && get_pcvar_num ( p_list_enabled ) ) |
166 |
{ |
{ |
167 |
new players[32], num, id, id2, i, j |
new players[32], num, id, id2, i, j; |
168 |
for( i=1; i<33; i++ ) spec_ids[i][0] = 0 |
for( i = 1; i < 33; i++ ) spec_ids[i][0] = 0; |
169 |
get_players( players, num, "bch" ) |
|
170 |
|
get_players( players, num, "bch" ); |
171 |
for( i=0; i<num; i++ ) |
for( i=0; i<num; i++ ) |
172 |
{ |
{ |
173 |
id = players[i] |
id = players[i]; |
174 |
if( !( get_user_flags( id ) & IMMUNE_FLAG && get_pcvar_num( p_immunity ) && cl_prefs[id] & FL_HIDE ) ) |
if( !( get_user_flags( id ) & IMMUNE_FLAG && get_pcvar_num( p_immunity ) && cl_prefs[id] & FL_HIDE ) ) |
175 |
{ |
{ |
176 |
id2 = pev( id, pev_iuser2 ) |
id2 = pev( id, pev_iuser2 ); |
177 |
if( id2 ) |
if( id2 ) |
178 |
{ |
{ |
179 |
spec_ids[ id2 - 1 ][ 0 ]++ |
spec_ids[ id2 ][ 0 ]++; |
180 |
spec_ids[ id2 - 1 ][ spec_ids[ id2 - 1 ][ 0 ] ] = id |
spec_ids[ id2 ][ spec_ids[ id2 ][ 0 ] ] = id; |
181 |
} |
} |
182 |
} |
} |
183 |
} |
} |
184 |
new tmplist[ LIST_STR_LEN + 1 ], tmpstr[41] |
new tmplist[ LIST_STR_LEN + 1 ], tmpstr[41]; |
185 |
new count, namelen, tmpname[21] |
new count, namelen, tmpname[21]; |
186 |
for( i=1; i<33; i++ ) |
for( i=1; i<33; i++ ) |
187 |
{ |
{ |
188 |
count = spec_ids[i][0] |
count = spec_ids[i][0]; |
189 |
if( count ) |
if( count ) |
190 |
{ |
{ |
191 |
namelen = ( LIST_STR_LEN - 10 ) / count |
namelen = ( LIST_STR_LEN - 10 ) / count; |
192 |
clamp( namelen, 10, 20 ) |
clamp( namelen, 10, 20 ); |
193 |
format( tmpname, namelen, cl_names[i] ) |
format( tmpname, namelen, cl_names[i] ); |
194 |
formatex( tmplist, LIST_STR_LEN - 1, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t(%d) %s %s:^n", count, "%L", tmpname) |
formatex( tmplist, LIST_STR_LEN - 1, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t(%d) %s %s:^n", count, "%L", tmpname); |
195 |
for( j=1; j<=count; j++ ) |
for( j=1; j<=count; j++ ) |
196 |
{ |
{ |
197 |
format( tmpname, namelen, cl_names[spec_ids[i][j]]) |
format( tmpname, namelen, cl_names[spec_ids[i][j]]); |
198 |
formatex( tmpstr, 40, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t%s", tmpname ) |
formatex( tmpstr, 40, "^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t%s", tmpname ); |
199 |
if( strlen( tmplist ) + strlen( tmpstr ) + ( 11 - j ) < ( LIST_STR_LEN - 1 ) ) |
if( strlen( tmplist ) + strlen( tmpstr ) + ( 11 - j ) < ( LIST_STR_LEN - 1 ) ) |
200 |
format( tmplist, LIST_STR_LEN-10, "%s%s^n", tmplist, tmpstr ) |
format( tmplist, LIST_STR_LEN - 10, "%s%s^n", tmplist, tmpstr ); |
201 |
else |
else |
202 |
{ |
{ |
203 |
format( tmplist, LIST_STR_LEN, "%s...^n", tmplist ) |
format( tmplist, LIST_STR_LEN, "%s...^n", tmplist ); |
204 |
break |
break; |
205 |
} |
} |
206 |
} |
} |
207 |
if( count < 10 ) |
if( count < 10 ) |
208 |
format( tmplist, LIST_STR_LEN, |
format( tmplist, LIST_STR_LEN, |
209 |
"%s^n^n^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^tSpecInfo v%s^n", |
"%s^n^n^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^tSpecInfo v%s^n", |
210 |
tmplist, VERSION |
tmplist, VERSION |
211 |
) |
); |
212 |
for( j+=0; j<10; j++ ) |
for( j+=0; j<10; j++ ) |
213 |
format( tmplist, LIST_STR_LEN, "%s%s", tmplist, "^n" ) |
format( tmplist, LIST_STR_LEN, "%s%s", tmplist, "^n" ); |
214 |
list_string[i] = tmplist |
list_string[i] = tmplist; |
215 |
} |
} |
216 |
} |
} |
217 |
get_players( players, num, "ch" ) |
get_players( players, num, "ch" ); |
218 |
for( i=0; i<num; i++ ) clmsg( players[i] ) |
for( i=0; i<num; i++ ) clmsg( players[i] ); |
219 |
} |
} |
220 |
return PLUGIN_HANDLED |
return PLUGIN_HANDLED; |
221 |
} |
} |
222 |
|
|
223 |
public keys_update( ) |
public keys_update( ) |
224 |
{ |
{ |
225 |
if( !get_pcvar_num( p_enabled ) && !get_pcvar_num( p_keys_enabled ) ) return |
if( !get_pcvar_num( p_enabled ) && !get_pcvar_num( p_keys_enabled ) ) return; |
226 |
|
|
227 |
new players[32], num, id, i |
new players[32], num, id, i; |
228 |
get_players( players, num, "a" ) |
get_players( players, num, "a" ); |
229 |
for( i = 0; i < num; i++ ) |
for( i = 0; i < num; i++ ) |
230 |
{ |
{ |
231 |
id = players[i] |
id = players[i]; |
232 |
formatex( keys_string[id], KEYS_STR_LEN, " ^n^t^t%s^t^t^t%s^n^t%s %s %s^t^t%s", |
formatex( keys_string[id], KEYS_STR_LEN, " ^n^t^t%s^t^t^t%s^n^t%s %s %s^t^t%s", |
233 |
cl_keys[id] & IN_FORWARD ? "W" : " .", |
cl_keys[id] & IN_FORWARD ? "W" : " .", |
234 |
"%L", |
"%L", |
236 |
cl_keys[id] & IN_BACK ? "S" : ".", |
cl_keys[id] & IN_BACK ? "S" : ".", |
237 |
cl_keys[id] & IN_MOVERIGHT ? "D" : ".", |
cl_keys[id] & IN_MOVERIGHT ? "D" : ".", |
238 |
"%L" |
"%L" |
239 |
) |
); |
240 |
|
|
241 |
//Flags stored in string to fill translation char in clmsg function |
//Flags stored in string to fill translation char in clmsg function |
242 |
keys_string[id][0] = 0 |
keys_string[id][0] = 0; |
243 |
if( cl_keys[id] & IN_JUMP ) keys_string[id][0] |= IN_JUMP |
if( cl_keys[id] & IN_JUMP ) keys_string[id][0] |= IN_JUMP; |
244 |
if( cl_keys[id] & IN_DUCK ) keys_string[id][0] |= IN_DUCK |
if( cl_keys[id] & IN_DUCK ) keys_string[id][0] |= IN_DUCK; |
245 |
|
|
246 |
cl_keys[id] = 0 |
cl_keys[id] = 0; |
247 |
} |
} |
248 |
|
|
249 |
new id2 |
new id2; |
250 |
get_players( players, num, "ch" ) |
get_players( players, num, "ch" ); |
251 |
for( i=0; i<num; i++ ) |
for( i=0; i<num; i++ ) |
252 |
{ |
{ |
253 |
id = players[i] |
id = players[i]; |
254 |
if( is_user_alive( id ) ) |
if( is_user_alive( id ) ) |
255 |
{ |
{ |
256 |
if( cl_prefs[id] & FL_OWNKEYS ) clmsg( id ) |
if( cl_prefs[id] & FL_OWNKEYS ) clmsg( id ); |
257 |
} |
} |
258 |
else |
else |
259 |
{ |
{ |
260 |
id2 = pev( id, pev_iuser2 ) |
id2 = pev( id, pev_iuser2 ); |
261 |
if( cl_prefs[id] & FL_KEYS && id2 && id2 != id ) clmsg( id ) |
if( cl_prefs[id] & FL_KEYS && id2 && id2 != id ) clmsg( id ); |
262 |
} |
} |
263 |
} |
} |
264 |
|
|
268 |
{ |
{ |
269 |
if( get_pcvar_num( p_enabled ) && get_pcvar_num( p_keys_enabled ) ) |
if( get_pcvar_num( p_enabled ) && get_pcvar_num( p_keys_enabled ) ) |
270 |
{ |
{ |
271 |
new players[32], num, id |
new players[32], num, id; |
272 |
get_players( players, num, "a" ) |
get_players( players, num, "a" ); |
273 |
for( new i = 0; i < num; i++ ) |
for( new i = 0; i < num; i++ ) |
274 |
{ |
{ |
275 |
id = players[i] |
id = players[i]; |
276 |
if( get_user_button( id ) & IN_FORWARD ) |
if( get_user_button( id ) & IN_FORWARD ) |
277 |
cl_keys[id] |= IN_FORWARD |
cl_keys[id] |= IN_FORWARD; |
278 |
if( get_user_button( id ) & IN_BACK ) |
if( get_user_button( id ) & IN_BACK ) |
279 |
cl_keys[id] |= IN_BACK |
cl_keys[id] |= IN_BACK; |
280 |
if( get_user_button( id ) & IN_MOVELEFT ) |
if( get_user_button( id ) & IN_MOVELEFT ) |
281 |
cl_keys[id] |= IN_MOVELEFT |
cl_keys[id] |= IN_MOVELEFT; |
282 |
if( get_user_button( id ) & IN_MOVERIGHT ) |
if( get_user_button( id ) & IN_MOVERIGHT ) |
283 |
cl_keys[id] |= IN_MOVERIGHT |
cl_keys[id] |= IN_MOVERIGHT; |
284 |
if( get_user_button( id ) & IN_DUCK ) |
if( get_user_button( id ) & IN_DUCK ) |
285 |
cl_keys[id] |= IN_DUCK |
cl_keys[id] |= IN_DUCK; |
286 |
if( get_user_button( id ) & IN_JUMP ) |
if( get_user_button( id ) & IN_JUMP ) |
287 |
cl_keys[id] |= IN_JUMP |
cl_keys[id] |= IN_JUMP; |
288 |
} |
} |
289 |
} |
} |
290 |
return PLUGIN_CONTINUE |
return PLUGIN_CONTINUE |
292 |
|
|
293 |
public clmsg( id ) |
public clmsg( id ) |
294 |
{ |
{ |
295 |
if( !id ) return |
if( !id ) return; |
296 |
|
|
297 |
new prefs = cl_prefs[id] |
new prefs = cl_prefs[id]; |
298 |
|
|
299 |
new bool:show_own = false |
new bool:show_own = false; |
300 |
if( is_user_alive( id ) && prefs & FL_OWNKEYS ) show_own = true |
if( is_user_alive( id ) && prefs & FL_OWNKEYS ) show_own = true; |
301 |
|
|
302 |
if( is_user_alive( id ) && !show_own ) |
if( is_user_alive( id ) && !show_own ) |
303 |
{ |
{ |
315 |
0.1, /*fade in*/ |
0.1, /*fade in*/ |
316 |
0.1, /*fade out*/ |
0.1, /*fade out*/ |
317 |
3 /*chan*/ |
3 /*chan*/ |
318 |
) |
); |
319 |
show_hudmessage( id, list_string[id], id, "SPECTATING" ) |
show_hudmessage( id, list_string[id], id, "SPECTATING" ); |
320 |
} |
} |
321 |
} |
} |
322 |
else |
else |
323 |
{ |
{ |
324 |
new id2 |
new id2; |
325 |
if( show_own ) id2 = id |
if( show_own ) id2 = id; |
326 |
else id2 = pev( id, pev_iuser2 ) |
else id2 = pev( id, pev_iuser2 ); |
327 |
if( !id2 ) return |
if( !id2 ) return; |
328 |
|
|
329 |
if( prefs & FL_LIST || prefs & FL_KEYS || show_own ) |
if( prefs & FL_LIST || prefs & FL_KEYS || show_own ) |
330 |
{ |
{ |
340 |
0.1, /*fade in*/ |
0.1, /*fade in*/ |
341 |
0.1, /*fade out*/ |
0.1, /*fade out*/ |
342 |
3 /*chan*/ |
3 /*chan*/ |
343 |
) |
); |
344 |
new msg[BOTH_STR_LEN+1] |
new msg[BOTH_STR_LEN + 1]; |
345 |
if( prefs & FL_LIST && get_pcvar_num( p_list_enabled ) && spec_ids[id2][0] ) |
if( prefs & FL_LIST && get_pcvar_num( p_list_enabled ) && spec_ids[id2][0] ) |
346 |
formatex(msg,BOTH_STR_LEN,list_string[id2],id,"SPECTATING") |
formatex(msg,BOTH_STR_LEN,list_string[id2],id,"SPECTATING"); |
347 |
else msg ="^n^n^n^n^n^n^n^n^n^n^n^n" |
else msg ="^n^n^n^n^n^n^n^n^n^n^n^n"; |
348 |
if( get_pcvar_num( p_keys_enabled ) && ( prefs & FL_KEYS || show_own ) ) |
if( get_pcvar_num( p_keys_enabled ) && ( prefs & FL_KEYS || show_own ) ) |
349 |
{ |
{ |
350 |
format( msg, BOTH_STR_LEN, "%s%s", msg, keys_string[id2][1] ) |
format( msg, BOTH_STR_LEN, "%s%s", msg, keys_string[id2][1] ); |
351 |
format( msg, BOTH_STR_LEN, msg, |
format( msg, BOTH_STR_LEN, msg, |
352 |
id, keys_string[id2][0] & IN_JUMP ? "JUMP" : "LAME", |
id, keys_string[id2][0] & IN_JUMP ? "JUMP" : "LAME", |
353 |
id, keys_string[id2][0] & IN_DUCK ? "DUCK" : "LAME" |
id, keys_string[id2][0] & IN_DUCK ? "DUCK" : "LAME" |
354 |
) |
); |
355 |
} |
} |
356 |
show_hudmessage( id, msg ) |
show_hudmessage( id, msg ); |
357 |
} |
} |
358 |
} |
} |
359 |
} |
} |
372 |
0.0, /*fade in*/ |
0.0, /*fade in*/ |
373 |
0.0, /*fade out*/ |
0.0, /*fade out*/ |
374 |
-1 /*chan*/ |
-1 /*chan*/ |
375 |
) |
); |
376 |
} |
} |
377 |
|
|
378 |
public toggle_list( id ) |
public toggle_list( id ) |
379 |
{ |
{ |
380 |
set_hudmsg_flg_notify( ) |
set_hudmsg_flg_notify( ); |
381 |
cl_prefs[id] ^= FL_LIST |
cl_prefs[id] ^= FL_LIST; |
382 |
show_hudmessage( id, "%L", id, cl_prefs[id] & FL_LIST ? "SPEC_LIST_ENABLED" : "SPEC_LIST_DISABLED" ) |
show_hudmessage( id, "%L", id, cl_prefs[id] & FL_LIST ? "SPEC_LIST_ENABLED" : "SPEC_LIST_DISABLED" ); |
383 |
return PLUGIN_HANDLED |
return PLUGIN_HANDLED; |
384 |
} |
} |
385 |
|
|
386 |
public toggle_keys( id ) |
public toggle_keys( id ) |
387 |
{ |
{ |
388 |
set_hudmsg_flg_notify( ) |
set_hudmsg_flg_notify( ); |
389 |
cl_prefs[id] ^= FL_KEYS |
cl_prefs[id] ^= FL_KEYS; |
390 |
show_hudmessage( id, "%L", id, cl_prefs[id] & FL_KEYS ? "SPEC_KEYS_ENABLED" : "SPEC_KEYS_DISABLED" ) |
show_hudmessage( id, "%L", id, cl_prefs[id] & FL_KEYS ? "SPEC_KEYS_ENABLED" : "SPEC_KEYS_DISABLED" ); |
391 |
return PLUGIN_HANDLED |
return PLUGIN_HANDLED; |
392 |
} |
} |
393 |
|
|
394 |
public toggle_ownkeys( id ) |
public toggle_ownkeys( id ) |
395 |
{ |
{ |
396 |
set_hudmsg_flg_notify( ) |
set_hudmsg_flg_notify( ); |
397 |
cl_prefs[id] ^= FL_OWNKEYS |
cl_prefs[id] ^= FL_OWNKEYS; |
398 |
show_hudmessage( id, "%L", id, cl_prefs[id] & FL_OWNKEYS ? "SPEC_OWNKEYS_ENABLED" : "SPEC_OWNKEYS_DISABLED" ) |
show_hudmessage( id, "%L", id, cl_prefs[id] & FL_OWNKEYS ? "SPEC_OWNKEYS_ENABLED" : "SPEC_OWNKEYS_DISABLED" ); |
399 |
return PLUGIN_HANDLED |
return PLUGIN_HANDLED; |
400 |
} |
} |
401 |
|
|
402 |
public toggle_hide( id, level, cid ) |
public toggle_hide( id, level, cid ) |
403 |
{ |
{ |
404 |
if( cmd_access( id, level, cid, 0 ) ) |
if( cmd_access( id, level, cid, 0 ) ) |
405 |
{ |
{ |
406 |
set_hudmsg_flg_notify( ) |
set_hudmsg_flg_notify( ); |
407 |
cl_prefs[id] ^= FL_HIDE |
cl_prefs[id] ^= FL_HIDE; |
408 |
show_hudmessage( id, "%L", id, cl_prefs[id] & FL_HIDE ? "SPEC_HIDE_ENABLED" : "SPEC_HIDE_DISABLED" ) |
show_hudmessage( id, "%L", id, cl_prefs[id] & FL_HIDE ? "SPEC_HIDE_ENABLED" : "SPEC_HIDE_DISABLED" ); |
409 |
} |
} |
410 |
return PLUGIN_HANDLED |
return PLUGIN_HANDLED; |
411 |
} |
} |