Posts: 152
Threads: 57
Joined: Jun 2011
Reputation:
0
Hello!
What script sets players vacant virtual world?
Example:
Player named "Dumbass" entered the server and took virtual world number 1. Other player came to server and want to take vacant virtual world, so not the virtual world with number 1. So what script makes that?
suhrab_mujeeb
Unregistered
You want to set a virtual world for every connecting player so that every player who joins is in a different virtual world than the other?
Posts: 484
Threads: 49
Joined: Feb 2011
Put this in public OnPlayerConnect or in OnPlayerLogin or in OnPlayerSpawn :P
SetPlayerVirtualWorld(playerid, playerid);
VW will same as players id...
Posts: 152
Threads: 57
Joined: Jun 2011
Reputation:
0
So Virtual World limit is Unlimited?
Posts: 484
Threads: 49
Joined: Feb 2011
No, you can create 2,147,483,647 Virtual Worlds

Almost unlimited
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
SetPlayerVirtualWorld(playerid, playerid);
Puts the player in the world of their ID.
EDIT: Sigh.
suhrab_mujeeb
Unregistered
pawn Code:
// Top of the script
new PlayerWorld;
// Under OnGameModeInit
PlayerWorld = 0;
// Under OnPlayerConnect
PlayerWorld++;
// Under OnPlayerDisconnect
PlayerWorld--;
// Under OnPlayerSpawn
SetPlayerVirtualWorld(playerid, PlayerWorld);
Try this, untested.
Basically the same as MP2 said, I was making it while he posted it.