djcev.com

//

Git Repos / fte_dogmode / qc / triggers / cvarset.qc

Last update to this file was on 2024-06-15 at 19:50.

Show cvarset.qc

//==============================================================================
// trigger_cvarset -- Drake version -- dumptruck_ds
//==============================================================================

//======================================================================
// forward declarations
//======================================================================

#ifdef SSQC
// trigger_cvarset
void() trigger_cvarset_delaythink;
void() trigger_cvarset_use;
// void() trigger_cvarset_touch;
void(entity e) trigger_cvarset_init;
void() trigger_cvarset;
#endif

//------------------------------------------------------------------------------

#ifdef SSQC
/*QUAKED trigger_cvarset (.5 .5 .5) (-8 -8 -8) (8 8 32)
You can set any CVAR on the server with this trigger. Put the CVAR name
in "netname" and put the value in "message". Useful CVAR's are
sv_gravity, sv_friction, fov, and v_idlescale.
*/
//----------------------------------------------------------------------
// class trigger_cvarset: base_trigger
// {
//--------------------------------------------------------------
// was cvarset_delaythink
//--------------------------------------------------------------
void() trigger_cvarset_delaythink =
{
sub_usetargets ();
};

//--------------------------------------------------------------
void() trigger_cvarset_use =
{
local entity check;

cvar_set (self.netname, self.message);
bprint ("\n\n\n\n");

self.classname = "cvar_done";
check = findfloat (world, classtype, CT_PLAYER);
if (!check)
check = find (world, classname, "camera");

check.ideal_yaw = -1;

self.think = trigger_cvarset_delaythink;
self.nextthink = time + 0.02;
};

//--------------------------------------------------------------
// touch wasn't enabled in the original trigger_cvarset -- CEV
//--------------------------------------------------------------
/*
void() trigger_cvarset_touch =
{
if (self.cnt > time || other.health <= 0 ||
other.classtype != CT_PLAYER)
{
return;
}

trigger_cvarset_use ();
};
*/

//--------------------------------------------------------------
void(entity e) trigger_cvarset_init =
{
if (deathmatch || coop)
remove (e);

e.classname = "trigger_cvarset";
e.classtype = CT_TRIGGER_CVARSET;
e.think = sub_null;
e.use = trigger_cvarset_use;
base_trigger_init (e);
};

//--------------------------------------------------------------
void() trigger_cvarset =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

trigger_cvarset_init (self);
};
// };
#endif

Return to the top of this page or return to the overview of this repo.

Log cvarset.qc

Return to the top of this page or return to the overview of this repo.