Raised This Month: $51 Target: $400
 12% 

[CSGO] Set server password


Post New Thread Reply   
 
Thread Tools Display Modes
alienagat
Junior Member
Join Date: Aug 2017
Old 08-30-2017 , 08:56   Re: [CSGO] Set server password
Reply With Quote #11

Wow, thanks i love you so much.

I will try in a few hours after my work
alienagat is offline
alienagat
Junior Member
Join Date: Aug 2017
Old 08-30-2017 , 09:25   Re: [CSGO] Set server password
Reply With Quote #12

Bacardi,

I just test the plugin with players connected on my server, and i don't know how to thank you but it works Perfectly.

You are a genius and you made my day
alienagat is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-30-2017 , 09:48   Re: [CSGO] Set server password
Reply With Quote #13

your welcome.

Not sure but, if you are going to get somekind joinning problem into server...
Add in server.cfg
sv_hibernate_postgame_delay 5

csgo game have much wierd things.
Bacardi is offline
controlsuz123
Member
Join Date: Nov 2009
Old 02-10-2018 , 16:09   Re: [CSGO] Set server password
Reply With Quote #14

Quote:
Originally Posted by Bacardi View Post
CSGO only


Here you go.
This is only server command. It work from cfg file or using sm_rcon or rcon or server console input.
Or can be set up in admin menu custom.

For remove password, same way as sv_password "none"
sm_sv_password "none"

Setting password
sm_sv_password "abcdef"
this change cvar sv_hibernate_postgame_delay to 0 and kick all connected players.
1 second later password has set by given argument.
Also logging kicks and password inputs through sm_sv_password command.


https://www.sourcemod.net/compiler.php

PHP Code:


public void OnPluginStart()
{
    
RegServerCmd("sm_sv_password"sm_sv_password"Set server password");
}

public 
Action sm_sv_password(int args)
{

    if(
args 1)
    {
        
ReplyToCommand(0"Set a password or to remove password use \"none\"");
        return 
Plugin_Handled;
    }

    
char buffer[30];
    
GetCmdArg(1buffersizeof(buffer));

    if(!
StrEqual(buffer"none"false))
    {

        
SetConVarInt(FindConVar("sv_hibernate_postgame_delay"), 0falsefalse); // # of seconds to wait after final client leaves before hibernating.
        //-> Reservation cookie 0:  reason reserved(yes), clients(no), reservationexpires(0.00)

        
for(int i 1<= MaxClientsi++)
        {
            if(
IsClientConnected(i) && !IsFakeClient(i) && !IsClientInKickQueue(i))
            {
                
LogAction(0i"sm_sv_password - kick %L"i);
                
KickClient(i"[SM] The server is cleared from the players to activate the password.");
            }
        }
    }

    
Handle pack;
    
CreateDataTimer(1.0delaypack);
    
WritePackString(packbuffer);
    
ResetPack(pack);
    
    return 
Plugin_Handled;
}

public 
Action delay(Handle timerHandle pack)
{
    
char buffer[30];
    
ReadPackString(packbuffersizeof(buffer));

    
LogMessage("sm_sv_password - setting server password to \"%s\""buffer);

    
SetConVarString(FindConVar("sv_password"), buffer);

hi bacardi, it's doesn't work anymore, could u fix it ...
controlsuz123 is offline
eseklikyapanari
New Member
Join Date: May 2020
Old 05-27-2020 , 09:36   Re: [CSGO] Set server password
Reply With Quote #15

Quote:
Originally Posted by Bacardi View Post
your welcome.

Not sure but, if you are going to get somekind joinning problem into server...
Add in server.cfg
sv_hibernate_postgame_delay 5

csgo game have much wierd things.
could you update these codes?sm_sv_password didnt work.i would appreciate it very much
eseklikyapanari is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode