VirtualWorld
#1

Is there any way to check is VirtualWorld occupied by other player??
Reply
#2

Simply count the people you send to another world, than you know if its occupied

if every player should have its own world use SetPlayerVirtualWorld(playerid, playerid + 1)
Reply
#3

PHP код:
for(new 0MAX_PLAYERSj++)
{
      if(
GetPlayerVirtualWorld(j) == 5)
      {
             
//Do something
      
}

Not sure if it works, just try ;P
Reply
#4

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Simply count the people you send to another world, than you know if its occupied

if every player should have its own world use SetPlayerVirtualWorld(playerid, playerid + 1)
Well I used
PHP код:
SetPlayerVirtualWorld(playeridplayerid 1
But could 2 players be in same VW with this??
Reply
#5

PHP код:
SetPlayerVirtualWorld(playeridplayerid+1);
SetPlayerVirtualWorld(targetidplayerid+1); 
Reply
#6

Quote:
Originally Posted by Micko123
Посмотреть сообщение
Well I used
PHP код:
SetPlayerVirtualWorld(playeridplayerid 1
But could 2 players be in same VW with this??
No, because the playerid is unique to every player and the + 1 prevents from joining the default world (0)
Reply
#7

Thx guys
Reply
#8

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
No, because the playerid is unique to every player and the + 1 prevents from joining the default world (0)
I would also consider adding an offset, for example:

#define UNIQUE_WORLD_OFFSET 10000

And you use what Nero stated + this.

This is only necessary (well useful) if you already use some virtual worlds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)