Jent Posted March 2, 2014 Share Posted March 2, 2014 This is a server-side mod! I've checked the Javadocs without finding a method I could use. I've tried getNumActivePlayers, but that's a local one, i.e. it always returns 1 no matter the number of networked users. Is there a way to list all current active remote IDs? I need to get the number of users currently connected to the server, and a way to reference each one. Any suggestions? Link to comment Share on other sites More sharing options...
RoboMat Posted March 5, 2014 Share Posted March 5, 2014 You could try something like this (not tested - just an idea):local players = {};for i = 0, maxPlayers do local insert = getSpecificPlayer(i); if insert then table.insert(players, insert); endend Link to comment Share on other sites More sharing options...
Jent Posted March 7, 2014 Author Share Posted March 7, 2014 Darn it. I thought I followed to this thread, but that was not the case. Anyways... I've tried something similar, but I can't seem to be able to get the player. getSpecificPlayer returns nil no matter what player ID I tried with (0..10 for example). I suspect networked players differ from local players (getSpecificPlayer is local?). Link to comment Share on other sites More sharing options...
RoboMat Posted March 8, 2014 Share Posted March 8, 2014 getSpecificPlayer() was introduced with co-op so I thought they might have carried it over to multiplayer - obviously they didn't Have you checked the farming code already? Link to comment Share on other sites More sharing options...
Jent Posted March 8, 2014 Author Share Posted March 8, 2014 getSpecificPlayer() was introduced with co-op so I thought they might have carried it over to multiplayer - obviously they didn't Have you checked the farming code already? Yeah, the hunt continues. Farming code? Link to comment Share on other sites More sharing options...
Dr_Cox1911 Posted March 10, 2014 Share Posted March 10, 2014 Just wanted to check the farming code but after updating to iwillbackupmysave there is no lua-code for farming/camping so I checked Build 24 but I can´t find anything according to getting the connected players. Link to comment Share on other sites More sharing options...
Koregan Posted March 11, 2014 Share Posted March 11, 2014 it is now in the server-folder: ProjectZomboid\media\lua\server\Farming\basicFarming.lua Dr_Cox1911 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now