Fixed the FF system after adding TDM broke it. Added color to error messages

This commit is contained in:
Richard Allen 2003-02-27 03:58:35 +00:00
parent b8180c0ff8
commit 2eca4b421f
6 changed files with 108 additions and 229 deletions

View file

@ -1,5 +1,7 @@
# List fixes here for the 2.3 release
* Fixed FF system.
* Added color to important error messages
* Added replacement model functionality for weapons and items
* Added replacement skin functionality for weapons and items
* Fixed the HC's power.
@ -217,4 +219,4 @@
set to 0 don't hurt the players
* Changing the "model" cvar in the console now causes the player model preview and the model icon
selection to be updated immediately
* Added "Hear All" option to the ref menu
* Added "Hear All" option to the ref menu

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.124 2003/02/27 03:58:35 jbravo
// Fixed the FF system after adding TDM broke it. Added color to error messages
//
// Revision 1.123 2002/11/17 20:14:15 jbravo
// Itembanning added
//
@ -1114,7 +1117,7 @@ void ClientUserinfoChanged(int clientNum)
gender = RQ3_Validatemodel(model2);
if (gender == -1) {
trap_SendServerCommand(ent - g_entities,
va("print \"Illegal player model (%s). Forcing change on server.\n\"",
va("print \"^1Illegal player model (%s). Forcing change on server.\n\"",
model2));
Q_strncpyz(model, "grunt/resdog", sizeof("grunt/resdog"));
Q_strncpyz(headModel, "grunt/resdog", sizeof("grunt/resdog"));

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.177 2003/02/27 03:58:35 jbravo
// Fixed the FF system after adding TDM broke it. Added color to error messages
//
// Revision 1.176 2002/11/13 00:50:38 jbravo
// Fixed item dropping, specmode selection on death and helmet probs.
//
@ -598,11 +601,11 @@ CheatsOk
qboolean CheatsOk(gentity_t * ent)
{
if (!g_cheats.integer) {
trap_SendServerCommand(ent - g_entities, va("print \"Cheats are not enabled on this server.\n\""));
trap_SendServerCommand(ent - g_entities, va("print \"^1Cheats are not enabled on this server.\n\""));
return qfalse;
}
if (ent->health <= 0) {
trap_SendServerCommand(ent - g_entities, va("print \"You must be alive to use this command.\n\""));
trap_SendServerCommand(ent - g_entities, va("print \"^1You must be alive to use this command.\n\""));
return qfalse;
}
return qtrue;
@ -660,13 +663,13 @@ int ClientNumberFromString(gentity_t * to, char *s)
if (s[0] >= '0' && s[0] <= '9') {
idnum = atoi(s);
if (idnum < 0 || idnum >= level.maxclients) {
trap_SendServerCommand(to - g_entities, va("print \"Bad client slot: %i\n\"", idnum));
trap_SendServerCommand(to - g_entities, va("print \"^1Bad client slot: %i\n\"", idnum));
return -1;
}
cl = &level.clients[idnum];
if (cl->pers.connected != CON_CONNECTED) {
trap_SendServerCommand(to - g_entities, va("print \"Client %i is not active\n\"", idnum));
trap_SendServerCommand(to - g_entities, va("print \"^1Client %i is not active\n\"", idnum));
return -1;
}
return idnum;
@ -683,7 +686,7 @@ int ClientNumberFromString(gentity_t * to, char *s)
}
}
trap_SendServerCommand(to - g_entities, va("print \"User %s is not on the server\n\"", s));
trap_SendServerCommand(to - g_entities, va("print \"^1User %s is not on the server\n\"", s));
return -1;
}
@ -882,7 +885,7 @@ void Cmd_LevelShot_f(gentity_t * ent)
}
// doesn't work in single player
if (g_gametype.integer != 0) {
trap_SendServerCommand(ent - g_entities, "print \"Must be in g_gametype 0 for levelshot\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Must be in g_gametype 0 for levelshot\n\"");
return;
}
@ -936,8 +939,6 @@ void Cmd_Kill_f(gentity_t * ent)
return;
}
if (g_gametype.integer == GT_TEAMPLAY && level.lights_camera_action) {
trap_SendServerCommand(ent - g_entities,
"print \"Don't be a Jmmsbnd007 and at least wait until the round starts.\n\"");
return;
}
ent->flags &= ~FL_GODMODE;
@ -1034,6 +1035,8 @@ void SetTeam(gentity_t * ent, char *s)
team = TEAM_BLUE;
} else {
// pick the team with the least number of players
trap_SendServerCommand(ent->client->ps.clientNum,
va("print \"^1%s is an illegal team. Putting you on the team with the least number of players.\n\"", s));
team = PickTeam(clientNum);
}
@ -1283,7 +1286,7 @@ void Cmd_Team_f(gentity_t * ent)
if (ent->client->switchTeamTime > level.time) {
trap_SendServerCommand(ent - g_entities,
"print \"May not switch teams more than once per 5 seconds.\n\"");
"print \"^1May not switch teams more than once per 5 seconds.\n\"");
return;
}
// if they are playing a tournement game, count as a loss
@ -1941,27 +1944,27 @@ void Cmd_CallVote_f(gentity_t * ent)
char arg2[MAX_STRING_TOKENS];
if (!g_allowVote.integer) {
trap_SendServerCommand(ent - g_entities, "print \"Voting not allowed here.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Voting not allowed here.\n\"");
return;
}
if (level.voteTime) {
trap_SendServerCommand(ent - g_entities, "print \"A vote is already in progress.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1A vote is already in progress.\n\"");
return;
}
//Makro - replaced the constant with a cvar
if (ent->client->pers.voteCount >= g_RQ3_maxClientVotes.integer) {
//Makro - added cvar info
trap_SendServerCommand(ent - g_entities, va("print \"You have called the maximum number of votes (%i).\n\"", g_RQ3_maxClientVotes.integer));
trap_SendServerCommand(ent - g_entities, va("print \"^1You have called the maximum number of votes (%i).\n\"", g_RQ3_maxClientVotes.integer));
return;
}
// JBravo: Lets allow spectators to vote in TP
if (ent->client->sess.sessionTeam == TEAM_SPECTATOR && g_gametype.integer < GT_TEAM) {
trap_SendServerCommand(ent - g_entities, "print \"Not allowed to call a vote as spectator.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Not allowed to call a vote as spectator.\n\"");
return;
}
//Slicer Matchmode
if(g_RQ3_matchmode.integer && ent->client->sess.captain == TEAM_FREE) {
trap_SendServerCommand(ent - g_entities, "print \"Only team Captains can start a vote.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Only team Captains can start a vote.\n\"");
return;
}
// make sure it is a valid command to vote on
@ -1969,7 +1972,7 @@ void Cmd_CallVote_f(gentity_t * ent)
trap_Argv(2, arg2, sizeof(arg2));
if (strchr(arg1, ';') || strchr(arg2, ';')) {
trap_SendServerCommand(ent - g_entities, "print \"Invalid vote string.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Invalid vote string.\n\"");
return;
}
@ -1983,13 +1986,13 @@ void Cmd_CallVote_f(gentity_t * ent)
if (!Q_stricmp(arg1, "resetmatch")) {
} else if (!Q_stricmp(arg1, "clearscores")) {
} else {
trap_SendServerCommand(ent - g_entities, "print \"Invalid vote command.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Invalid vote command.\n\"");
trap_SendServerCommand(ent - g_entities,"print \"Valid vote commands are: cyclemap, map <mapname>, g_gametype <n>, kick <player>, clientkick <clientnum>,clearscores,resetmatch.\n\"");
return;
}
}
else {
trap_SendServerCommand(ent - g_entities, "print \"Invalid vote command.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Invalid vote command.\n\"");
trap_SendServerCommand(ent - g_entities,
"print \"Valid vote commands are: cyclemap, map <mapname>, g_gametype <n>, kick <player>, and clientkick <clientnum>.\n\"");
return;
@ -2005,7 +2008,7 @@ void Cmd_CallVote_f(gentity_t * ent)
if (!Q_stricmp(arg1, "g_gametype")) {
i = atoi(arg2);
if (i != GT_FFA && i != GT_TEAMPLAY && i != GT_CTF && i != GT_TEAM) {
trap_SendServerCommand(ent - g_entities, "print \"Invalid gametype. Valid gametypes are 0, 3, 4 and 5.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Invalid gametype. Valid gametypes are 0, 3, 4 and 5.\n\"");
return;
}
@ -2016,13 +2019,13 @@ void Cmd_CallVote_f(gentity_t * ent)
// this allows a player to change maps, but not upset the map rotation
if ( !G_FileExists(va("maps/%s.bsp", arg2)) ) {
trap_SendServerCommand(ent - g_entities, va("print \"The map %s does not exist.\n\"", arg2));
trap_SendServerCommand(ent - g_entities, va("print \"^1The map %s does not exist.\n\"", arg2));
return;
}
// NiceAss: Talk to NiceAss before you fix this crappy hack =)
if ( !G_FileSearch( va("scripts/%s.arena", arg2), "rq3ctb" ) && g_gametype.integer == GT_CTF ) {
trap_SendServerCommand(ent - g_entities, va("print \"The map %s does not support CTB.\n\"", arg2));
trap_SendServerCommand(ent - g_entities, va("print \"^1The map %s does not support CTB.\n\"", arg2));
return;
}
@ -2072,17 +2075,17 @@ void Cmd_Vote_f(gentity_t * ent)
return;
}
if (ent->client->ps.eFlags & EF_VOTED) {
trap_SendServerCommand(ent - g_entities, "print \"Vote already cast.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Vote already cast.\n\"");
return;
}
//Makro - allow spectators to vote in TP
if (ent->client->sess.sessionTeam == TEAM_SPECTATOR && g_gametype.integer < GT_TEAM) {
trap_SendServerCommand(ent - g_entities, "print \"Not allowed to vote as spectator.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Not allowed to vote as spectator.\n\"");
return;
}
//Slicer Matchmode
if(g_RQ3_matchmode.integer && ent->client->sess.captain == TEAM_FREE) {
trap_SendServerCommand(ent - g_entities, "print \"Only team Captains vote.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Only team Captains vote.\n\"");
return;
}
trap_SendServerCommand(ent - g_entities, "print \"Vote cast.\n\"");
@ -2127,23 +2130,23 @@ void Cmd_CallTeamVote_f(gentity_t * ent)
return;
if (!g_allowVote.integer) {
trap_SendServerCommand(ent - g_entities, "print \"Voting not allowed here.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Voting not allowed here.\n\"");
return;
}
if (level.teamVoteTime[cs_offset]) {
trap_SendServerCommand(ent - g_entities, "print \"A team vote is already in progress.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1A team vote is already in progress.\n\"");
return;
}
//Makro - replaced the constant with a cvar
if (ent->client->pers.teamVoteCount >= g_RQ3_maxClientVotes.integer) {
//Makro - added cvar info
trap_SendServerCommand(ent - g_entities,
va("print \"You have called the maximum number of team votes (%i).\n\"", g_RQ3_maxClientVotes.integer));
va("print \"^1You have called the maximum number of team votes (%i).\n\"", g_RQ3_maxClientVotes.integer));
return;
}
if (ent->client->sess.sessionTeam == TEAM_SPECTATOR) {
trap_SendServerCommand(ent - g_entities, "print \"Not allowed to call a vote as spectator.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Not allowed to call a vote as spectator.\n\"");
return;
}
// make sure it is a valid command to vote on
@ -2156,7 +2159,7 @@ void Cmd_CallTeamVote_f(gentity_t * ent)
}
if (strchr(arg1, ';') || strchr(arg2, ';')) {
trap_SendServerCommand(ent - g_entities, "print \"Invalid vote string.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Invalid vote string.\n\"");
return;
}
@ -2175,13 +2178,13 @@ void Cmd_CallTeamVote_f(gentity_t * ent)
i = atoi(arg2);
if (i < 0 || i >= level.maxclients) {
trap_SendServerCommand(ent - g_entities,
va("print \"Bad client slot: %i\n\"", i));
va("print \"^1Bad client slot: %i\n\"", i));
return;
}
if (!g_entities[i].inuse) {
trap_SendServerCommand(ent - g_entities,
va("print \"Client %i is not active\n\"", i));
va("print \"^1Client %i is not active\n\"", i));
return;
}
} else {
@ -2200,7 +2203,7 @@ void Cmd_CallTeamVote_f(gentity_t * ent)
}
if (i >= level.maxclients) {
trap_SendServerCommand(ent - g_entities,
va("print \"%s is not a valid player on your team.\n\"",
va("print \"^1%s is not a valid player on your team.\n\"",
arg2));
return;
}
@ -2208,7 +2211,7 @@ void Cmd_CallTeamVote_f(gentity_t * ent)
}
Com_sprintf(arg2, sizeof(arg2), "%d", i);
} else {
trap_SendServerCommand(ent - g_entities, "print \"Invalid vote string.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Invalid vote string.\n\"");
trap_SendServerCommand(ent - g_entities, "print \"Team vote commands are: leader <player>.\n\"");
return;
}
@ -2304,7 +2307,7 @@ void Cmd_SetViewpos_f(gentity_t * ent)
int i;
if (!g_cheats.integer) {
trap_SendServerCommand(ent - g_entities, va("print \"Cheats are not enabled on this server.\n\""));
trap_SendServerCommand(ent - g_entities, va("print \"^1Cheats are not enabled on this server.\n\""));
return;
}
if (trap_Argc() != 5) {
@ -2913,7 +2916,7 @@ void ClientCommand(int clientNum)
if (!G_SendCheatVars(clientNum))
Com_Printf("Error loading cvar cfg\n");
} else
trap_SendServerCommand(clientNum, va("print \"unknown cmd %s\n\"", cmd));
trap_SendServerCommand(clientNum, va("print \"^1unknown cmd ^7%s\n\"", cmd));
}
/*

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.132 2003/02/27 03:58:35 jbravo
// Fixed the FF system after adding TDM broke it. Added color to error messages
//
// Revision 1.131 2002/10/30 20:04:34 jbravo
// Adding helmet
//
@ -1635,152 +1638,6 @@ int CheckArmor(gentity_t * ent, int damage, int dflags)
return save;
}
/*
============
G_LocationDamage
Added by Duffman
============
*/
/*Blaze: incorporated into the G_Damage function
int G_LocationDamage(vec3_t point, gentity_t* targ, gentity_t* attacker, int take) {
vec3_t bulletPath;
vec3_t bulletAngle;
int clientHeight;
int clientFeetZ;
int clientRotation;
int bulletHeight;
int bulletRotation; // Degrees rotation around client.
// used to check Back of head vs. Face
int impactRotation;
// First things first. If we're not damaging them, why are we here?
if (!take)
return 0;
// Point[2] is the REAL world Z. We want Z relative to the clients feet
// Where the feet are at [real Z]
clientFeetZ = targ->r.currentOrigin[2] + targ->r.mins[2];
// How tall the client is [Relative Z]
clientHeight = targ->r.maxs[2] - targ->r.mins[2];
// Where the bullet struck [Relative Z]
bulletHeight = point[2] - clientFeetZ;
// Get a vector aiming from the client to the bullet hit
VectorSubtract(targ->r.currentOrigin, point, bulletPath);
// Convert it into PITCH, ROLL, YAW
vectoangles(bulletPath, bulletAngle);
clientRotation = targ->client->ps.viewangles[YAW];
bulletRotation = bulletAngle[YAW];
impactRotation = abs(clientRotation-bulletRotation);
impactRotation += 45; // just to make it easier to work with
impactRotation = impactRotation % 360; // Keep it in the 0-359 range
if (impactRotation < 90)
targ->client->lasthurt_location = LOCATION_BACK;
else if (impactRotation < 180)
targ->client->lasthurt_location = LOCATION_RIGHT;
else if (impactRotation < 270)
targ->client->lasthurt_location = LOCATION_FRONT;
else if (impactRotation < 360)
targ->client->lasthurt_location = LOCATION_LEFT;
else
targ->client->lasthurt_location = LOCATION_NONE;
// The upper body never changes height, just distance from the feet
if (bulletHeight > clientHeight - 2)
targ->client->lasthurt_location |= LOCATION_HEAD;
else if (bulletHeight > clientHeight - 8)
targ->client->lasthurt_location |= LOCATION_FACE;
else if (bulletHeight > clientHeight - 10)
targ->client->lasthurt_location |= LOCATION_SHOULDER;
else if (bulletHeight > clientHeight - 16)
targ->client->lasthurt_location |= LOCATION_CHEST;
else if (bulletHeight > clientHeight - 26)
targ->client->lasthurt_location |= LOCATION_STOMACH;
else if (bulletHeight > clientHeight - 29)
targ->client->lasthurt_location |= LOCATION_GROIN;
//else if (bulletHeight < 4)
// targ->client->lasthurt_location |= LOCATION_FOOT;
else
// The leg is the only thing that changes size when you duck,
// so we check for every other parts RELATIVE location, and
// whats left over must be the leg.
targ->client->lasthurt_location |= LOCATION_LEG;
G_Printf("In loc damage: %d incomming\n",take);
// Check the location ignoring the rotation info
switch ( targ->client->lasthurt_location &
~(LOCATION_BACK | LOCATION_LEFT | LOCATION_RIGHT | LOCATION_FRONT) )
{
case (LOCATION_HEAD):
{ trap_SendServerCommand( attacker-g_entities, va("print \"You hit %s^7 in the head.\n\"", targ->client->pers.netname));
trap_SendServerCommand( targ-g_entities, va("print \"Head Damage.\n\""));
take *= 1.8; //+ 1;
break;
}
case (LOCATION_FACE):
{ trap_SendServerCommand( attacker-g_entities, va("print \"You hit %s^7 in the head.\n\"", targ->client->pers.netname));
trap_SendServerCommand( targ-g_entities, va("print \"Head Damage.\n\""));
take *= 1.8; //+ 1;
break;
}
case (LOCATION_SHOULDER):
{ trap_SendServerCommand( attacker-g_entities, va("print \"You hit %s^7 in the chest.\n\"", targ->client->pers.netname));
trap_SendServerCommand( targ-g_entities, va("print \"Chest Damage.\n\""));
take *= 0.65;
break;
}
case (LOCATION_CHEST):
{ trap_SendServerCommand( attacker-g_entities, va("print \"You hit %s^7 in the chest.\n\"", targ->client->pers.netname));
trap_SendServerCommand( targ-g_entities, va("print \"Chest Damage.\n\""));
take *= 0.65;
break;
}
case (LOCATION_STOMACH):
{ trap_SendServerCommand( attacker-g_entities, va("print \"You hit %s^7 in the stomac.\n\"", targ->client->pers.netname));
trap_SendServerCommand( targ-g_entities, va("print \"Stomach Damage.\n\""));
take *= 0.4;
break;
}
case (LOCATION_GROIN):
{ trap_SendServerCommand( attacker-g_entities, va("print \"You hit %s^7 in the stomac.\n\"", targ->client->pers.netname));
trap_SendServerCommand( targ-g_entities, va("print \"Stomach Damage.\n\""));
take *= 0.4;
break;
}
case (LOCATION_LEG):
{ trap_SendServerCommand( attacker-g_entities, va("print \"You hit %s^7 in the leg.\n\"", targ->client->pers.netname));
trap_SendServerCommand( targ-g_entities, va("print \"Leg Damage.\n\""));
take *= 0.25;
break;
}
case (LOCATION_FOOT):
{ trap_SendServerCommand( attacker-g_entities, va("print \"You hit %s^0 in the leg.\n\"", targ->client->pers.netname));
trap_SendServerCommand( targ-g_entities, va("print \"Leg Damage.\n\""));
take *= 0.25;
break;
}
}
G_Printf("In loc damage: %d outgoing\n",take);
return take;
}
*/
// End Duffman
/*
================
RaySphereIntersections
@ -1875,11 +1732,17 @@ void G_Damage(gentity_t * targ, gentity_t * inflictor, gentity_t * attacker,
}
// NiceAss: Fixed pointer bug causing DLLs to crash
// JBravo: FF control
if (targ != attacker && attacker && targ && targ->client && attacker->client &&
targ->client->sess.sessionTeam == attacker->client->sess.sessionTeam &&
((g_gametype.integer == GT_TEAMPLAY && !g_friendlyFire.integer && level.team_round_going) ||
(g_gametype.integer >= GT_TEAM && !g_friendlyFire.integer)))
return;
if (targ != attacker && attacker && targ && targ->client && attacker->client) {
if (g_gametype.integer >= GT_TEAM && targ->client->sess.sessionTeam == attacker->client->sess.sessionTeam) {
if (g_gametype.integer == GT_TEAMPLAY) {
if (level.team_round_going && g_friendlyFire.integer == 0)
return;
} else if (g_gametype.integer >= GT_TEAM) {
if (g_friendlyFire.integer == 0)
return;
}
}
}
// the intermission has allready been qualified for, so don't
// allow any extra scoring
@ -2089,11 +1952,13 @@ void G_Damage(gentity_t * targ, gentity_t * inflictor, gentity_t * attacker,
// if the attacker was on the same team
if (targ != attacker && OnSameTeam(targ, attacker)) {
// JBravo: more FF tweaks
if (g_gametype.integer == GT_TEAMPLAY && g_friendlyFire.integer == 2 && level.team_round_going) {
return;
if (g_gametype.integer == GT_TEAMPLAY) {
if (g_friendlyFire.integer == 2 && level.team_round_going)
return;
} else if (g_gametype.integer >= GT_TEAM) {
if (g_friendlyFire.integer == 2)
return;
}
if (g_gametype.integer >= GT_TEAM && g_friendlyFire.integer == 2)
return;
if ((g_gametype.integer == GT_TEAMPLAY && level.team_round_going)
|| g_gametype.integer >= GT_TEAM)
Add_TeamWound(attacker, targ, mod);

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.132 2003/02/27 03:58:35 jbravo
// Fixed the FF system after adding TDM broke it. Added color to error messages
//
// Revision 1.131 2003/02/25 22:41:14 jbravo
// Fixed a bug in item replacements. Removed "Beta" from the version.
//
@ -855,7 +858,7 @@ void G_UpdateCvars(void)
if (Q_stricmp(cv->cvarName, "g_gravity") == 0)
G_GravityChange();
if (cv->trackChange) {
trap_SendServerCommand(-1, va("print \"Server: %s changed to %s\n\"",
trap_SendServerCommand(-1, va("print \"^1Server: %s changed to %s\n\"",
cv->cvarName, cv->vmCvar->string));
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.147 2003/02/27 03:58:35 jbravo
// Fixed the FF system after adding TDM broke it. Added color to error messages
//
// Revision 1.146 2002/11/17 20:14:15 jbravo
// Itembanning added
//
@ -588,7 +591,7 @@ void CheckTeamRules()
} else {
if (level.time - level.startTime >= g_timelimit.integer * 60000) {
//Slicer : Let's do a normal console print instead..
trap_SendServerCommand(-1, "print \"Timelimit hit.\n\"");
trap_SendServerCommand(-1, "print \"^1Timelimit hit.\n\"");
level.team_round_going = level.team_round_countdown = level.team_game_going = 0;
//Slicer: Start Intermission
BeginIntermission();
@ -1043,7 +1046,7 @@ void RQ3_Cmd_Choose_f(gentity_t * ent)
}
if (g_gametype.integer == GT_TEAM && g_RQ3_tdmMode.integer) {
trap_SendServerCommand(ent - g_entities, va("print \"This Team DM mode does not allow you to choose weapons or items.\n\""));
trap_SendServerCommand(ent - g_entities, va("print \"^1This Team DM mode does not allow you to choose weapons or items.\n\""));
return;
}
@ -1054,84 +1057,84 @@ void RQ3_Cmd_Choose_f(gentity_t * ent)
ent->client->teamplayWeapon = WP_MP5;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_MP5_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_MP5_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_MP5_NAME));
}
} else if (Q_stricmp(cmd, RQ3_M3_NAME) == 0 || Q_stricmp(cmd, "m3") == 0) {
if ((int) g_RQ3_weaponban.integer & WPF_M3) {
ent->client->teamplayWeapon = WP_M3;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_M3_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_M3_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_M3_NAME));
}
} else if (Q_stricmp(cmd, RQ3_M4_NAME) == 0 || Q_stricmp(cmd, "m4") == 0) {
if ((int) g_RQ3_weaponban.integer & WPF_M4) {
ent->client->teamplayWeapon = WP_M4;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_M4_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_M4_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_M4_NAME));
}
} else if (Q_stricmp(cmd, RQ3_HANDCANNON_NAME) == 0 || Q_stricmp(cmd, "hc") == 0) {
if ((int) g_RQ3_weaponban.integer & WPF_HC) {
ent->client->teamplayWeapon = WP_HANDCANNON;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_HANDCANNON_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_HANDCANNON_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_HANDCANNON_NAME));
}
} else if (Q_stricmp(cmd, RQ3_SSG3000_NAME) == 0 || Q_stricmp(cmd, "sniper") == 0) {
if ((int) g_RQ3_weaponban.integer & WPF_SNIPER) {
ent->client->teamplayWeapon = WP_SSG3000;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_SSG3000_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_SSG3000_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_SSG3000_NAME));
}
} else if (Q_stricmp(cmd, RQ3_KNIFE_NAME) == 0 || Q_stricmp(cmd, "knives") == 0) {
if ((int) g_RQ3_weaponban.integer & WPF_KNIFE) {
ent->client->teamplayWeapon = WP_KNIFE;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_KNIFE_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_KNIFE_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_KNIFE_NAME));
}
} else if (Q_stricmp(cmd, RQ3_AKIMBO_NAME) == 0 || Q_stricmp(cmd, "akimbo") == 0) {
if ((int) g_RQ3_weaponban.integer & WPF_DUAL) {
ent->client->teamplayWeapon = WP_AKIMBO;
trap_SendServerCommand(ent - g_entities, va("print \"Weapon selected: %s\n\"", RQ3_AKIMBO_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_AKIMBO_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_AKIMBO_NAME));
}
} else if (Q_stricmp(cmd, RQ3_KEVLAR_NAME) == 0 || Q_stricmp(cmd, "kevlar") == 0) {
if ((int) g_RQ3_weaponban.integer & ITF_KEVLAR) {
ent->client->teamplayItem = HI_KEVLAR;
trap_SendServerCommand(ent - g_entities, va("print \"Item selected: %s\n\"", RQ3_KEVLAR_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_KEVLAR_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_KEVLAR_NAME));
}
} else if (Q_stricmp(cmd, RQ3_LASER_NAME) == 0 || Q_stricmp(cmd, "laser") == 0) {
if ((int) g_RQ3_weaponban.integer & ITF_LASER) {
ent->client->teamplayItem = HI_LASER;
trap_SendServerCommand(ent - g_entities, va("print \"Item selected: %s\n\"", RQ3_LASER_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_LASER_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_LASER_NAME));
}
} else if (Q_stricmp(cmd, RQ3_SLIPPERS_NAME) == 0 || Q_stricmp(cmd, "slippers") == 0) {
if ((int) g_RQ3_weaponban.integer & ITF_SLIPPERS) {
ent->client->teamplayItem = HI_SLIPPERS;
trap_SendServerCommand(ent - g_entities, va("print \"Item selected: %s\n\"", RQ3_SLIPPERS_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_SLIPPERS_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_SLIPPERS_NAME));
}
} else if (Q_stricmp(cmd, RQ3_SILENCER_NAME) == 0 || Q_stricmp(cmd, "silencer") == 0) {
if ((int) g_RQ3_weaponban.integer & ITF_SILENCER) {
ent->client->teamplayItem = HI_SILENCER;
trap_SendServerCommand(ent - g_entities, va("print \"Item selected: %s\n\"", RQ3_SILENCER_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_SILENCER_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_SILENCER_NAME));
}
} else if (Q_stricmp(cmd, RQ3_BANDOLIER_NAME) == 0 || Q_stricmp(cmd, "bandolier") == 0) {
if ((int) g_RQ3_weaponban.integer & ITF_BANDOLIER) {
ent->client->teamplayItem = HI_BANDOLIER;
trap_SendServerCommand(ent - g_entities, va("print \"Item selected: %s\n\"", RQ3_BANDOLIER_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_BANDOLIER_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_BANDOLIER_NAME));
}
} else if (Q_stricmp(cmd, RQ3_HELMET_NAME) == 0 || Q_stricmp(cmd, "helmet") == 0) {
if (g_RQ3_haveHelmet.integer) {
@ -1139,13 +1142,13 @@ void RQ3_Cmd_Choose_f(gentity_t * ent)
ent->client->teamplayItem = HI_HELMET;
trap_SendServerCommand(ent - g_entities, va("print \"Item selected: %s\n\"", RQ3_HELMET_NAME));
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_HELMET_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_HELMET_NAME));
}
} else {
trap_SendServerCommand(ent - g_entities, va("print \"%s is disabled on this server.\n\"", RQ3_HELMET_NAME));
trap_SendServerCommand(ent - g_entities, va("print \"^1%s is disabled on this server.\n\"", RQ3_HELMET_NAME));
}
} else {
trap_SendServerCommand(ent - g_entities, va("print \"Invalid weapon or item choice.\n\""));
trap_SendServerCommand(ent - g_entities, va("print \"^1Invalid weapon or item choice.\n\""));
return;
}
}
@ -1158,7 +1161,7 @@ void Cmd_Dropcase_f(gentity_t * ent)
if (!ent->client)
return;
if (!ent->client->ps.powerups[PW_REDFLAG] && !ent->client->ps.powerups[PW_BLUEFLAG]) {
trap_SendServerCommand(ent - g_entities, va("print \"Go get the enemy case and try again.\n\""));
trap_SendServerCommand(ent - g_entities, va("print \"^1Go get the enemy case and try again.\n\""));
return;
}
item = NULL;
@ -1178,7 +1181,7 @@ void Cmd_Dropcase_f(gentity_t * ent)
ent->client->uniqueItems--;
}
} else {
trap_SendServerCommand(ent - g_entities, va("print \"Huh? You dont have a flag to drop!\n\""));
trap_SendServerCommand(ent - g_entities, va("print \"^1Huh? You dont have a flag to drop!\n\""));
}
}
@ -1200,7 +1203,7 @@ void RQ3_Cmd_Drop_f(gentity_t * ent)
} else if (Q_stricmp(cmd, "case") == 0) {
Cmd_Dropcase_f(ent);
} else {
trap_SendServerCommand(ent - g_entities, va("print \"unknown item: %s\n\"", cmd));
trap_SendServerCommand(ent - g_entities, va("print \"^1unknown item: %s\n\"", cmd));
}
}
@ -1606,7 +1609,7 @@ void RQ3_Cmd_Radiogender_f(gentity_t * ent)
ent->client->radioGender = 1;
} else {
trap_SendServerCommand(ent - g_entities,
"print \"Invalid gender selection, try 'male' or 'female'\n\"");
"print \"^1Invalid gender selection, try 'male' or 'female'\n\"");
}
}
@ -1751,7 +1754,7 @@ qboolean CheckForFlood(gentity_t * ent)
if (ent->client->rd_Count >= g_RQ3_radioFlood.integer) {
trap_SendServerCommand(ent - g_entities,
va
("print \"Radio Flood Detected, you are silenced for %i secs\n\"",
("print \"^1Radio Flood Detected, you are silenced for %i secs\n\"",
(int) g_RQ3_radioBan.integer));
ent->client->rd_mute = level.time + g_RQ3_radioBan.integer * 1000;
return qfalse;
@ -1783,7 +1786,7 @@ qboolean CheckForRepeat(gentity_t * ent, int radioCode)
if (ent->client->rd_repCount == g_RQ3_radioRepeat.integer) {
trap_SendServerCommand(ent - g_entities,
va
("print \"Radio Repeat Flood Detected, you are silenced for %i secs\n\"",
("print \"^1Radio Repeat Flood Detected, you are silenced for %i secs\n\"",
(int) g_RQ3_radioBan.integer));
ent->client->rd_mute = level.time + g_RQ3_radioBan.integer * 1000;
}
@ -1813,7 +1816,7 @@ void RQ3_Cmd_Radio_f(gentity_t * ent)
if (g_RQ3_lca.integer)
return;
if (ent->client->radioOff == qtrue) {
trap_SendServerCommand(ent - g_entities, "print \"Your radio is off!\n\"");
trap_SendServerCommand(ent - g_entities, "print \"^1Your radio is off!\n\"");
return;
}
if (ent->client->radioGender == 0) {
@ -2385,9 +2388,9 @@ void Add_TeamWound(gentity_t * attacker, gentity_t * victim, int mod)
if (attacker->client->ff_warning == 0) {
attacker->client->ff_warning++;
trap_SendServerCommand(victim - g_entities, va("print \"You were hit by %s^7, your TEAMMATE!\n\"",
trap_SendServerCommand(victim - g_entities, va("print \"You were hit by %s^7, your ^1TEAMMATE!\n\"",
attacker->client->pers.netname));
trap_SendServerCommand(attacker - g_entities, va("print \"You hit your TEAMMATE %s^7!\n\"",
trap_SendServerCommand(attacker - g_entities, va("print \"You hit your ^1TEAMMATE^7 %s^7!\n\"",
victim->client->pers.netname));
}
attacker->client->team_wounds = (attacker->client->team_wounds_before + 1);
@ -2401,15 +2404,15 @@ void Add_TeamWound(gentity_t * attacker, gentity_t * victim, int mod)
attacker->client->pers.netname));
trap_SendServerCommand(attacker - g_entities,
va
("print \"WARNING: You'll be temporarily banned if you continue wounding teammates!\n\""));
("print \"^1WARNING:^7 You'll be temporarily banned if you continue wounding teammates!\n\""));
return;
} else {
trap_SendServerCommand(-1,
va("print \"Banning %s^7 for team wounding\n\"",
va("print \"^1Banning^7 %s^7 for team wounding\n\"",
attacker->client->pers.netname));
trap_SendServerCommand(attacker - g_entities,
va
("print \"You've wounded teammates too many times, and are banned for %d %s.\n\"",
("print \"^1You've wounded teammates too many times, and are banned for %d %s.\n\"",
g_RQ3_twbanrounds.integer,
((g_RQ3_twbanrounds.integer > 1) ? "games" : "game")));
trap_GetUserinfo(attacker - g_entities, userinfo, sizeof(userinfo));
@ -2435,20 +2438,20 @@ void Add_TeamKill(gentity_t * attacker)
if ((g_RQ3_maxteamkills.integer < 1) ||
(attacker->client->team_kills < ((g_RQ3_maxteamkills.integer % 2) + g_RQ3_maxteamkills.integer / 2))) {
trap_SendServerCommand(attacker - g_entities, va("print \"You killed your TEAMMATE!\n\""));
trap_SendServerCommand(attacker - g_entities, va("print \"You killed your ^1TEAMMATE!\n\""));
return;
} else if (attacker->client->team_kills < g_RQ3_maxteamkills.integer) {
trap_SendServerCommand(-1, va("print \"%s^7 is in danger of being banned for killing teammates\n\"",
attacker->client->pers.netname));
trap_SendServerCommand(attacker - g_entities,
va
("print \"WARNING: You'll be temporarily banned if you continue killing teammates!\n\""));
("print \"^1WARNING:^7 You'll be temporarily banned if you continue killing teammates!\n\""));
return;
} else {
trap_SendServerCommand(-1,
va("print \"Banning %s^7 for team killing\n\"", attacker->client->pers.netname));
va("print \"^1Banning^7 %s^7 for team killing\n\"", attacker->client->pers.netname));
trap_SendServerCommand(attacker - g_entities,
va("print \"You've killed too many teammates, and are banned for %d %s.\n",
va("print \"^1You've killed too many teammates, and are banned for %d %s.\n",
g_RQ3_tkbanrounds.integer,
((g_RQ3_tkbanrounds.integer > 1) ? "games" : "game")));
trap_GetUserinfo(attacker - g_entities, userinfo, sizeof(userinfo));
@ -2550,7 +2553,7 @@ void RQ3_AddOrDelIgnoreSubject(gentity_t * source, gentity_t * subject, qboolean
return;
if (!subject->client || !subject->inuse) {
trap_SendServerCommand(source - g_entities,
va("print \"Only valid clients may be added to ignore list!\n\""));
va("print \"^1Only valid clients may be added to ignore list!\n\""));
return;
}
@ -2631,7 +2634,7 @@ void Cmd_Ignore_f(gentity_t * self)
RQ3_AddOrDelIgnoreSubject(self, target, qfalse);
else {
trap_SendServerCommand(self - g_entities,
va("print \"Wait 5 seconds before ignoring again.\n\""));
va("print \"^1Wait 5 seconds before ignoring again.\n\""));
return;
}
} else
@ -2666,7 +2669,7 @@ void Cmd_Unignore_f(gentity_t * self)
RQ3_AddOrDelIgnoreSubject(self, target, qfalse);
else {
trap_SendServerCommand(self - g_entities,
va("print \"Wait 5 seconds before ignoring again.\n\""));
va("print \"^1Wait 5 seconds before ignoring again.\n\""));
return;
}
} else
@ -2696,7 +2699,7 @@ void Cmd_Ignorenum_f(gentity_t * self)
trap_SendServerCommand(self - g_entities,
va("print \"Use ignorelist to see who can be ignored.\n\""));
} else
trap_SendServerCommand(self - g_entities, va("print \"Used ignorenum with illegal number.\n\""));
trap_SendServerCommand(self - g_entities, va("print \"^1Used ignorenum with illegal number.\n\""));
}
void Cmd_Ignoreclear_f(gentity_t * self)