If you have AI disabled, then the player soldier will appear/disappear on connection/disconnection. If AI is enabled, then the player will take over an existing AI when connecting and be taken over by AI when disconnecting.
If AI is disabled, then you wouldn't need to delete the player when disconnected and wouldn't be able to find the followers of a player using this example script, since the player object would have been deleted before this script could do anything about it.
If AI is enabled, then the player would continue to operate normally as an AI after disconnection and killing him would just make him respawn normally as an AI who would then continue in the game as usual; it wouldn't make the ex-player soldier stop being in the game. You would be able to delete his retinue with this script in this case.
I have tried using onplayerdissconnected with numerous variations of (_x setdammage 1) foreach units _id/_name/player/this etc.... with no success, am i on the right track or completely wrong on how to use this command?
Within the onPlayerDisconnected handler code, you have access to _id (a number unique to a copy of ArmA) and _name (a
string name of the player). You don't have access to the soldier object that the player used to be connected to and since the game doesn't keep a list of player objects for you, you need to manually monitor player objects as shown (you can actually use SPON Core to do this for you. Since I know you use this in your mission, contact me if you need wisdom on how to do this).