eq2emu/docs/lua_functions/GetInfoStructString.md

18 lines
693 B
Markdown
Raw Permalink Normal View History

### Function: GetInfoStructString(spawn, field)
2025-05-04 14:34:15 -04:00
**Description:**
Retrieves a string field from the spawns info data structure. The info struct contains various attributes of a spawn (like name, last name, guild, etc.). FieldName is the identifier of the string field. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for a full list of options.
2025-05-04 14:34:15 -04:00
**Parameters:**
- `spawn` (Spawn) - Spawn object representing `spawn`.
- `field` (string) - String `field`.
2025-05-04 14:34:15 -04:00
**Returns:** String The value of that field, or an empty string if not set.
2025-05-04 14:34:15 -04:00
**Example:**
2025-05-13 22:57:49 -04:00
```lua
2025-05-13 22:57:49 -04:00
-- Example usage (get a player's surname)
local surname = GetInfoStructString(Player, "last_name")
```