xboxlive_user_is_active


描述

With this function you can check whether the given user id is in the list of users currently using the console, and the function will return true if they are, or false otherwise. You can get a User ID pointer with the function xboxlive_get_user()

IMPORTANT! This function is only valid when exporting using the UWP target for the Xbox One and it requires you to have checked the Enable XBox Live option in the UWP Game Options.


语法:

xboxlive_user_is_active(user_id);

参数 描述
user_id The ID pointer of the user to check.


返回:

Boolean(布尔值)


例如:

global.PlayerNum = 0;
global.Player_ID = array_create();
for(var i = 0; i < xboxlive_get_user_count(); ++i;)
    {
    var _uid = xboxlive_get_user(i);
    if xboxlive_user_is_active(_uid)
        {
        global.Player_ID[global.PlayerNum++] = _uid;
        }
    }

The above code loops through the user accounts and then checks to see if any of them are active. If they are, their user ID is added into a global array.