示例#1
0
        public static void SV_ConSay_f( )
        {
            client_t client;
            Int32    j;
            String   p;
            String   text;

            if (Cmd.Argc() < 2)
            {
                return;
            }
            text = "console: ";
            p    = Cmd.Args();
            if (p[0] == '"')
            {
                p = p.Substring(1, p.Length - 1);
            }

            text += p;
            for (j = 0; j < SV_MAIN.maxclients.value; j++)
            {
                client = SV_INIT.svs.clients[j];
                if (client.state != Defines.cs_spawned)
                {
                    continue;
                }
                SV_SEND.SV_ClientPrintf(client, Defines.PRINT_CHAT, text + "\\n");
            }
        }
示例#2
0
        public static void PF_cprintf(edict_t ent, int level, string fmt)
        {
            int n = 0;

            if (ent != null)
            {
                n = ent.index;
                if (n < 1 || n > SV_MAIN.maxclients.value)
                {
                    Com.Error(Defines.ERR_DROP, "cprintf to a non-client");
                }
            }

            if (ent != null)
            {
                SV_SEND.SV_ClientPrintf(SV_INIT.svs.clients[n - 1], level, fmt);
            }
            else
            {
                Com.Printf(fmt);
            }
        }
示例#3
0
        public static void SV_Kick_f( )
        {
            if (!SV_INIT.svs.initialized)
            {
                Com.Printf("No server running.\\n");
                return;
            }

            if (Cmd.Argc() != 2)
            {
                Com.Printf("Usage: kick <userid>\\n");
                return;
            }

            if (!SV_SetPlayer())
            {
                return;
            }
            SV_SEND.SV_BroadcastPrintf(Defines.PRINT_HIGH, SV_MAIN.sv_client.name + " was kicked\\n");
            SV_SEND.SV_ClientPrintf(SV_MAIN.sv_client, Defines.PRINT_HIGH, "You were kicked from the game\\n");
            SV_MAIN.SV_DropClient(SV_MAIN.sv_client);
            SV_MAIN.sv_client.lastmessage = SV_INIT.svs.realtime;
        }