Added /builder command and flag (+)
Upped max admin commands and flags to 128 (200% of original value). Wiki
This commit is contained in:
1 parent
6cb47ac868
commit
56a06e3ff0
4 files changed
+48
-3
No files matched your search
+3
-2
@@ -38,8 +38,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#define MAX_ADMIN_NAMELOG_NAMES 5
|
||||
#define MAX_ADMIN_ADMINLOGS 128
|
||||
#define MAX_ADMIN_ADMINLOG_ARGS 50
|
||||
#define MAX_ADMIN_FLAGS 64
|
||||
#define MAX_ADMIN_COMMANDS 64
|
||||
#define MAX_ADMIN_FLAGS 128
|
||||
#define MAX_ADMIN_COMMANDS 128
|
||||
#define MAX_ADMIN_CMD_LEN 20
|
||||
#define MAX_ADMIN_BAN_REASON 50
|
||||
|
||||
@@ -79,6 +79,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#define ADMF_SEESFULLLISTPLAYERS '$'
|
||||
#define ADMF_DBUILDER '#'
|
||||
#define ADMF_ADMINCHAT '?'
|
||||
#define ADMF_BUILDCHECK '+'
|
||||
|
||||
#define ADMF_BANIMMUNITY '&'
|
||||
|
||||
|
||||
@@ -3516,6 +3516,7 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori
|
||||
BG_FindNameForBuildable( built->s.modelindex ) );
|
||||
}
|
||||
|
||||
|
||||
// ok we're all done building, so what we log here should be the final values
|
||||
if( builder && builder->client ) // log ingame building only
|
||||
{
|
||||
@@ -3530,6 +3531,12 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori
|
||||
VectorCopy( built->s.angles2, new->angles2 );
|
||||
new->fate = BF_BUILT;
|
||||
}
|
||||
|
||||
built->madeby = ( builder->client ) ? builder->client->pers.netname : "<world>";
|
||||
if( !builder->client )
|
||||
built->bdnumb = -1;
|
||||
else
|
||||
built->bdnumb = new->ID ;
|
||||
|
||||
return built;
|
||||
}
|
||||
|
||||
+35
-1
@@ -3385,6 +3385,39 @@ void Cmd_Protect_f( gentity_t *ent )
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Cmd_Builder_f
|
||||
=================
|
||||
*/
|
||||
void Cmd_Builder_f( gentity_t *ent )
|
||||
{
|
||||
vec3_t forward, end;
|
||||
trace_t tr;
|
||||
gentity_t *traceEnt;
|
||||
char bdnumbchr[21];
|
||||
|
||||
if( !G_admin_permission( ent, ADMF_BUILDCHECK ) )
|
||||
return;
|
||||
|
||||
AngleVectors( ent->client->ps.viewangles, forward, NULL, NULL );
|
||||
VectorMA( ent->client->ps.origin, 100, forward, end );
|
||||
|
||||
trap_Trace( &tr, ent->client->ps.origin, NULL, NULL, end, ent->s.number,
|
||||
MASK_PLAYERSOLID );
|
||||
traceEnt = &g_entities[ tr.entityNum ];
|
||||
|
||||
Com_sprintf( bdnumbchr, sizeof(bdnumbchr), "%i", traceEnt->bdnumb );
|
||||
|
||||
if( tr.fraction < 1.0f && ( traceEnt->s.eType == ET_BUILDABLE ) &&
|
||||
( traceEnt->biteam == ent->client->pers.teamSelection ) )
|
||||
{
|
||||
|
||||
trap_SendServerCommand( ent-g_entities, va(
|
||||
"print \"Building was built by: %s^7, buildlog number: %s^7\n\"", traceEnt->madeby, (traceEnt->bdnumb != -1) ? bdnumbchr : "none" ) );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Cmd_Resign_f
|
||||
@@ -4239,7 +4272,8 @@ commands_t cmds[ ] = {
|
||||
{ "share", CMD_TEAM, Cmd_Share_f },
|
||||
{ "donate", CMD_TEAM, Cmd_Donate_f },
|
||||
{ "protect", CMD_TEAM|CMD_LIVING, Cmd_Protect_f },
|
||||
{ "resign", CMD_TEAM, Cmd_Resign_f }
|
||||
{ "resign", CMD_TEAM, Cmd_Resign_f },
|
||||
{ "builder", CMD_TEAM, Cmd_Builder_f }
|
||||
};
|
||||
static int numCmds = sizeof( cmds ) / sizeof( cmds[ 0 ] );
|
||||
|
||||
|
||||
@@ -240,6 +240,9 @@ struct gentity_s
|
||||
int suicideTime; // when the client will suicide
|
||||
|
||||
int lastDamageTime;
|
||||
|
||||
char *madeby;
|
||||
int bdnumb;
|
||||
};
|
||||
|
||||
typedef enum
|
||||
|
||||
Reference in new issue
Block a user