???
Математика на уровне МГУ

Показано с 1 по 25 из 789

Тема: Вопросы.

Комбинированный просмотр

Предыдущее сообщение Предыдущее сообщение   Следующее сообщение Следующее сообщение
  1. #1

    Re: Вопросы.

    Цитата Сообщение от naryv Посмотреть сообщение
    It was a single-mission sample, i tryed step by step check , but now it seems like i know what is the problem:. In multiplayer label will not sent to player which is author of this label - just to not doubling labels, exept case when labels sent to everybody. So, when you use that code you make label with player who enter the plane as author, sever will not send it to this player. But You can change the author of label, then it would be send to remote player, server is good candidate to be author(couse hi makes it really) like this :
    Код:
    using maddox.game;
    using maddox.game.world;
    using maddox.GP;
    using System.Collections.Generic;
    using Math = System.Math;
    
    
    public class Mission : AMission
    {
    
        public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
        {
            base.OnPlaceEnter(player, actor, placeIndex);
            Point2d p ;
            p.x = actor.Pos().x;
            p.y = actor.Pos().y;
            GPUserLabel ul = GamePlay.gpMakeUserLabel(p, GamePlay.gpPlayer(), actor.Name(), GamePlay.gpTimeofDay(), (int)GPUserIconType.Plane);
            GamePlay.gpDrawUserLabel(ul);
            p.x -= 300;        
            ul.pos = p;
            ul.Text = "Show player";
            GamePlay.gpDrawUserLabel(new Player[] { player }, ul);
    
            p.x += 600;
            p.y += 300;
            ul.pos = p;
            ul.Text = "Show army";
            GamePlay.gpDrawUserLabel(0,ul);
            p.x += 300;
            p.y += 300;
            ul.pos = p;
            GamePlay.gpDrawUserLabel(1, ul);
            p.x += 300;
            p.y += 300;
            ul.pos = p;
            GamePlay.gpDrawUserLabel(2, ul);
        }
        
    }
    it should draw 3 labels - actor.Name, Show player and Show army , try it please.[COLOR="Silver"]
    Does GamePlay.gpPlayer() work for dedicated server, too?

  2. #2
    Старший Офицер Форума
    Регистрация
    15.02.2002
    Адрес
    Moscow
    Возраст
    47
    Сообщений
    6,905
    Images
    51

    Re: Вопросы.

    Цитата Сообщение от 41Sqn_Banks Посмотреть сообщение
    Does GamePlay.gpPlayer() work for dedicated server, too?
    yes, just tryed this mission runing on dedicated server, join it, and enter the spit flying in mission, get 3 labels as it should be done.
    Don't happy, be worry

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •