server.cfg
and add following lines:
exec @hypnonema/permissions.cfg
start hypnonema
By default only members of group.admin
are allowed to interact with hypnonema.
To permit users to make use of all available functionality make sure to edit the permissions.cfg
file inside the resource directory.
Below is a list of all available permission settings. | Permission | Description |
---|---|---|
hypnonema.screens.edit |
Allow editing existing screens | |
hypnonema.screens.create |
Allow creating screens | |
hypnonema.screens.delete |
Allow deleting screens | |
hypnonema.playback.play |
Allow playing videos | |
hypnonema.playback.resume |
Allow resuming paused videos | |
hypnonema.playback.repeat |
Allow enabling/disabling repeating of videos | |
hypnonema.playback.pause |
Allow pausing videos | |
hypnonema.playback.stop |
Allow stopping videos |
To restrict creating / editing screens to admins only but allow everyone to control the playback use following settings.
add_ace group.admin hypnonema.screens allow
add_ace builtin.everyone hypnonema.playback allow
There is an example map included, just copy the folder hypnonema-map to your resource directory and paste following line into your server.cfg
.
start hypnonema-map
If you want to use your own command just edit the fxmanifest.lua
. Don't add preceding slashes or any special characters.
hypnonema_command_name 'mynewcommand'
exports.hypnonema:play(screenName, url)
exports.hypnonema:pause(screenName)
exports.hypnonema:stop(screenName)
exports.hypnonema:resume(screenName)
exports.hypnonema:repeat(screenName, shouldRepeat)
exports.hypnonema:seek(screenName, time)
local screens = json.decode(exports.hypnonema:getScreenList())
Note: The parameter has to be in JSON format.
local exampleScreen = {
AlwaysOn = false,
DuiBrowserSettings = {
GlobalVolume = 100,
Is3DAudioEnabled = true,
SoundAttenuation = 10,
SoundMaxDistance = 200,
SoundMinDistance = 10,
},
Is3DRendered = true,
Name = "Hypnonema Example Screen",
PositionalSettings = {
PositionX = -1678.949,
PositionY = -928.3431,
PositionZ = 20.6290932,
RotationX = 0,
RotationY = 0,
RotationZ = -140,
ScaleX = 0.969999969,
ScaleY = 0.484999985,
ScaleZ = -0.1,
}
}
exports.hypnonema:createScreen(json.encode(exampleScreen))
Note: The parameter has to be in JSON format
exports.hypnonema:editScreen(jsonScreen)
exports.hypnonema:deleteScreen(screenName)
returns a list containing current player states.
local duiState = json.decode(exports.hypnonema.getDuiState())
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
Please use the fivem-thread for support.