Commander elected
HookEvent("commander_elected_player", Event_ElectedPlayer);
Seems to be a little weird.
If I test with single player.
I dont opt in at all. The value of "commander_elected_player" "team" will be -1 at round start. (no comm elected)
I opt in and stay comm. The value of "commander_elected_player" "team" will be 0 or more (playerid) at round start. (comm elected)
If I opt in and dont opt out and just leave. The value of "commander_elected_player" "team" will still be 0 or more (playerid) at round start. (comm elected)
So in general, it doesnt seem to track this properly when the comm leaves or loses vote or something like that.
One planned solution is to add a check of the vehicle_enter event for the cv.
Which is also planned for the change map at start if there is nobody entering the cv for some time.
Or redo this with cvars, not events.