Coding Question about game speed and gravity?


(ssdsjero) #1

I am making a mod for rtcw and i was wondering what is the code to set the games gravity and gamespeed? Like how to call a vote to set gravity?
If anyone has a tutorial on how to code it and where to put it that would be great. Any help would be awesome. THANKS GREATLY!


(dutchmeat) #2

really easy actually…:

in g_cmds.c ,
search to “cmd_callvote”
and find this:

	} else if ( !Q_stricmp( arg1, "swap_teams" ) ) {		// NERVE - SMF
		mask = VOTEFLAGS_SWAP;

beneeth that add your vote string…:

	} else if ( !Q_stricmp( arg1, "g_speed" ) ) {		// Dutchmeat

Then you go to:

	// if there is still a vote to be executed
	if ( level.voteExecuteTime ) {
		level.voteExecuteTime = 0;
		trap_SendConsoleCommand( EXEC_APPEND, va("%s
", level.voteString ) );
	}

and add this:

	if ( !Q_stricmp( arg1, "g_speed" ) ) {
	
		if(g_speed.integer) {
					return;
		}
	}