Help With objects and virtual world!
#1

How can I Get players to only see objects in virtual world?
Reply
#2

pawn Код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0);
Set a worldid;

then
pawn Код:
SetPlayerVirtualWorld(playerid, worldid);
Reply
#3

Find the id of the int that you want, copy down the pawn code and set the virtual world (I think the first number) to the interior id.
Reply
#4

Thanks!
Reply
#5

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
pawn Код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0);
Set a worldid;

then
pawn Код:
SetPlayerVirtualWorld(playerid, worldid);
i have a script with virtual world
but objects are still visible in original world

i want that objects must be visible only in virtual world
Reply
#6

the object must appear only when the player do teleport command (eg /stunt... the stunt area object must be appaear only when player do thge command no in normal gamemode)
Reply
#7

https://sampwiki.blast.hk/wiki/CreatePlayerObject

That function will create an object for a player wherever he is (interiors and virtual worlds). w/o the need of a streamer. Although if you are using more than 400 objects you should definitely use a streamer.
Reply
#8

i need a demo script
Reply
#9

****** finds this so I put an example script:

Код:
//Example with 5 objects in a VirtualWorld

CreateDynamicObject(18256,-317.30000000,-0.30000000,1.08000000,3.00000000,35.00000000,-12.00000000,1);
CreateDynamicObject(18256,-346.25000000,8.09000000,29.40000000,3.00000000,61.00000000,-12.00000000,1);
CreateDynamicObject(18256,-376.36000000,17.01000000,32.43000000,0.00000000,-47.00000000,-12.00000000,1);
CreateDynamicObject(18256,-383.28000000,19.28000000,32.62000000,2.00000000,-30.00000000,-12.00000000,1);
CreateDynamicObject(18256,-399.35000000,23.70000000,25.08000000,0.00000000,-20.00000000,-12.00000000,1);

//Example of teleport with setting a VirtualWorld which in this case is 1

if (strcmp("/stunt",cmdtext,true, 6) == 0)
{
    
       

	SetPlayerPos(playerid,-399.35000000,23.70000000,26.00000000);
	SendClientMessage(playerid,COLOR_GREEN,"Welcome to stunt");
	GivePlayerWeapon(playerid,46,1);
	GameTextForPlayer(playerid,"Welcome to stunt",3500,6);
	SetPlayerVirtualWorld(playerid, 1);
	return 1;
}
Peace
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)