Hello guys, i have a problem with my capture system. Problem in sync server with client.
This code adding point:
function AddCapturePoint(map, name, printName, box, fishka, termpos, termangl)
if map != game.GetMap() then return end
local box_start = Vector()
local box_end = Vector()
box_start.x = box[1].x < box[2].x && box[1].x || box[2].x
box_start.y = box[1].y < box[2].y && box[1].y || box[2].y
box_start.z = box[1].z < box[2].z && box[1].z || box[2].z
box_end.x = box[1].x > box[2].x && box[1].x || box[2].x
box_end.y = box[1].y > box[2].y && box[1].y || box[2].y
box_end.z = box[1].z > box[2].z && box[1].z || box[2].z
name = map..'_'..name
local t = {name = name, printName = printName, box = {box_start, box_end},fishka = fishka, termpos = termpos, termangl = termangl, capture = false, alliancepoint = 0, rebelpoint = 0, owner = 1, visitors = {}}
Capture.PointsMap[name] = t
t.id = table.insert(Capture.Points, t)
end
AddCapturePoint('rp_c18_divrp', 'Unknown', 'Unknown', {Vector(0, 0, 0), Vector(0, 0, 0)})
AddCapturePoint('rp_c18_divrp', 'D5', 'D5', {Vector(-1330.181030, -688.898010, 1798.443481), Vector(54.280197, 123.194534, 589.622070)})
AddCapturePoint('rp_c18_divrp', 'D1', 'D1', {Vector(-637.031433, -2800.531982, 2756.971680), Vector(1887.761353, -2160.350586, 628.830872)}, "eda", Vector(1393.615601, -2875.524658, 720.031250), Angle(0, -90, 0))
How it works: Guy go to capture point terminal and click E then server do this thing: Capture.Points[self:Getid].capture = true , But after that on client still Capture.Points[id].capture = false. So my question is: How i can change global point status from server, On client and on server.
The code you provided doesn't even show how you're handling on use nor how you're networking the capture information.
You could use Entity/SetNWBool and Entity/GetNWBool.
I'm not sure if they work if the entity is dormant so you would probably want to make sure the entity always transmits data or use the net library, that is if you want everyone to know the current status of each point.
I used networks to send Capture.Points[self:Getid].capture = true but it's doesnt work because if player reconnect point will be have standart options
Doesn't help at all, please provide all your code or hire a developer to help you
Problem fixed) thanks for help
Sorry, you need to Log In to post a reply to this thread.