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

Scripting ConVar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SoulSteel
Junior Member
Join Date: May 2019
Old 08-31-2019 , 11:11   Scripting ConVar
Reply With Quote #1

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

Last edited by SoulSteel; 08-31-2019 at 11:11.
SoulSteel is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 08-31-2019 , 22:03   Re: Scripting ConVar
Reply With Quote #2

sm_rcon mp_restartgame 1 if you have ADMFLAG_RCON. No plugin needed.
404UserNotFound is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 09-01-2019 , 05:08   Re: Scripting ConVar
Reply With Quote #3

Quote:
Originally Posted by 404UNF View Post
sm_rcon mp_restartgame 1 if you have ADMFLAG_RCON. No plugin needed.
or sm_cvar mp_restartgame 1
__________________
Ilusion9 is offline
qNiGHT
AlliedModders Donor
Join Date: Mar 2019
Location: Romania
Old 09-01-2019 , 07:42   Re: Scripting ConVar
Reply With Quote #4

Quote:
Originally Posted by SoulSteel View Post
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");
}
qNiGHT is offline
I am inevitable
Member
Join Date: May 2019
Location: 0xA6DA34
Old 09-01-2019 , 13:56   Re: Scripting ConVar
Reply With Quote #5

ServerCommand is already sent using rcon, so get rid of sm_rcon.
__________________
I do make plugins upon requests, so hit me up on discord if you're interested: Stefan Milivojevic#5311
I am inevitable is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 09-01-2019 , 20:28   Re: Scripting ConVar
Reply With Quote #6

Quote:
Originally Posted by I am inevitable View Post
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.
404UserNotFound is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 09-02-2019 , 01:44   Re: Scripting ConVar
Reply With Quote #7

Quote:
Originally Posted by 404UNF View Post
-snip-
They were talking about the use of sm_rcon within ServerCommand(), which is always unnecessary.
__________________
ddhoward is offline
Reply


Thread Tools
Display Modes

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 04:15.


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