Code snippet showing how to determine the number of players in a MP game:
nplayers=(playersNumber east + playersNumber west + playersNumber resistance + playersNumber civilian)
? nplayers=0: hint "You are in a SP game";exit
hint format ["You are in a MP game with %1 players in total.",nplayers]
There are other ways of determining wether you are in MP or SP mode, though. Another nifty trick is to use the result of the missionStart command:
_mpgame=({_x > 0} count missionStart > 0)
? _mpgame: "You are in a MP game"
?!_mpgame: "You are in SP mode"
(Reason: missionStart will return the result [0,0,0,0,0] when in single-player. In MP, the result will not be all zeroes.)