The game was pretty mutch configured to be multiplayer from the current code .. but there is a few problems:
mplay_message_send(0,5,global.username)
and the:
if mplay_message_id()=5
{
ini_open('Accounts.ini')//open accounts
if ini_section_exists(mplay_message_value())
{
username = mplay_message_value()
}
} section can be removed .. because you can find the username that you send to server when you joined the session by mplay_message_name()
and close the ini files after opeing them:
ini_close()
And take a look at this part, here you are looking for section username, key 0 or 1
if ini_key_exists(username,'Password' = mplay_message_value())
.. I highly doubt that you would find that key..
maybe try:
if ini_key_exists(mplay_message_name(),'Password') {
if ini_read_string(mplay_message_name(),'Password','')=mplay_message_value()
// password is correct
else
// password is wrong;
} else {
// profile doesn't exist .. then create it
ini_write ...
}in the start it can be good to know that the correct things get triggered, so I use to make a code that when I send something to server/player .. then I can get notified when that happends:for object controll:
create event:
for(i=0;i<10;i+=1) log[i]="";
draw event:
for(i=0;i<10;i+=1) draw_text(x,y+i*15,log[i]);
// this is a list of all players that is connected
n=mplay_player_find(); i=0;
while(i<n) { draw_text(200,y+15*i,mplay_player_name(i)); i+=1; }make a new script and call it: log_add
for(i=9;i>0;i-=1;) log[i]=log[i-1];
log[0]=argument0;
this is meant to be put after a id check
if mplay_message_id()=4//create bullet
{
log_add(mplay_message_name()+" created a bullet")
...
but that one might happen ofen .. so it would get a bit annoying ..
.. funny, I had to learn mplay to fix this .. I'm used to work with 39dll only x3 .. will upload it later (because you learn more if you manage to fix it on your own)