すべての音声コマンドを削除し、「altExcellent」を「multiKill」に名前変更します
This commit is contained in:
@@ -1152,7 +1152,7 @@ typedef struct {
|
||||
int delagHitscan;
|
||||
//unlagged - client options
|
||||
//KK-OAX For storing whether or not the server has multikills enabled.
|
||||
int altExcellent;
|
||||
int multiKill;
|
||||
} cgs_t;
|
||||
|
||||
//==============================================================================
|
||||
|
@@ -338,7 +338,7 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) {
|
||||
//Com_Printf("impressive\n");
|
||||
}
|
||||
//KK-OAX We Just Won't Draw The Excellent Stuff if Multikills are Enabled!!!
|
||||
if( !cgs.altExcellent ) {
|
||||
if( !cgs.multiKill ) {
|
||||
if (ps->persistant[PERS_EXCELLENT_COUNT] != ops->persistant[PERS_EXCELLENT_COUNT]) {
|
||||
sfx = cgs.media.excellentSound;
|
||||
pushReward(sfx, cgs.media.medalExcellent, ps->persistant[PERS_EXCELLENT_COUNT]);
|
||||
|
@@ -347,7 +347,7 @@ void CG_ParseServerinfo( void ) {
|
||||
cgs.roundtime = atoi( Info_ValueForKey( info, "elimination_roundtime" ) );
|
||||
cgs.nopickup = atoi( Info_ValueForKey( info, "g_rockets" ) ) + atoi( Info_ValueForKey( info, "g_instantgib" ) ) + atoi( Info_ValueForKey( info, "g_elimination" ) );
|
||||
cgs.lms_mode = atoi( Info_ValueForKey( info, "g_lms_mode" ) );
|
||||
cgs.altExcellent = atoi( Info_ValueForKey( info, "g_altExcellent" ) );
|
||||
cgs.multiKill = atoi( Info_ValueForKey( info, "g_multiKill" ) );
|
||||
mapname = Info_ValueForKey( info, "mapname" );
|
||||
Com_sprintf( cgs.mapname, sizeof( cgs.mapname ), "maps/%s.bsp", mapname );
|
||||
Q_strncpyz( cgs.redTeam, Info_ValueForKey( info, "g_redTeam" ), sizeof(cgs.redTeam) );
|
||||
|
@@ -1270,230 +1270,6 @@ static void Cmd_Tell_f( gentity_t *ent ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void G_VoiceTo( gentity_t *ent, gentity_t *other, int mode, const char *id, qboolean voiceonly ) {
|
||||
int color;
|
||||
char *cmd;
|
||||
|
||||
if (!other) {
|
||||
return;
|
||||
}
|
||||
if (!other->inuse) {
|
||||
return;
|
||||
}
|
||||
if (!other->client) {
|
||||
return;
|
||||
}
|
||||
if ( mode == SAY_TEAM && !OnSameTeam(ent, other) ) {
|
||||
return;
|
||||
}
|
||||
// no chatting to players in tournements
|
||||
if ( (g_gametype.integer == GT_TOURNAMENT )) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode == SAY_TEAM) {
|
||||
color = COLOR_CYAN;
|
||||
cmd = "tchat";
|
||||
}
|
||||
else if (mode == SAY_TELL) {
|
||||
color = COLOR_MAGENTA;
|
||||
cmd = "tell";
|
||||
}
|
||||
else {
|
||||
color = COLOR_GREEN;
|
||||
cmd = "chat";
|
||||
}
|
||||
|
||||
trap_SendServerCommand( other-g_entities, va("%s %d %d %d %s", cmd, voiceonly, ent->s.number, color, id));
|
||||
}
|
||||
|
||||
void G_Voice( gentity_t *ent, gentity_t *target, int mode, const char *id, qboolean voiceonly ) {
|
||||
int j;
|
||||
gentity_t *other;
|
||||
|
||||
if ( (g_gametype.integer < GT_TEAM || g_ffa_gt==1 ) && mode == SAY_TEAM ) {
|
||||
mode = SAY_ALL;
|
||||
}
|
||||
|
||||
if ( target ) {
|
||||
G_VoiceTo( ent, target, mode, id, voiceonly );
|
||||
return;
|
||||
}
|
||||
|
||||
// echo the text to the console
|
||||
if ( g_dedicated.integer ) {
|
||||
G_Printf( "voice: %s %s\n", ent->client->pers.netname, id);
|
||||
}
|
||||
|
||||
// send it to all the apropriate clients
|
||||
for (j = 0; j < level.maxclients; j++) {
|
||||
other = &g_entities[j];
|
||||
G_VoiceTo( ent, other, mode, id, voiceonly );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
Cmd_Voice_f
|
||||
KK-OAX Modified this to trap args.
|
||||
|
||||
In the original, every call to this function would always set "arg0" to false, and it was
|
||||
never passed along to other functions, so I removed/commented it out.
|
||||
==================
|
||||
*/
|
||||
static void Cmd_Voice_f( gentity_t *ent ) {
|
||||
char *p;
|
||||
char arg[MAX_TOKEN_CHARS];
|
||||
int mode = SAY_ALL;
|
||||
qboolean voiceonly = qfalse;
|
||||
|
||||
trap_Argv( 0, arg, sizeof( arg ) );
|
||||
if((Q_strequal( arg, "vsay_team" ) ) ||
|
||||
Q_strequal( arg, "vosay_team" ) )
|
||||
mode = SAY_TEAM;
|
||||
|
||||
if((Q_strequal( arg, "vosay" ) ) ||
|
||||
Q_strequal( arg, "vosay_team" ) )
|
||||
voiceonly = qtrue;
|
||||
|
||||
//KK-OAX Removed "arg0" since it will always be set to qfalse.
|
||||
if ( trap_Argc () < 2 ) {
|
||||
return;
|
||||
}
|
||||
//KK-OAX This was tricky to figure out, but since none of the original command handlings
|
||||
//set it to "qtrue"...
|
||||
|
||||
/*if (arg0)
|
||||
{
|
||||
p = ConcatArgs( 0 );
|
||||
}
|
||||
else
|
||||
{*/
|
||||
p = ConcatArgs( 1 );
|
||||
//}
|
||||
|
||||
G_Voice( ent, NULL, mode, p, voiceonly );
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
Cmd_VoiceTell_f
|
||||
KK-OAX Modified this to trap args.
|
||||
==================
|
||||
*/
|
||||
static void Cmd_VoiceTell_f( gentity_t *ent ) {
|
||||
int targetNum;
|
||||
gentity_t *target;
|
||||
char *id;
|
||||
char arg[MAX_TOKEN_CHARS];
|
||||
qboolean voiceonly = qfalse;
|
||||
|
||||
if ( trap_Argc () < 2 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
trap_Argv( 0, arg, sizeof( arg ) );
|
||||
if( Q_strequal( arg, "votell" ) )
|
||||
voiceonly = qtrue;
|
||||
|
||||
trap_Argv( 1, arg, sizeof( arg ) );
|
||||
targetNum = atoi( arg );
|
||||
if ( targetNum < 0 || targetNum >= level.maxclients ) {
|
||||
return;
|
||||
}
|
||||
|
||||
target = &g_entities[targetNum];
|
||||
if ( !target || !target->inuse || !target->client ) {
|
||||
return;
|
||||
}
|
||||
|
||||
id = ConcatArgs( 2 );
|
||||
|
||||
G_LogPrintf( "tell: %s to %s: %s\n", ent->client->pers.netname, target->client->pers.netname, id );
|
||||
G_Voice( ent, target, SAY_TELL, id, voiceonly );
|
||||
// don't tell to the player self if it was already directed to this player
|
||||
// also don't send the chat back to a bot
|
||||
if ( ent != target && !(ent->r.svFlags & SVF_BOT)) {
|
||||
G_Voice( ent, ent, SAY_TELL, id, voiceonly );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
Cmd_VoiceTaunt_f
|
||||
==================
|
||||
*/
|
||||
static void Cmd_VoiceTaunt_f( gentity_t *ent ) {
|
||||
gentity_t *who;
|
||||
int i;
|
||||
|
||||
if (!ent->client) {
|
||||
return;
|
||||
}
|
||||
|
||||
// insult someone who just killed you
|
||||
if (ent->enemy && ent->enemy->client && ent->enemy->client->lastkilled_client == ent->s.number) {
|
||||
// i am a dead corpse
|
||||
if (!(ent->enemy->r.svFlags & SVF_BOT)) {
|
||||
G_Voice( ent, ent->enemy, SAY_TELL, VOICECHAT_DEATHINSULT, qfalse );
|
||||
}
|
||||
if (!(ent->r.svFlags & SVF_BOT)) {
|
||||
G_Voice( ent, ent, SAY_TELL, VOICECHAT_DEATHINSULT, qfalse );
|
||||
}
|
||||
ent->enemy = NULL;
|
||||
return;
|
||||
}
|
||||
// insult someone you just killed
|
||||
if (ent->client->lastkilled_client >= 0 && ent->client->lastkilled_client != ent->s.number) {
|
||||
who = g_entities + ent->client->lastkilled_client;
|
||||
if (who->client) {
|
||||
// who is the person I just killed
|
||||
if (who->client->lasthurt_mod == MOD_GAUNTLET) {
|
||||
if (!(who->r.svFlags & SVF_BOT)) {
|
||||
G_Voice( ent, who, SAY_TELL, VOICECHAT_KILLGAUNTLET, qfalse ); // and I killed them with a gauntlet
|
||||
}
|
||||
if (!(ent->r.svFlags & SVF_BOT)) {
|
||||
G_Voice( ent, ent, SAY_TELL, VOICECHAT_KILLGAUNTLET, qfalse );
|
||||
}
|
||||
} else {
|
||||
if (!(who->r.svFlags & SVF_BOT)) {
|
||||
G_Voice( ent, who, SAY_TELL, VOICECHAT_KILLINSULT, qfalse ); // and I killed them with something else
|
||||
}
|
||||
if (!(ent->r.svFlags & SVF_BOT)) {
|
||||
G_Voice( ent, ent, SAY_TELL, VOICECHAT_KILLINSULT, qfalse );
|
||||
}
|
||||
}
|
||||
ent->client->lastkilled_client = -1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_gametype.integer >= GT_TEAM && g_ffa_gt!=1) {
|
||||
// praise a team mate who just got a reward
|
||||
for(i = 0; i < MAX_CLIENTS; i++) {
|
||||
who = g_entities + i;
|
||||
if (who->client && who != ent && who->client->sess.sessionTeam == ent->client->sess.sessionTeam) {
|
||||
if (who->client->rewardTime > level.time) {
|
||||
if (!(who->r.svFlags & SVF_BOT)) {
|
||||
G_Voice( ent, who, SAY_TELL, VOICECHAT_PRAISE, qfalse );
|
||||
}
|
||||
if (!(ent->r.svFlags & SVF_BOT)) {
|
||||
G_Voice( ent, ent, SAY_TELL, VOICECHAT_PRAISE, qfalse );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// just say something
|
||||
G_Voice( ent, NULL, SAY_ALL, VOICECHAT_TAUNT, qfalse );
|
||||
}
|
||||
|
||||
|
||||
|
||||
static char *gc_orders[] = {
|
||||
"hold your position",
|
||||
"hold this position",
|
||||
|
@@ -305,139 +305,6 @@ int G_FloodLimited( gentity_t *ent )
|
||||
return ms;
|
||||
}
|
||||
|
||||
//KK-Private Messaging Not implemented.
|
||||
/*
|
||||
void Cmd_PrivateMessage_f( gentity_t *ent )
|
||||
{
|
||||
int pids[ MAX_CLIENTS ];
|
||||
int ignoreids[ MAX_CLIENTS ];
|
||||
char name[ MAX_NAME_LENGTH ];
|
||||
char cmd[ 12 ];
|
||||
char str[ MAX_STRING_CHARS ];
|
||||
char *msg;
|
||||
char color;
|
||||
int pcount, matches, ignored = 0;
|
||||
int i;
|
||||
int skipargs = 0;
|
||||
qboolean teamonly = qfalse;
|
||||
gentity_t *tmpent;
|
||||
|
||||
if( !g_privateMessages.integer && ent )
|
||||
{
|
||||
ADMP( "Sorry, but private messages have been disabled\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
G_SayArgv( 0, cmd, sizeof( cmd ) );
|
||||
if( !Q_stricmp( cmd, "say" ) || !Q_stricmp( cmd, "say_team" ) )
|
||||
{
|
||||
skipargs = 1;
|
||||
G_SayArgv( 1, cmd, sizeof( cmd ) );
|
||||
}
|
||||
if( G_SayArgc( ) < 3+skipargs )
|
||||
{
|
||||
ADMP( va( "usage: %s [name|slot#] [message]\n", cmd ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !Q_stricmp( cmd, "mt" ) || !Q_stricmp( cmd, "/mt" ) )
|
||||
teamonly = qtrue;
|
||||
|
||||
G_SayArgv( 1+skipargs, name, sizeof( name ) );
|
||||
msg = G_SayConcatArgs( 2+skipargs );
|
||||
pcount = G_ClientNumbersFromString( name, pids, MAX_CLIENTS );
|
||||
|
||||
if( ent )
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
for( i = 0; i < pcount; i++ )
|
||||
{
|
||||
tmpent = &g_entities[ pids[ i ] ];
|
||||
|
||||
if( teamonly && !OnSameTeam( ent, tmpent ) )
|
||||
continue;
|
||||
|
||||
if( BG_ClientListTest( &tmpent->client->pers.ignoreList,
|
||||
ent-g_entities ) )
|
||||
{
|
||||
ignoreids[ ignored++ ] = pids[ i ];
|
||||
continue;
|
||||
}
|
||||
|
||||
pids[ count ] = pids[ i ];
|
||||
count++;
|
||||
}
|
||||
matches = count;
|
||||
}
|
||||
else
|
||||
{
|
||||
matches = pcount;
|
||||
}
|
||||
|
||||
color = teamonly ? COLOR_CYAN : COLOR_YELLOW;
|
||||
|
||||
Com_sprintf( str, sizeof( str ), "^%csent to %i player%s: ^7", color, matches,
|
||||
( matches == 1 ) ? "" : "s" );
|
||||
|
||||
for( i=0; i < matches; i++ )
|
||||
{
|
||||
tmpent = &g_entities[ pids[ i ] ];
|
||||
|
||||
if( i > 0 )
|
||||
Q_strcat( str, sizeof( str ), "^7, " );
|
||||
Q_strcat( str, sizeof( str ), tmpent->client->pers.netname );
|
||||
trap_SendServerCommand( pids[ i ], va(
|
||||
"chat \"%s^%c -> ^7%s^7: (%d recipient%s): ^%c%s^7\" %i",
|
||||
( ent ) ? ent->client->pers.netname : "console",
|
||||
color,
|
||||
name,
|
||||
matches,
|
||||
( matches == 1 ) ? "" : "s",
|
||||
color,
|
||||
msg,
|
||||
ent ? ent-g_entities : -1 ) );
|
||||
if( ent )
|
||||
{
|
||||
trap_SendServerCommand( pids[ i ], va(
|
||||
"print \">> to reply, say: /m %d [your message] <<\n\"",
|
||||
( ent - g_entities ) ) );
|
||||
}
|
||||
trap_SendServerCommand( pids[ i ], va(
|
||||
"cp \"^%cprivate message from ^7%s^7\"", color,
|
||||
( ent ) ? ent->client->pers.netname : "console" ) );
|
||||
}
|
||||
|
||||
if( !matches )
|
||||
ADMP( va( "^3No player matching ^7\'%s^7\' ^3to send message to.\n",
|
||||
name ) );
|
||||
else
|
||||
{
|
||||
ADMP( va( "^%cPrivate message: ^7%s\n", color, msg ) );
|
||||
ADMP( va( "%s\n", str ) );
|
||||
|
||||
G_LogPrintf( "%s: %s^7: %s^7: %s\n",
|
||||
( teamonly ) ? "tprivmsg" : "privmsg",
|
||||
( ent ) ? ent->client->pers.netname : "console",
|
||||
name, msg );
|
||||
}
|
||||
|
||||
if( ignored )
|
||||
{
|
||||
Com_sprintf( str, sizeof( str ), "^%cignored by %i player%s: ^7", color,
|
||||
ignored, ( ignored == 1 ) ? "" : "s" );
|
||||
for( i=0; i < ignored; i++ )
|
||||
{
|
||||
tmpent = &g_entities[ ignoreids[ i ] ];
|
||||
if( i > 0 )
|
||||
Q_strcat( str, sizeof( str ), "^7, " );
|
||||
Q_strcat( str, sizeof( str ), tmpent->client->pers.netname );
|
||||
}
|
||||
ADMP( va( "%s\n", str ) );
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
=================
|
||||
G_AdminMessage
|
||||
|
@@ -705,7 +705,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
||||
if ( level.time - attacker->client->lastKillTime < CARNAGE_REWARD_TIME ) {
|
||||
// KK-OAX
|
||||
// Check if Multikills are enabled
|
||||
if( g_altExcellent.integer ) {
|
||||
if( g_multiKill.integer ) {
|
||||
attacker->client->pers.multiKillCount++;
|
||||
G_checkForMultiKill( attacker );
|
||||
} // play excellent on player
|
||||
|
@@ -77,9 +77,9 @@ qboolean G_ReadAltKillSettings( gentity_t *ent, int skiparg )
|
||||
// If the config file is not defined...forget reading/loading
|
||||
if( !g_sprees.string[0] ) {
|
||||
//Let's disable multikills to keep stock excellent sound
|
||||
if( g_altExcellent.integer == 1 )
|
||||
if( g_multiKill.integer == 1 )
|
||||
{
|
||||
trap_Cvar_Set( "g_altExcellent", "0" );
|
||||
trap_Cvar_Set( "g_multiKill", "0" );
|
||||
}
|
||||
return qfalse;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ qboolean G_ReadAltKillSettings( gentity_t *ent, int skiparg )
|
||||
//If the file can't be accessed/opened.
|
||||
if( length < 0 ) {
|
||||
G_Printf( "Could not open configuration file for Sprees and Multikills %s\n", g_sprees.string );
|
||||
trap_Cvar_Set( "g_altExcellent", "0" );
|
||||
trap_Cvar_Set( "g_multiKill", "0" );
|
||||
return qfalse;
|
||||
}
|
||||
//Allocate some memory.
|
||||
@@ -209,8 +209,8 @@ qboolean G_ReadAltKillSettings( gentity_t *ent, int skiparg )
|
||||
level.mKillUBound = -1;
|
||||
//KK-OAX We don't have any kills defined, revert to stock.
|
||||
//FIXME: Make sure this change shows up in the console...
|
||||
if( g_altExcellent.integer == 1 ) {
|
||||
trap_Cvar_Set( "g_altExcellent", "0" );
|
||||
if( g_multiKill.integer == 1 ) {
|
||||
trap_Cvar_Set( "g_multiKill", "0" );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -514,4 +514,4 @@ void G_checkForMultiKill( gentity_t *ent ) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1120,7 +1120,7 @@ extern vmCvar_t g_lagLightning;
|
||||
//unlagged - server options
|
||||
//KK-OAX Killing Sprees
|
||||
extern vmCvar_t g_sprees; //Used for specifiying the config file
|
||||
extern vmCvar_t g_altExcellent; //Turns on Multikills instead of Excellent
|
||||
extern vmCvar_t g_multiKill; //Turns on Multikills instead of Excellent
|
||||
extern vmCvar_t g_spreeDiv; // Interval of a "streak" that form the spree triggers
|
||||
//KK-OAX Command/Chat Flooding/Spamming
|
||||
extern vmCvar_t g_floodMaxDemerits;
|
||||
|
@@ -167,7 +167,7 @@ vmCvar_t g_lagLightning; //Adds a little lag to the lightninggun to make
|
||||
//unlagged - server options
|
||||
//KK-OAX
|
||||
vmCvar_t g_sprees;
|
||||
vmCvar_t g_altExcellent;
|
||||
vmCvar_t g_multiKill;
|
||||
vmCvar_t g_spreeDiv;
|
||||
|
||||
//Command/Chat spamming/flooding
|
||||
@@ -357,7 +357,7 @@ static cvarTable_t gameCvarTable[] = {
|
||||
|
||||
//KK-OAX
|
||||
{ &g_sprees, "g_sprees", "sprees.dat", 0, 0, qfalse },
|
||||
{ &g_altExcellent, "g_altExcellent", "0", CVAR_SERVERINFO, 0, qtrue},
|
||||
{ &g_multiKill, "g_multiKill", "0", CVAR_SERVERINFO, 0, qtrue},
|
||||
{ &g_spreeDiv, "g_spreeDiv", "5", 0, 0, qfalse},
|
||||
|
||||
//Used for command/chat flooding
|
||||
|
Reference in New Issue
Block a user