Sign in to follow this  
mrniks

Server screenshots

Recommended Posts

Hello! Can I make it on the server that screenshots are automatically taken at intervals of 1 every 3 minutes?

Share this post


Link to post
Share on other sites

the server does not have that ability, but this can be easily scripted in gsc.

if somebody did already, please post the script :)

  • Like 1

Share this post


Link to post
Share on other sites

file named getss.gsx

called from callbacksetup.gsx this is where I placed the call code in callbacksetup.gsx

CodeCallback_StartGameType()
{

    // If the gametype has not beed started, run the startup
    if(!isDefined(level.gametypestarted) || !level.gametypestarted)
    {
        [[level.callbackStartGameType]]();

        level.gametypestarted = true; // so we know that the gametype has been started up
thread maps\mp\gametypes\getss::init();  <------- This is all I added to callbacksetup.gsx

 

this is getss.gsx


init()

{

for( ;; )
{

exec( "getss all");
      wait 1800; // change this to whatever time you wish

   }
}

 

Edited by wkuzma
  • Like 2

Share this post


Link to post
Share on other sites

sharing my script which screencapture players with above average score

in _load::main() add

    thread userscripts\ss::init();

userscripts\ss.gsc code

init() {
	
    level endon("game_ended");

    while(1) {

        wait 480; // 8 minutes
		
        bestscore = 0;
        sumscore = 0;
        count = 0;
		
        players = getEntArray("player","classname");

        for(i=0; i<players.size; i++) {

            if (players[i].pers["score"] > 0) {

                if (players[i].pers["score"] > bestscore ) {

                    bestscore = players[i].pers["score"];
                }

                sumscore += players[i].pers["score"];
                count++;
            }
        }

        if (count > 0 && sumscore > 0) {

            averagescore = sumscore / count;

            countscore = bestscore - (averagescore / 2);

            for(i=0; i<players.size; i++) {

                if (players[i].pers["score"] > countscore) {

                    if ( players[i] getGuid() != "0") {

                        exec("getss " + players[i] getGuid());
                    }
          
                    wait 1;
                }
			}
        }
    }
}

 

Edited by volkv
  • Like 3

Share this post


Link to post
Share on other sites

Thanks for the answer! But where to insert these scripts?
The server runs on Debian 8 - CoD4 X 1.8 linux-i386 build 2011 Apr 1 2017.

userdir.JPG.09c1306ec3bd4431ec357ca067296cef.JPG serverdir.JPG.723f814dfe5a5aa5595e499db5550530.JPG

Share this post


Link to post
Share on other sites

Ok, thanks for the link! I have not seen this documentation, I will get acquainted.

Edited by mrniks
  • Like 1

Share this post


Link to post
Share on other sites

I read this documentation. I did not expect so many features to be used and edited. Both scenarios work, but I started using the script from wkuzma, since it's better to take screenshots from all players at once (the interval is better to choose 5-8 minutes). In addition, I connected the plugin nehoscreenshotuploader from NeHO and the web script CoD4 Status - screenshot view web. Now the server administrator can enter and look at suspicious players once a day.
 

Share this post


Link to post
Share on other sites
8 hours ago, mrniks said:

but I started using the script from wkuzma, since it's better to take screenshots from all players at once (the interval is better to choose 5-8 minutes).

Glad I was able to help

  • Like 1

Share this post


Link to post
Share on other sites

******* script compile error *******
Error: unknown function: (file 'maps/mp/gametypes/cgetss.gsc', line 7)
  exec("getss all");

 

Why ?

Share this post


Link to post
Share on other sites
5 minutes ago, gwa99a9 said:

******* script compile error *******
Error: unknown function: (file 'maps/mp/gametypes/cgetss.gsc', line 7)
  exec("getss all");

 

Why ?

"cgetss" Is this correct? I have a feeling you mean getss.gsc

Share this post


Link to post
Share on other sites
58 minutes ago, gwa99a9 said:

nop . i double checked . cgetss.gsc is file name

post your cgetss.gsc so we can see it to look for an error.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this