]>
Commit | Line | Data |
---|---|---|
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 | return CMD_USAGE; | |
12 | ||
13 | if ((victim=getnickbynick(cargv[0]))!=NULL) { | |
14 | controlreply(victim," _ ___,;;;^"); | |
15 | controlreply(victim," ,;( )__, )~\\|"); | |
16 | controlreply(victim," ;; // '--;"); | |
17 | controlreply(victim," ' ;\\ |"); | |
18 | controlreply(sender,"Gave %s a horse.",victim->nick); | |
19 | } else if ((cp=findchannel(cargv[0]))!=NULL) { | |
20 | controlchanmsg(cp," _ ___,;;;^"); | |
21 | controlchanmsg(cp," ,;( )__, )~\\|"); | |
22 | controlchanmsg(cp," ;; // '--;"); | |
23 | controlchanmsg(cp," ' ;\\ |"); | |
24 | controlreply(sender,"Spammed horse in %s.",cp->index->name->content); | |
25 | } else { | |
26 | controlreply(sender,"Can't find %s.",cargv[0]); | |
27 | } | |
28 | ||
29 | return CMD_OK; | |
30 | } | |
31 | ||
32 | void _init() { | |
33 | registercontrolhelpcmd("horse",NO_OPERED,2,ho_horse,"Usage: horse <target>\nSpams a horse at target."); | |
34 | } | |
35 | ||
36 | void _fini() { | |
37 | deregistercontrolcmd("horse",ho_horse); | |
38 | } | |
39 |