The only 100% way to determine player or ai in OFPR is to deleteVehicle them.
Yeah it was very annoying to find that out...
I once had in mind that maybe ordering the unit do something and then using
unitReady to check whether something is happening or not could reveal if unit is player or AI, but didn't start to test that idea in practice. So can't say if it's possible to get that idea to work in practice
Not sure how a player unit responds to a
unitReady query, if it always returns
true for player units then this could work I guess. Then, a unit which is not ready has to be an AI no matter did the unit get the order from your test or from an earlier order from group leader.