leiizko / cod4_new_experience

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server crash when running $fov, $fps or $promod command

halfpastfouram opened this issue · comments

commented

The result is always the same, the server crashes immediately and this is logged:

Jan 06 03:06:08 cod4x start.sh[140896]: Command execution: promod   Invoked by: XXXX   InvokerSteamID: XXXX Power: 1
Jan 06 03:06:08 cod4x start.sh[140896]: Sys_Error: Attempt to call a script added function without a registered callback: maps/mp/gametypes/_callbacksetup::CodeCallback_ScriptCommand
Jan 06 03:06:08 cod4x start.sh[140896]: Maybe you have not used addscriptcommand() like it is supposed to use?

In main_shared/code/scriptcommands.gsx:

init()
{
        addscriptcommand( "fov", 1 );
        addscriptcommand( "fps", 1 );
        addscriptcommand( "promod", 1 );
        addscriptcommand( "shop", 1 );
        addscriptcommand( "stats", 1 );
        addscriptcommand( "emblem", 1 );
        addscriptcommand( "speckeys", 1 );
}

In my server config:

// Allow players to change r_fullbright, cg_fovscale and promod vision setting with script command or via rcon interface ( 1-yes ; 0-no )
set cmd_fov "1"
set cmd_fps "1"
set cmd_promod "1"

// If above CMD_XYZ settings are set to 0 it will default to these ( force players to play at that vision settings )
// If you want to force either FPS or PROMOD it is recommended that you disable both FPS and PROMOD command
// if fs_players / mysql is set to 1, players will start with these settings
set default_fov "2" // 0-2, 2- fovscale 1.25, 1- fovscale 1.125, 0- fovscale 1.0
set default_fps "0" // 1-enable, 0-disable
set default_promod "1" // 1-enable, 0-disable

// Enable rcon commands to change vision settings ( for B3 and other 3rd party admin tools ) ( 1-yes ; 0-no )
set rcon_interface "1"
commented

I managed to resolve this by editing main_shared/maps/mp/gametypes/_callbacksetup.gsx, there in the bottom of the file the function CodeCallback_ScriptCommand was missing for some reason. After copying it from this repository, the server no longer crashes.