SA-MP Forums Archive
CreateDynamicObject problem - 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: CreateDynamicObject problem (/showthread.php?tid=356446)



CreateDynamicObject problem - pasha97 - 03.07.2012

I have some maps with vehicles in the sky on my server. I used createobject before and all was ok, but now i need createdynamicobject, because i have too many objects, and when i use it following bugs happen:

First of all, objects appear too slowly, and when player teleports to place in the sky, he falls down because objects appear after a few time, but when player teleports second time, this bug doesnt happen

Also, vehicles fall down too.

So how can i fix it?


Re: CreateDynamicObject problem - FalconX - 03.07.2012

Quote:
Originally Posted by pasha97
Посмотреть сообщение
I have some maps with vehicles in the sky on my server. I used createobject before and all was ok, but now i need createdynamicobject, because i have too many objects, and when i use it following bugs happen:

First of all, objects appear too slowly, and when player teleports to place in the sky, he falls down because objects appear after a few time, but when player teleports second time, this bug doesnt happen

Also, vehicles fall down too.

So how can i fix it?
Yes that's a problem in Streamer you could use a timer for it. Make a SetTimerEx for a player and when he teleport freeze the player then unfreeze it let's say after 3 seconds so the objects get load before the player fall down (actually happened with me before)

Regards,
FalconX


Re: CreateDynamicObject problem - ReneG - 03.07.2012

The objects aren't streaming in in-time. When you're teleporting the player, freeze them, and set a timer to unfreeze them.

Example with zcmd.
pawn Код:
CMD:teleport(playerid, params[])
{
    SetPlayerPos(playerid, 123.90, 53.980, 800.0);
    TogglePlayerControllable(playerid, 0); // Freeze them
    SetTimerEx("UnFreezeTimer", 3000, 0, "d", playerid); // Set a timer of 3000 milliseconds (3 secs)
    return 1;
}

forward UnFreezeTimer(playerid);
public UnFreezeTimer(playerid)
{
    TogglePlayerControllable(playerid, 1); // Unfreeze them
    return 1;
}



Re: CreateDynamicObject problem - pasha97 - 03.07.2012

thank you guys, repped


Re: CreateDynamicObject problem - pasha97 - 03.07.2012

but what about vehicles? I cant du such thing to them xD


Re: CreateDynamicObject problem - ReneG - 03.07.2012

You might be able to, do they fall only when a player is teleported there, or do they fall when the gamemode is started?