# SProfile

**成员** 3

|      |                                             |                                                                                             |
| ---- | ------------------------------------------- | ------------------------------------------------------------------------------------------- |
| 函数 | [Authorize](#authorize)                     | Requests access to profile functions, must be called prior to attempting to access profile. |
| 函数 | [LoadProfile](#loadprofile)                 | Load the profile of player                                                                  |
| 属性 | [ActivePlayerProfile](#activeplayerprofile) | –                                                                                           |

## 函数

### Authorize

void Authorize(Closure onAuthorized = null, Closure onRejected = null)

void Authorize(Action onAuthorized = null, Action onRejected = null)

Requests access to profile functions, must be called prior to attempting to access profile. As soon as the player has accepted the request, the Authorized attribute will be 'true'.

参数

| 名称         | 类型    | 默认值 |
| ------------ | ------- | ------ |
| onAuthorized | Closure | null   |
| onRejected   | Closure | null   |
| onAuthorized | Action  | null   |
| onRejected   | Action  | null   |

返回值

`void`

示例

**Lua**

```lua
Space.Profile.Authorize()
--or
Space.Profile.Authorize(AnOnAuthorizeFunction)
--or
Space.Profile.Authorize(AnOnAuthorizeFunction, AnOnRejectedFuncton)

```

### LoadProfile

void LoadProfile(Closure onFinished)

Load the profile of player

参数

| 参数       | 类型              | 说明                                                                                                                                      |
| ---------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| onFinished | Callback Function | onFinished([SUserProfile](/docs/zh-Hans/scripting/client-scripting-api-reference/types/suserprofile.md)) is called once profile is loaded |

返回值

`void`

示例

**Lua**

```lua
function onFinished(SUserProfile)
--
end
Space.Profile.LoadProfile(onFinished)


```

## 属性

### ActivePlayerProfile

[SUserProfile](/docs/zh-Hans/scripting/client-scripting-api-reference/types/suserprofile.md) ActivePlayerProfile {get; }

示例

Lua

```text
Space.Profile.ActivePlayerProfile

```
