mplay_message_name()

This function is another of the combo; it returns the string name of the player, very useful. In the followings example, we’re going to build a chat message with the name of the player, a colon and the value of the message:

 

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_name()+": "+mplay_message_value();

         chat+=1;

         break;

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

         player1.hspeed = mplay_message_value();

         break;

}

}

 

gml_josea Revision #1