diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-07-12 14:51:43 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-07-12 14:51:43 +0100 |
commit | ba41749cc6a6693f11a7f1c7535ff758a461a424 (patch) | |
tree | 945786de1feff62180ea7c451c09482a3af823ac /Northstar.CustomServers/scripts/vscripts/_loadouts_mp.gnut | |
parent | 07b7eafd5c1845c70510b695446c23973fed1d4d (diff) | |
download | NorthstarMods-ba41749cc6a6693f11a7f1c7535ff758a461a424.tar.gz NorthstarMods-ba41749cc6a6693f11a7f1c7535ff758a461a424.zip |
add hardpoint, infection changes, fra changes
Diffstat (limited to 'Northstar.CustomServers/scripts/vscripts/_loadouts_mp.gnut')
-rw-r--r-- | Northstar.CustomServers/scripts/vscripts/_loadouts_mp.gnut | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Northstar.CustomServers/scripts/vscripts/_loadouts_mp.gnut b/Northstar.CustomServers/scripts/vscripts/_loadouts_mp.gnut index 74f5e047..2a6eb5a8 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<string> args ) +bool function ClientCommandCallback_LoadoutMenuClosed( entity player, array<string> args ) { SavePdataForEntityIndex( player.GetPlayerIndex() ) TryGivePilotLoadoutForGracePeriod( player ) return true } +bool function ClientCommandCallback_InGameMPMenuClosed( entity player, array<string> 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 } |