1 | /* |
1 | /* |
2 | * static char *rcsid_c_wiz_c = |
2 | * static char *rcsid_c_wiz_c = |
3 | * "$Id: c_wiz.C,v 1.2 2006/08/24 13:13:49 root Exp $"; |
3 | * "$Id: c_wiz.C,v 1.3 2006/08/29 05:03:55 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
245 | |
245 | |
246 | int command_kick (object *op, char *params) { |
246 | int command_kick (object *op, char *params) { |
247 | struct pl *pl; |
247 | struct pl *pl; |
248 | |
248 | |
249 | for (pl = first_player; pl != NULL; pl = pl->next) |
249 | for (pl = first_player; pl != NULL; pl = pl->next) |
250 | if (params == NULL || !strcmp (pl->ob->name, params)) |
250 | if ((params == NULL || !strcmp (pl->ob->name, params)) |
|
|
251 | && !INVOKE_PLAYER (KICK, pl, ARG_STRING (params))) |
251 | { |
252 | { |
252 | object *op = pl->ob; |
253 | object *op = pl->ob; |
253 | |
254 | |
254 | if (!QUERY_FLAG (op, FLAG_REMOVED) && !QUERY_FLAG (op, FLAG_FREED)) |
255 | if (!QUERY_FLAG (op, FLAG_REMOVED) && !QUERY_FLAG (op, FLAG_FREED)) |
255 | { |
256 | { |
256 | /* Avion : Here we handle the KICK global event */ |
|
|
257 | execute_global_event (EVENT_KICK, op, params); |
|
|
258 | |
|
|
259 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 5, op, |
257 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 5, op, |
260 | "%s is kicked out of the game.", |
258 | "%s is kicked out of the game.", |
261 | op->name); |
259 | op->name); |
262 | strcpy (op->contr->killer, "kicked"); |
260 | strcpy (op->contr->killer, "kicked"); |
263 | } |
261 | } |
… | |
… | |
284 | " overlay."); |
282 | " overlay."); |
285 | |
283 | |
286 | ready_map_name(op->map->path, 0); |
284 | ready_map_name(op->map->path, 0); |
287 | |
285 | |
288 | return 1; |
286 | return 1; |
289 | } |
|
|
290 | |
|
|
291 | /* |
|
|
292 | * A simple toggle for the no_shout field. |
|
|
293 | * AKA the MUZZLE command |
|
|
294 | */ |
|
|
295 | int command_toggle_shout(object *op, char *params) { |
|
|
296 | player *pl; |
|
|
297 | |
|
|
298 | if (!params) { |
|
|
299 | new_draw_info(NDI_UNIQUE, 0, op, "Usage: toggle_shout <player>."); |
|
|
300 | return 1; |
|
|
301 | } |
|
|
302 | |
|
|
303 | pl = get_other_player_from_name(op, params); |
|
|
304 | if (!pl) |
|
|
305 | return 1; |
|
|
306 | |
|
|
307 | if (pl->ob->contr->no_shout == 0) { |
|
|
308 | pl->ob->contr->no_shout = 1; |
|
|
309 | |
|
|
310 | new_draw_info(NDI_UNIQUE|NDI_RED, 0, pl->ob, "You have been muzzled by the DM!"); |
|
|
311 | new_draw_info_format(NDI_UNIQUE, 0, op, "You muzzle %s.", pl->ob->name); |
|
|
312 | |
|
|
313 | /* Avion : Here we handle the MUZZLE global event */ |
|
|
314 | execute_global_event(EVENT_MUZZLE, pl->ob, params); |
|
|
315 | |
|
|
316 | return 1; |
|
|
317 | } else { |
|
|
318 | pl->ob->contr->no_shout = 0; |
|
|
319 | new_draw_info(NDI_UNIQUE|NDI_ORANGE, 0, pl->ob, |
|
|
320 | "You are allowed to shout and chat again."); |
|
|
321 | new_draw_info_format(NDI_UNIQUE, 0, op, |
|
|
322 | "You remove %s's muzzle.", pl->ob->name); |
|
|
323 | return 1; |
|
|
324 | } |
|
|
325 | } |
287 | } |
326 | |
288 | |
327 | int |
289 | int |
328 | command_shutdown (object * op, char *params) |
290 | command_shutdown (object * op, char *params) |
329 | { |
291 | { |