{"author_name":"mohammad","cat":"MiniLD","comments":[{"author_name":"","time":"July 28, 2012 5:07 pm","epoch":1343513220,"text":"Why so many posts?","spam":"N"},{"author_name":"","time":"July 28, 2012 6:35 pm","epoch":1343518500,"text":"Just thought I would let you know, but Mplay is very insecure, which can often cause viruses.","spam":"N"},{"author_name":"Gaggerzon","time":"July 29, 2012 8:09 am","epoch":1343567340,"text":"I suggest posting this in the game maker community forums instead of here.","spam":"N"},{"author_name":"LiteLab","time":"August 24, 2012 3:11 pm","epoch":1345839060,"text":"Use the code tags.","spam":"N"}],"epoch":1343493000,"likes":0,"metadata":{"p_key":"55546","p_author":"mohammad","p_authorkey":"14064","p_urlkey":"91264","p_title":"even MORE about multiplayer (players & messages!)","p_cat":"MiniLD","p_event":"LD24","p_time":"1343493000","p_likes":"0","p_comments":"4","p_status":"UPD5","us_key":"14064","us_name":"mohammad","us_username":"mohammad","event_start":"1345766400","event_key":"12","event_name":"LD24"},"text":"<p>\/\/i hope you guys liked my previous scripts,for we shall be coding in GML. if you experince errors in the compiler<br \/>\n \/\/like, &#8220;PROGRAM ENDS BEFORE END OF CODE&#8221; it means you have one too many programs. other than that lets get<br \/>\n \/\/started shall we? this script is about players and handling with them. because its soo short we will<br \/>\n \/\/throw in some more commands on messages.<\/p>\n <p>\/\/to see how many players are on a session,along with a certian name, you would do the following:<br \/>\n {<br \/>\n mplay_player_find();<br \/>\n mplay_player_name(a_number);<br \/>\n }<\/p>\n <p>\/\/note that in order to do this you MUST use mplay_player_find(),else it will not work.<\/p>\n <p>\/\/to find the ID of that certian player,use the following code<br \/>\n {<br \/>\n mplay_player_find();<br \/>\n mplay_player_id(a_number);<br \/>\n }<\/p>\n <p>\/\/now onto messages.messages are pre-programmed strings the will be sent to a player instance.<br \/>\n \/\/but enough of that! lets get programming! lets start on a personal message sent to a player.<br \/>\n \/\/it would look like this: (use 0 to send it to all players)<br \/>\n {<br \/>\n mplay_message_send(player,id,message);<br \/>\n }<br \/>\n \/\/to make sure its sent to it,you would use the following code:<br \/>\n {<br \/>\n mplay_message_send_guaranteed(player,id,message);<br \/>\n }<br \/>\n \/\/this next code will have you &#8220;recive&#8221; messages from other players: (use 0 for any message)<br \/>\n {<br \/>\n mplay_message_receive(player);<br \/>\n }<br \/>\n \/\/now we can tinker with this abit.the next following code can be used to do diffrent things with the message:<br \/>\n {<br \/>\n mplay_message_receive(player);<br \/>\n mplay_message_id(); Returns the identifier of the last received message.<br \/>\n mplay_message_value(); Returns the value of the last received message.<br \/>\n mplay_message_player(); Returns the player who sent the last received message.<br \/>\n mplay_message_name(); Returns the name of the player who sent the last received message.<br \/>\n mplay_message_count(player); Returns the number of messages left in the queue from the player (use 0 to count all message).<br \/>\n mplay_message_clear(player); Removes all messages left in the queue from the player (use 0 to remove all message).<br \/>\n }<br \/>\n \/\/there you have it! if your eager to see more code ill be happy to show you just simply post a comment<br \/>\n \/\/down below and ill see how it goes!<\/p>","time":"July 28th, 2012 11:30 am","title":"even MORE about multiplayer (players & messages!)"}