PlayXIsPermitted(ply, instance)
Called to check whether a user can use PlayX. |
PlayXMediaBegan(instance, handler, uri, start, resumeSupported, lowFramerate, handlerArgs, length)
Called after BeginMedia(). |
PlayXMediaBegin(instance, handler, uri, start, resumeSupported, lowFramerate, handlerArgs, length)
Called on BeginMedia(). |
PlayXMediaEnd(instance)
Called right before media end. |
PlayXMediaEnded(instance)
Called on media end. |
PlayXMediaExpire(instance, media)
Called when a piece of media has finished. |
PlayXMediaOpen(instance, provider, uri, start, forceLowFramerate, useJW, result)
Called when OpenMedia() has been called on an entity. |
PlayXMetadataReceive(instance, existingMedia, data)
Called when metadata is received. |
PlayXRemove(instance)
Called a PlayX entity is being removed. |
PlayXRepeaterSpawnFunction(ply, tr)
Called when a client requests a spawn of a PlayX repeater. |
PlayXRepeaterUse(instance, activator, caller)
Called when a client does use on a PlayX repeater. |
PlayXResolveProvider(provider, uri, useJW)
Called when a provider is being resolved. |
PlayXSelectInstance(ply)
Called when a single main entity (for a provided client if available) is required. |
PlayXShouldAutoSubscribe(ply, instance)
This hook is used to determine whether a user should be automatically subscribed to a player in the event of the user having just joined or in the event of an entity being spawned. |
PlayXSpawnFunction(ply, tr)
Called when a client requests a spawn of a PlayX player. |
PlayXSpawnPlayX(ply, model, repeater, mdl)
Called when a player or repeater is being spawned for a user. |
PlayXSubscribe(instance, ply)
Called when a player is being subscribed to an instance. |
PlayXUnsubscribe(instance, ply)
Called when a player is being unsubscribed from an instance. |
PlayXUse(instance, activator, caller)
Called when a client does use on a PlayX player. |
PlayXIsPermitted(ply, instance)
Called to check whether a user can use PlayX. This is called when requesting media and also when spawning a player. In the case of requesting or closing media, the entity that it is for will be passed. If you want to deny all default control mechanism, use this hook and return false.
Parameters:
ply
- Playerinstance
- PlayX entityReturn value:
- True/false to allow/deny
PlayXMediaBegan(instance, handler, uri, start, resumeSupported, lowFramerate, handlerArgs, length)
Called after BeginMedia().
Parameters:
instance
- PlayX entityhandler
uri
start
resumeSupported
lowFramerate
handlerArgs
- Arguments for the handler, can be nillength
- Length of the media in seconds, can be nil
PlayXMediaBegin(instance, handler, uri, start, resumeSupported, lowFramerate, handlerArgs, length)
Called on BeginMedia().
Parameters:
instance
- PlayX entityhandler
uri
start
resumeSupported
lowFramerate
handlerArgs
- Arguments for the handler, can be nillength
- Length of the media in seconds, can be nilReturn value:
- Nil/true to pass or false to fail
PlayXMediaEnd(instance)
Called right before media end.
Parameters:
instance
- PlayX entityReturn value:
- False to prevent
PlayXMediaEnded(instance)
Called on media end.
Parameters:
instance
- PlayX entity
PlayXMediaExpire(instance, media)
Called when a piece of media has finished. This is only called if the length of the media was provided via the metadata functions.
Parameters:
instance
- PlayX entitymedia
- ENT.Media
PlayXMediaOpen(instance, provider, uri, start, forceLowFramerate, useJW, result)
Called when OpenMedia() has been called on an entity. Remember that BeginMedia() gets called latter, and OpenMedia() can be skipped. This hook can be used to block the media or change it.
Parameters:
instance
- PlayX entityprovider
- Name of provider, leave blank to auto-detecturi
- URI to playstart
- Time to start the video at, in secondsforceLowFramerate
- Force the client side players to play at 1 FPSuseJW
- True to allow the use of the JW player, false for otherwise, nil to default trueresult
- Result resolvedReturn values:
- Nil/true to pass, a table to override result, or false to fail
- Error message in the case of failure
PlayXMetadataReceive(instance, existingMedia, data)
Called when metadata is received. A table can be returned to replace the metadata that has been received.
Parameters:
instance
- PlayX entityexistingMedia
- Untouched Media tabledata
- Received metadata tableReturn value:
- New data table or nil
PlayXRemove(instance)
Called a PlayX entity is being removed.
Parameters:
instance
- PlayX entity
PlayXRepeaterSpawnFunction(ply, tr)
Called when a client requests a spawn of a PlayX repeater. This is called directly when the entity's SpawnFunction hook is called.
Parameters:
ply
- Playertr
- TraceReturn value:
- False to prevent standard behavior
PlayXRepeaterUse(instance, activator, caller)
Called when a client does use on a PlayX repeater. The use type is SIMPLE_USE. Instead of using this hook, you can also override the entity's OnUse hook.
Parameters:
instance
- PlayX repeater entityactivator
- See Gmod wikicaller
- See Gmod wiki
PlayXResolveProvider(provider, uri, useJW)
Called when a provider is being resolved.
Parameters:
provider
uri
useJW
Return value:
- Nil to do nothing, or a provider
PlayXSelectInstance(ply)
Called when a single main entity (for a provided client if available) is required. Since a user is provided (though not necessarily in all cases that call this hook), you can use it to choose the closest PlayX entity that a user has access to. If you have a sandbox-based gamemode and you wanted to allow the PlayX tool menu controls to work, you would have to define this hook. Also, when the bookmarks manager is used (sandbox not required), it goes through the same mechanisms that the tool panel uses, so if you want the bookmark manager to work, you have to define this hook as well. However, the client-side PlayXRequestOpenMedia hook also lets you control this process much earlier on the client, so there you could popup a dialog to select an entity if it's too ambiguous, although you would have to skip the server-side portion of this media request/control process.
Parameters:
ply
- Player or nilReturn value:
- PlayX entity or nil
PlayXShouldAutoSubscribe(ply, instance)
This hook is used to determine whether a user should be automatically subscribed to a player in the event of the user having just joined or in the event of an entity being spawned. By default, everyone will always be automatically subscribed, so this hook should be defined in most cases, possibly returning false all the time to prevent automatic subscription all together.
Parameters:
ply
- Playerinstance
- PlayX entityReturn value:
- False to deny
PlayXSpawnFunction(ply, tr)
Called when a client requests a spawn of a PlayX player. This is called directly when the entity's SpawnFunction hook is called.
Parameters:
ply
- Playertr
- TraceReturn value:
- False to prevent standard behavior
PlayXSpawnPlayX(ply, model, repeater, mdl)
Called when a player or repeater is being spawned for a user. Normally this is called when the entity is spawned via the Entities menu of sandbox gamemodes (which can be intercepted earlier using the SpawnFunction hooks). This hook can be used to allow the spawn, prevent it, or change the position and angle that the player is spawned at.
Parameters:
ply
- Playermodel
repeater
- True if for the repeatermdl
- Model nameReturn values:
- Nil or true to allow, false to deny, vector to change position
- Error message if false, angle if vector was provided as first return
PlayXSubscribe(instance, ply)
Called when a player is being subscribed to an instance. Return false in order to prevent the subscription from happening.
Parameters:
instance
- PlayX entityply
- PlayerReturn value:
- Nil to pass through or false to prevent
PlayXUnsubscribe(instance, ply)
Called when a player is being unsubscribed from an instance. Return false in order to prevent the unsubscription from happening.
Parameters:
instance
- PlayX entityply
- PlayerReturn value:
- Nil to pass or false to prevent
PlayXUse(instance, activator, caller)
Called when a client does use on a PlayX player. The use type is SIMPLE_USE. Instead of using this hook, you can also override the entity's OnUse hook.
Parameters:
instance
- PlayX entityactivator
- See Gmod wikicaller
- See Gmod wiki