Problem with registred DarkRP Vars

Hello,
I got a probleme with my registred darkrpvar, I can get the var server side but not client side.
I registred the var in modules/repairswep/sh_init.lua :


DarkRP.declareChatCommand{
        command = "/spawnrepairman",
        description = "spawn a npc",
        delay = 1.5
}
DarkRP.registerDarkRPVar("mode",
    function(val)net.WriteInt(val,32) end,
    function() net.ReadInt(32) end)

I set a default value for each new player :


hook.Add("PlayerInitialSpawn", "Initspawnseeds", function(ply)
            local filter = RecipientFilter()
            filter:AddPlayer( ply )
      ply:setDarkRPVar("mode", 0, filter)
end)

In the swep shared file I display the current mode for the client : (Error)


hook.Add("HUDPaint", "DrawFarmingHUD", function()
    if(LocalPlayer():Team() == REPAIR.Job) then
        draw.RoundedBox( 6, 50, 50, 200, 40, Color( 0, 0, 0, 150 ) )
print(tostring(LocalPlayer():getDarkRPVar("mode"))) -- print nil
        local name = allmods[LocalPlayer().DarkRPVars.mode].name -- ERROR : attempt to index nil value
        draw.SimpleText(mode, "repairfont", 150, 70, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
    end
end)

But in the primary fire function i get the value of the registred var:


function SWEP:PrimaryAttack()
print(tostring(self.Owner:getDarkRPVar("mode"))) -- its prints the value

Here is some debuging I did :


rcon lua_run PrintTable( player.GetByID(1).DarkRPVars)
> PrintTable ( player.GetByID ( 1 ) .DarkRPVars )...
rpname    =    Yoo
salary    =    45
job    =    Citizen
money    =    499428
mode    =    0


lua_run_cl PrintTable( LocalPlayer().DarkRPVars )
rpname    =    Yoo
salary    =    45
job    =    Citizen
money    =    499428

I can’t get the value client side and i don’t know why.

What are you trying to do here? Are you trying to make the DarkRPVar private to the player so other player cannot see your “mode” by using player.GetByID(idx)?

I was just thinking that maybe the filter will resolve the problem, but even if i remove it I still have the problem

No idea?