Create Account


call a batch file from a cod4x server

#1

Hi all
using the windows version of COD4X
I would like to know if there is a way to call a batch file from within the server
I know the $exec can call a script is there anyway to call a test.bat file?
what I am looking to do is remove or add the // in the following script via a batch file
called from within the game.
//thread maps\mp\gametypes\_setup::init();

I can make the batch file to do it but do not know how to call it from the server when ever I want.
Reply

#2
(This post was last modified: 01-01-2017, 07:41 AM by c-bin.)

you want to enable or disable execution of specific scripts from within game ?

You can use dvars for that ..

if(getdvarint("enable_script")==1)
thread maps\mp\gametypes\_setup::init();

It will do almost same that '//' does Smile

To enable execution of script, use rcon or use $set command example: $set enable_script 1


#####**connect 139.59.15.22:28960 and feel the difference**####
==== Dont PM me, that will not work Tongue ====

Reply

#3

(12-31-2016, 06:16 PM)wkuzma Wrote: Hi all
using the windows version of COD4X
I would like to know if there is a way to call a batch file from within the server
I know the $exec can call a script is there anyway to call a test.bat file?
what I am looking to do is remove or add the // in the following script via a batch file
called from within the game.
//thread maps\mp\gametypes\_setup::init();

I can make the batch file to do it but do not know how to call it from the server when ever I want.

no i dont think there is not. but the screenshot arrive fun does something similar and you could easily create a console command from it. 
[font=Consolas,]Sys_DoStartProcess(...)[/font]
https://github.com/callofduty4x/CoD4x_Se...hot.c#L172
Reply

#4
(This post was last modified: 01-02-2017, 04:08 AM by wkuzma.)

(01-01-2017, 07:40 AM)c-bin Wrote: you want to enable or disable execution of specific scripts from within game ?

You can use dvars for that ..

if(getdvarint("enable_script")==1)
thread maps\mp\gametypes\_setup::init();

It will do almost same that '//' does Smile

To enable execution of script, use rcon or use $set command     example:  $set enable_script 1

ok I added that to my script and got it to work by using $set enable_script 1 to turn it on and $set Enable_script 0 to turn it off
I just do not know what the rcon command would be to turn the script on or off
could you please post what that rcon command would be.
Reply

#5

Same command ...  
set enable_script 1        through any rcon tool  

Or
 InGame rcon  
/rcon login <rconpassword>      
 /rcon set enable_script 1

Or
Add it in any cfg file and use exec command


#####**connect 139.59.15.22:28960 and feel the difference**####
==== Dont PM me, that will not work Tongue ====

Reply

#6

(01-02-2017, 07:53 AM)c-bin Wrote: Same command ...  
set enable_script 1        through any rcon tool  

Or
 InGame rcon  
/rcon login <rconpassword>      
 /rcon set enable_script 1

Or
Add it in any cfg file and use exec command
Thank you  - it works and does what i was trying to do.
Reply

#7
(This post was last modified: 01-08-2017, 08:08 PM by wkuzma.)

Another question
will enable_script 0 disable all scripts or just the one I enabled as in this thread

if(getdvarint("enable_script")==1)
thread maps\mp\gametypes\_setup::init();
Reply

#8

Here enable_script 0 will disable executing init() function in _setup.gsc file.. ie whatever inside init() function of that script will not be executed


#####**connect 139.59.15.22:28960 and feel the difference**####
==== Dont PM me, that will not work Tongue ====

Reply

#9

(01-02-2017, 03:44 PM)wkuzma Wrote:
(01-02-2017, 07:53 AM)c-bin Wrote: Same command ...  
set enable_script 1        through any rcon tool  

Or
 InGame rcon  
/rcon login <rconpassword>      
 /rcon set enable_script 1

Or
Add it in any cfg file and use exec command
Thank you  - it works and does what i was trying to do.

(01-09-2017, 10:53 AM)c-bin Wrote: Here enable_script 0 will disable executing init() function in _setup.gsc file.. ie whatever inside init() function of that script will not be executed

thank you
Reply






ABOUT US
A client and server modification for Call of Duty: Modern Warfare with the aim to fix bugs and enhance gameplay!