So habs nun endlich fertig bekommen.
Lua Code:
function Autorespected()
for k,v in pairs(player.GetAll()) do
if v and v:IsValid() then
if !ULib.ucl.authed[v] or (ULib.ucl.authed[v] and table.HasValue(ULib.ucl.authed[v].groups,"user") ) and !v:IsUserGroup("respected") then
if v:GetUTimeTotalTime() > (6*3600) then
ULib.ucl.addUser( v:Nick(), "steamid", v:SteamID(), {"respected"}, {allow={}, deny={}} , _, _, true )
end
end
end
end
end
timer.Create("Autorespectedtimer",30,0,Autorespected)
Und mit Assmod
Lua Code:
function Autorespected()
for k,v in pairs(player.GetAll()) do
if v and v:IsValid() then
local time = v:GetUTimeTotalTime()
if time > (6*3600) then
if !ULib.ucl.authed[v] or (ULib.ucl.authed[v] and table.HasValue(ULib.ucl.authed[v].groups,"user") ) and !v:IsUserGroup("respected") then
ULib.ucl.addUser( v:Nick(), "steamid", v:SteamID(), {"respected"}, {allow={}, deny={}} , _, _, true )
end
end
if time > (4*3600) then
if !v:HasLevel(4) then
game.ConsoleCommand("ass_PromotePlayer "..v:UserID().." 4\n")
end
end
end
end
end
timer.Create("Autorespectedtimer",30,0,Autorespected)
So war etwas hartnäckig, da ich mit Ulib zu Kämpfen hatte.
Nun werden alle User auf die das zutrifft Respected gesetz.
Mfg Tight