PlayX
static |
GetHostURL()
Gets the URL of the host file. |
static |
GetInstance(ply)
Gets the player instance entity. |
static |
GetInstances()
Gets a list of instances. |
static |
GetJWURL()
Gets the URL of the JW player. |
static |
GetProvider(id)
Gets a provider by name. |
static |
GetSubscribed(ply)
Gets a list of instances that a player has subscribed to. |
static |
IsPermitted(ply, instance)
Returns whether a player is permitted to use the player. |
static |
IsUsingJW()
Checks whether the JW player is enabled. |
static |
JWPlayerSupportsYouTube()
Returns whether the JW player supports YouTube. |
static |
PlayerExists()
Checks if a player instance exists in the game. |
static |
ResolveProvider(provider, uri, useJW)
Resolves a provider to a handler. |
static |
SendError(ply, err)
Send the PlayXEnd umsg to clients. |
static |
SendSpawnDialog(ply, forRepeater)
Send the PlayXSpawnDialog umsg to a client, telling the client to open the spawn dialog. |
static |
SendUpdateInfo(ply, ver)
Send the PlayXUpdateInfo umsg to a user. |
static |
SpawnForPlayer(ply, model, repeater)
Spawns the player at the location that a player is looking at. |
static |
SubscribeOnly(ply, instance)
Subscribe a user to only one instance. |
static |
UnsubscribeAll(ply)
Unsubscribes a user from all players. |
PlayX.GetHostURL()
Gets the URL of the host file. @return
PlayX.GetInstance(ply)
Gets the player instance entity. When there are multiple instances out, default behavior is to get the closest one to the player (if a player is provided). If no player is provided, the behavior is undefined. A hook named PlayXSelectInstance can be -- defined to return a specific entity. This function may return nil. An error message can be returned to indicate why an instance could not be found.
Parameters:
ply
- Player that can be passed to specify a userReturn values:
- Entity or nil
- Error message (optional)
PlayX.GetInstances()
Gets a list of instances.
Return value:
- List of entities
PlayX.GetJWURL()
Gets the URL of the JW player. @return
PlayX.GetProvider(id)
Gets a provider by name.
Parameters:
id
- ID of providerReturn value:
- Provider function or nil
PlayX.GetSubscribed(ply)
Gets a list of instances that a player has subscribed to.
Parameters:
ply
Return value:
- List of entities
PlayX.IsPermitted(ply, instance)
Returns whether a player is permitted to use the player. The PlayXIsPermitted hook allows this function to be overridden.
Parameters:
ply
- Playerinstance
- Instance to check against (may be nil) @return
PlayX.IsUsingJW()
Checks whether the JW player is enabled.
Return value:
- Whether the JW player is enabled
PlayX.JWPlayerSupportsYouTube()
Returns whether the JW player supports YouTube. @return
PlayX.PlayerExists()
Checks if a player instance exists in the game.
Return value:
- Whether a player exists
PlayX.ResolveProvider(provider, uri, useJW)
Resolves a provider to a handler.
Parameters:
provider
- Name of provider, leave blank to auto-detecturi
- URI to playuseJW
- True to allow the use of the JW player, false for otherwise, nil to default trueReturn values:
- Provider name (detected) or nil
- Result or error message
PlayX.SendError(ply, err)
Send the PlayXEnd umsg to clients. You should not have much of a a reason to call this method.
Parameters:
ply
err
PlayX.SendSpawnDialog(ply, forRepeater)
Send the PlayXSpawnDialog umsg to a client, telling the client to open the spawn dialog.
Parameters:
ply
- Player to send toforRepeater
- True if this is for the repeater
PlayX.SendUpdateInfo(ply, ver)
Send the PlayXUpdateInfo umsg to a user.
Parameters:
ply
ver
PlayX.SpawnForPlayer(ply, model, repeater)
Spawns the player at the location that a player is looking at. This function will check whether there is already a player or not.
Parameters:
ply
- Playermodel
- Model pathrepeater
- Spawn repeaterReturn value:
- Success, and error message
PlayX.SubscribeOnly(ply, instance)
Subscribe a user to only one instance. The user will be unsubscribed from all other players. If the user is already only subscribed to the instance, then nothing will happen.
Parameters:
ply
- Playerinstance
- Instance to subscribe to
PlayX.UnsubscribeAll(ply)
Unsubscribes a user from all players.
Parameters:
ply
- Player