View previous topic :: View next topic |
Author |
Message |
goldenboy

Joined: 05 Sep 2008 Posts: 310 Location: Kiel
|
Posted: Sun Feb 28, 2010 12:08 am Post subject: |
|
|
Oh, I just meant that I should have thought of stuffcmd - hence the facepalm.
I'm thinking to do this inside a trigger, as well as the automatic quickloading on death. Every mod should have this. _________________ ReMakeQuake
The Realm of Blog Magic |
|
Back to top |
|
 |
Scrama

Joined: 28 Aug 2009 Posts: 20 Location: Siberia, Omsk
|
Posted: Mon Mar 01, 2010 5:41 am Post subject: |
|
|
items.qc
Code: | void() key_touch =
{
if (other.classname != "player")
return;
if (other.health <= 0)
return;
if (other.items & self.items)
return;
sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n");
other.items = other.items | self.items;
// Scrama: auto save games on old maps
// rtnc maps should use trigger_autosave
if (!world.frags)
SUB_AutoSave();
sprint (other, "You got the ");
sprint (other, self.netname);
sprint (other,"\n");
activator = other;
SUB_UseTargets(); // fire all targets / killtargets
if (!coop)
remove(self);
}; |
and somewere
Code: | void () SUB_AutoSave =
{
if (coop||deathmatch)
return;
localcmd("save auto\n");
game_autosaved = 1;
} |
client.qc
Code: | void() respawn =
{
if ((intermission_running)&&((coop)||(deathmatch))) // not allowed during intermission
return;
if (coop)
{
// make a copy of the dead body for appearances sake
CopyToBodyQue (self);
// save weapons and ammo
// get the spawn parms as they were at level start
setspawnparms (self);
// respawn
PutClientInServer ();
}
else if (deathmatch)
{
// make a copy of the dead body for appearances sake
CopyToBodyQue (self);
// set default spawn parms
SetNewParms ();
// respawn
PutClientInServer ();
}
else
{ // restart the entire server
if (game_autosaved)
localcmd ("load auto\n");
else
localcmd ("restart\n");
}
}; |
Dr. Shadowborg +1 =) |
|
Back to top |
|
 |
goldenboy

Joined: 05 Sep 2008 Posts: 310 Location: Kiel
|
Posted: Mon Mar 01, 2010 6:13 am Post subject: |
|
|
Thanks.
I'm going to use an autosaving trigger in strategic spots of RMQ Episode 1 - one of its trademarks are "traps", so this will come in handy.  _________________ ReMakeQuake
The Realm of Blog Magic |
|
Back to top |
|
 |
|