Spectate a point


I want to add some scenes in my gamemode where the player will see something.

The problem is: The player has to be near the objects I want to show to the player else he/she will see the LOD rendered objects... But how can I say to the client "Render this area in the normal quality without seeing the player"?

A current workaround is to set the players position to some invisible point (e.g. a building) and freeze it there.

But what I want is something like the spectate mode with the possibility to move the camera by the script.

Would that be possible?

Just set player position with z-2 of point where you are looking with camera

It's easy:

1є. Save Player's position.
2є. Use TogglePlayerSpectating and set player camera positions where you want.
3є. Turn spectating mode off, it'll call OnPlayerSpawn, but set player position where he was when he used the command or what you did.

pawn Код:
new Float:PosX[MAX_PLAYERS], Float:PosY[MAX_PLAYERS], Float:PosZ[MAX_PLAYERS], Spectating[MAX_PLAYERS];

//---Your command/script.
GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
TogglePlayerSpectating(playerid, 1);
Spectating[playerid] = 1;
//etc., etc.

//---Your command to stop spectating.
TogglePlayerSpectating(playerid, 0);

if(Spectating[playerid] >= 1)
    Spectating[playerid] = 0;
I hope you understand...

Best regards!

TogglePlayerSpectating on, then set a 100 MS timer, and in said 100 MS timer set their camera (delay is required).

OK, I think the timer was the problem when I tried it with TogglePlayerSpectating.
Because that didn't work without a timer the last time (I saw some other location).

I will try it later. Thanks for the fast replies.

Forum Jump:

Users browsing this thread: 1 Guest(s)