![]() |
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() Code:
private void ProcessCommands(List<ServerCommand> newCmds) WildWillie |
Code:
int armyPlayer = GamePlay.gpPlayer().Army(); Code:
namespace maddox.game |
@wildwillie:
To send a message to a specific army (1 red, 2 blue, -1 to all) Code:
private void sendScreenMessageTo(int army, string msg, object[] parms) sendChatMessageTo send the message to the chat to use following sends a HudMessage "Hello red" to red Army sendScreenMessageTo(1, "Hello red", null); to all sendScreenMessageTo(-1, "Hello all", null); if you want show values etc. you can use int redpoints = 100; //example value sendScreenMessageTo(1, "Hello red, you have {0} points", new object[]{ redpoints}); so red gets the message "Hello red, you have 100 points" to a specific player: Code:
private void sendChatMessageTo(Player player, string msg, object[] parms) for timing i use Stopwatch from.net, ontickgame is not very exact. example: Code:
using System; |
Another solution, based on the example above
Code:
using System; |
Thank you for the quick replys. I'll work them in later this weekend.
|
All times are GMT. The time now is 07:46 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.