Preliminary cmd support. cmd weapon added, with one parameter.

"cmd weapon reload" now reloads your weapon

This is really cool! :D
This commit is contained in:
Finny Merrill 2003-12-09 03:27:26 +00:00
parent 46826ceba3
commit 31fe80774c
5 changed files with 17 additions and 1 deletions

View file

@ -587,6 +587,12 @@ integer (string s) stoi = #113;
vector (string s) stov = #114; vector (string s) stov = #114;
string (vector v) vtos = #27; string (vector v) vtos = #27;
integer () Cmd_Argc = #0;
string (integer i) Cmd_Argv = #0;
string (integer i) Cmd_Args = #0;
integer (string cmd, void() func) Cmd_AddCommand = #0;
integer (string cmd, void() func, integer noredir) SV_AddUserCommand = #0;
//============================================================================ //============================================================================
// //

View file

@ -92,3 +92,5 @@
#define HUNTED_YELLOWTEAM_FACTOR 0.5 // this multiplied to current red players is max for yellow team on huntedr #define HUNTED_YELLOWTEAM_FACTOR 0.5 // this multiplied to current red players is max for yellow team on huntedr
#define SENSOR_MINSPEED 100 // minimum speed someone has to be moving to be picked up by sense. #define SENSOR_MINSPEED 100 // minimum speed someone has to be moving to be picked up by sense.
#define AIRGUN_STRENGTH 300 // strength of airfist (was 1000), same as recoil. #define AIRGUN_STRENGTH 300 // strength of airfist (was 1000), same as recoil.
//#define NO_USER_CMDS // don't use SV_AddUserCommand (QF previous to 2003-12-07 have it broken)
#define NO_AUTORIFLE

View file

@ -75,3 +75,4 @@ ofnents.qc
waypoint.qc waypoint.qc
coop.qc coop.qc
cmds.qc

View file

@ -20,6 +20,9 @@ void() Alias_SetBatch;
//ofN //ofN
void() bprintline; void() bprintline;
//GR
void(entity e) AddCommandAliases;
//========================================================================= //=========================================================================
// HELP FUNCTIONS // HELP FUNCTIONS
//========================================================================= //=========================================================================
@ -366,6 +369,8 @@ void () Alias_SetBatch =
return; return;
} }
AddCommandAliases(self);
self.got_aliases_num = floor (num + 1); self.got_aliases_num = floor (num + 1);
self.got_aliases_time = time + 5; self.got_aliases_time = time + 5;
stuffcmd (self, "impulse " + ftos (TF_ALIASNEXT) + "\n"); stuffcmd (self, "impulse " + ftos (TF_ALIASNEXT) + "\n");

View file

@ -12,7 +12,7 @@ void () UpdateInfos;
//==============// //==============//
void() InitBodyQue; void() InitBodyQue;
void() AddCommands;
void() main = void() main =
{ {
@ -552,6 +552,8 @@ void() worldspawn =
// 63 testing // 63 testing
lightstyle(63, "a"); lightstyle(63, "a");
AddCommands();
}; };
void() StartFrame = void() StartFrame =