AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Scripting ConVar (https://forums.alliedmods.net/showthread.php?t=318440)

SoulSteel 08-31-2019 11:11

Scripting ConVar
 
i wanna do a restart game command if someone can help i will be very appreciate

404UserNotFound 08-31-2019 22:03

Re: Scripting ConVar
 
sm_rcon mp_restartgame 1 if you have ADMFLAG_RCON. No plugin needed.

Ilusion9 09-01-2019 05:08

Re: Scripting ConVar
 
Quote:

Originally Posted by 404UNF (Post 2665426)
sm_rcon mp_restartgame 1 if you have ADMFLAG_RCON. No plugin needed.

or sm_cvar mp_restartgame 1

qNiGHT 09-01-2019 07:42

Re: Scripting ConVar
 
Quote:

Originally Posted by SoulSteel (Post 2665385)
i wanna do a restart game command if someone can help i will be very appreciate

simple example
Code:

public void OnPluginStart()
{
        RegAdminCmd("sm_restart", RESTART, ADMFLAG_GENERIC);
}

public Action RESTART(client, args)
{
        ServerCommand("sm_rcon mp_restartgame 1");
}


I am inevitable 09-01-2019 13:56

Re: Scripting ConVar
 
ServerCommand is already sent using rcon, so get rid of sm_rcon.

404UserNotFound 09-01-2019 20:28

Re: Scripting ConVar
 
Quote:

Originally Posted by I am inevitable (Post 2665492)
ServerCommand is already sent using rcon, so get rid of sm_rcon.

You can send it via the console if you're logged into RCON, but if you aren't and don't have access to the RCON password but do have access to the sm_rcon command (lord knows why anyone would have a setup like that), then I would highly suggest using sm_rcon and not sm_cvar.

I use /rcon mp_restartgame 1 all the time on my test server and it does what it says on the tin; restarts the game.

ddhoward 09-02-2019 01:44

Re: Scripting ConVar
 
Quote:

Originally Posted by 404UNF (Post 2665533)
-snip-

They were talking about the use of sm_rcon within ServerCommand(), which is always unnecessary.


All times are GMT -4. The time now is 09:02.

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