Hi,

I am trying to implement a message system for communication between teams and players.

Code:


function messageHandler(Sender, Receiver, Message)
{
messageSender = sender;
messageReceiver = receiver;
messageCmd = message;
messageReceiver._ds_messageCommand = ds_messageCmd;
//ds_mgsDelete();
}




I have a team state machine and imagine the team in STATE1 sends a message to respective players:

Code:

msgGoHome(my, player1, MCgoHome);
msgGoHome(my, player2, MCgoHome);
msgGoHome(my, player3, MCgoHome);
...




And now in the player state machine - State goHome

Code:
 
if(my._messageCommand == MCgoHome)
{
selectPlayerState(my, stateGoHome);
}




The problem is: i need to find a good way to delete the message, because if the team stays in STATE1 (loop) it will send always that message and i cant change the player state to another one.

So, ideas about this?
Thanks in advance.