Advertisement
IdoX10

Untitled

Nov 7th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. AddCSLuaFile("cl_init.lua")
  2. AddCSLuaFile("shared.lua")
  3.  
  4. include("shared.lua")
  5. include("Config.lua")
  6.  
  7. //another scripts
  8.  
  9. include("zombie_spawn/sv_zombie_spawn.lua")
  10.  
  11.  
  12.  
  13. //Network strings
  14. util.AddNetworkString("playerSpawnMessage")
  15.  
  16.  
  17. function GM:PlayerSay(ply, text, team)
  18.  
  19. if (text == "/playerspawn" and playmod == false) then
  20. local spawnpoint = ply:GetPos()
  21. if (file.Exists("StayAlive PlayerSpawns.txt", "DATA")) then
  22.  
  23. file.Append("StayAlive PlayerSpawns.txt", " || "..tostring(spawnpoint))
  24.  
  25. end
  26. if (!file.Exists("StayAlive PlayerSpawns.txt", "DATA")) then
  27.  
  28. file.Write("StayAlive PlayerSpawns.txt", tostring(spawnpoint))
  29.  
  30. end
  31. net.Start("playerSpawnMessage")
  32. net.Send(ply)
  33. return ""
  34.  
  35. end
  36.  
  37. end
  38.  
  39.  
  40. function GM:PlayerSpawn( ply )
  41.  
  42. //spawn player at the spawn point
  43. if (file.Exists("StayAlive PlayerSpawns.txt", "DATA")) then
  44. local spawnPoints = file.Read("StayAlive PlayerSpawns.txt", "DATA")
  45. local s = string.Split(spawnPoints, " || ")
  46. local random = math.random(1, table.Count(s))
  47. local v = Vector(s[random])
  48. ply:SetPos(v)
  49. end
  50. //setup player hands model
  51. ply:SetupHands()
  52.  
  53. //Give player starter weapons
  54. for k, v in pairs(StartWeapons) do
  55.  
  56. ply:Give(v, false)
  57.  
  58. end
  59.  
  60. end
  61.  
  62. //setup player hands model
  63. function GM:PlayerSetHandsModel( ply, ent )
  64.  
  65. local simplemodel = player_manager.TranslateToPlayerModelName( ply:GetModel() )
  66. local info = player_manager.TranslatePlayerHands( simplemodel )
  67. if ( info ) then
  68. ent:SetModel( info.model )
  69. ent:SetSkin( info.skin )
  70. ent:SetBodyGroups( info.body )
  71. end
  72.  
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement