Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
halfpastfouram opened this issue Jan 6, 2024 · 1 comment
Open

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

halfpastfouram opened this issue Jan 6, 2024 · 1 comment

Comments

@halfpastfouram
Copy link

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"
@halfpastfouram
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant