Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // shared.lua
- local nwstring = "anyname"
- local allowedteams = {
- TEAM_E11 = true,
- }
- if SERVER then // alle serverside funktionen hier rein
- util.AddNetworkString(nwstring)
- hook.Add("PlayerSpawn", "nameofthehook", function(ply)
- if allowedteams[ply:Team()] then
- SquadSystem:Create("Nine Tailed Fox", ply, false)
- timer.Simple(2, function()
- net.Start(nwstring)
- net.WriteInt(1, 8)
- net.Send(ply)
- end)
- else
- ply:SetNWInt("SquadSystem.SquadID", self:GetID()) // self ist nicht definiert
- ply:SetNWInt("SquadSystem.SquadPosition", #SquadSystem.Config.Positions)
- timer.Simple(1, function()
- net.Start("SquadSystem.MembersUpdated")
- net.WriteInt(self:GetID(), 8)
- net.Send(self:GetMembers())
- end)
- return self,
- net.Start(nwstring) // warum soll der cookie NACH dem return gesetzt werden? hier wird nichts passieren
- net.WriteInt(1, 8)
- net.Send(ply)
- end
- end)
- hook.Add("PlayerChangedTeam", "sharkze11changeteam", function(ply, oldteam, newteam)
- if allowedteams[ply:Team(oldteam)] and ! allowedteams[ply:Team(newteam)] then
- self:Remove()
- net.Start(nwstring)
- net.WriteInt(0, 8)
- net.Send(ply)
- end
- end)
- else
- net.Receive(nwstring, function()
- local num = net.ReadInt()
- cookie.Set("SquadSystem.Nametags", num)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment