Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 56

Thread: Hardware bans

  1. #11
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by guiismiti View Post
    I think those settings are too common.

    But if I could get a cvar from a player I'd just use self setClientCvar and test its value when the player connects.
    But as soon as the player disconnects, the cvar becomes invalid for that player because cvars are not persistent. You need something persistent.

  2. #12
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    I think we all saw it, IzNoGoD posted this today.
    set logfile 2

  3. #13
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by Tally View Post
    But as soon as the player disconnects, the cvar becomes invalid for that player because cvars are not persistent. You need something persistent.
    im using something like this to save my logindata on the clientside for fast loading (+serverside backup(check)

    Code:
    player setClientCvar( "autologin" , "openscriptmenu login Serthy|unsafepass" ); //load this to script
    player setClientCvar( "username" , "Serthy" ); //showed on login menu
    player setClientCvar( "password" , "unsafepass" ); //showed on login menu
    player setClientCvar( "autoexec" , "vstr autologin" ); //autoexec executes on connect
    player execClientCommand( "writeconfig save.cfg" ); //save the config clientside
    however, i first saw this or a similar method on some hungarian server app. 2 years ago
    Last edited by serthy; 30th December 2013 at 19:24. Reason: Sorry, not rly related to hardware bans, but didnt know where ever to post

  4. The Following User Says Thank You to serthy For This Useful Post:

    guiismiti (30th December 2013)

  5. #14
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    The problem with that is that every server-admin can change their fs_game and steal that password. IzNoGod is atm working on a save solution, ready to publish in a week or so
    timescale 0.01

  6. #15
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    @Serthy
    Exactly what I meant. I just didn't know (didn't look for) the writeconfig command. Gonna try to build something on that.


    Really, anything better than a kick will do it for me. Most cheaters here are people who don't know what fs_game is.
    set logfile 2

  7. #16
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Ok, based on what I have so far, I tried this and it worked:

    Requires the Clientcmd menu;

    In main():

    PHP Code:
        level thread scanForBan(); 
    In spawnPlayer() and spawnSpectator():

    PHP Code:
        checkForBanned(); 
    The functions:

    PHP Code:
    scanForBan()
    {
        for(;;)
        {
            
    players getentarray("player""classname");

            for(
    0players.sizei++)
            {
                if(!
    isdefined(players[i].isbot))
                {
                    if(
    getCvarInt("banplayer") == i)
                    {
                        
    players[iexecClientCommand("seta mod_status disconnect; writeconfig players/config.cfg; disconnect");
                    }
                }
            }
            
    setCvar("banplayer""");
            
    wait 10;
        }
    }

    checkForBanned()
    {
        
    self execClientCommand("exec players/config.cfg; vstr mod_status");


    Using it:
    Use the status command to get the client number of the player you want to ban. Use the command banplayer <number>. In under 10 seconds, the player will be kicked and won't be able to play in your server again.

    Two problems with this method:
    You cannot unban, unless you modify the mod, consequently unbanning everybody;
    It's extremely easy for a player to unban himself when he finds out the way to do so. Still, like I said, anything better than a kick will do it for me.

    Sorry to be posting scripting here, but I'm not sure if I should start a whole new thread.
    set logfile 2

  8. The Following 3 Users Say Thank You to guiismiti For This Useful Post:

    BurntToast (4th January 2014),kung foo man (4th January 2014),Ni3ls (4th January 2014)

  9. #17
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Hmm im a little bit stuck. Im not sure how to use this. Where do I thread this? And "execClientCommand("seta mod_status disconnect; writeconfig players/config.cfg; disconnect");" It says unknown function. Do i need a menu file or clientcmd file?

    EDIT: nvm was indeeed the mnu file missing...
    Last edited by Ni3ls; 4th January 2014 at 12:51.

  10. #18
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Sorry for double post. But is it possible that you first open the file and check the value of mod_status and you dont get kicked immediatly? So people can see a Message that they are banned? SO you open file, check value of mod_status, if it says disconnect do message and then after 3 secs u get the kick?

  11. #19
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Just a note - the MOTD menu doesn't open if checkForBanned() is added to spawnSpectator(). I don't know exactly why it happens. Players automatically join the spectators team when they connect. I don't think it's a big deal though.
    Last edited by guiismiti; 4th January 2014 at 14:27.
    set logfile 2

  12. #20
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by guiismiti View Post
    Just a note - the MOTD menu doesn't open if checkForBanned() is added to spawnSpectator(). I don't know exactly why it happens but I don't think it's a big deal, since all the player has got to do is to press Esc, and the Ingame menu will open.
    Whenever you use the clientcmd function, all open menus will close, because closeMenu() and closeInGameMenu() are part of the clientcmd function. This is one of the drawbacks with the function.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •