Pause/Unpause feature for custom mod
Pause/Unpause feature for custom mod
What I am trying to do is code something very similar to what OSP has in the way of pauseing/unpausing a game when teams get jacked. Does anyone know where in the source code this feature could be added in? Thanks!
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Re: Pause/Unpause feature for custom mod
sv_paused / cl_paused?
Re: Pause/Unpause feature for custom mod
Well I'm only able to work with sourc/cgame, source/game/ source/ui, and source/q3_ui in my mod.
Re: Pause/Unpause feature for custom mod
I've created a pause/unpause command for RTCW,
http://www.s4ndmod.com/phpBB2/viewtopic.php?t=1144
You might want to check who can or can't use the pause command. Or just make it a servercommand.
http://www.s4ndmod.com/phpBB2/viewtopic.php?t=1144
You might want to check who can or can't use the pause command. Or just make it a servercommand.
-----------
Wolfenstein: Vampire;
[url]http://www.splashdamage.com/forums/showthread.php?t=16833[/url]
Wolfenstein: Vampire;
[url]http://www.splashdamage.com/forums/showthread.php?t=16833[/url]
Re: Pause/Unpause feature for custom mod
Yes, I am looking to code this for admin's only. This looks like some good stuff dutchmeat. I think I can work with this...
Re: Pause/Unpause feature for custom mod
Any idea how/if I can add in the sound that is made in OSP when the game is paused?
Re: Pause/Unpause feature for custom mod
Ok, I am coming across some errors I need help with. I am thinking the last two might be RTCW specific?!
g_cmds.c: In function UnPauseGame: 'G_ExplodeMissle' undeclared (first use in this function)
g_cmds.c: structure has no member named 'effect1Time'
g_cmds.c: structure has no member named 'frozen'
Any help would really be appreciated!
g_cmds.c: In function UnPauseGame: 'G_ExplodeMissle' undeclared (first use in this function)
g_cmds.c: structure has no member named 'effect1Time'
g_cmds.c: structure has no member named 'frozen'
Any help would really be appreciated!
Re: Pause/Unpause feature for custom mod
scroll down at the topic, and you'll find myself correcting the code.
as for:
g_cmds.c: structure has no member named 'effect1Time'
remove:
grenades->s.effect1Time = level.time;
and before the UnPause function, add this:
extern void G_ExplodeMissile (gentity_t *ent);
as for:
g_cmds.c: structure has no member named 'effect1Time'
remove:
grenades->s.effect1Time = level.time;
and before the UnPause function, add this:
extern void G_ExplodeMissile (gentity_t *ent);
-----------
Wolfenstein: Vampire;
[url]http://www.splashdamage.com/forums/showthread.php?t=16833[/url]
Wolfenstein: Vampire;
[url]http://www.splashdamage.com/forums/showthread.php?t=16833[/url]
Re: Pause/Unpause feature for custom mod
Ok that fixed those errors, however I am still getting this one:
g_cmds.c: structure has no member named 'frozen'
g_cmds.c: structure has no member named 'frozen'
Re: Pause/Unpause feature for custom mod
Leftover from a freezetag gameplay, remove these lines:
if (who->client)
who->client->sess.frozen = 0;
if (who->client)
who->client->sess.frozen = 0;
-----------
Wolfenstein: Vampire;
[url]http://www.splashdamage.com/forums/showthread.php?t=16833[/url]
Wolfenstein: Vampire;
[url]http://www.splashdamage.com/forums/showthread.php?t=16833[/url]
Re: Pause/Unpause feature for custom mod
Ok, I will give that a try when I get off work.
To pause/unpause the game with your code would you just issue rcon Pause to pause and rcon UnPause to unpause?
To pause/unpause the game with your code would you just issue rcon Pause to pause and rcon UnPause to unpause?
Re: Pause/Unpause feature for custom mod
nexus024 wrote:Ok, I will give that a try when I get off work.
To pause/unpause the game with your code would you just issue rcon Pause to pause and rcon UnPause to unpause?
Well if you don't want just about anyone who knows the command to pause the game it would make sense to make it a server only command.
Last edited by jkoder on Sat Jul 19, 2008 9:59 am, edited 1 time in total.
Re: Pause/Unpause feature for custom mod
Ok, I'm now getting g_active.c:850 structure has no member named 'paused'
I added this line in g_local.h thinking it might fix the problem but it didn't...
int paused;
Any ideas?
I added this line in g_local.h thinking it might fix the problem but it didn't...
int paused;
Any ideas?
Re: Pause/Unpause feature for custom mod
Ok, I managed to figure it out... next is getting sound. 

Re: Pause/Unpause feature for custom mod
Thanks for all your help guys... I was able to get the feature added with the sounds!
One more question though... What I would like to do is when the unpause cmd is called for the game to broadcast to everyone:
"Prepare to fight!"
"Three"
"Two"
"One"
"Fight!"
I was able to code it in for the sounds, however the problem is that I don't know how to code in a delay between playing each sound. As it stands now, it plays all the sounds almost simultaneously which isn't any good. Any suggestions?
One more question though... What I would like to do is when the unpause cmd is called for the game to broadcast to everyone:
"Prepare to fight!"
"Three"
"Two"
"One"
"Fight!"
I was able to code it in for the sounds, however the problem is that I don't know how to code in a delay between playing each sound. As it stands now, it plays all the sounds almost simultaneously which isn't any good. Any suggestions?
Re: Pause/Unpause feature for custom mod
Hi,
If you take a look at how the warm up is implemented in cgame/cg_draw that should put you on the right
track. Take a look specifically at the method "static void CG_DrawWarmup( void )". Another useful function
for timed tasks is in game/g_active called ClientTimerActions. The comment states "Actions that happen once a second".
If you take a look at how the warm up is implemented in cgame/cg_draw that should put you on the right
track. Take a look specifically at the method "static void CG_DrawWarmup( void )". Another useful function
for timed tasks is in game/g_active called ClientTimerActions. The comment states "Actions that happen once a second".