Example #1
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);
            }
        }
    }