SA-MP Forums Archive
Virtual world help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Virtual world help (/showthread.php?tid=541798)



Virtual world help - kevin_1991 - 14.10.2014

Greetings, i need help i mapped someting and i want to place it ONLY in virtual world 1 and Interior 1 how can i do that i did it like this



Код:
public OnFilterScriptExit() {
    for(new i; i < MAX_PLAYERS; i++) {
	    if(GetPlayerVirtualWorld(i) != 1 || GetPlayerInterior(i) != 1) {
			TogglePlayerControllable(i, false);
		}
	}
}
But its still on Virtual word 0...


Re: Virtual world help - MasonSFW - 14.10.2014

Put Under onplayerconnect in Filescript or your gm

SetPlayerVirtualWorld(playerid, 1);
SetPlayerInterior(playerid, 1);


Re: Virtual world help - kevin_1991 - 14.10.2014

what do you mean ?


Re: Virtual world help - kevin_1991 - 14.10.2014

I made this under the filterscript


Код:
    for(new i, Float: fPlayerPos[3]; i < MAX_PLAYERS; i++) {
	    if(GetPlayerVirtualWorld(i) != 1 || GetPlayerInterior(i) != 1) {
			Streamer_UpdateEx(i, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
			GetPlayerPos(i, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2]);
			SetPlayerPos(i, fPlayerPos[0], fPlayerPos[1], fPlayerPos[2] + 2.5);
			TogglePlayerControllable(i, true);
		}
	}



Re: Virtual world help - iOxide - 14.10.2014

Are you trying to make the map appear in virtual world 1? If yes, i guess that is not possible. Since the objects are global, it will appear in virtual world 0 even if you place it inside other world.


Re: Virtual world help - kevin_1991 - 14.10.2014

It is possible to do that i know it can but i need to know what i need to change to i will only appear in Virtual World 1


Re: Virtual world help - iOxide - 14.10.2014

Ah, sorry for the wrong information above. Just realized you can do it with CreateDynamicObject using streamer plugin. The syntax to add the object is

Код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 300.0);
So all you have to do is, change the worldid to the world you want same for the interior.