Jump to content

Wergio

Member
  • Posts

    3
  • Joined

  • Last visited

Wergio's Achievements

  1. Thanks Zeros for the tips now the code is working! I made this simple mod https://steamcommunity.com/sharedfiles/filedetails/?id=2855326218
  2. thanks isAsleep() is working! but getDescriptor() not working unfortunately: I get "Object tried to call nil" when calling print(p:getDescriptor():getForname()); I think the problem is I call getOnlinePlayers() from server side. is it possibile it returns a different Class? print(type(p)); and print(type(p:getDescriptor())); return "userdata" how do I know the "real" object's Class of userdatas? full code: if not isServer() then return end; local function WergioServerData() local players = getOnlinePlayers(); for i=0, players:size()-1 do local p = players:get(i); print(type(p)); print(p:getUsername()); print(type(p:isAsleep())); if p:isAsleep() then print(p:getUsername() .. " is asleep"); else print(p:getUsername() .. " is awake"); end local pd = p:getDescriptor(); print(type(pd)); print(pd:getForname()); print(pd:getSurname()); end end Events.EveryTenMinutes.Add(WergioServerData);
  3. I want to log server side the name/surname and awake status of all connected users This is my code (server side): But there are 2 problems: - getForname() and getSurname always return the name/surname from the first user connected (for all users), usernames are ok and all users are listed - the awake/asleep check is not working. i tested also with isAsleep() method but seems not existent in the object
×
×
  • Create New...