You could script virtual words for objects and its not very difficult...
You just need to create a new SetPlayerVirtualWorld function and use CreatePlayerObject
Here a huge example code
pawn Код:
// costum SetPlayerVirutalWorld function
stock ovwSetPlayerVirtualWorld(playerid, const newWorldid) {
new
oldWorldid = GetPlayerVirtualWorld(playerid);
if((oldWorldid != newWorldid) && SetPlayerVirtualWorld(playerid, newWorldid)) {
return OnPlayerVirtualWorldChange(playerid, newWorldid, oldWorldid);
}
return false;
}
forward OnPlayerVirtualWorldChange(playerid, newWorldid, oldWorldid);
#define SetPlayerVirtualWorld ovwSetPlayerVirtualWorld
pawn Код:
new // similar system as YSI_objects
ObjectInfo[TOTAL_OBJECTS][OI_ENUM],
PlayerObject[MAX_PLAYERS][MAX_OBJECTS];
pawn Код:
public OnPlayerVirtualWorldChange(playerid, newWorldid, oldWorldid) {
for(new i; i != sizeof ObjectInfo; ++i) {
if(ObjectInfo[i][Active][playerid]) { // if the object is spawned for the player
if(ObjectInfo[i][VirtualWorld] == -1) { // global objects
continue;
} // if its not global it must be in another virtual world => so we can destroy it
for(new o; o != sizeof PlayerObject; ++o) {
if(PlayerObject[playerid][o] == i) {
ObjectInfo[i][Active][playerid] = false; // set the active status to false
DestroyPlayerObject(playerid, o); // destroy player object
PlayerObject[playerid][o] = -1;
break;
}
}
} else { // if the object is not spawned
if(ObjectInfo[i][VirtualWorld] == newWorldid) {
new // create player object
objectid = CreatePlayerObject(playerid, ...);
if(objectid != INVALID_OBJECT_ID) {
ObjectInfo[i][Active][playerid] = true; // Active should be a bit array (y_bit)
PlayerObject[playerid][objectid] = i; // connect objectid and data
}
}
}
}
return true;
}
As you just saw, the main problem is that you would need a ObjectData array
Such an array uses a lot of space and is only effectively used within a streamer
Just use a existing streamer with such a function