From ba41749cc6a6693f11a7f1c7535ff758a461a424 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Mon, 12 Jul 2021 14:51:43 +0100 Subject: add hardpoint, infection changes, fra changes --- .../scripts/vscripts/_loadouts_mp.gnut | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Northstar.CustomServers/scripts/vscripts/_loadouts_mp.gnut') diff --git a/Northstar.CustomServers/scripts/vscripts/_loadouts_mp.gnut b/Northstar.CustomServers/scripts/vscripts/_loadouts_mp.gnut index 74f5e0476..2a6eb5a8c 100644 --- a/Northstar.CustomServers/scripts/vscripts/_loadouts_mp.gnut +++ b/Northstar.CustomServers/scripts/vscripts/_loadouts_mp.gnut @@ -34,7 +34,10 @@ void function SvLoadoutsMP_Init() AddClientCommandCallback( "SetFactionChoicePersistenceSlot", ClientCommandCallback_SetFactionChoicePersistenceSlot ) } else + { AddClientCommandCallback( "InGameMPMenuClosed", ClientCommandCallback_InGameMPMenuClosed ) + AddClientCommandCallback( "LoadoutMenuClosed", ClientCommandCallback_LoadoutMenuClosed ) + } AddCallback_OnPlayerKilled( DestroyDroppedWeapon ) } @@ -216,13 +219,20 @@ bool function ClientCommandCallback_SetFactionChoicePersistenceSlot( entity play return true } -bool function ClientCommandCallback_InGameMPMenuClosed( entity player, array args ) +bool function ClientCommandCallback_LoadoutMenuClosed( entity player, array args ) { SavePdataForEntityIndex( player.GetPlayerIndex() ) TryGivePilotLoadoutForGracePeriod( player ) return true } +bool function ClientCommandCallback_InGameMPMenuClosed( entity player, array args ) +{ + SavePdataForEntityIndex( player.GetPlayerIndex() ) + //TryGivePilotLoadoutForGracePeriod( player ) + return true +} + bool function IsRefValidAndOfType( string ref, int itemType ) { return IsRefValid( ref ) && GetItemType( ref ) == itemType @@ -230,7 +240,7 @@ bool function IsRefValidAndOfType( string ref, int itemType ) void function SetPlayerLoadoutDirty( entity player ) { - if ( file.loadoutGracePeriodEnabled ) + if ( file.loadoutGracePeriodEnabled || player.p.usingLoadoutCrate ) file.dirtyLoadouts.append( player ) } @@ -240,8 +250,11 @@ void function TryGivePilotLoadoutForGracePeriod( entity player ) { file.dirtyLoadouts.remove( file.dirtyLoadouts.find( player ) ) - if ( Time() - player.s.respawnTime <= CLASS_CHANGE_GRACE_PERIOD ) + if ( Time() - player.s.respawnTime <= CLASS_CHANGE_GRACE_PERIOD || player.p.usingLoadoutCrate ) + { Loadouts_TryGivePilotLoadout( player ) + player.p.usingLoadoutCrate = false + } else SendHudMessage( player, "#LOADOUT_CHANGE_NEXT_BOTH", -1, 0.4, 255, 255, 255, 255, 0.15, 3.0, 0.5 ) // like 90% sure this is innacurate lol } -- cgit v1.2.3