Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-10-2011, 12:49 PM
wildwillie wildwillie is offline
Approved Member
 
Join Date: Aug 2010
Posts: 111
Default Scripting help needed

I need help with a couple of scripts for the stats/server manager program I am working on.

1st I need to check every 5 seconds to see of there is any commands in the queue to be processed. I have the queue stuff setup, just need the timing stuff. This is what I have so far based on examples I have seen, but it needs the timer number correctly:

Code:
    public override void OnTickGame()
    {
        if (Time.tickCounter() % 5000 == 50)
        {
            if (stats != null )
            {
               newCmds = stats.getCommands();
               if (newCmds.Count > 0)
                   ProcessCommands(newCmds);
            }
        }
 }
The next is for sending messages to the HUDlog. I would like the ability to send messages to (All players, All players in army 1(Red) or army 2(Blue), or a specific player) This is what I have so far:

Code:
    private void ProcessCommands(List<ServerCommand> newCmds)
    {
        try
        {
            foreach (ServerCommand sc in newCmds)
            {
                if (sc.CommandType.Equals("HUDmsg"))
                {
                	if (sc.ToWho.Equals("All"))
                    GamePlay.gpHUDLogCenter(sc.Command);
                  else if (sc.ToWho.Equals("Red"))
                   // Send message to Red Team
                    ????
                  else if (sc.ToWho.Equals("Blue"))
                   // Send message to Blue team
                   ???
                  else
                  {
                  	// Message is for a specific player based on player name in string sc.ToWho
                          ????
                  }
                }
            }
        }
        catch (Exception ex)
        {
            System.Console.WriteLine("Stats.ProcessCommands - Exception: " + ex);
        }
    }
Any help is appreciated,

WildWillie
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:05 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.