aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sbox.gnut
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-10-20 20:11:43 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-10-20 20:11:43 +0100
commite79a58640e1ef1ea1c3c954aefccd36c3cb55286 (patch)
tree8c7b822f8777ccdf6b0d86587da853b8451953c1 /Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sbox.gnut
parentd37c5ae333b4e622ebd0d18cf02a87d66aac62f9 (diff)
downloadNorthstarMods-e79a58640e1ef1ea1c3c954aefccd36c3cb55286.tar.gz
NorthstarMods-e79a58640e1ef1ea1c3c954aefccd36c3cb55286.zip
automatic mod enable/disable, refactors and item registration callbacks
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sbox.gnut')
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sbox.gnut49
1 files changed, 0 insertions, 49 deletions
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 27581aeac..000000000
--- 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