Hi there
We are currently facing the problem, that one player misses his armor. And due to high-tech-start with bots, we arent on the point we can reproduce the armor easily(much higher tier). So I am looking for a way to "delete" him from the server so that he can join again and is handled as a new user, with all the starting-stuff. Is there any lua-command or file I can delete to 'delete the user from the server' ?
best regards,
doppelEben
Delete a player from the Server
-
- Fast Inserter
- Posts: 117
- Joined: Thu Oct 27, 2016 6:21 am
- Contact:
Re: Delete a player from the Server
Can you upload a save for me to poke around in?
There are 10 types of people: those who get this joke and those who don't.
-
- Fast Inserter
- Posts: 117
- Joined: Thu Oct 27, 2016 6:21 am
- Contact:
Re: Delete a player from the Server
mods:http://www.psychopathix.net/mods.zip
save: http://www.psychopathix.net/neuerroot.zip
User who misses his armor: Padde
save: http://www.psychopathix.net/neuerroot.zip
User who misses his armor: Padde
Re: Delete a player from the Server
Code: Select all
/c game.remove_offline_players(game.players["Padde"].index)
Code: Select all
/c game.raise_event(defines.event.on_player_created, {player_index = game.players["Padde"].index})
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Delete a player from the Server
What i've used before in a similar situation is:
This will place an exact copy of the armor of the person typing the command into 'Padde's armor slot. The armor currently in his slot will be destroyed, so tell him to take it out if it's important.
Here's a more generic version that will copy the cursor item to other players in case you need to retrieve other stuff.
Code: Select all
/c game.players['Padde'].get_inventory(defines.inventory.player_armor)[1].set_stack(game.player.get_inventory(defines.inventory.player_armor)[1])
Here's a more generic version that will copy the cursor item to other players in case you need to retrieve other stuff.
Code: Select all
/c
local player1='YourName'
local player2='TheirName'
game.players[player1].cursor_stack.set_stack(game.players[player2].cursor_stack)
Re: Delete a player from the Server
A simpler solution might be to find a friend who isn't going to play. Have them join, dump their new armour in a box, and then leave. (This isn't very scalable but it avoids the need for console commands). If you can probably fake that by turning off authentication in the server setup, and having an existing player temporarily change his in his factorio name in settings. (The host could probably also do that by changing his name, and loading the map in single player between sessions).
Re: Delete a player from the Server
You can also add the same code to the on_player_respawned like in on_player_created.
-
- Fast Inserter
- Posts: 117
- Joined: Thu Oct 27, 2016 6:21 am
- Contact:
Re: Delete a player from the Server
Nexela wrote:or (this should work and keep all other earned stats)Code: Select all
/c game.remove_offline_players(game.players["Padde"].index)
Because of mods both of these "could" have bad behaviours depending on what other mods do re on_player_createdCode: Select all
/c game.raise_event(defines.event.on_player_created, {player_index = game.players["Padde"].index})
thanks for the tipps guys. will write that down if another time the armor says byeeradicator wrote:What i've used before in a similar situation is:This will place an exact copy of the armor of the person typing the command into 'Padde's armor slot. The armor currently in his slot will be destroyed, so tell him to take it out if it's important.Code: Select all
/c game.players['Padde'].get_inventory(defines.inventory.player_armor)[1].set_stack(game.player.get_inventory(defines.inventory.player_armor)[1])
Here's a more generic version that will copy the cursor item to other players in case you need to retrieve other stuff.Code: Select all
/c local player1='YourName' local player2='TheirName' game.players[player1].cursor_stack.set_stack(game.players[player2].cursor_stack)
![Smile :)](./images/smilies/icon_e_smile.gif)
Thats what we did in the end. The new user dropped his starting-equip in a chest and "padde" could grab it from there.Zavian wrote:A simpler solution might be to find a friend who isn't going to play. Have them join, dump their new armour in a box, and then leave. (This isn't very scalable but it avoids the need for console commands). If you can probably fake that by turning off authentication in the server setup, and having an existing player temporarily change his in his factorio name in settings. (The host could probably also do that by changing his name, and loading the map in single player between sessions).