Цитата Сообщение от 41Sqn_Banks Посмотреть сообщение
Hello naryv,
Hi Banks!

Цитата Сообщение от 41Sqn_Banks Посмотреть сообщение
I have some problems with the creation of user labels. Basically I want to use gpMakeUserLabel to create a user label for each waypoint of an air group, and than use gpMakeUserLabel to draw it to the player. This is needed to show the waypoints to the players under full real realism settings.

Код:
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
{
    base.OnPlaceEnter(player, actor, placeIndex);

    if (actor is AiAircraft)
    {
        AiAircraft aiAircraft = actor as AiAircraft;
        AiAirGroup aiAirGroup = aiAircraft.AirGroup();
        if (aiAirGroup != null)
        {
            AiWayPoint[] waypoints = aiAirGroup.GetWay();

            foreach (AiWayPoint waypoint in waypoints)
            {
                GPUserLabel userLabel = GamePlay.gpMakeUserLabel(new maddox.GP.Point2d(waypoint.P.x, waypoint.P.x), player, waypoint.P.z.ToString(System.Globalization.CultureInfo.InvariantCulture.NumberFormat), GamePlay.gpTimeofDay(), (int)GPUserIconType.Waypoint);
                GamePlay.gpDrawUserLabel(new Player[] { player }, userLabel);
            }
        }
    }
}
The problem is that the labels are not displayed. The creation seems to have been successful, at least gpMakeUserLabel didn't return null. There is also no error or exception in the log.

Am I missing something? Do I have to store the created user label in order to display it? Is it because the same player is used to create and draw it?
Now in single mission there would be event OnUserCreateUserLabel(GPUserLabel ul) after you make gpDrawUserLabel(), but it really don't display, this is bug ( hope it would be fixed with next patch, we didn't test it this way in single). But it should work in online missions, displaying labels for users thats not a server, i mean client players would get displayed labels, server player wouldn't.