GetPlayerControlAssignment

Category: Player
Since engine version: 1.0 OC

Description

Returns the name of the key, mouse of joystick button assigned to a control for a player. If the player number is invalid, nil is returned. For unassigned or invalid controls, "" is returned.

Syntax

string GetPlayerControlAssignment(int player, int control, bool human_readable, bool short_name);

Parameters

player:
Number of the player for whom the control set is queried.
control:
Control to query. A CON_* constant should be used here.
human_readable:
If true, some internal names such as JOY_* for joystick buttons are replaced by variants suitable for display to the player.
short_name:
If true, short names are preferred if available. Currently effects Mac builds only.

Remark

For network games and replays, the returned value is not synchronized. If the function is called for a remote player or during replay, "" is always returned for valid player numbers.

Example

Message("Press <c ffff00>%s</c> to walk left!", GetPlayerControlAssignment(GetPlayerByIndex(0, C4PT_User), CON_Left, true, true));
Tells the first player how to walk left.
Sven2, 2012-04