Index  

trap_SendServerCommand

Description

Reliably sends a command string to be interpreted by the given client.

Prototype

    void trap_SendServerCommand(
        int clientNum,
        const char *text
    );

Parameters

Remarks

If clientNum is -1, it will be sent to all clients.
This has the same effect as typing a command in a clients console for evaluation by the server. This includes the commands evaluated in g_cmds.c.
It is usually used as a way of notifying the client of data that otherwise doesn't fit in networks packets or configstrings, e.g. chat texts, scores, player locations, event messages).
Its main use in the Q3 source is to print information to a specific client's console via the "print" command.
Passing -1 as the clientNum sends the command to every client.

Return value

This function has no return value.

See also

Author(s)

Timbo


QuakeIII trap calls reference