]> icculus.org git repositories - divverent/nexuiz.git/blob - qcsrc/gamec/clientcommands.c
yet another message
[divverent/nexuiz.git] / qcsrc / gamec / clientcommands.c
1 void SV_ParseClientCommand(string s) {
2         tokenize(s);
3         
4         if(cvar("sv_clientcommands")) {
5                 if(argv(0) == "clogin") {
6                         if(self.adminstatus < -5) {
7                                 sprint(self, "Too many unsuccessful tries.\n");                 
8                         } else if(argv(1) == cvar_string("sv_clientcommands_password")) {
9                                 self.adminstatus = 1;
10                                 sprint(self, "You now have remote admin status.\n");
11                         } else {
12                                 sprint(self, "Wrong password.\n");
13                                 self.adminstatus--;
14                                 if(self.adminstatus == 0) 
15                                         sprint(self, "You lost remote admin status.\n");
16                         }
17                 } else if(argv(0) == "ccmd") {
18                         if(self.adminstatus > 0)
19                                 localcmd(strcat(argv(1)," ",argv(2)," ",argv(3)," ",argv(4),"\n"));
20                         else
21                                 sprint(self, "You don't have remote admin status.\n");
22                 } else {
23                         clientcommand(self,s);
24                 }
25                                 
26         } else {
27                 clientcommand(self,s);  
28         }
29 }