SA-MP Forums Archive
Remove objects after SetVirtualWorld - 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: Remove objects after SetVirtualWorld (/showthread.php?tid=359080)



Remove objects after SetVirtualWorld - kbalor - 12.07.2012

I was having this problem.

How to remove objects or stunt objects after teleporting in same place but different command.

Example:

If I type /lsa the stunt or object are there. (It's just normal coz my gamemode is freeroam and stunts)
But after I type /drag and the map is in lsa. The object are still there.

How can i remove them? so i can drag clearly and no object will bump.


Re : Remove objects after SetVirtualWorld - vernz - 12.07.2012

use a streamer... like incognito


Re: Re : Remove objects after SetVirtualWorld - kbalor - 13.07.2012

Quote:
Originally Posted by vernz
Посмотреть сообщение
use a streamer... like incognito
Its not the streamer. I need to use setplayer and setvehicle virtual world. but i dont know how. anybody?


Re: Remove objects after SetVirtualWorld - Vince - 13.07.2012

CreatePlayerObject/DestroyPlayerObject. That, or use Incognito's streamer as suggested; it has a virtual world parameter.


Re: Remove objects after SetVirtualWorld - kbalor - 13.07.2012

Quote:
Originally Posted by Vince
Посмотреть сообщение
CreatePlayerObject/DestroyPlayerObject. That, or use Incognito's streamer as suggested; it has a virtual world parameter.
In my gamemode i already have #include <streamer> also my in my plugins folder. and im using incognitos streamer. All object are created using CreateDynamicObject and AddStaticVehicle.
How can i destroy them after moving to a same place but different command?


Re: Remove objects after SetVirtualWorld - kbalor - 13.07.2012

i saw your post last 2 years ago.

Код:
Objects are created in all worlds and interiors. There is no virtualworld parameter for that (only for pickups, afaik). 
You can try to using CreatePlayerObject to create the map when the player is in a certain virtual world and destroy them again once he leaves that specific virtual world.
Now i know. So I need to move and replace all CreateDynamicObject also with the vehicle to

Код:
new pObject[MAX_PLAYERS];
 
public OnPlayerConnect(playerid)
{
    pObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0, 0, 96);
 
    // Or alternatively, using the DrawDistance parameter to show it from as far away as possible:
    pObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0, 0, 96, 300.0);
    return 1;
}
 
public OnPlayerDisconnect(playerid, reason)
{
    DestroyPlayerObject(playerid, pObject[playerid]);
    return 1;
}



Re: Remove objects after SetVirtualWorld - Vince - 13.07.2012

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



Re: Remove objects after SetVirtualWorld - kbalor - 13.07.2012

Quote:
Originally Posted by Vince
Посмотреть сообщение
Код:
native CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0);
Can you make a simple demo script here.

I have a example of object:
CreateObject(3265, -2955.304687, -192.912765, 25.427370, 0.000000, 0.000000, 91.30001; //sign