-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Returns an array of information about what the current user's Steam friends are playing.
Equivalent to what can be seen in Steam Friends UI.
steam_get_friends_game_info();
array of structs
| struct Contents | ||
|---|---|---|
| Key | Type | Description |
| friendId | int64 | The Steam user id |
| gameId | real | The Steam game id |
| lobbyId | int64 | The Steam lobby id (if hosting a lobby that is open for friends to join - otherwise 0) |
| name | string | The friend's user name |
var info_arr = steam_get_friends_game_info();
var info_num = array_length(info_arr);
var _steam_app_id = steam_get_app_id();
for (var i = 0; i < info_num; i++)
{
var info = info_arr[i];
// same game!
if (info.gameId == _steam_app_id)
{
var lobby_id = info.lobbyId;
// has an open lobby!
if (lobby_id != 0)
{
var user_id = info.friendId;
var name = info.name;
// Use steam_lobby_join_id(lobby_id) to join the lobby when asked
}
}
}
The above code will check all you friends to see if anyone of them is playing the same game as you are (steam_get_app_id) and check if they have an open lobbies and if so we can request to join the lobby they are in using steam_lobby_join_id.
YoYoGames 2023