]> jfr.im git - irc/gameservirc.git/blob - gameserv/do_reset.cpp
Removed GameServ.suo
[irc/gameservirc.git] / gameserv / do_reset.cpp
1 #include "extern.h"
2 #include "aClient.h"
3 #include "flags.h"
4 #include "options.h"
5 #include "player.h"
6
7 void do_reset(char *u)
8 {
9 char *nick = strtok(NULL, " ");
10 aClient *user;
11 Player *p;
12
13 if (!(user = find(u)))
14 {
15 notice(s_GameServ, u, "Error: aClient not found. Contact a <S admin");
16 log("Error: aClient not found: %s", u);
17 return;
18 }
19 else if (!isAdmin(user))
20 {
21 notice(s_GameServ, u, "You must be a <S admin to use this command!");
22 return;
23 }
24
25 if (!nick)
26 {
27 notice(s_GameServ, u, "SYNTAX: RESET {ALL | NICK}");
28 }
29 else if (stricmp(nick, "ALL") == 0)
30 {
31 notice(s_GameServ, u, "Resetting everyone's stats!");
32 resetall();
33 }
34 else if (!(p = findplayer(nick)))
35 {
36 notice(s_GameServ, u, "Nick %s not found.", nick);
37 }
38 else
39 {
40 notice(s_GameServ, u, "Resetting %s.", p->getName().c_str());
41 reset(p);
42 }
43 }