1 | // svn://clanwtf.net/repos/ioUrT-server-4.1/code/server/sv_ccmds.c |
---|
2 | |
---|
3 | /* |
---|
4 | ================== |
---|
5 | SV_ConTell_f |
---|
6 | ================== |
---|
7 | */ |
---|
8 | static void SV_ConTell_f(void) { |
---|
9 | char *p; |
---|
10 | char text[1024]; |
---|
11 | client_t *cl; |
---|
12 | |
---|
13 | // make sure server is running |
---|
14 | if ( !com_sv_running->integer ) { |
---|
15 | Com_Printf( "Server is not running.\n" ); |
---|
16 | return; |
---|
17 | } |
---|
18 | |
---|
19 | if ( Cmd_Argc() < 3 ) { |
---|
20 | Com_Printf ("Usage: tell <client number> <text>\n"); |
---|
21 | return; |
---|
22 | } |
---|
23 | |
---|
24 | cl = SV_GetPlayerByNum(); |
---|
25 | if ( !cl ) { |
---|
26 | return; |
---|
27 | } |
---|
28 | |
---|
29 | strcpy (text, "console_tell: "); |
---|
30 | p = Cmd_ArgsFrom(2); |
---|
31 | |
---|
32 | if ( *p == '"' ) { |
---|
33 | p++; |
---|
34 | p[strlen(p)-1] = 0; |
---|
35 | } |
---|
36 | |
---|
37 | strcat(text, p); |
---|
38 | |
---|
39 | SV_SendServerCommand(cl, "chat \"%s\n\"", text); |
---|
40 | } |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | |
---|