Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER1 then
- hook.Add("Tick", "UpdateGhosts", function()
- for key, ply in pairs(player.GetAll()) do
- -- Send an ip to the second server
- csrvmsg.Start("<ip to server2>")
- -- Let them know this is about ghosts. Maybe this could be defined in Start..
- csrvmsg.String("Ghosts")
- csrvmsg.String(ply:UniqueID())
- csrvmsg.Vector(ply:GetPos())
- csrvmsg.Angle(ply:EyeAngles())
- csrvmsg.End()
- end
- end)
- elseif SERVER2 then
- local ghosts = {}
- hook.Add("ReceiveCrossServerMessage", "UpdateGhosts", function(umr)
- -- If it's not about ghosts, ignore the message
- if not umr:ReadString() == "Ghosts" then return end
- local id = umr:ReadString()
- local pos = umr:ReadVector()
- local ang = umr:ReadAngle()
- ghosts[id] = {pos = pos, ang = ang}
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment