Clearing inventory of players sleeping?
Discussion in 'Rust Development' started by Studzik :D CSGOLoteria.pl, Aug 22, 2016.
-
[DOUBLEPOST=1471877282][/DOUBLEPOST]if you wanted to do the inventory of a sleeping player you could do if(sleeper.userID == 0) or if(sleeper.displayName == "name") in a foreach loop as seen above then strip that inventory inside the if loop.Code:
void CleanAll() { foreach(var sleeper in BasePlayer.sleepingPlayerList) sleeper.inventory.Strip(); } -
Wouldn't !sleeper.IsConnected() also work just as fine? I was a little confused by what you were trying to say with the userID and name, but I'm guessing what you were trying to say is a sleeper who isn't connected.
-
Yeah so like a offline sleeper. Just in case he had the ID of that person.
