@@ -6,22 +6,22 @@ lia.command.add("afktoggle", {
66 type = " player"
77 }
88 },
9- desc = " Toggle AFK status on a player " ,
9+ desc = L ( " afkCommandDesc " ) ,
1010 onRun = function (client , arguments )
1111 local target = lia .util .findPlayer (client , arguments [1 ])
1212 if not IsValid (target ) then return " @invalidTarget" end
13- if not lia .config .get (" AFKProtectionEnabled" , true ) then return " AFK protection is disabled. " end
13+ if not lia .config .get (" AFKProtectionEnabled" , true ) then return L ( " afkProtectionDisabled " ) end
1414 local isAFK = target :getNetVar (" isAFK" , false )
1515 if isAFK then
1616 target :setNetVar (" isAFK" , false )
1717 target :setNetVar (" lastActivity" , CurTime ())
18- client :notify (" Removed AFK status from " .. target :Name ())
19- target :notify (" Your AFK status has been removed by an admin. " )
18+ client :notify (L ( " afkStatusRemoved " , target :Name () ))
19+ target :notify (L ( " afkStatusRemovedByAdmin " ) )
2020 else
2121 target :setNetVar (" isAFK" , true )
2222 target :setNetVar (" afkTime" , CurTime ())
23- client :notify (" Set AFK status on " .. target :Name ())
24- target :notify (" You have been marked as AFK by an admin. " )
23+ client :notify (L ( " afkStatusSet " , target :Name () ))
24+ target :notify (L ( " afkStatusSetByAdmin " ) )
2525 end
2626 end
2727})
@@ -35,18 +35,18 @@ lia.command.add("afkstatus", {
3535 optional = true
3636 }
3737 },
38- desc = " Check AFK status of a player or all players " ,
38+ desc = L ( " afkStatusCommandDesc " ) ,
3939 onRun = function (client , arguments )
40- if not lia .config .get (" AFKProtectionEnabled" , true ) then return " AFK protection is disabled. " end
40+ if not lia .config .get (" AFKProtectionEnabled" , true ) then return L ( " afkProtectionDisabled " ) end
4141 local target = arguments [1 ] and lia .util .findPlayer (client , arguments [1 ])
4242 if target then
4343 local isAFK = target :getNetVar (" isAFK" , false )
4444 local lastActivity = target :getNetVar (" lastActivity" , 0 )
4545 local afkTime = target :getNetVar (" afkTime" , 0 )
4646 local timeSinceActivity = CurTime () - lastActivity
4747 local timeAFK = isAFK and (CurTime () - afkTime ) or 0
48- local status = isAFK and " AFK " or " Active "
49- client :notify (string.format (" %s: %s (Last Activity : %.1fs ago, AFK Time : %.1fs)" , target :Name (), status , timeSinceActivity , timeAFK ))
48+ local status = isAFK and L ( " afkStatus " ) or L ( " activePlayers " )
49+ client :notify (string.format (" %s: %s (" .. L ( " lastActivity " ) .. " : %.1fs ago, " .. L ( " afkTimeLabel " ) .. " : %.1fs)" , target :Name (), status , timeSinceActivity , timeAFK ))
5050 else
5151 local afkPlayers = {}
5252 local activePlayers = {}
@@ -65,14 +65,14 @@ lia.command.add("afkstatus", {
6565 end
6666 end
6767
68- client :notify (" === AFK Status ===" )
68+ client :notify (" === " .. L ( " afkStatus " ) .. " ===" )
6969 if # afkPlayers > 0 then
70- client :notify (" AFK Players : " .. table.concat (afkPlayers , " , " ))
70+ client :notify (L ( " afkPlayers " ) .. " : " .. table.concat (afkPlayers , " , " ))
7171 else
72- client :notify (" No players are currently AFK " )
72+ client :notify (L ( " noPlayersAFK " ) )
7373 end
7474
75- if # activePlayers > 0 then client :notify (" Active Players : " .. table.concat (activePlayers , " , " )) end
75+ if # activePlayers > 0 then client :notify (L ( " activePlayers " ) .. " : " .. table.concat (activePlayers , " , " )) end
7676 end
7777 end
7878})
0 commit comments