27.11.2011, 16:46
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 ..
Freeze(playerid, 5000);
stock Freeze(playerid, time) { TogglePlayerControllable(playerid, false); SetTimerEx("Unfreeze", time, false, "i", playerid); }
forward Unfreeze(playerid); public Unfreeze(playerid) { TogglePlayerControllable(playerid, true); return 1; }
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
}