Home   Help Search Login Register  

Author Topic: Quit if it's multiplayer  (Read 721 times)

0 Members and 1 Guest are viewing this topic.

Offline Nemesis6

  • Members
  • *
Quit if it's multiplayer
« on: 28 Jul 2004, 18:32:25 »
I know there are commands to determine of the player is host or client, but is there a command to completely determine of there are more than one player? Thanks in advance.
I am actually flying into a star... this is incredible!

Offline Blanco

  • Former Staff
  • ****
Re:Quit if it's multiplayer
« Reply #1 on: 28 Jul 2004, 20:44:19 »
maybe this could help :
from the comref

Code: [Select]
playersNumber side
Operand types:
    side: Side
Compatibility:
    Version 1.8 required.
Type of returned value:
    Number
Description:
    Return count of players playing on given side

Search or search or search before you ask.

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Quit if it's multiplayer
« Reply #2 on: 28 Jul 2004, 21:23:29 »
I know there are commands to determine of the player is host or client, but is there a command to completely determine of there are more than one player? Thanks in advance.



 ??? mpGame ???

there IS a script code, mostly used to "switch" effects off if the game is MP.

in scripts, it looks like this:

   ?mpGame: goto "skip"

It makes the gameEngine check if your in a multi player game, but maybe I just misunderstand yer Q (?)  :P :)
« Last Edit: 28 Jul 2004, 21:24:26 by Tomb »

Offline Nemesis6

  • Members
  • *
Re:Quit if it's multiplayer
« Reply #3 on: 29 Jul 2004, 04:23:45 »
Nope, you enterpreted it just right. It's for changing from an object based fire to a script based one if the current game is MP. Thanks very much both of you.
« Last Edit: 29 Jul 2004, 04:24:38 by Nemesis6 »
I am actually flying into a star... this is incredible!

Offline Nemesis6

  • Members
  • *
Re:Quit if it's multiplayer
« Reply #4 on: 15 Sep 2004, 15:10:17 »
Just telling... I tried this command thing recently, and it didn't work.
I am actually flying into a star... this is incredible!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Quit if it's multiplayer
« Reply #5 on: 15 Sep 2004, 17:23:18 »
Why do you need to determine the number of players ???

??? mpGame ???
I think you mean the command local... ( ??? )
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:Quit if it's multiplayer
« Reply #6 on: 20 Sep 2004, 14:29:02 »
Code snippet showing how to determine the number of players in a MP game:
Code: [Select]
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:
Code: [Select]
_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.)