mplay_message_value()

This functions works almost like mplay_message_id(), the main difference is that this one returns the value of the last message received. You can easily incorporate this to the last explained example:

 

Example

if (mplay_message_receive(0)) //observe the use of this function

{

switch (mplay_message_id()) //switch the id of the message

{

  case 1: //id = 1, is  a chat message

         array[chat+1]=mplay_message_value();

         chat+=1;

         break;

  case 2: //id = 2, is a hspeed update

         player1.hspeed = mplay_message_value();

         break;

}

}

 

In this example we incorporated the use of mplay_message_value() to determine exactly what to do, note that we invented the id, remember that the id are assigned by you when sending a message, you need to remember what each id stores. Now, we set that an id 1 means a chat message, while an id 2 means an hspeed update.

 

gml_josea Revision #1