Server Setup Cod4 and Cod4xsetting up a cod4 and cod4x server on WINDOWS ONLY

Help for setting up a server
Post Reply
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 256
Joined: Mon Jan 19, 2004 6:28 pm
Zodiac: Gemini
Contact:

setting up a cod4 and cod4x server on WINDOWS ONLY

Post by Gen Stranger » Tue Jan 23, 2018 4:03 pm

I will start these instructions for a COD4 server only then at the end show how to add cod4x to it!

First you must have cod4 installed with all patches to bring it to version 1.7
you can get the patches here
First you have to install patch 1.6 http://www.4players.de/4players.php/dow ... -Pack.html
then patch 1.7 http://www.4players.de/4players.php/dow ... ch_17.htm
if those links do not work try
http://www.moddb.com/games/call-of-duty ... ll-patches
Once all patches are installed you can now copy all files in your cod4 directory to a new directory (I named mine cod4)
using cod4 as the directory I will continue from here,
in the cod4/main directory create a text file called server.cfg
in server.cfg you will place the following


set sv_hostname "your server name"
sets Administrator "Your Namer"
sets Email "your email"
sets Hosted_By "squad name if you have one" //leave blank if no squad
sets Irc ""
sets Location "USA"
sets Url "your web site if you have one"

set scr_allow_vote "0" //0 no vote 1 if voting allowed
set g_allowvote "0" //0 no vote 1 if voting allowed
set logfile "1"
set g_log "games_mp.log"
set g_logsync "2"
set sv_log_damage "1"


set net_noudp "0"
set sv_maxping "650"
set sv_minping "0"
set sv_minrate "5000"
set sv_maxrate "12000"
set sv_connectTimeout "220"
//set sv_fps "20"
set g_antilag "1"

set rcon_password "your rcon password"
set g_password "" //game password will only allow those that know the password to enter

set sv_maxclients "64"
set sv_reconnectlimit "3"
set sv_allowAnonymous "0"

set sv_allowdownload "1"
seta sv_wwwDownload "0"
seta sv_wwwDlDisconnected "1"

set sv_timeout "100000"
set sv_zombietime "1"
set g_inactivity "100000"
set g_inactivityspectator "100000"

s
set sv_cheats "0"
set sv_pure "1"
set g_no_script_spam "1"
set sv_punkbuster "0"
set sv_floodProtect "1"

set sv_voice "0"
set sv_voiceQuality "1"
set voice_deadChat "0"
set voice_global "0"
set voice_localEcho "0"
set winvoice_mic_mute "1"

set scr_teambalance "1"
set g_allowvote "0"

set scr_hardcore "1"
set scr_oldschool "0"

// Game Types

// SD

set scr_sd_bombtimer 40
set scr_sd_defusetime 4
set scr_sd_multibomb 0
set scr_sd_numlives 1
set scr_sd_planttime 4.5
set scr_sd_playerrespawndelay -1
set scr_sd_roundlimit 0
set scr_sd_roundswitch 5
set scr_sd_scorelimit 12
set scr_sd_timelimit 2

set scr_sd_spectatetype "2"
set scr_sd_waverespawndelay 1
set scr_sd_playerrespawndelay -1

// Deathmatch
set scr_game_allowkillcam 1
set scr_dm_playerrespawndelay -1
set scr_dm_waverespawndelay 1
set scr_dm_scorelimit 300
set scr_dm_timelimit unlimited
set scr_intermission_time 12
set scr_dm_numlives "0"
set scr_dm_spectatetype "2"

// Domination
set scr_dom_scorelimit "200"
set scr_dom_timelimit "12"
set scr_dom_roundlimit "0"
set scr_dom_numlives "0"
set scr_dom_playerrespawndelay "-1"
set scr_dom_waverespawndelay "1"

// Teamdeath Match
set scr_war_scorelimit "1500"
set scr_war_timelimit "15"
set scr_war_roundlimit "0"
set scr_war_numlives "0"
set scr_war_playerrespawndelay "-1"
set scr_war_waverespawndelay "1"


// Sabotoge

set scr_sab_scorelimit "2"
set scr_sab_timelimit "3"
set scr_sab_roundlimit "0"
set scr_sab_roundswitch "1"
set scr_sab_numlives "0"
set scr_sab_bombtimer "40"
set scr_sab_planttime "4"
set scr_sab_defusetime "4"
set scr_sab_hotpotato "0"
set scr_sab_playerrespawndelay "-1"
set scr_sab_waverespawndelay "1"

// King of the Hill

set scr_koth_scorelimit "0"
set scr_koth_timelimit "6"
set scr_koth_roundlimit "0"
set scr_koth_roundswitch "1"
set scr_koth_numlives "0"
set scr_koth_playerrespawndelay "-1"
set scr_koth_waverespawndelay "1"
set koth_autodestroytime "30"
set koth_spawntime "0"
set koth_kothmode "0"
set koth_capturetime "20"
set koth_destroytime "10"
set koth_delayPlayer "0"
set koth_spawnDelay "30"

// "dm" - free for all deathmatch
// "dom" - domination
// "koth" - headquarters
// "sab" - sabotage
// "sd" - search & destroy
// "war" - team deathmatch

set g_gametype "dm"

set sv_mapRotation "gametype dm map mp_crash_snow gametype dm map mp_vacant gametype dm map mp_broadcast gametype dm map mp_shipment gametype dm map mp_convoy gametype dm map mp_showdown gametype dm map mp_pipeline gametype dm map mp_backlot gametype dm map mp_killhouse gametype dm map mp_carentan gametype dm map mp_strike gametype dm map mp_showdown gametype dm map mp_citystreets gametype dm map mp_broadcast gametype dm map mp_killhouse gametype dm map mp_bloc gametype dm map mp_backlot"
// add maps from zone listed as mp_mapname if not listed above
Gen Stranger
Stranger-KAB

User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 256
Joined: Mon Jan 19, 2004 6:28 pm
Zodiac: Gemini
Contact:

Re: setting up a cod4 and cod4x server

Post by Gen Stranger » Tue Jan 23, 2018 4:33 pm

Ok since that is all set up we need a way to call the server. (we will get to cod4x later)
make a shortcut on your desktop and point it to cod4 "C:\cod4\iw3mp.exe"
save the shortcut naming it cod4 server
click on that shortcut just to make sure cod4 runs up (not a sever)- if it does you did all right if not check the directories in the shortcut
now click on the properties for the shortcut and add the following to the first line +set dedicated 1 +exec server.cfg +map_rotate
making the first line "C:\cod4\iw3mp.exe +set dedicated 1 +exec server.cfg +map_rotate"
save the shortcut and click on it and your server window should run up if all went well
Gen Stranger
Stranger-KAB

User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 256
Joined: Mon Jan 19, 2004 6:28 pm
Zodiac: Gemini
Contact:

Re: setting up a cod4 and cod4x server on WINDOWS ONLY

Post by Gen Stranger » Tue Jan 23, 2018 4:53 pm

Ok the server works but what about running mods and or custom maps?
That is slightly different then what you now have as a server

First you cannot run usermaps without a mod!!!!!!
some mods and usermaps are quite large and without a redirect to a faster download it would not be worth while to run mods or usermaps

Lets start by running a mod - each mod comes with its own server.cfg file allowing you to adjust the mod to your liking.
you have to edit the config file that comes with the mod to get the server the way you want.

To set up a redirect you must have a fast download place to store the mods and usermaps
after you upload you mod and usermaps to the fast downloads you must tell cod4 where they are
you do this in the server.cfg file that you made or the one that comes with a mod by editing or adding the following lines

// Client Download Settings. (0=off/1=on) Used for MODs and custom maps
// See included Quick Setup Guide for instructions.
set sv_allowDownload "1"
set sv_wwwDownload "1"
set sv_wwwDlDisconnected "0"
/// URL to a redirect server for fast downloads, if you have one
set sv_wwwBaseURL "http://your fastdownload site"

now we add the command to the start u line
this is the command +set fs_game mods/your mod name
so now the command line looks like this
"C:\cod4\iw3mp.exe +set dedicated 1+set fs_game mods/your mod name +exec server.cfg +map_rotate"
lets say the mod name is modernpaintball making the line look look this
"C:\cod4\iw3mp.exe +set dedicated 1+set fs_game mods/modernpaintball +exec server.cfg +map_rotate"
That alone will not run and give an error since we have not added the mod to cod4 yet
In the cod4 directory you should have a directory called mods if its not there create one while your at it also make a directory called usermaps we will use that later
so now your cod4 directory should look like this
c:\cod4
c:\cod4\main
c:\cod4\mods
c:\cod4\players if you created a player
c:\cod4\usermaps
c:\cod4\zone
under c:\cod4 should be iw3mp.exe and a bunch of other files
there may be other files and directories in there but what is listed is the main ones needed to run a server
DO NOT DELETE the other files or directories

ok we now have the mods directory so we have to make a directory in the mods directory called modernpaintball
so it will look like this c"\cod4\mods\modernpaintball
in the modernpaintball directory we will put all the paintball mod files
mine consists of the following
auth.cfg
server.cfg (the one you made) note the server.cfg is now in the mod directory and the games_mp.log will also be made in that diecxctory
mod.ff
z_modernpaintball.iwd
modernpaintball.cfg

open modernpaintball.cfg and adjust it as you wish it to run oe just lesve all at the defaults
open server,cfg and add this line to the bottom of the file.
exec modernpaintball.cfg
that will allow the setting to merge with server.cfg when you start the server

not for the redirect you only want to upload the mod.ff and z_modernpaintball.iwd files keeping the same format in directories
so on the redirect it will be
mods\modermpaintball
and the two files in the modernpaintball directory on the redirect
if all went well you can now click on the shortcut and have a paintball server running
Gen Stranger
Stranger-KAB

User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 256
Joined: Mon Jan 19, 2004 6:28 pm
Zodiac: Gemini
Contact:

Re: setting up a cod4 and cod4x server on WINDOWS ONLY

Post by Gen Stranger » Wed Jan 24, 2018 4:54 pm

wow all that just to run a mod lets now add a custom map to it.
you may already have some custom maps in you main cod4 (the one you play in the games with)
most maps you will want to run will be downloaded from sites that have them available for download or ones in you play cod4 under usersmaps

I will start with just showing how to install them and run a custom map
lets use mp_kh1 as an example a map I run on my server
first map a director in the c:\cod4\usermaps directory called mp_kh1
in that directory you will put all the map files for mp_kh1
so it now looks like
C;\cod4\usermaps\mp_kh1
and in mp_kh1 will be
mp_kh1.ff
mp_kh1.iwd
mp_kh1_load.ff
upload the map to your redirect using the same format of usermaps\mp_kh1

now add the map to server.cfg the section that controls the maps
set sv_mapRotation "gametype dm map mp_crash_snow gametype dm map mp_vacant gametype dm map mp_broadcast gametype dm map mp_shipment gametype dm map mp_convoy gametype dm map mp_showdown gametype dm map mp_pipeline gametype dm map mp_backlot gametype dm map mp_killhouse gametype dm map mp_carentan gametype dm map mp_strike gametype dm map mp_showdown gametype dm map mp_citystreets gametype dm map mp_broadcast gametype dm map mp_killhouse gametype dm map mp_bloc gametype dm map mp_backlot"

add gametype dm map mp_kh1 to the end of the line like so

set sv_mapRotation "gametype dm map mp_crash_snow gametype dm map mp_vacant gametype dm map mp_broadcast gametype dm map mp_shipment gametype dm map mp_convoy gametype dm map mp_showdown gametype dm map mp_pipeline gametype dm map mp_backlot gametype dm map mp_killhouse gametype dm map mp_carentan gametype dm map mp_strike gametype dm map mp_showdown gametype dm map mp_citystreets gametype dm map mp_broadcast gametype dm map mp_killhouse gametype dm map mp_bloc gametype dm map mp_backlot gametype dm map mp_kh1"
now after backlot runs it will load your custom map of kh1

you have to do the same for all custom maps you wish to run


you can do all I posted without a redirect but when someone joins it may take forever to download the map and custom map
Gen Stranger
Stranger-KAB

User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 256
Joined: Mon Jan 19, 2004 6:28 pm
Zodiac: Gemini
Contact:

Re: setting up a cod4 and cod4x server on WINDOWS ONLY

Post by Gen Stranger » Wed Jan 24, 2018 5:08 pm

ok we now have a running server with mods and custom maps or just a plan server if you do not want to run mods and custom maps
how do we update it to run cod4x?
first go to https://cod4x.me/
and download the cod4x server files
extract the zip file then copy all files to c:\cod4

you will now have to change your startup shortcut for which server you are running mods or no mods
you will change iw3mp.exe to cod4x18_dedrun.exe
save the shortcut
startup the server and it will create the files needed and start running a server
but our not done yet
shut down the server because we are now going to add a new command to the server.cfg file to allow bans to work
you will add
loadplugin simplebanlist
to the end of the file this will allow bans to be made and be permanent without that command
if you ban someone they will be able to come right back in the server.
if ll went well you should have a cod4x server now running when you click the shortcut.
if not double check all the steps I listed
Gen Stranger
Stranger-KAB

User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 256
Joined: Mon Jan 19, 2004 6:28 pm
Zodiac: Gemini
Contact:

Re: setting up a cod4 and cod4x server on WINDOWS ONLY

Post by Gen Stranger » Sat Feb 03, 2018 12:30 pm

Ok now about bans in cod4x you must add this to you server config for bans to work otherwise those banned will be able to come back in.
loadplugin simplebanlist

here is some more reading on cod4x functions
https://github.com/callofduty4x/CoD4x_S ... er-changes
Gen Stranger
Stranger-KAB

User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 256
Joined: Mon Jan 19, 2004 6:28 pm
Zodiac: Gemini
Contact:

Re: setting up a cod4 and cod4x server on WINDOWS ONLY

Post by Gen Stranger » Sat Feb 03, 2018 12:55 pm

Port Forwarding is necessary to have your server to get to the internet
I forward port 28960 to the computer that runs my server
I cannot explain how to do it so here is a link to port forwarding
https://portforward.com/ports.htm

if no one can see your server then you have to tell your router and firewall to allow the port to your server computer
Gen Stranger
Stranger-KAB

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest