Jump to content

[Request] Call an Admin Script


Krankie

Recommended Posts

I'm looking for a script to "contact an admin"

 

General idea is that if someone types /calladmin [Reason] in chat or similar it will send an email or some form of message, to all the registered admins.

Even if it just called a script on the server, ie a batch file like you can with BEC, that would be amazing.

 

It would be good if a player could only call it every 20 mins or something to stop abuse, would also be good if along with the reason it sent the player name and their guid etc.

 

Just stops a server feeling empty when admins can't be online.

 

Any ideas would be greatly appreciated.

 

Krankie

Link to comment
Share on other sites

some rcon tools highlights chat red when your name (configurable) or "admin" is mentioned. For email, that would require new DLL server side. I can hardly imagine anyone would just go out and make it for you tho. But it's an interesting idea.

Link to comment
Share on other sites

  • 4 weeks later...

Just in case anyone ever comes across this I managed to pull this off with BEC.

I went through a few iterations of how to pull this off, first of all I had a log monitor constantly looking for !calladmin in chat logs. That was clunky as all hell, so I settled on a BEC custom command.

BEC lets you set custom commands, I just created one called !calladmin and had it run a quick script.
External BEC commands ALWAYS push through the rcon player id (win!) to the script it executes.

The script BEC executes then pulls the BEGUID and player name for that player by using rcon to connect and query which user that is related to the player name and ID pushed from the BEC command.

After that the script then uses cURL to post data to a php script on my webserver which runs a few checks (see if someone is just trying to spam call an admin etc) and then emails admins + posts it to a little portal I made to keep track of requests.

You could simply just make it send an email to an admin by using a vbs script (this is what I did first).

 

Just a couple of notes to anyone who decides to go this route.

1) BEC commands can only be executed if there is more than 1 person in the server.

2) BEC Commands are channel sensitive. IE they won't execute in direct chat unless there's someone near you, group chat unless there's >1 person in blufor, vehicle unless you're in a vehicle with >1 person and sie chat unless there is >1 person online.

3) the custom BEC command you create has to have a group of 100, this makes it executable by anyone.

If anyone can think of a better way to execute an external script the way BEC does when !calladmin is put in any chat I'd be really interested to hear it.

 

Link to comment
Share on other sites

@kimzer - It's not really in any state to be shared, but once it's polished enough to share I will do. Currently the pulling of names using bercon is flakey.

@axeman - Yea, it logs to a DB as I said and the script checks the db to see when the last time that be-guid logged something was. 5 mins is the current limit to stop spam. It emails a distribution group every time it logs something which isn't too bad.

This overall cuts down on the amount of baby sitting we have to do on the server and makes us more available for people.
If people abuse it then they'll get a 24 hour ban. I was even considering having a system where by there is no "cooldown" to start with but if you spam the system (say 5 tickets in 10 mins) then you'd get kicked, following that it would be a hour ban, 24 hour ban then perma ban.

It's still early stages, I just wish BEC sent more information to external script as using bercon to pull stuff from game is really flakey.

Link to comment
Share on other sites

Personally I'd prefer sqf to dll / callExtension as it would be more portable, not reliant on BEC or a specific database setup. It would need to be open source as most people won't install a dll onto their server without first knowing exactly what it is doing.

How you would capture the chat text in game is not something I have tried before. That could be got around by creating your own GUI for the admin message, a timer could be worked out in game to stop spamming.

Certainly a good idea, I could see it being popular.

Link to comment
Share on other sites

I've done it this way around as I know close to nothing about SQF.

I'd be happy to partner with someone who could write the SQF in game end and I'd write the back end for managing and emailing.

Edit:

Also there are no DLLs to install. If you've got battleye and BEC then this is just a change to BEC and a VB Script currently.

Edited by Krankie
additional information
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...