Hey! I whant to make one more objects then I have players connected. So, if there is 1 players connected, the program should make 2 objects, and so on. But it seem to make much more objects then 2!
Host:
#include <DarkGDK.h>
#include "multisync.h"
int counter = 0;
int counter2 = 0;
void DarkGDK ( void )
{
dbSyncOn();
if (NetHost(16))
{
while (LoopGDK())
{
dbCLS();
if (NetPlayerJoined() != 0)
{
counter++;
NetPutInt(counter);
NetSend(counter);
for(int a = 0; a < counter + 2; a++)
{
if(!dbObjectExist(a))
{
dbMakeObjectCube(a, 32);
counter2 = a;
}
}
}
dbText(0, 0, dbStr(counter));
dbText(0, 20, dbStr(counter2));
dbSync();
}
}
}
Client:
#include <DarkGDK.h>
#include "multisync.h"
void DarkGDK ( void )
{
dbSyncOn();
if (NetConnect("127.0.0.1"))
{
while(LoopGDK())
{
dbSync();
}
}
}