diff --git a/Source/Client/Event.c b/Source/Client/Event.c index 7a3f3d18..1cb825e5 100755 --- a/Source/Client/Event.c +++ b/Source/Client/Event.c @@ -26,6 +26,17 @@ Init all the cmds in one place ================= */ void CSQC_ConsoleCommand_Init( void ) { + registercommand( "slot1" ); + registercommand( "slot2" ); + registercommand( "slot3" ); + registercommand( "slot4" ); + registercommand( "slot5" ); + registercommand( "slot6" ); + registercommand( "slot7" ); + registercommand( "slot8" ); + registercommand( "slot9" ); + registercommand( "slot10" ); + registercommand( "dev_testorbituary" ); registercommand( "minimap" ); registercommand( "overview_test" ); @@ -41,6 +52,7 @@ void CSQC_ConsoleCommand_Init( void ) { registercommand( "buy" ); registercommand( "chooseteam" ); + registercommand( "lastinv" ); registercommand( "invnext" ); registercommand( "invprev" ); registercommand( "+showscores" ); @@ -76,7 +88,9 @@ void CSQC_ConsoleCommand_Init( void ) { registercommand( "m249" ); registercommand( "primammo" ); + registercommand( "buyammo1" ); registercommand( "secammo" ); + registercommand( "buyammo2" ); registercommand( "vest" ); registercommand( "vesthelm" ); @@ -123,6 +137,50 @@ float CSQC_ConsoleCommand( string sCMD ) { tokenize( sCMD ); switch ( argv( 0 ) ) { + case "lastinv": + HUD_DrawWeaponSelect_Last(); + return TRUE; + break; + case "slot1": + localcmd( "impulse 1\n" ); + return TRUE; + break; + case "slot2": + localcmd( "impulse 2\n" ); + return TRUE; + break; + case "slot3": + localcmd( "impulse 3\n" ); + return TRUE; + break; + case "slot4": + localcmd( "impulse 4\n" ); + return TRUE; + break; + case "slot5": + localcmd( "impulse 5\n" ); + return TRUE; + break; + case "slot6": + localcmd( "impulse 6\n" ); + return TRUE; + break; + case "slot7": + localcmd( "impulse 7\n" ); + return TRUE; + break; + case "slot8": + localcmd( "impulse 8\n" ); + return TRUE; + break; + case "slot9": + localcmd( "impulse 9\n" ); + return TRUE; + break; + case "slot10": + localcmd( "impulse 10\n" ); + return TRUE; + break; case "dev_testorbituary": HUD_AddOrbituaries( player_localnum, TEAM_T, player_localnum, TEAM_CT, floor( random( 1, CS_WEAPON_COUNT ) ), FALSE ); return TRUE; @@ -293,10 +351,12 @@ float CSQC_ConsoleCommand( string sCMD ) { sendevent( "PlayerBuyWeapon", "f", WEAPON_PARA ); return TRUE; break; + case "buyammo1": case "primammo": sendevent( "GamePlayerBuyAmmo", "f", 0 ); return TRUE; break; + case "buyammo2": case "secammo": sendevent( "GamePlayerBuyAmmo", "f", 1 ); return TRUE; diff --git a/Source/Client/HUDWeaponSelect.c b/Source/Client/HUDWeaponSelect.c index b1567120..c89d02c3 100755 --- a/Source/Client/HUDWeaponSelect.c +++ b/Source/Client/HUDWeaponSelect.c @@ -370,16 +370,31 @@ void HUD_DrawWeaponSelect( void ) { } } + +var float fHUDWeaponLast; /* ================= -HUD_DrawWeaponSelect +HUD_DrawWeaponSelect_Trigger Called by CSQC_Input_Frame when conditions are met ================= */ void HUD_DrawWeaponSelect_Trigger( void ) { + fHUDWeaponLast = getstatf( STAT_ACTIVEWEAPON ); sendevent( "PlayerSwitchWeapon", "f", pSeat->fHUDWeaponSelected ); sound( self, CHAN_ITEM, "common/wpn_select.wav", 0.5, ATTN_NONE ); pSeat->fHUDWeaponSelectTime = 0; pSeat->fHUDWeaponSelected = 0; } + +/* +================= +HUD_DrawWeaponSelect_Last + +Returns the last weapon we've used +================= +*/ +void HUD_DrawWeaponSelect_Last( void ) { + sendevent( "PlayerSwitchWeapon", "f", fHUDWeaponLast ); + fHUDWeaponLast = getstatf( STAT_ACTIVEWEAPON ); +} diff --git a/Source/Shared/Weapons.c b/Source/Shared/Weapons.c index 60c9e4a7..7cabe882 100755 --- a/Source/Shared/Weapons.c +++ b/Source/Shared/Weapons.c @@ -524,6 +524,9 @@ Client-HUD call that switches to a specific weapon ================= */ void CSEv_PlayerSwitchWeapon_f( float fWeapon ) { + if ( Weapon_AlreadyExists( fWeapon ) == FALSE && fWeapon != WEAPON_KNIFE ) { + return; + } if ( fWeapon != self.weapon ) { Weapon_Draw( fWeapon ); } @@ -539,5 +542,4 @@ Client call that tells us to drop the currently equipped weapon void CSEv_WeaponDrop( void ) { Weapon_DropWeapon( wptTable[ self.weapon ].iSlot ); } - #endif diff --git a/freecs/csprogs.dat b/freecs/csprogs.dat index 6de45c80..87e68b72 100755 Binary files a/freecs/csprogs.dat and b/freecs/csprogs.dat differ diff --git a/freecs/default.cfg b/freecs/default.cfg index 32c50e79..72e3e953 100755 --- a/freecs/default.cfg +++ b/freecs/default.cfg @@ -2,6 +2,16 @@ bind w +forward bind s +back bind a +moveleft bind d +moveright +bind "0" "slot10" +bind "1" "slot1" +bind "2" "slot2" +bind "3" "slot3" +bind "4" "slot4" +bind "5" "slot5" +bind "6" "slot6" +bind "7" "slot7" +bind "8" "slot8" +bind "9" "slot9" bind "UPARROW" "+forward" bind "DOWNARROW" "+back" bind "LEFTARROW" "+left" @@ -20,11 +30,6 @@ bind x radio2 bind z radio1 bind t messagemode -bind 1 "impulse 1" -bind 2 "impulse 2" -bind 3 "impulse 3" -bind 4 "impulse 4" - bind SPACE +jump bind CTRL +duck bind SHIFT +speed diff --git a/freecs/progs.dat b/freecs/progs.dat index 9c2bcf45..5a16a947 100755 Binary files a/freecs/progs.dat and b/freecs/progs.dat differ