Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self:Register( { "tele", "s" }, function( ply )
- Command:RemoveLimit( ply )
- Command.StageRestart( ply )
- end )
- function Command.StageRestart( ply )
- if not Command:Possible( ply ) then return end
- if ply:Team() != _C.Team.Spectator then
- local szWeapon = nil
- if IsValid( ply:GetActiveWeapon() ) then
- szWeapon = ply:GetActiveWeapon():GetClass() or _C.Player.DefaultWeapon
- end
- ply.ReceiveWeapons = not not szWeapon
- ply:KillSilent()
- ply:StageSpawn()
- ply.ReceiveWeapons = nil
- if szWeapon and ply:HasWeapon( szWeapon ) then
- ply:SelectWeapon( szWeapon )
- end
- if ply.WeaponsFlipped then
- Core:Send( ply, "Client", { "WeaponFlip", true } )
- end
- else
- Core:Send( ply, "Print", { "Surf Timer", Lang:Get( "SpectateRestart" ) } )
- end
- end
- function Player:StageSpawn( ply )
- if not IsValid( ply ) then return end
- ply:SetModel( _C["Player"].DefaultModel )
- ply:SetTeam( _C["Team"].Players )
- ply:SetJumpPower( _C["Player"].JumpPower )
- ply:SetHull( _C["Player"].HullMin, _C["Player"].HullStand )
- ply:SetHullDuck( _C["Player"].HullMin, _C["Player"].HullDuck )
- ply:SetNoCollideWithTeammates( true )
- ply:SetAvoidPlayers( false )
- if not ply:IsBot() then
- Player:StageChecks( ply )
- else
- ply:SetMoveType( MOVETYPE_NONE )
- ply:SetCollisionGroup( COLLISION_GROUP_DEBRIS )
- ply:SetFOV( 90, 0 )
- ply:SetGravity( 0 )
- --ply:StripWeapons()
- if Zones.BotPoint then
- ply:SetPos( Zones.BotPoint )
- end
- end
- end
- function Player:StageChecks( ply )
- if ply.Stage == _C.Stage.Stage1 and Zones.StartPoint then
- ply:SetPos( Zones:GetSpawnPoint( Zones.StartPoint ) )
- elseif ply.Stage == _C.Stage.Stage2 and Zones.PointStage2 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage2 ) )
- elseif ply.Stage == _C.Stage.Stage3 and Zones.PointStage3 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage3 ) )
- elseif ply.Stage == _C.Stage.Stage4 and Zones.PointStage4 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage4 ) )
- elseif ply.Stage == _C.Stage.Stage5 and Zones.PointStage5 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage5 ) )
- elseif ply.Stage == _C.Stage.Stage6 and Zones.PointStage6 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage6 ) )
- elseif ply.Stage == _C.Stage.Stage7 and Zones.PointStage7 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage7 ) )
- elseif ply.Stage == _C.Stage.Stage8 and Zones.PointStage8 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage8 ) )
- elseif ply.Stage == _C.Stage.Stage9 and Zones.PointStage9 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage9 ) )
- elseif ply.Stage == _C.Stage.Stage10 and Zones.PointStage10 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage10 ) )
- elseif ply.Stage == _C.Stage.Stage11 and Zones.PointStage11 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage11 ) )
- elseif ply.Stage == _C.Stage.Stage12 and Zones.PointStage12 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage12 ) )
- elseif ply.Stage == _C.Stage.Stage13 and Zones.PointStage13 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage13 ) )
- elseif ply.Stage == _C.Stage.Stage14 and Zones.PointStage14 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage14 ) )
- elseif ply.Stage == _C.Stage.Stage15 and Zones.PointStage15 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage15 ) )
- elseif ply.Stage == _C.Stage.Stage16 and Zones.PointStage16 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage16 ) )
- elseif ply.Stage == _C.Stage.Stage24 and Zones.PointStage17 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage17 ) )
- elseif ply.Stage == _C.Stage.Stage17 and Zones.PointStage18 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage18 ) )
- elseif ply.Stage == _C.Stage.Stage18 and Zones.PointStage19 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage19 ) )
- elseif ply.Stage == _C.Stage.Stage19 and Zones.PointStage20 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage20 ) )
- elseif ply.Stage == _C.Stage.Stage20 and Zones.PointStage21 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage21 ) )
- elseif ply.Stage == _C.Stage.Stage21 and Zones.PointStage22 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage22 ) )
- elseif ply.Stage == _C.Stage.Stage22 and Zones.PointStage23 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage23 ) )
- elseif ply.Stage == _C.Stage.Stage23 and Zones.PointStage24 then
- ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage24 ) )
- elseif ply.Style != _C.Style.Bonus and Zones.StartPoint then
- ply:SetPos( Zones:GetSpawnPoint( Zones.StartPoint ) )
- end
- if not ply:IsBot() and ply:GetMoveType() != MOVETYPE_WALK then
- ply:SetMoveType( MOVETYPE_WALK )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment