A system administrator may add a permissions check to the SCNP25 script by triggering a client event to indicate the permission checker the script should use. Once triggered, any future codeplug changes will trigger this event, with a callback required to continue with setting the codeplug.
To set the permissions checker, a script must trigger the radioExternal:SetPermissionsHandler event.
Once the SetPermissionsHandler event has been triggered, the script will call the event set with the handler event for any future codeplug change (except for the default codeplug, which may always be accessed by any user)
A sample lua script which utilizes this functionality is included below:
AddEventHandler("scn_permission_check",function(codeplugID,approved)
print("Got permission request")
print("Codeplug ID: ["..codeplugID.."]")
approve = true -- This should be set by checking databases, player identities, etc
if approve then
approved()
end
end)
TriggerEvent("radioExternal:SetPermissionsHandler","scn_permission_check")
When the callback is called, the script will generate a log message indicating Codeplug permissions approved
Server version must be R06.16.0 or higher for this feature.