eq2emu/docs/lua_functions/SendUpdateDefaultCommand.md

20 lines
797 B
Markdown
Raw Permalink Normal View History

### Function: SendUpdateDefaultCommand(Spawn, Distance, CommandString, Player)
2025-05-04 14:34:15 -04:00
**Description:**
Updates the default highlighted command for an entity, as seen on hover or target window. This is often used after changing accessible commands to ensure the correct default action (usually the first allowed command) is highlighted.
2025-05-04 14:34:15 -04:00
**Parameters:**
- `Spawn`: Spawn The entity to update.
- `Distance`: Float The maximum distance the command can be used.
- `CommandString`: String The command to provide access.
- `Player`: Spawn The player whom has access to the command (optional to specify a specific Player).
2025-05-04 14:34:15 -04:00
**Returns:** None.
2025-05-04 14:34:15 -04:00
**Example:**
2025-05-19 13:13:42 -04:00
```lua
2025-05-19 13:13:42 -04:00
-- Example usage (after toggling commands on an NPC, refresh its default action)
SendUpdateDefaultCommand(NPC, 10.0, "hail")
```