Call Of Duty 4 Game Help and MapsSetting up and running a cod4 server

Help for Computer Games and Maps for online games
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Setting up and running a cod4 server

Post by Gen Stranger »

Unless you have a second computer to dedicate as a server or alot of memory on your play computer what I will post will not be wise to do
I have a second computer that I run my servers on and this is the setup on running a server but it will not explain how to add mods or custom maps

step 1. you need a config file to tell the server your server name and some settings.

i named mine knife.cfg in it is

set sv_hostname "^5Your server name"
set scr_motd ""
sets Administrator "your name"
sets Email "your email"
sets Hosted_By "your squad or your name"
sets Irc ""
sets Location "USA"
sets Url "your web site"

set scr_allow_vote "0" //allow vote 0 no 1 yes
set g_allowvote "0"
set logfile "1"
set g_log "games_mp.log"
set g_logsync "2"
set sv_log_damage "1"
//******************************************************************************
// ANTIFLOODING SETTINGS
//******************************************************************************
//set sv_floodProtect "0"
set sv_floodProtect "4"
set sv_reconnectlimit "3"

set sv_minPing "0"
set sv_maxPing "500"

// Have the clients archive data to save bandwidth on the server
set sv_clientarchive "1"

// Extrapolation between client states
// Enable it so that players with bad connections don't 'teleport'
set g_smoothClients "1"

// Enable the antilag routine inside the game engine (use only when players with
// a huge difference in ping values connect to the server).
// It sets g_antilag, but it's a dynamic dvar so you can set it by
// server load (and by gametype or maps too...)
// 0 = Disabled (default), 1 = Enabled
set scr_antilag "1"

// Force this variable upon all clients. Disabled means that clients use their own defined value.
// 0 = Disabled (default), 15-100 = Max packets (stock cod4 value is 30)
// set scr_cl_maxpackets "0"

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"

rcon_password "your rcon password" //rcon password
set sv_privatePassword ""
set g_password ""

set scr_spectatefree "2"

set sv_maxclients "64"
set sv_privateclients "2"
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"

set sv_disableClientConsole "0"
set cl_autocmd "0"

set sv_cheats "0"
set sv_pure "1"
set g_filterban "0"
set g_banips "0"
set g_no_script_spam "1"

set sv_punkbuster "0"

set sv_floodProtect "1"

//set sv_kickBanTime "30" \\ This is temp ban, bans via PB.

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 g_compassShowEnemies "0"

set scr_game_allowkillcam "1"
set scr_game_onlyheadshots "0"
set scr_game_deathpointloss "0"
set scr_game_suicidepointloss "0"
set scr_team_teamkillpointloss "0"
set scr_game_spectatetype "2"
set scr_game_forceuav "0"
set scr_game_hardpoints "1"
set scr_enable_music 0

set scr_hardpoint_allowartillery "0"
set scr_hardpoint_allowuav "1"
set scr_hardpoint_allowhelicopter "1"

set scr_team_fftype "0"
set scr_team_teamkillspawndelay "0"
set scr_team_kickteamkillers "3"

set scr_player_maxhealth "100"
set scr_player_suicidespawndelay "0"
set scr_player_healthregentime "5"
set scr_player_forcerespawn "1"
set scr_player_sprinttime "8"

set scr_hardcore "1"
set scr_oldschool "0"
set ui_hud_obituaries "1"
set ui_hud_showobjicons "1"

// Game Types and score and time limit

// 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 200
set scr_dm_timelimit unlimited //can be set to any time
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"



see next post for step 2
Gen Stranger
Stranger-KAB
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Setting up and running a cod4 server

Post by Gen Stranger »

Step 2
place the config fie in the cod4 main directory (the directory named main)
step 2 make a short cut leading to the iw3mp.exe in the cod4 directory.
edit the short cut target by using properties on the short cut
and place this in the target
"C:\cod4\iw3mp.exe" +set dedicated 2 +exec knife.cfg +map_rotate
note its added after the second " if you do it any other way it will not save the short cut
in the path
"c:\cod4"

use the path of your ccod4 install
if its "c:\program files\activision\call of duty 4 modern warfare"
use that instead of what I wrote

Test you server by clicking the short cut you made the server console window should come up

see next post on ports and fowarding
Gen Stranger
Stranger-KAB
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Setting up and running a cod4 server

Post by Gen Stranger »

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 comnputer
Gen Stranger
Stranger-KAB

cc' Born_2_Win
Registered
Posts: 20
Joined: 17 Sep 2017 15:54
6
Contact:

Re: Setting up and running a cod4 server

Post by cc' Born_2_Win »

thank you bro will try it out now and see if it works... you are probably one of the first persons that is nice enough to really help me
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Setting up and running a cod4 server

Post by Gen Stranger »

cc' Born_2_Win wrote: 17 Sep 2017 15:59 thank you bro will try it out now and see if it works... you are probably one of the first persons that is nice enough to really help me
Thank you - I try to help when I can and it is a shame all server owners are not like that. It took me a long time figuring out getting my servers to do what I wanted them to.
Gen Stranger
Stranger-KAB

cc' Born_2_Win
Registered
Posts: 20
Joined: 17 Sep 2017 15:54
6
Contact:

Re: Setting up and running a cod4 server

Post by cc' Born_2_Win »

I figured out what my real problem was... I gave my friends my LAN IP instead of my internet IP... Typed "my IP" on google and it gave me my internet IP...

So normal hosting of server works now and your way of hosting a server also works :D I can easily host mods through the normal way... but what's the secret of hosting mods your way? haha

PS I got the Manned Helicopter yesterday by knifing 20 people and your server did not crash when I got it... think it only crashes on one of the maps...
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Setting up and running a cod4 server

Post by Gen Stranger »

cc' Born_2_Win wrote: 18 Sep 2017 08:54 I figured out what my real problem was... I gave my friends my LAN IP instead of my internet IP... Typed "my IP" on google and it gave me my internet IP...

So normal hosting of server works now and your way of hosting a server also works :D I can easily host mods through the normal way... but what's the secret of hosting mods your way? haha

PS I got the Manned Helicopter yesterday by knifing 20 people and your server did not crash when I got it... think it only crashes on one of the maps...
that is interesting about only one of the maps.
I will also note to the maker of the new experience about the 20 knifes getting the manned copter
but first I will have to test it to see if its everyone that can get it.
Gen Stranger
Stranger-KAB

cc' Born_2_Win
Registered
Posts: 20
Joined: 17 Sep 2017 15:54
6
Contact:

Re: Setting up and running a cod4 server

Post by cc' Born_2_Win »

My friend can't join my server it says that his CD key is in use? How do you get past this problem? He can join your server but not mine? Other people can join my server but not him...
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Setting up and running a cod4 server

Post by Gen Stranger »

cc' Born_2_Win wrote: 18 Sep 2017 14:41 My friend can't join my server it says that his CD key is in use? How do you get past this problem? He can join your server but not mine? Other people can join my server but not him...
can he join other internet non cod4x servers?
or does he get the cd key in use on them also?
if he does he may be using a hacked key or someone hacked his key

btw how are you running your server did you use the setup I showed you or using the internal start a server in cod4?
Gen Stranger
Stranger-KAB

cc' Born_2_Win
Registered
Posts: 20
Joined: 17 Sep 2017 15:54
6
Contact:

Re: Setting up and running a cod4 server

Post by cc' Born_2_Win »

Gen Stranger wrote: 19 Sep 2017 01:39
cc' Born_2_Win wrote: 18 Sep 2017 14:41 My friend can't join my server it says that his CD key is in use? How do you get past this problem? He can join your server but not mine? Other people can join my server but not him...
can he join other internet non cod4x servers?
or does he get the cd key in use on them also?
if he does he may be using a hacked key or someone hacked his key

btw how are you running your server did you use the setup I showed you or using the internal start a server in cod4?
He can join other servers but some he can't because they say his CD key is in use... he bought the game, but lost the CD key...

I use the internet start a server in COD4 because I don't know how to host mods with the setup you showed me...
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Setting up and running a cod4 server

Post by Gen Stranger »

He can join other servers but some he can't because they say his CD key is in use... he bought the game, but lost the CD key...

I use the internet start a server in COD4 because I don't know how to host mods with the setup you showed me...
Top
Then his key is hacked and someone else uses it or someone gave him a key that they too use.
I can only figure since my server is cod4x and does not depend on the activision main servers to get out
on the internet meaning cod4x has it own master servers I guess that is why he can join my server without the key use error.

I was under the impression that you cannot run mods with the way you are running the server and actually unless you have a lot of memory or another computer to run as
a server as I do it would be best to do it the way you are for a one on one.

The server setup I posted is used to set up a stand alone server that you join (and it can be on the same computer you run the server if you have the memory)
it is not a play and server as in start a server

I will explain how I host mods and custom maps in the next post
Gen Stranger
Stranger-KAB
User avatar

Topic author
Gen Stranger
KAB Administrator
Posts: 363
Joined: 19 Jan 2004 18:28
20
Contact:

Re: Setting up and running a cod4 server

Post by Gen Stranger »

to run custom maps you need to run a mod so I will tell how to run a mod in the way I run a server.
Please understand this is for a stand alone server and not the start a server that comes with cod4

I will use the paintball mod as an example.
In the cod4 directory there should already be a sub directory called mods make a directory called paintball in the mods directory
copy all contents of the paintball mod you have or downloaded from the internet to the paintball directory.
Copy the config file I showed you how to make to the paintball directory.
check to see if there are any other config files (files with cfg as an extension) in the paintball directory if there are edit them as needed
now to make those other config files active add the following line to the config file you made to run the server. lets say its paint.cfg for this example

you would add exec paint.cfg to the config file you made.
if the mod had more then one config file you would add a line for each one in the config file you made

if the name of the config that came with the paintball mod is config.cfg make sure the name of the config I showed you how to make is not named config,cfg
I named my config knife.cfg to avoid over writing a config file

so now to get the mod to run is simple
you have to add to the short cut you made the following +set fs_game mods/paintball
right after the exe in the line
so "C:\cod4\iw3mp.exe" +set dedicated 2 +exec knife.cfg +map_rotate
becomes "C:\cod4\iw3mp.exe" +set fs_game mods/paintball +set dedicated 2 +exec knife.cfg +map_rotate
now you will run a paintball mod when you start the server with the shortcut you made.
later I will post how to run custom maps
Gen Stranger
Stranger-KAB

cc' Born_2_Win
Registered
Posts: 20
Joined: 17 Sep 2017 15:54
6
Contact:

Re: Setting up and running a cod4 server

Post by cc' Born_2_Win »

ok tried to host it but it says fs_game is write protected? but think the problem might be the config file... can you perhaps give me an example of a paintball config file could not find one on the internet or will the same config file work?

cc' Born_2_Win
Registered
Posts: 20
Joined: 17 Sep 2017 15:54
6
Contact:

Re: Setting up and running a cod4 server

Post by cc' Born_2_Win »

Here is the problem... he does not find the cfg file...

fs_game is write protected.
dedicated is read only.
Error: Waited 2303 msec for missing asset "knife.cfg".
Error: couldn't exec knife.cfg

cc' Born_2_Win
Registered
Posts: 20
Joined: 17 Sep 2017 15:54
6
Contact:

Re: Setting up and running a cod4 server

Post by cc' Born_2_Win »

ok figured out that i did not use the correct cfg file.. so now it is reading the config file...
Post Reply