Fixes #59 by actually testing this shoddy code I wrote
Adds color sliders for the HUD, Crosshair etc. in the Player options Fixed some other small things someone might notice
This commit is contained in:
parent
4568b0a31c
commit
eba1491409
16 changed files with 216 additions and 108 deletions
|
@ -39,8 +39,9 @@ var vector autocvar_cross_color = '0 255 0'; // autocvar of "cross_color"
|
|||
var float autocvar_cl_bob = 0.01;
|
||||
var float autocvar_cl_bobcycle = 0.8;
|
||||
var float autocvar_cl_bobup = 0.5;
|
||||
var float autocvar_cl_bobclassic = 0;
|
||||
var float autocvar_v_lefthanded = 0;
|
||||
var int autocvar_cl_bobclassic = FALSE;
|
||||
var int autocvar_v_lefthanded = FALSE;
|
||||
var int autocvar_cl_thirdperson = FALSE;
|
||||
|
||||
// Particle stuff
|
||||
var float PARTICLE_SPARK;
|
||||
|
|
|
@ -48,6 +48,31 @@ string sPModels[ CS_WEAPON_COUNT - 1 ] = {
|
|||
"models/p_smokegrenade.mdl"
|
||||
};
|
||||
|
||||
void Player_Draw( void ) {
|
||||
if ( !self.eGunModel ) {
|
||||
self.eGunModel = spawn();
|
||||
self.eGunModel.drawmask = MASK_ENGINE;
|
||||
|
||||
// Get the weapon bone ID for the current player model
|
||||
self.fWeaponBoneID = gettagindex( self, "Bip01 R Hand" );
|
||||
}
|
||||
|
||||
// Only bother updating the model if the weapon has changed
|
||||
if ( self.fWeaponLast != self.weapon ) {
|
||||
setmodel( self.eGunModel, sPModels[ self.weapon - 1 ] );
|
||||
self.fWeaponLast = self.weapon;
|
||||
|
||||
// Update the bone index of the current p_ model so we can calculate the offset
|
||||
self.eGunModel.fWeaponBoneID = gettagindex( self.eGunModel, "Bip01 R Hand" );
|
||||
}
|
||||
|
||||
Animation_PlayerUpdate();
|
||||
self.baseframe1time += frametime;
|
||||
self.frame1time += frametime;
|
||||
|
||||
self.baseframe2time += frametime;
|
||||
self.frame2time += frametime;
|
||||
}
|
||||
/*
|
||||
=================
|
||||
Player_PreDraw
|
||||
|
@ -58,29 +83,33 @@ Responsible for local player prediction and other player appearance/interpolatio
|
|||
*/
|
||||
float Player_PreDraw( void ) {
|
||||
if ( self.entnum == player_localentnum ) {
|
||||
vector vOldOrigin;
|
||||
vector vOldVelocity;
|
||||
float fOldPMoveFlags;
|
||||
// Don't predict if we're frozen/paused FIXME: FTE doesn't have serverkey_float yet!
|
||||
if ( serverkey( SERVERKEY_PAUSESTATE ) == "1" || ( ( getstati( STAT_GAMESTATE ) == GAME_FREEZE ) && ( getstati( STAT_HEALTH ) > 0 ) ) ) {
|
||||
vPlayerOrigin = self.origin;
|
||||
vPlayerVelocity = '0 0 0';
|
||||
addentity( self );
|
||||
return PREDRAW_NEXT;
|
||||
}
|
||||
|
||||
vector vOldOrigin = self.origin;
|
||||
vector vOldVelocity = self.velocity;
|
||||
float fOldPMoveFlags = self.pmove_flags;
|
||||
|
||||
if ( getplayerkeyvalue( player_localnum, "*spec" ) == "0" ) {
|
||||
self.movetype = MOVETYPE_WALK;
|
||||
vOldOrigin = vPlayerOrigin;
|
||||
|
||||
self.velocity = '0 0 0';
|
||||
vOldVelocity = self.velocity;
|
||||
fOldPMoveFlags = 0;
|
||||
} else {
|
||||
self.movetype = MOVETYPE_NOCLIP;
|
||||
vOldOrigin = self.origin;
|
||||
vOldVelocity = self.velocity;
|
||||
fOldPMoveFlags = self.pmove_flags;
|
||||
|
||||
if ( getplayerkeyvalue( player_localnum, "*spec" ) == "0" ) {
|
||||
self.movetype = MOVETYPE_WALK;
|
||||
} else {
|
||||
self.movetype = MOVETYPE_NOCLIP;
|
||||
}
|
||||
|
||||
for ( int i = servercommandframe + 1; i <= clientcommandframe; i++ ) {
|
||||
getinputstate( i );
|
||||
runstandardplayerphysics( self );
|
||||
}
|
||||
}
|
||||
|
||||
for ( int i = servercommandframe + 1; i <= clientcommandframe; i++ ) {
|
||||
getinputstate( i );
|
||||
runstandardplayerphysics( self );
|
||||
}
|
||||
|
||||
vPlayerOriginOld = vPlayerOrigin;
|
||||
|
||||
if ( ( self.flags & FL_ONGROUND ) && ( self.origin_z - vPlayerOriginOld_z > 0 ) ) {
|
||||
|
@ -97,8 +126,26 @@ float Player_PreDraw( void ) {
|
|||
vPlayerOriginOld_z = self.origin_z;
|
||||
}
|
||||
|
||||
vPlayerOrigin = [ self.origin_x, self.origin_y, vPlayerOriginOld_z ];
|
||||
vPlayerVelocity = self.velocity;
|
||||
|
||||
if ( autocvar_cl_thirdperson == TRUE ) {
|
||||
static vector vStart;
|
||||
static vector vEnd;
|
||||
|
||||
makevectors( view_angles );
|
||||
vStart = [ self.origin_x, self.origin_y, vPlayerOriginOld_z + 8 ] + ( v_right * 4 );
|
||||
vEnd = vStart + ( v_forward * -48 ) + '0 0 8' + ( v_right * 4 );
|
||||
traceline( vStart, vEnd, FALSE, self );
|
||||
vPlayerOrigin = trace_endpos + ( v_forward * 5 );
|
||||
self.renderflags = 0;
|
||||
Player_Draw();
|
||||
} else {
|
||||
if ( self.eGunModel ) {
|
||||
remove( self.eGunModel );
|
||||
}
|
||||
self.renderflags = RF_EXTERNALMODEL;
|
||||
vPlayerOrigin = [ self.origin_x, self.origin_y, vPlayerOriginOld_z ];
|
||||
}
|
||||
addentity( self );
|
||||
|
||||
self.origin = vOldOrigin;
|
||||
|
@ -106,33 +153,8 @@ float Player_PreDraw( void ) {
|
|||
self.velocity = vOldVelocity;
|
||||
self.pmove_flags = fOldPMoveFlags;
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
|
||||
self.renderflags = RF_EXTERNALMODEL;
|
||||
} else {
|
||||
if ( !self.eGunModel ) {
|
||||
self.eGunModel = spawn();
|
||||
self.eGunModel.drawmask = MASK_ENGINE;
|
||||
|
||||
// Get the weapon bone ID for the current player model
|
||||
self.fWeaponBoneID = gettagindex( self, "Bip01 R Hand" );
|
||||
}
|
||||
|
||||
// Only bother updating the model if the weapon has changed
|
||||
if ( self.fWeaponLast != self.weapon ) {
|
||||
setmodel( self.eGunModel, sPModels[ self.weapon - 1 ] );
|
||||
self.fWeaponLast = self.weapon;
|
||||
|
||||
// Update the bone index of the current p_ model so we can calculate the offset
|
||||
self.eGunModel.fWeaponBoneID = gettagindex( self.eGunModel, "Bip01 R Hand" );
|
||||
}
|
||||
|
||||
Animation_PlayerUpdate();
|
||||
self.baseframe1time += frametime;
|
||||
self.frame1time += frametime;
|
||||
|
||||
self.baseframe2time += frametime;
|
||||
self.frame2time += frametime;
|
||||
|
||||
Player_Draw();
|
||||
addentity( self );
|
||||
}
|
||||
return PREDRAW_NEXT;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<project version="Crimson Editor 3.60">
|
||||
<category name="Client" expanded="yes">
|
||||
<category name="Client" expanded="no">
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Client\Defs.h" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Client\Draw.c" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Client\Entities.c" />
|
||||
|
@ -60,7 +60,7 @@
|
|||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\TraceAttack.c" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Triggers.c" />
|
||||
</category>
|
||||
<category name="Menu" expanded="no">
|
||||
<category name="Menu" expanded="yes">
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\Defs.h" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\Draw.c" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\Header.c" />
|
||||
|
@ -114,29 +114,18 @@
|
|||
</project>
|
||||
|
||||
<workspace version="Crimson Editor 3.60">
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\Defs.h" linenum="129" placement="0:1:-1:-1:-4:-23:198:198:1084:634" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\MenuMain.c" linenum="49" placement="0:1:-1:-1:-4:-23:0:0:886:436" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\Objects.c" linenum="330" placement="0:1:-1:-1:-4:-23:22:22:908:458" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\freecs\menu.dat.en.po" linenum="48" placement="0:1:-1:-1:-4:-23:44:44:930:480" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\MenuMultiplayer.c" linenum="163" placement="0:1:-1:-1:-4:-23:88:88:974:524" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Builtins.h" linenum="2160" placement="0:1:-1:-1:-4:-23:110:110:996:546" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\MenuConfiguration.c" linenum="298" placement="0:1:-1:-1:-4:-23:132:132:1018:568" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\freecs\default.cfg" linenum="65" placement="0:1:-1:-1:-4:-23:198:198:1084:634" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\freecs\ftesrv.cfg" linenum="9" placement="0:1:-1:-1:-4:-23:0:0:886:436" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\cstrike\gfx\shell\kb_act.lst" linenum="13" placement="0:1:-1:-1:-4:-23:44:44:930:480" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\Weapons.c" linenum="420" placement="0:1:-1:-1:-4:-23:88:88:974:524" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Client.c" linenum="64" placement="0:1:-1:-1:-4:-23:110:110:996:546" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Player.c" linenum="143" placement="0:1:-1:-1:-4:-23:132:132:1018:568" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Client\HUDOrbituaries.c" linenum="18" placement="0:1:-1:-1:-4:-23:154:154:1040:590" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Client\HUDScope.c" linenum="28" placement="0:1:-1:-1:-4:-23:176:176:1062:612" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\WeaponAUG.c" linenum="27" placement="0:1:-1:-1:-4:-23:198:198:1084:634" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Client\Draw.c" linenum="179" placement="0:1:-1:-1:-4:-23:0:0:886:436" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Main.c" linenum="439" placement="0:1:-1:-1:-4:-23:22:22:908:458" />
|
||||
<localfile path="C:\Users\User\Dropbox\The Wastes Build\sdk\Source\Client\View.c" linenum="129" placement="0:1:-1:-1:-4:-23:44:44:930:480" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Rules.c" linenum="140" placement="0:1:-1:-1:-4:-23:110:110:996:546" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\TraceAttack.c" linenum="1" placement="0:1:-1:-1:-4:-23:132:132:1018:568" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Timer.c" linenum="65" placement="0:1:-1:-1:-4:-23:154:154:1040:590" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Spawn.c" linenum="291" placement="0:1:-1:-1:-4:-23:176:176:1062:612" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\WeaponC4Bomb.c" linenum="82" placement="2:3:-1:-1:-4:-23:198:198:1084:634" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\MenuConfiguration.c" linenum="255" placement="0:1:-1:-1:-4:-23:198:198:1080:630" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Globals.h" linenum="1" placement="0:1:-1:-1:-4:-23:0:0:886:436" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\Defs.h" linenum="189" placement="0:1:-1:-1:-4:-23:22:22:908:458" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Client\Defs.h" linenum="37" placement="0:1:-1:-1:-4:-23:44:44:930:480" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\Objects.c" linenum="237" placement="0:1:-1:-1:-4:-23:66:66:952:502" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Builtins.h" linenum="2214" placement="0:1:-1:-1:-4:-23:88:88:974:524" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\freecs\menu.dat.en.po" linenum="49" placement="0:1:-1:-1:-4:-23:110:110:996:546" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Player.c" linenum="264" placement="0:1:-1:-1:-4:-23:132:132:1018:568" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\PhysicsMove.c" linenum="266" placement="0:1:-1:-1:-4:-23:154:154:1040:590" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Client.c" linenum="138" placement="0:1:-1:-1:-4:-23:176:176:1062:612" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\WeaponC4Bomb.c" linenum="89" placement="0:1:-1:-1:-4:-23:198:198:1084:634" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Rules.c" linenum="101" placement="0:1:-1:-1:-4:-23:0:0:886:436" />
|
||||
<localfile path="C:\cygwin\home\User\FreeCS\freecs\menu.dat.de.po" linenum="48" placement="2:3:-1:-1:-4:-23:22:22:908:458" />
|
||||
</workspace>
|
||||
|
||||
|
|
|
@ -182,5 +182,11 @@ typedef struct {
|
|||
int iHeaderID;
|
||||
} fcsMenu;
|
||||
|
||||
typedef struct {
|
||||
int iR;
|
||||
int iG;
|
||||
int iB;
|
||||
} color;
|
||||
|
||||
void Menu_SetClipArea( vector vPosition, vector vRegion );
|
||||
void Menu_ResetClipArea( void );
|
|
@ -240,6 +240,9 @@ Menu_Configuration_Player
|
|||
void Menu_Configuration_Player( void ) {
|
||||
static string strPlayername;
|
||||
static int iFirst = 1;
|
||||
static color cCross;
|
||||
static color cVGUI;
|
||||
static color cCon;
|
||||
|
||||
static void Player_OK( void ) {
|
||||
if ( strPlayername != __NULL__ ) {
|
||||
|
@ -248,15 +251,80 @@ void Menu_Configuration_Player( void ) {
|
|||
} else {
|
||||
strPlayername = cvar_string( "name" );
|
||||
}
|
||||
|
||||
cvar_set( "cross_color", sprintf( "%i %i %i", cCross.iR, cCross.iG, cCross.iB ) );
|
||||
cvar_set( "vgui_color", sprintf( "%i %i %i", cVGUI.iR, cVGUI.iG, cVGUI.iB ) );
|
||||
cvar_set( "con_color", sprintf( "%i %i %i", cCon.iR, cCon.iG, cCon.iB ) );
|
||||
}
|
||||
|
||||
if ( iFirst == 1 ) {
|
||||
float fCheck;
|
||||
strPlayername = cvar_string( "name" );
|
||||
|
||||
fCheck = tokenize( cvar_string( "cross_color" ) );
|
||||
if ( fCheck == 3 ) {
|
||||
cCross.iR = stof( argv( 0 ) );
|
||||
cCross.iG = stof( argv( 1 ) );
|
||||
cCross.iB = stof( argv( 2 ) );
|
||||
} else {
|
||||
// TODO... put this in a more global location? If this is changed, change Defs.h in Source/Client too!
|
||||
cCross.iR = 0;
|
||||
cCross.iG = 255;
|
||||
cCross.iB = 0;
|
||||
cvar_set( "cross_color", "0 255 0" );
|
||||
}
|
||||
|
||||
fCheck = tokenize( cvar_string( "vgui_color" ) );
|
||||
if ( fCheck == 3 ) {
|
||||
cVGUI.iR = stof( argv( 0 ) );
|
||||
cVGUI.iG = stof( argv( 1 ) );
|
||||
cVGUI.iB = stof( argv( 2 ) );
|
||||
} else {
|
||||
cVGUI.iR = 255;
|
||||
cVGUI.iG = 170;
|
||||
cVGUI.iB = 0;
|
||||
cvar_set( "vgui_color", "255 170 0" );
|
||||
}
|
||||
|
||||
fCheck = tokenize( cvar_string( "con_color" ) );
|
||||
if ( fCheck == 3 ) {
|
||||
cCon.iR = stof( argv( 0 ) );
|
||||
cCon.iG = stof( argv( 1 ) );
|
||||
cCon.iB = stof( argv( 2 ) );
|
||||
} else {
|
||||
cCon.iR = 255;
|
||||
cCon.iG = 170;
|
||||
cCon.iB = 0;
|
||||
cvar_set( "con_color", "255 170 0" );
|
||||
}
|
||||
|
||||
iFirst = 0;
|
||||
}
|
||||
|
||||
Object_Label( '196 148', _("PLAYER_NICK"), '8 8' );
|
||||
Object_Textfield( '196 160', strPlayername, 16 );
|
||||
|
||||
Object_Label( '196 200', _("PLAYER_CROSSCOLOR"), '8 8' );
|
||||
Object_ScrollbarH( '196 212', 255, cCross.iR );
|
||||
Object_ScrollbarH( '196 230', 255, cCross.iG );
|
||||
Object_ScrollbarH( '196 248', 255, cCross.iB );
|
||||
Object_Frame( '468 388', '52 52' );
|
||||
drawfill( vMenuOffset + '469 213', '50 50', [ cCross.iR / 255, cCross.iG / 255, cCross.iB / 255 ], 1.0f );
|
||||
|
||||
Object_Label( '196 288', _("PLAYER_GUICOLOR"), '8 8' );
|
||||
Object_ScrollbarH( '196 300', 255, cVGUI.iR );
|
||||
Object_ScrollbarH( '196 318', 255, cVGUI.iG );
|
||||
Object_ScrollbarH( '196 336', 255, cVGUI.iB );
|
||||
Object_Frame( '468 388', '52 52' );
|
||||
drawfill( vMenuOffset + '469 300', '50 50', [ cVGUI.iR / 255, cVGUI.iG / 255, cVGUI.iB / 255 ], 1.0f );
|
||||
|
||||
Object_Label( '196 376', _("PLAYER_HUDCOLOR"), '8 8' );
|
||||
Object_ScrollbarH( '196 388', 255, cCon.iR );
|
||||
Object_ScrollbarH( '196 406', 255, cCon.iG );
|
||||
Object_ScrollbarH( '196 424', 255, cCon.iB );
|
||||
Object_Frame( '468 388', '52 52' );
|
||||
drawfill( vMenuOffset + '469 388', '50 50', [ cCon.iR / 255, cCon.iG / 255, cCon.iB / 255 ], 1.0f );
|
||||
|
||||
Object_Button( '32 148', BTN_OK, Player_OK, fButtonAlpha[0] );
|
||||
Object_Button( '32 180', BTN_CANCEL, Menu_Configuration_ButtonCancel, fButtonAlpha[1] );
|
||||
}
|
||||
|
|
|
@ -227,27 +227,26 @@ void Object_ScrollbarH( vector vPosition, int iWidth, __inout int iProgress ) {
|
|||
|
||||
vPosition += vMenuOffset;
|
||||
|
||||
if ( ( iScrollbarHold == TRUE ) || ( Menu_InputCheckMouse( [vPosition_x + iProgress, vPosition_y ], '16 16' ) == TRUE ) ) {
|
||||
if ( ( Menu_InputCheckMouse( [vPosition_x, vPosition_y ], [ iWidth, 16 ] ) == TRUE ) ) {
|
||||
if ( fMouseClick == TRUE ) {
|
||||
iProgress = ( vMousePos_x - vPosition_x );
|
||||
iScrollbarHold = TRUE;
|
||||
}
|
||||
|
||||
if ( fScrollWheel == SCROLL_DOWN ) {
|
||||
iProgress += 2;
|
||||
fScrollWheel = SCROLL_NONE;
|
||||
} else if ( fScrollWheel == SCROLL_UP ) {
|
||||
iProgress -= 2;
|
||||
fScrollWheel = SCROLL_NONE;
|
||||
}
|
||||
|
||||
if ( iProgress < 0 ) {
|
||||
iProgress = 0;
|
||||
} else if ( iProgress > iWidth ) {
|
||||
iProgress = iWidth;
|
||||
}
|
||||
}
|
||||
|
||||
if ( fScrollWheel == SCROLL_DOWN ) {
|
||||
iProgress += 2;
|
||||
fScrollWheel = SCROLL_NONE;
|
||||
} else if ( fScrollWheel == SCROLL_UP ) {
|
||||
iProgress -= 2;
|
||||
fScrollWheel = SCROLL_NONE;
|
||||
}
|
||||
|
||||
if ( iProgress < 0 ) {
|
||||
iProgress = 0;
|
||||
} else if ( iProgress > iWidth ) {
|
||||
iProgress = iWidth;
|
||||
}
|
||||
|
||||
|
||||
drawfill( [ vPosition_x + iProgress, vPosition_y ], [ 16, 16 ], autocvar_menu_fgcolor, 1.0f );
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ void SV_SendChat( entity eSender, string sMessage, entity eEnt, float fType ) {
|
|||
WriteString( MSG_MULTICAST, sMessage );
|
||||
msg_entity = eEnt;
|
||||
multicast( '0 0 0', MULTICAST_ONE );
|
||||
|
||||
localcmd( sprintf( "echo %s: %s\n", eSender.netname, sMessage ) );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -261,7 +261,7 @@ void Player_UseDown( void ) {
|
|||
traceline ( vSource, vSource + ( v_forward * 64 ), FALSE, self);
|
||||
|
||||
if ( trace_ent.iUsable ) {
|
||||
if ( ( trace_ent.weapon == WEAPON_C4BOMB ) && ( trace_ent.classname != "func_pushable" ) ) {
|
||||
if ( ( trace_ent.classname != "c4bomb" ) && ( trace_ent.classname != "func_pushable" ) ) {
|
||||
self.flags = ( self.flags - FL_USERELEASED );
|
||||
sound( self, CHAN_ITEM, "common/wpn_select.wav", 0.25, ATTN_IDLE );
|
||||
}
|
||||
|
|
|
@ -106,6 +106,11 @@ void Rules_Restart( void ) {
|
|||
remove( eFind );
|
||||
}
|
||||
|
||||
// Find the bombs. Destory them!
|
||||
for ( entity eFind = world; ( eFind = find( eFind, classname, "c4bomb" ) ); ) {
|
||||
remove( eFind );
|
||||
}
|
||||
|
||||
// Select a random Terrorist for the bomb, if needed
|
||||
if ( iBombZones > 0 ) {
|
||||
int iRandomT = floor( random( 1, (float)iAlivePlayers_T + 1 ) );
|
||||
|
|
|
@ -64,9 +64,11 @@ var float fBeepTime; // Used for the beeping sounds that last 1.5 seconds
|
|||
var float fDefuseProgress; // Used to track... the progress
|
||||
|
||||
static void WeaponC4BOMB_Use( void ) {
|
||||
/*if ( eActivator.team != TEAM_CT ) {
|
||||
return;
|
||||
}*/
|
||||
if ( cvar( "developer" ) == 0 ) {
|
||||
if ( eActivator.team != TEAM_CT ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// On first use, play defusing sound
|
||||
if ( self.eUser == world ) {
|
||||
|
@ -93,8 +95,7 @@ static void WeaponC4BOMB_Use( void ) {
|
|||
fDefuseProgress += 0.01;
|
||||
}
|
||||
|
||||
eActivator.fProgressBar = (fDefuseProgress * 0.1);
|
||||
self.fProgressBar = time + 1.0f;
|
||||
eActivator.fProgressBar = fDefuseProgress * 0.1;
|
||||
|
||||
// Make sure WeaponC4BOMB_Think knows who the user is
|
||||
self.eUser = eActivator;
|
||||
|
@ -103,11 +104,9 @@ static void WeaponC4BOMB_Use( void ) {
|
|||
static void WeaponC4BOMB_Think( void ) {
|
||||
// If the guy who started using us stopped using us, reset the defuser counter
|
||||
if ( ( self.eUser != world ) && ( self.eUser.button6 == FALSE ) ) {
|
||||
if ( self.fProgressBar < time ) {
|
||||
self.eUser.fProgressBar = 0;
|
||||
self.eUser = world;
|
||||
fDefuseProgress = 0;
|
||||
}
|
||||
self.eUser.fProgressBar = 0;
|
||||
self.eUser = world;
|
||||
fDefuseProgress = 0;
|
||||
}
|
||||
|
||||
// If our time has passed, explode
|
||||
|
@ -163,10 +162,9 @@ static void WeaponC4BOMB_Think( void ) {
|
|||
void WeaponC4BOMB_Drop( vector vBombPos ) {
|
||||
// Do all the dirty entspawning stuff
|
||||
entity eBomb = spawn();
|
||||
eBomb.classname = "remove_me";
|
||||
eBomb.classname = "c4bomb";
|
||||
|
||||
eBomb.solid = SOLID_BBOX;
|
||||
eBomb.weapon = WEAPON_C4BOMB;
|
||||
setmodel( eBomb, "models/w_c4.mdl" );
|
||||
setorigin( eBomb, vBombPos );
|
||||
setsize( eBomb, '-6 -6 0', '6 6 6' );
|
||||
|
|
|
@ -132,7 +132,7 @@ void Weapon_PrimaryAttack( float fWeapon ) {
|
|||
return;
|
||||
#endif
|
||||
#ifdef CSQC
|
||||
if ( fWeaponEventPlayer != player_localentnum ) {
|
||||
if ( fWeaponEventPlayer != player_localentnum || autocvar_cl_thirdperson == TRUE ) {
|
||||
entity ono = findfloat( world, entnum, fWeaponEventPlayer );
|
||||
if ( ono != __NULL__ ) {
|
||||
Animation_ShootWeapon( ono );
|
||||
|
@ -156,7 +156,7 @@ void Weapon_SecondaryAttack( float fWeapon ) {
|
|||
}
|
||||
#endif
|
||||
#ifdef CSQC
|
||||
if ( fWeaponEventPlayer != player_localentnum ) {
|
||||
if ( fWeaponEventPlayer != player_localentnum || autocvar_cl_thirdperson == TRUE ) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -175,7 +175,7 @@ void Weapon_Reload( float fWeapon ) {
|
|||
}
|
||||
#endif
|
||||
#ifdef CSQC
|
||||
if ( fWeaponEventPlayer != player_localentnum ) {
|
||||
if ( fWeaponEventPlayer != player_localentnum || autocvar_cl_thirdperson == TRUE ) {
|
||||
entity ono = findfloat( world, entnum, fWeaponEventPlayer );
|
||||
if ( ono != __NULL__ ) {
|
||||
Animation_ReloadWeapon( ono );
|
||||
|
|
Binary file not shown.
BIN
freecs/menu.dat
BIN
freecs/menu.dat
Binary file not shown.
|
@ -39,4 +39,13 @@ msgid "AUDIO_MASTER"
|
|||
msgstr "Lautstaerke:"
|
||||
|
||||
msgid "VIDEO_RES"
|
||||
msgstr "Aufloesung:"
|
||||
msgstr "Aufloesung:"
|
||||
|
||||
msgid "PLAYER_CROSSCOLOR"
|
||||
msgstr "Fadenkreuz Farbe:"
|
||||
|
||||
msgid "PLAYER_GUICOLOR"
|
||||
msgstr "UI Farbe:"
|
||||
|
||||
msgid "PLAYER_HUDCOLOR"
|
||||
msgstr "Heads-Up-Display Farbe:"
|
|
@ -45,4 +45,13 @@ msgid "VIDEO_RESTARTMSG"
|
|||
msgstr "Some settings will require you to REFRESH your renderer. Please do so with the option on the left. "
|
||||
|
||||
msgid "PLAYER_NICK"
|
||||
msgstr "Nickname:"
|
||||
msgstr "Nickname:"
|
||||
|
||||
msgid "PLAYER_CROSSCOLOR"
|
||||
msgstr "Crosshair Color:"
|
||||
|
||||
msgid "PLAYER_GUICOLOR"
|
||||
msgstr "UI Color:"
|
||||
|
||||
msgid "PLAYER_HUDCOLOR"
|
||||
msgstr "Heads-Up-Display Color:"
|
BIN
freecs/progs.dat
BIN
freecs/progs.dat
Binary file not shown.
Loading…
Reference in a new issue