This function will return true if the Steam client currently has a live connection to the Steam servers. If it returns false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server being down or busy.
steam_is_user_logged_on();
String
if steam_is_user_logged_on()
{
global.user_id = steam_get_user_account_id();
}
The above code will check to see if the user is logged onto the Steam server and if it stores the user ID in a global variable.