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/sh_custom_air_accel.gnut | |
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/sh_custom_air_accel.gnut')
-rw-r--r-- | Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut new file mode 100644 index 000000000..faa924804 --- /dev/null +++ b/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut @@ -0,0 +1,25 @@ +global function CustomAirAccelVars_Init + +void function CustomAirAccelVars_Init() +{ + #if MP + AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "custom_air_accel_pilot", "500" ) // 500 is the default airaccel + #endif + + #if SERVER + AddCallback_OnPlayerRespawned( ApplyCustomPlayerAirAccel ) + AddCallback_OnPilotBecomesTitan( ApplyCustomPlayerAirAccelFromTitan ) // not sure if necessary but assuming it is + #endif +} + +#if SERVER +void function ApplyCustomPlayerAirAccel( entity player ) +{ + player.kv.airAcceleration = GetCurrentPlaylistVarInt( "custom_air_accel_pilot", int( player.GetPlayerSettingsField( "airAcceleration" ) ) ) +} + +void function ApplyCustomPlayerAirAccelFromTitan( entity player, entity titan ) +{ + player.kv.airAcceleration = GetCurrentPlaylistVarInt( "custom_air_accel_pilot", int( player.GetPlayerSettingsField( "airAcceleration" ) ) ) +} +#endif
\ No newline at end of file |