[Discussion]: Export driven developer API in monitor script
See original GitHub issueScope
Developer API
Feature Description
Summary Provide a public API for third party resources to trigger methods or fetch useful data within txAdmin.
API Scope
This export API should be limited mainly to txAdmin Game Script related functionality defined in the scripts
folder. No relaying of data should be done through game scripts as a means of communicating with the txAdmin backend.
Possible Concerns
- What limitations should we establish for exposing internal methods & data?
- Should we tie txAdmin player state directly into a state bag, or should we prevent undefined behavior by not allowing for this data to be directly mutated by a user?
This API’s structure and scope is not final and is open to feedback and comments from contributors and users.
Use Case
- Enables implementation of #390 through export calls
- Tie into menu state for correct handling of players (Ex. To check if a player has been frozen by a server moderator before modifying a ped’s state)
We encourage you share any use cases for exports that you may find useful
Additional Info
Proposed Examples:
--- An export returning whether a player has a given txAdmin permission
--- if the player has the 'all_permissions' flag, this function will always
--- return true.
--- @param playerSrc number|string The target player's server ID
--- @param permission string The permission to check against
local function doesPlayerHavePermission(playerSrc, permission)
return PlayerHasTxPermission(playerSrc, permission)
end
exports('doesPlayerHavePermission', doesPlayerHavePermission)
--- Add an announcement using the in-game menu announcement
--- alerts.
--- @param msg string The announcement message to display
local function addAnnouncement(msg)
TriggerClientEvent('txAdmin:receiveAnnounce', -1, msg)
end
exports('addAnnouncement', addAnnouncement)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:55
- Comments:24 (5 by maintainers)
Top Results From Across the Web
Export All Reports, In Bulk, Via PowerShell And API - Orion SDK
I "borrowed" KMSigma's PowerShell script, which exports the device templates, and converted it to export the reports. I take absolutely 0% of the...
Read more >DevOps: REST API Execution Through Bash Shell Scripting
This is the first part of a paper proposing a framework that enables DevOps teams to issue REST API calls via bash shell...
Read more >Discussions API - GitLab Documentation
Discussions are a set of related notes on: Snippets; Issues; Epics; Merge requests; Commits. This includes comments and threads and system notes.
Read more >Monitor Apps Script use in your organization
You can view the actions people take on Apps Script projects with Drive log events reporting in the Admin console. Take the following...
Read more >Monitoring your APIs - Postman Learning Center
Because they run Postman requests and scripts, collection-based monitors can be used to monitor APIs in a variety of ways. Here are some...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sup, so basically what I would need and probably many others too are functions for:
(TriggerServerEvent('txaLogger:DebugMessage', 'Goats are ugly')
Banning a player Would be nice to have for Anticheats to trigger. Therefore, a function would need to contain:
script-label (to identify the resource it's coming from more easily), player, reason
Kicking a player Would be nice to have for Anticheats to trigger too (And similar detection methods, like the ones included in some ESX-based scripts). Therefore, a function would need to contain:
script-label (to identify the resource it's coming from more easily), player, reason
Warn a player Would be nice to have for Anticheats to trigger, in addition it could be useful for people using bad words in the chat or other similar stuff. : Therefore, a function would need to contain:
script-label (to identify the resource it's coming from more easily), player, reason
and the most important function: Sending stuff to the log more easily. A function would need to contain the options:
script-label (to identify the resource it's coming from more easily), player, message, category
Feel free to reply.
Playtime (Both Server & Client Hooks)
I’d love to see something that would allow me to easily get the playtime of a player, both in seconds (if its recorded in such way) and also the displayed date.
An example for a use case would be the following