]> jfr.im git - irc/quakenet/newserv.git/blob - horse/horse.c
r592@blue (orig r482): cruicky | 2006-05-04 15:00:58 +0100
[irc/quakenet/newserv.git] / horse / horse.c
1 #include "../control/control.h"
2 #include "../nick/nick.h"
3 #include "../channel/channel.h"
4
5 int ho_horse(void *source, int cargc, char **cargv) {
6 nick *sender=(nick *)source;
7 nick *victim;
8 channel *cp;
9
10 if (cargc<1) {
11 controlreply(sender,"Usage: horse <target>");
12 return CMD_ERROR;
13 }
14
15 if ((victim=getnickbynick(cargv[0]))!=NULL) {
16 controlreply(victim," _ ___,;;;^");
17 controlreply(victim," ,;( )__, )~\\|");
18 controlreply(victim," ;; // '--;");
19 controlreply(victim," ' ;\\ |");
20 controlreply(sender,"Gave %s a horse.",victim->nick);
21 } else if ((cp=findchannel(cargv[0]))!=NULL) {
22 controlchanmsg(cp," _ ___,;;;^");
23 controlchanmsg(cp," ,;( )__, )~\\|");
24 controlchanmsg(cp," ;; // '--;");
25 controlchanmsg(cp," ' ;\\ |");
26 controlreply(sender,"Spammed horse in %s.",cp->index->name->content);
27 } else {
28 controlreply(sender,"Can't find %s.",cargv[0]);
29 }
30
31 return CMD_OK;
32 }
33
34 void _init() {
35 registercontrolcmd("horse",10,2,ho_horse);
36 }
37
38 void _fini() {
39 deregistercontrolcmd("horse",ho_horse);
40 }
41