diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-10-20 20:11:43 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-10-20 20:11:43 +0100 |
commit | e79a58640e1ef1ea1c3c954aefccd36c3cb55286 (patch) | |
tree | 8c7b822f8777ccdf6b0d86587da853b8451953c1 /Northstar.Custom/mod/scripts/vscripts | |
parent | d37c5ae333b4e622ebd0d18cf02a87d66aac62f9 (diff) | |
download | NorthstarMods-e79a58640e1ef1ea1c3c954aefccd36c3cb55286.tar.gz NorthstarMods-e79a58640e1ef1ea1c3c954aefccd36c3cb55286.zip |
automatic mod enable/disable, refactors and item registration callbacks
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts')
15 files changed, 32 insertions, 378 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut index e0178034..8c68f554 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut @@ -15,6 +15,10 @@ void function GamemodeGG_Init() AddCallback_OnPlayerKilled( OnPlayerKilled ) AddCallback_GameStateEnter( eGameState.WinnerDetermined, OnWinnerDetermined ) + + // set scorelimit if it's wrongm sort of a jank way to do it but best i've got rn + if ( GetCurrentPlaylistVarInt( "scorelimit", GetGunGameWeapons().len() ) != GetGunGameWeapons().len() ) + SetPlaylistVarOverride( "scorelimit", GetGunGameWeapons().len().tostring() ) } void function OnPlayerRespawned( entity player ) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sbox.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sbox.gnut deleted file mode 100644 index 27581aea..00000000 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sbox.gnut +++ /dev/null @@ -1,49 +0,0 @@ -untyped -global function GamemodeSbox_Init - -struct { - array<entity> spawnpoints -} file - -void function GamemodeSbox_Init() -{ - SetConVarInt( "sv_cheats", 1 ) // cheats on by default - - // cache spawnpoints - //file.spawnpoints = GetEntArrayByClass_Expensive( "info_spawnpoint_human" ) - // todo just use a spawn callback for this rather than weird late cache in spawn - - AddCallback_OnClientConnected( SboxSpawnPlayer ) - AddDeathCallback( "player", SboxRespawnPlayer ) -} - -void function SboxSpawnPlayer( entity player ) -{ - if ( player.GetPlayerSettings() == "spectator" ) // if they haven't spawned yet - player.SetPlayerSettings( "pilot_grapple_male" ) - - if ( file.spawnpoints.len() == 0 ) // have to cache late rather than on init due to spawnpoints not existing in init - file.spawnpoints = GetEntArrayByClass_Expensive( "info_spawnpoint_human" ) - - if ( GetGameState() != eGameState.Playing ) // hacky but can't set this in init either - SetGameState( eGameState.Playing ) - - entity spawnpoint = file.spawnpoints[ RandomInt( file.spawnpoints.len() ) ] - - ScreenFadeFromBlack( player, 0.0, 0.0 ) // HACK before non-classicmp intros are ready, remove the blackscreen we get from waitingforplayers - player.RespawnPlayer( spawnpoint ) - player.GiveWeapon( "mp_weapon_toolgun" ) -} - -void function SboxRespawnPlayer( entity player, var damageInfo ) -{ - thread SboxRespawnPlayerThreaded( player ) -} - -void function SboxRespawnPlayerThreaded( entity player ) -{ - // todo: replace this with real respawn logic when that's ready - - wait 2.5 - SboxSpawnPlayer( player ) -}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_sbox.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_sbox.gnut deleted file mode 100644 index 893d9410..00000000 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_sbox.gnut +++ /dev/null @@ -1,20 +0,0 @@ -global function Sh_GamemodeSbox_Init - -global const string GAMEMODE_SBOX = "sbox" - -void function Sh_GamemodeSbox_Init() -{ - // create custom gametype - AddCallback_OnCustomGamemodesInit( CreateGamemodeSbox ) -} - -void function CreateGamemodeSbox() -{ - GameMode_Create( GAMEMODE_SBOX ) - GameMode_SetName( GAMEMODE_SBOX, "#PL_sbox" ) - GameMode_SetDesc( GAMEMODE_SBOX, "#PL_sbox_desc" ) - - #if SERVER - GameMode_AddServerInit( GAMEMODE_SBOX, GamemodeSbox_Init ) - #endif -}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_riff_instagib.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_riff_instagib.gnut index b3868359..316893bb 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_riff_instagib.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_riff_instagib.gnut @@ -1,12 +1,17 @@ global function RiffInstagib_Init +#if SERVER struct { table<entity, int> playerWeapons array<string> instagibWeapons } file +#endif void function RiffInstagib_Init() { + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_RIFF", "riff_instagib", [ "Disabled", "Enabled" ], "0" ) + + #if SERVER if ( GetCurrentPlaylistVarInt( "riff_instagib", 0 ) == 0 ) return @@ -26,8 +31,10 @@ void function RiffInstagib_Init() AddCallback_OnPlayerRespawned( InstagibSetWeapons ) AddCallback_OnPlayerKilled( InstagibCycleWeaponsForKill ) AddCallback_OnClientDisconnected( InstagibCleanupClient ) + #endif } +#if SERVER void function InstagibSetWeapons( entity player ) { if ( !( player in file.playerWeapons ) ) @@ -62,4 +69,5 @@ void function InstagibCleanupClient( entity player ) { if ( player in file.playerWeapons ) delete file.playerWeapons[ player ] -}
\ No newline at end of file +} +#endif
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/northstar_custom_autoprecache.gnut b/Northstar.Custom/mod/scripts/vscripts/northstar_custom_autoprecache.gnut deleted file mode 100644 index 1d5b7ba9..00000000 --- a/Northstar.Custom/mod/scripts/vscripts/northstar_custom_autoprecache.gnut +++ /dev/null @@ -1,14 +0,0 @@ -untyped -global function NorthstarCustomAutoprecache - -void function NorthstarCustomAutoprecache() -{ - PrecacheWeapon( "mp_weapon_peacekraber" ) - PrecacheWeapon( "melee_pilot_kunai" ) - - if ( GAMETYPE == GAMEMODE_SBOX ) - PrecacheWeapon( "mp_weapon_toolgun" ) - - // will include this as a custom asset when mod v2 is written - PrecacheModel( $"models/SPOILER_w_titan_particle_accelerator.mdl" ) -}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/rodeo/sh_classic_rodeo.gnut b/Northstar.Custom/mod/scripts/vscripts/rodeo/sh_classic_rodeo.gnut index 6e2f0259..038305c0 100644 --- a/Northstar.Custom/mod/scripts/vscripts/rodeo/sh_classic_rodeo.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/rodeo/sh_classic_rodeo.gnut @@ -50,12 +50,15 @@ void function OnRodeoWeakpointDamaged( entity weakpoint, var damageInfo ) attacker.NotifyDidDamage( weakpoint, DamageInfo_GetHitBox( damageInfo ), DamageInfo_GetDamagePosition( damageInfo ), DamageInfo_GetCustomDamageType( damageInfo ) | DF_CRITICAL, damageAmount, DamageInfo_GetDamageFlags( damageInfo ), DamageInfo_GetHitGroup( damageInfo ), DamageInfo_GetWeapon( damageInfo ), DamageInfo_GetDistFromAttackOrigin( damageInfo ) ) // figure out damage to deal to titan - entity attackerWeapon = attacker.GetActiveWeapon() + entity attackerWeapon = DamageInfo_GetWeapon( damageInfo ) + if ( !IsValid( attackerWeapon ) ) + attackerWeapon = attacker.GetActiveWeapon() + int rodeoDamage = attackerWeapon.GetWeaponSettingInt( eWeaponVar.damage_rodeo ) // only really on weapons that were in tf1, unfortunately - if ( rodeoDamage == 0 ) - rodeoDamage = int( attackerWeapon.GetWeaponSettingInt( eWeaponVar.damage_near_value_titanarmor ) * ( attackerWeapon.GetWeaponSettingFloat( eWeaponVar.damage_headshot_scale ) * 1.5 ) ) // would use headshot scale, but it's a bit low in most cases to be competitive + if ( rodeoDamage == 0 ) // would use headshot scale, but it's a bit low in most cases to be competitive with weapons with a valid damage_rodeo + rodeoDamage = int( attackerWeapon.GetWeaponSettingInt( eWeaponVar.damage_near_value_titanarmor ) * ( attackerWeapon.GetWeaponSettingFloat( eWeaponVar.damage_headshot_scale ) * 1.5 ) ) - // damage titan - titan.TakeDamage( rodeoDamage, attacker, attackerWeapon, { damageSourceId = eDamageSourceId.rodeo } ) + // damage titan, make sure DF_BYPASS_SHIELD is a thing for proper behaviour + titan.TakeDamage( rodeoDamage, attacker, attackerWeapon, { damageSourceId = eDamageSourceId.rodeo, scriptType = DamageInfo_GetCustomDamageType( damageInfo ) | DF_BYPASS_SHIELD } ) } #endif
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/_bleedout_damage.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_bleedout_damage.gnut index 8b21184a..8b21184a 100644 --- a/Northstar.Custom/mod/scripts/vscripts/_bleedout_damage.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/sh_bleedout_damage.gnut diff --git a/Northstar.Custom/mod/scripts/vscripts/_custom_air_accel.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut index faa92480..faa92480 100644 --- a/Northstar.Custom/mod/scripts/vscripts/_custom_air_accel.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut diff --git a/Northstar.Custom/mod/scripts/vscripts/_custom_oob_timer.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_custom_oob_timer.gnut index 9689302c..9689302c 100644 --- a/Northstar.Custom/mod/scripts/vscripts/_custom_oob_timer.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/sh_custom_oob_timer.gnut diff --git a/Northstar.Custom/mod/scripts/vscripts/sh_northstar_custom_precache.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_northstar_custom_precache.gnut new file mode 100644 index 00000000..3e66b5ca --- /dev/null +++ b/Northstar.Custom/mod/scripts/vscripts/sh_northstar_custom_precache.gnut @@ -0,0 +1,11 @@ +untyped +global function NorthstarCustomPrecache + +void function NorthstarCustomPrecache() +{ + PrecacheWeapon( "mp_weapon_peacekraber" ) + PrecacheWeapon( "melee_pilot_kunai" ) + + // create kunai damage source so game won't crash when we hit smth with it + getconsttable()[ "eDamageSourceId" ][ "melee_pilot_kunai" ] <- eDamageSourceId.melee_pilot_emptyhanded +}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/_promode.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_promode.gnut index f390fed6..f390fed6 100644 --- a/Northstar.Custom/mod/scripts/vscripts/_promode.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/sh_promode.gnut diff --git a/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_toolgun.nut b/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_toolgun.nut deleted file mode 100644 index 94bd7429..00000000 --- a/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_toolgun.nut +++ /dev/null @@ -1,39 +0,0 @@ -untyped -global function OnWeaponActivate_weapon_toolgun -global function OnWeaponDeactivate_weapon_toolgun -global function OnWeaponPrimaryAttack_weapon_toolgun -global function OnWeaponStartZoomIn_weapon_toolgun -global function OnWeaponStartZoomOut_weapon_toolgun -#if SERVER -global function OnWeaponNpcPrimaryAttack_weapon_toolgun -#endif - -void function OnWeaponActivate_weapon_toolgun( entity weapon ) -{ - CallToolOnEquipped( weapon.GetOwner(), weapon ) -} - -void function OnWeaponDeactivate_weapon_toolgun( entity weapon ) -{ - CallToolOnUnequipped( weapon.GetOwner(), weapon ) -} - -var function OnWeaponPrimaryAttack_weapon_toolgun( entity weapon, WeaponPrimaryAttackParams attackParams ) -{ - CallToolOnFired( weapon.GetOwner(), weapon, attackParams ) -} - -void function OnWeaponStartZoomIn_weapon_toolgun( entity weapon ) -{ - CallToolOnAds( weapon.GetOwner(), weapon ) -} - -void function OnWeaponStartZoomOut_weapon_toolgun( entity weapon ) -{ - CallToolOnUnAds( weapon.GetOwner(), weapon ) -} - -var function OnWeaponNpcPrimaryAttack_weapon_toolgun( entity weapon, WeaponPrimaryAttackParams attackParams ) -{ - // do nothing for now, maybe make it launch nukes or something later that could be funny -}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/weapons/toolgun/sh_toolgun_tool_explode.nut b/Northstar.Custom/mod/scripts/vscripts/weapons/toolgun/sh_toolgun_tool_explode.nut deleted file mode 100644 index 512c538c..00000000 --- a/Northstar.Custom/mod/scripts/vscripts/weapons/toolgun/sh_toolgun_tool_explode.nut +++ /dev/null @@ -1,30 +0,0 @@ -global function ToolgunToolCreateExplosion_Init - -void function ToolgunToolCreateExplosion_Init() -{ - AddCallback_OnToolgunToolsInit( CreateToolgunToolCreateExplosion ) -} - -void function CreateToolgunToolCreateExplosion() -{ - ToolgunTool createExplosionTool - createExplosionTool.toolName = "Create explosion" - createExplosionTool.toolDescription = "Creates an explosion" - - createExplosionTool.onFired = ToolgunToolCreateExplosion_Fire - - RegisterTool( createExplosionTool ) -} - -void function ToolgunToolCreateExplosion_Fire( entity player, entity weapon, WeaponPrimaryAttackParams attackParams ) -{ - #if SERVER - int dist = 55555 // should hit edge of map at all times ideally - vector forward = AnglesToForward( player.EyeAngles() ) - - // raycast to explosion position - TraceResults trace = TraceLine( player.EyePosition(), player.EyePosition() + ( dist * forward ), null, TRACE_MASK_NPCSOLID ) - // make explosion - Explosion( trace.endPos, player, player, 90, 90, 100, 100, 0, trace.endPos, 5000, damageTypes.explosive, eDamageSourceId.burn, "exp_small" ) - #endif -}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/weapons/toolgun/sh_toolgun_tool_throw.nut b/Northstar.Custom/mod/scripts/vscripts/weapons/toolgun/sh_toolgun_tool_throw.nut deleted file mode 100644 index d6975c6d..00000000 --- a/Northstar.Custom/mod/scripts/vscripts/weapons/toolgun/sh_toolgun_tool_throw.nut +++ /dev/null @@ -1,24 +0,0 @@ -global function ToolgunToolThrowEntity_Init - -void function ToolgunToolThrowEntity_Init() -{ - AddCallback_OnToolgunToolsInit( CreateToolgunToolThrow ) -} - -void function CreateToolgunToolThrow() -{ - ToolgunTool throwTool - throwTool.toolName = "Throw entity" - throwTool.toolDescription = "Spawns and throws the currently selected entity type" - - throwTool.onFired = ToolgunToolThrow_OnFired - - RegisterTool( throwTool ) -} - -void function ToolgunToolThrow_OnFired( entity player, entity weapon, WeaponPrimaryAttackParams attackParams ) -{ - #if SERVER - ClientCommand( player, "ent_throw npc_frag_drone" ) - #endif -}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/weapons/toolgun/sh_toolgun_tools.gnut b/Northstar.Custom/mod/scripts/vscripts/weapons/toolgun/sh_toolgun_tools.gnut deleted file mode 100644 index 4d7e9d89..00000000 --- a/Northstar.Custom/mod/scripts/vscripts/weapons/toolgun/sh_toolgun_tools.gnut +++ /dev/null @@ -1,196 +0,0 @@ -untyped -global function ToolgunTools_Init -global function AddCallback_OnToolgunToolsInit - -global function RegisterTool -global function CallToolOnEquipped -global function CallToolOnUnequipped -global function CallToolOnFired -global function CallToolOnAds -global function CallToolOnUnAds - -#if SERVER -global function SetToolgunAmmoCount -global function SetToolgunProscreen -#endif // #if SERVER - -global struct ToolgunTool -{ - string toolName = "" - string toolDescription = "" - - void functionref( entity, entity ) onEquipped - void functionref( entity, entity ) onUnequipped - void functionref( entity, entity, WeaponPrimaryAttackParams ) onFired - void functionref( entity, entity ) onAds - void functionref( entity, entity ) onUnAds -} - -struct ToolgunPlayerSettings -{ - int selectedToolIndex - int ammoCount - int proscreenNumber -} - -// doing preprocessor defs inside the struct seemed to cause compiler errors so we define them separately -#if CLIENT -struct { - array<void functionref()> onToolgunToolsInitCallbacks - - array<ToolgunTool> tools - ToolgunPlayerSettings clientPlayerSettings -} file -#endif // #if CLIENT - -#if SERVER -struct { - array<void functionref()> onToolgunToolsInitCallbacks - - array<ToolgunTool> tools - // serverside playersettings - table<int, ToolgunPlayerSettings> playerSettings -} file -#endif // #if SERVER - -void function AddCallback_OnToolgunToolsInit( void functionref() callback ) -{ - file.onToolgunToolsInitCallbacks.append( callback ) -} - -void function ToolgunTools_Init() -{ - //#if SERVER - //AddCallback_OnClientConnecting( InitialiseToolgunSettings ) - //AddCallback_OnClientDisconnected( DestroyToolgunSettings ) - //#endif // #if SERVER - // - //// need this threaded so we can wait a frame - //thread ToolgunTools_InitThreaded() -} - -void function ToolgunTools_InitThreaded() -{ - // wait a frame for tools to all init and add their callbacks - WaitFrame() - - // call callbacks - foreach ( void functionref() callback in file.onToolgunToolsInitCallbacks ) - callback() -} - -void function RegisterTool( ToolgunTool toolStruct ) -{ - file.tools.append( toolStruct ) -} - -void function CallToolOnEquipped( entity player, entity weapon ) -{ - #if CLIENT - if ( file.tools[ file.clientPlayerSettings.selectedToolIndex ].onEquipped != null ) - file.tools[ file.clientPlayerSettings.selectedToolIndex ].onEquipped( player, weapon ) - #endif // #if CLIENT - - #if SERVER - // set ammo and proscreen numbers when equipped - weapon.SetProScreenIntValForIndex( PRO_SCREEN_INT_LIFETIME_KILLS, file.playerSettings[ player.GetPlayerIndex() ].proscreenNumber ) - weapon.SetWeaponPrimaryClipCount( file.playerSettings[ player.GetPlayerIndex() ].ammoCount ) - - if ( file.tools[ file.playerSettings[ player.GetPlayerIndex() ].selectedToolIndex ].onEquipped != null ) - file.tools[ file.playerSettings[ player.GetPlayerIndex() ].selectedToolIndex ].onEquipped( player, weapon ) - #endif // #if SERVER -} - -void function CallToolOnUnequipped( entity player, entity weapon ) -{ - #if CLIENT - if ( file.tools[ file.clientPlayerSettings.selectedToolIndex ].onUnequipped != null ) - file.tools[ file.clientPlayerSettings.selectedToolIndex ].onUnequipped( player, weapon ) - #endif // #if CLIENT - - #if SERVER - if ( file.tools[ file.playerSettings[ player.GetPlayerIndex() ].selectedToolIndex ].onUnequipped != null ) - file.tools[ file.playerSettings[ player.GetPlayerIndex() ].selectedToolIndex ].onUnequipped( player, weapon ) - #endif // #if SERVER -} - -void function CallToolOnFired( entity player, entity weapon, WeaponPrimaryAttackParams attackParams ) -{ - #if CLIENT - if ( file.tools[ file.clientPlayerSettings.selectedToolIndex ].onFired != null ) - file.tools[ file.clientPlayerSettings.selectedToolIndex ].onFired( player, weapon, attackParams ) - #endif // #if CLIENT - - #if SERVER - // ammocount needs to be +1 because we lose 1 ammo immediately after this function is run - weapon.SetWeaponPrimaryClipCount( file.playerSettings[ player.GetPlayerIndex() ].ammoCount + 1 ) - - if ( file.tools[ file.playerSettings[ player.GetPlayerIndex() ].selectedToolIndex ].onFired != null ) - file.tools[ file.playerSettings[ player.GetPlayerIndex() ].selectedToolIndex ].onFired( player, weapon, attackParams ) - #endif // #if SERVER -} - -void function CallToolOnAds( entity player, entity weapon ) -{ - #if CLIENT - if ( file.tools[ file.clientPlayerSettings.selectedToolIndex ].onAds != null ) - file.tools[ file.clientPlayerSettings.selectedToolIndex ].onAds( player, weapon ) - #endif // #if CLIENT - - #if SERVER - if ( file.tools[ file.playerSettings[ player.GetPlayerIndex() ].selectedToolIndex ].onUnequipped != null ) - file.tools[ file.playerSettings[ player.GetPlayerIndex() ].selectedToolIndex ].onUnequipped( player, weapon ) - #endif // #if SERVER -} - -void function CallToolOnUnAds( entity player, entity weapon ) -{ - #if CLIENT - if ( file.tools[ file.clientPlayerSettings.selectedToolIndex ].onUnAds != null ) - file.tools[ file.clientPlayerSettings.selectedToolIndex ].onUnAds( player, weapon ) - #endif // #if CLIENT - - #if SERVER - if ( file.tools[ file.playerSettings[ player.GetPlayerIndex() ].selectedToolIndex ].onUnequipped != null ) - file.tools[ file.playerSettings[ player.GetPlayerIndex() ].selectedToolIndex ].onUnequipped( player, weapon ) - #endif // #if SERVER -} - -#if SERVER -void function InitialiseToolgunSettings( entity player ) -{ - print( "initialising toolgun settings for player " + player ) - - ToolgunPlayerSettings playerSettings - playerSettings.selectedToolIndex = 0 - - file.playerSettings[ player.GetPlayerIndex() ] <- playerSettings -} - -void function DestroyToolgunSettings( entity player ) -{ - delete file.playerSettings[ player.GetPlayerIndex() ] -} - -void function SetToolgunAmmoCount( entity player, int ammoCount ) -{ - entity currentWeapon = player.GetActiveWeapon() - if ( ammoCount > currentWeapon.GetWeaponPrimaryClipCountMax() ) // setting clipcount to over max clipcount crashes so we need to prevent that - return - - ToolgunPlayerSettings playerSettings = file.playerSettings[ player.GetPlayerIndex() ] - playerSettings.ammoCount = ammoCount - - if ( currentWeapon.GetWeaponClassName() == "mp_weapon_toolgun" ) // set ammocount immediately if we've got toolgun equipped already - currentWeapon.SetWeaponPrimaryClipCount( ammoCount ) -} - -void function SetToolgunProscreen( entity player, int proscreenNumber ) -{ - ToolgunPlayerSettings playerSettings = file.playerSettings[ player.GetPlayerIndex() ] - playerSettings.proscreenNumber = proscreenNumber - - if ( player.GetActiveWeapon().GetWeaponClassName() == "mp_weapon_toolgun" ) // set proscreen number immediately if we've got toolgun equipped already - player.GetActiveWeapon().SetProScreenIntValForIndex( PRO_SCREEN_INT_LIFETIME_KILLS, proscreenNumber ) -} -#endif // #if SERVER
\ No newline at end of file |