AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to send a command to rcon (https://forums.alliedmods.net/showthread.php?t=173657)

KamiN 12-08-2011 14:08

How to send a command to rcon
 
I'v forgot how to send a command to server's console.

For e.g how to send a command sv_gravity 600

cmd_server() something like that?

.Dare Devil. 12-08-2011 14:10

Re: How to send a command to rcon
 
server_cmd("command", "value")

kramesa 12-08-2011 14:12

Re: How to send a command to rcon
 
PHP Code:

server_cmd("sv_gravity 600"


fysiks 12-08-2011 16:18

Re: How to send a command to rcon
 
Quote:

Originally Posted by .Dare Devil. (Post 1609869)
server_cmd("command", "value")

This is not correct. See the funcwiki on how it works. It's similar to format().

kramesa 12-08-2011 20:37

Re: How to send a command to rcon
 
PHP Code:

set_cvar_string("sv_gravity"600


fysiks 12-08-2011 22:34

Re: How to send a command to rcon
 
Quote:

Originally Posted by kramesa (Post 1610020)
PHP Code:

set_cvar_string("sv_gravity"600


You have to use set_cvar_num() or make the 600 into a string. But, yes, if you are changing cvars it's recommended to use p/cvar natives.

Devil259 12-09-2011 04:31

Re: How to send a command to rcon
 
Little example

Code:
new pCvarGravity //init pCvarGravity = get_cvar_pointer( "sv_gravity" ) //function set_pcvar_num( pCvarGravity , 600 )


All times are GMT -4. The time now is 12:05.

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