Problem with objects
#1

I have big problem with objects... I use incognito streamer.. And the problem - I maked Island over water and when i spawn cars falling on water and some times me ..
Reply
#2

use a timer to freeze yourself for so many seconds to give the objects sometime to load this is what i do and works fine for me


in you teleport cmd put this

Код:
Freeze(playerid, 5000);
at the bottom of your script

Код:
stock Freeze(playerid, time)
	{
	TogglePlayerControllable(playerid, false);
	SetTimerEx("Unfreeze", time, false, "i", playerid);
}
and this below it

Код:
forward Unfreeze(playerid);
public Unfreeze(playerid)
	{
	TogglePlayerControllable(playerid, true);
	return 1;
}
Reply
#3

How ?
Reply
#4

edit my post before might have missed a few bits just say what the errors are.
Reply
#5

In my server I use something like this:

pawn Код:
stock Ex_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
{
        if(floatabs(x) > 3000.0 || floatabs(y) > 3000.0) //Checks if the coords are outside the main land
        {
                TogglePlayerControllable(playerid, false); //Freezes the player
                SetTimerEx("SPP_Unfreeze", 5000, false, "d", playerid); //Sets a timer of ~5 seconds (Change the value if needed) to unfreeze the player
        }
        Streamer_UpdateEx(playerid, x, y, z); //Makes the streamer 'update' and load the objects in the position where the player will teleport
        return SetPlayerPos(playerid, x, y, z); //Sets the pos :P
}
#define SetPlayerPos Ex_SetPlayerPos
//^ "hooks" SetPlayerPos, no need to call the function in every teleport command, you just add this in top of script (after includes)

forward SPP_Unfreeze(playerid);
public SPP_Unfreeze(playerid)
{
        return TogglePlayerControllable(playerid, true); //Unfreezes the player :D
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)