NMT_VadRe

Untitled

May 27th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.66 KB | None | 0 0
  1. self:Register( { "tele", "s" }, function( ply )
  2. Command:RemoveLimit( ply )
  3. Command.StageRestart( ply )
  4. end )
  5.  
  6. function Command.StageRestart( ply )
  7. if not Command:Possible( ply ) then return end
  8. if ply:Team() != _C.Team.Spectator then
  9. local szWeapon = nil
  10. if IsValid( ply:GetActiveWeapon() ) then
  11. szWeapon = ply:GetActiveWeapon():GetClass() or _C.Player.DefaultWeapon
  12. end
  13.  
  14. ply.ReceiveWeapons = not not szWeapon
  15. ply:KillSilent()
  16. ply:StageSpawn()
  17. ply.ReceiveWeapons = nil
  18.  
  19. if szWeapon and ply:HasWeapon( szWeapon ) then
  20. ply:SelectWeapon( szWeapon )
  21. end
  22.  
  23. if ply.WeaponsFlipped then
  24. Core:Send( ply, "Client", { "WeaponFlip", true } )
  25. end
  26. else
  27. Core:Send( ply, "Print", { "Surf Timer", Lang:Get( "SpectateRestart" ) } )
  28. end
  29. end
  30.  
  31. function Player:StageSpawn( ply )
  32. if not IsValid( ply ) then return end
  33.  
  34. ply:SetModel( _C["Player"].DefaultModel )
  35. ply:SetTeam( _C["Team"].Players )
  36. ply:SetJumpPower( _C["Player"].JumpPower )
  37. ply:SetHull( _C["Player"].HullMin, _C["Player"].HullStand )
  38. ply:SetHullDuck( _C["Player"].HullMin, _C["Player"].HullDuck )
  39. ply:SetNoCollideWithTeammates( true )
  40. ply:SetAvoidPlayers( false )
  41.  
  42. if not ply:IsBot() then
  43. Player:StageChecks( ply )
  44. else
  45. ply:SetMoveType( MOVETYPE_NONE )
  46. ply:SetCollisionGroup( COLLISION_GROUP_DEBRIS )
  47. ply:SetFOV( 90, 0 )
  48. ply:SetGravity( 0 )
  49. --ply:StripWeapons()
  50.  
  51. if Zones.BotPoint then
  52. ply:SetPos( Zones.BotPoint )
  53. end
  54. end
  55. end
  56.  
  57. function Player:StageChecks( ply )
  58. if ply.Stage == _C.Stage.Stage1 and Zones.StartPoint then
  59. ply:SetPos( Zones:GetSpawnPoint( Zones.StartPoint ) )
  60. elseif ply.Stage == _C.Stage.Stage2 and Zones.PointStage2 then
  61. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage2 ) )
  62. elseif ply.Stage == _C.Stage.Stage3 and Zones.PointStage3 then
  63. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage3 ) )
  64. elseif ply.Stage == _C.Stage.Stage4 and Zones.PointStage4 then
  65. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage4 ) )
  66. elseif ply.Stage == _C.Stage.Stage5 and Zones.PointStage5 then
  67. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage5 ) )
  68. elseif ply.Stage == _C.Stage.Stage6 and Zones.PointStage6 then
  69. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage6 ) )
  70. elseif ply.Stage == _C.Stage.Stage7 and Zones.PointStage7 then
  71. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage7 ) )
  72. elseif ply.Stage == _C.Stage.Stage8 and Zones.PointStage8 then
  73. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage8 ) )
  74. elseif ply.Stage == _C.Stage.Stage9 and Zones.PointStage9 then
  75. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage9 ) )
  76. elseif ply.Stage == _C.Stage.Stage10 and Zones.PointStage10 then
  77. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage10 ) )
  78. elseif ply.Stage == _C.Stage.Stage11 and Zones.PointStage11 then
  79. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage11 ) )
  80. elseif ply.Stage == _C.Stage.Stage12 and Zones.PointStage12 then
  81. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage12 ) )
  82. elseif ply.Stage == _C.Stage.Stage13 and Zones.PointStage13 then
  83. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage13 ) )
  84. elseif ply.Stage == _C.Stage.Stage14 and Zones.PointStage14 then
  85. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage14 ) )
  86. elseif ply.Stage == _C.Stage.Stage15 and Zones.PointStage15 then
  87. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage15 ) )
  88. elseif ply.Stage == _C.Stage.Stage16 and Zones.PointStage16 then
  89. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage16 ) )
  90. elseif ply.Stage == _C.Stage.Stage24 and Zones.PointStage17 then
  91. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage17 ) )
  92. elseif ply.Stage == _C.Stage.Stage17 and Zones.PointStage18 then
  93. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage18 ) )
  94. elseif ply.Stage == _C.Stage.Stage18 and Zones.PointStage19 then
  95. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage19 ) )
  96. elseif ply.Stage == _C.Stage.Stage19 and Zones.PointStage20 then
  97. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage20 ) )
  98. elseif ply.Stage == _C.Stage.Stage20 and Zones.PointStage21 then
  99. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage21 ) )
  100. elseif ply.Stage == _C.Stage.Stage21 and Zones.PointStage22 then
  101. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage22 ) )
  102. elseif ply.Stage == _C.Stage.Stage22 and Zones.PointStage23 then
  103. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage23 ) )
  104. elseif ply.Stage == _C.Stage.Stage23 and Zones.PointStage24 then
  105. ply:SetPos( Zones:GetSpawnPoint( Zones.PointStage24 ) )
  106. elseif ply.Style != _C.Style.Bonus and Zones.StartPoint then
  107. ply:SetPos( Zones:GetSpawnPoint( Zones.StartPoint ) )
  108. end
  109.  
  110. if not ply:IsBot() and ply:GetMoveType() != MOVETYPE_WALK then
  111. ply:SetMoveType( MOVETYPE_WALK )
  112. end
  113. end
Advertisement
Add Comment
Please, Sign In to add comment