Quote:
Originally Posted by the_chaoz
Well looks like won't get this pice of code working like I want:
pawn Код:
stock StartEditor(playerid) { new Float:P[3]; TogglePlayerSpectating(playerid, true); GetPlayerCameraPos(playerid, P[0], P[1], P[2]); gPlayers[playerid][CameraObject] = CreateDynamicObject(19300, P[0], P[1], P[2], 0.0, 0.0, 0.0, .playerid = playerid); AttachCameraToDynamicObject(playerid, gPlayers[playerid][CameraObject]); gPlayers[playerid][Mode] = PLAYER_MODE_EDITOR; return 1; }
Yes I know, the object must be streamed in in order to AttachCameraToDynamicObject work. I've tryed from a timer to make a delay, to re-order so the camera coords are obtained after the player enter on spec mode, etc. And nothing work.
Does anyone have any clue?
|
Quote:
Originally Posted by leong124
Maybe make a forced update before attaching the camera. They won't appear until you move (unless you turn it on using Streamer_ToggleIdleUpdate). I am also making an in-game editor that fulfills my needs.
|
You can also use Streamer_Update or Streamer_UpdateEx immediately after CreateDynamicObject. It will re-synchronize all the objects. (Even if IdleUpdate is disabled.) I don't think there's a function to re-synchronise a single object.