Search Unity

assign string array photonView.RPC

Discussion in 'Scripting' started by vfxjex, Apr 23, 2014.

  1. vfxjex

    vfxjex

    Joined:
    Jun 3, 2013
    Posts:
    93
    Hi guys need some help here :cry:,

    how do I create a string array in photonView.RPC?
    I got an error that says

    "Cannot send messages when not connected. Either connect to Photon OR use offline mode!"

    here is the sample line of my script.

    Code (csharp):
    1.  
    2. public string[] players;
    3. [RPC]
    4.     public void SendList()
    5.     {
    6.         if(PhotonNetwork.isMasterClient)
    7.         {
    8.             //for(int i = 0; i <= players.Length -1; i++)
    9.             //{
    10.                 photonView.RPC("AcceptList",PhotonTargets.AllBuffered, players);
    11.             //}
    12.         }
    13.  
    14.     }
    15.     [RPC]
    16.     public void AcceptList(string[] _players)
    17.     {
    18.         players = _players;
    19.     }
    20.