AddMsgBoardCmd

Category: Interface
Since engine version: 4.9.1.0 GWE

Description

Creates a user-defined messageboard command. This command can be entered by any player using the syntax "/[command]" in the message board. This will execute the defined script. The script can use "%s" to incorporate parameters.

Syntax

int AddMsgBoardCmd (string strCommand, string strScript, int iRestriction);

Parameters

strCommand:
Name of messageboard command
strScript:
Script to be executed
iRestriction:
Defines how the input is treated:
Name Number Description
C4MSGCMDR_Escaped 0 Input is escaped before substituting %s with it.
C4MSGCMDR_Plain 1 Input is substituted for %s without any changes.
C4MSGMCDR_Identifier 2 All characters except [a-z], [A-Z], [0-9], [_], [~], [+], [-] and space are stripped before substituting %s.

Through the /script ingame-command only C4MSGCMDR_Identifier restricted commands are accepted and added.
PeterW, Juni 2003