Esempio n. 1
0
 public virtual void PickUpThisItem()
 {
     if (index != -1)
     {
         Message.PickUpItem up = new Message.PickUpItem();
         up.itemIndex = index;
         Networking_client.net.SendUnreliable(Networking_msgType.PickUp, up);
     }
 }
Esempio n. 2
0
    void HandlePickUpItem(NetworkMessage netMsg)
    {
        Message.PickUpItem up = netMsg.ReadMessage <Message.PickUpItem>();

        Player_AnimateControl controll = Data_ListPlayerOnScene.GetPlayerControll(up.index);

        if (controll)
        {
            Player_Item item = Data_ListPlayerOnScene.GetItem(up.itemIndex);
            if (item)
            {
                item.TakeWeapon(controll.rightHand, controll);
            }
            if (up.thisPlayer)
            {
                Chat.AmmoMax(up.ammo, up.ammoMax);
            }
        }
    }