Xer0botXer0
Senpai
Hi guys,
so basically I was trying to prevent duplicate entries when receiving data from the server,
well it's still not working grr..
any ideas ? i thought this would work.
so basically I was trying to prevent duplicate entries when receiving data from the server,
well it's still not working grr..
Code:
case 15: ///Receive other player Instance information
//first check that this player data is not already client side
var get_usn = buffer_read(buffer,buffer_string)
for (qu =0; qu < 10; qu ++)
{
if global.arr_other_player_information[qu,0] != get_usn
{
inc_qu = inc_qu + 1
}
}
if inc_qu >= 9 //player data doesnt already exist
{
for (qa =0; qa < 10; qa ++)
{
if global.arr_other_player_information[qa,0] == "" //if slot is empty
{
///Populate other player slot with other player information
global.arr_other_player_information[qa,0] = get_usn //username
global.arr_other_player_information[qa,1] = -1 //Instance id (use to store instance id upon creation, to use after)
global.arr_other_player_information[qa,2] = buffer_read(buffer,buffer_u8) //room x
global.arr_other_player_information[qa,3] = buffer_read(buffer,buffer_u8) //room y
global.arr_other_player_information[qa,4] = buffer_read(buffer,buffer_u16) //x pos
global.arr_other_player_information[qa,5] = buffer_read(buffer,buffer_u16) //y pos
qa = 11 //end
inc_qu = 0;
}
}
}
break;
Last edited: