SetCameraBehindPlayer(playerid); bug
#1

https://www.youtube.com/watch?v=xrCmzehs4pI

it bug like video after i add SetCameraBehindPlayer(playerid);
PHP код:
if(clickedid == TDEditor_TD26)
                 {
                 
TextDrawHideForPlayer(playeridTDEditor_TD24);
                 
TextDrawHideForPlayer(playeridTDEditor_TD25);
                 
TextDrawHideForPlayer(playeridTDEditor_TD26);
                 
SetCameraBehindPlayer(playerid);
                 
SendClientMessage(playerid, -1"Nhan nut Spawn de bat dau cau chuyen!");
                 
CancelSelectTextDraw(playerid);
                 
SpawnPlayer(playerid);
                 
SetPlayerPos(playerid, -2778.8638,-626.3374,504.9848);
                 
SetPlayerFacingAngleplayerid270 );
                 
SetPlayerCheckpoint(playerid, -2507.6191,-613.1049,132.56253.0);
                 
onCheck[playerid] = true;
                 } 
How to fix?
Reply
#2

Try this:
PHP код:
if(clickedid == TDEditor_TD26
                 { 
                 
TextDrawHideForPlayer(playeridTDEditor_TD24); 
                 
TextDrawHideForPlayer(playeridTDEditor_TD25); 
                 
TextDrawHideForPlayer(playeridTDEditor_TD26); 
                 
SendClientMessage(playerid, -1"Nhan nut Spawn de bat dau cau chuyen!"); 
                 
CancelSelectTextDraw(playerid); 
                 
SpawnPlayer(playerid); 
                 
SetPlayerPos(playerid, -2778.8638,-626.3374,504.9848); 
                 
SetPlayerFacingAngleplayerid270 ); 
                 
SetCameraBehindPlayer(playerid); 
                 
SetPlayerCheckpoint(playerid, -2507.6191,-613.1049,132.56253.0); 
                 
onCheck[playerid] = true
                 } 
Reply
#3

You're using SetCameraBehindPlayer before SpawnPlayer that could be the issue here.
Reply
#4

Quote:
Originally Posted by SonnyGamer
Посмотреть сообщение
Try this:
PHP код:
if(clickedid == TDEditor_TD26
                 { 
                 
TextDrawHideForPlayer(playeridTDEditor_TD24); 
                 
TextDrawHideForPlayer(playeridTDEditor_TD25); 
                 
TextDrawHideForPlayer(playeridTDEditor_TD26); 
                 
SendClientMessage(playerid, -1"Nhan nut Spawn de bat dau cau chuyen!"); 
                 
CancelSelectTextDraw(playerid); 
                 
SpawnPlayer(playerid); 
                 
SetPlayerPos(playerid, -2778.8638,-626.3374,504.9848); 
                 
SetPlayerFacingAngleplayerid270 ); 
                 
SetCameraBehindPlayer(playerid); 
                 
SetPlayerCheckpoint(playerid, -2507.6191,-613.1049,132.56253.0); 
                 
onCheck[playerid] = true
                 } 
No change, my friend
Reply
#5

Try TogglePlayerSpectating to 0
Reply
#6

In the video you provided, the
Код:
                 SendClientMessage(playerid, -1, "Nhan nut Spawn de bat dau cau chuyen!");
isn't executed. I am not sure this is the part of the code involved into the matter. Also this code
Код:
                 SetCameraBehindPlayer(playerid);
                 SendClientMessage(playerid, -1, "Nhan nut Spawn de bat dau cau chuyen!");
                 CancelSelectTextDraw(playerid);
                 SpawnPlayer(playerid);
                 SetPlayerPos(playerid, -2778.8638,-626.3374,504.9848);
                 SetPlayerFacingAngle( playerid, 270 );
                 SetPlayerCheckpoint(playerid, -2507.6191,-613.1049,132.5625, 3.0);
is a bit messed up, as you randomly spawn the player.
Plus, if you use SpawnPlayer the camera should be reset behind the player without using SetCameraBehindPlayer.
Reply
#7

I'm pretty sure the issue is that you are using SpawnPlayer instead of TogglePlayerSpectating here.

EDIT: Forgot to mention that JasonRiggs said that above already.
Reply
#8

I'm with you GoldenLion
Reply
#9

Quote:
Originally Posted by kAn3
Посмотреть сообщение
In the video you provided, the
Код:
                 SendClientMessage(playerid, -1, "Nhan nut Spawn de bat dau cau chuyen!");
isn't executed. I am not sure this is the part of the code involved into the matter. Also this code
Код:
                 SetCameraBehindPlayer(playerid);
                 SendClientMessage(playerid, -1, "Nhan nut Spawn de bat dau cau chuyen!");
                 CancelSelectTextDraw(playerid);
                 SpawnPlayer(playerid);
                 SetPlayerPos(playerid, -2778.8638,-626.3374,504.9848);
                 SetPlayerFacingAngle( playerid, 270 );
                 SetPlayerCheckpoint(playerid, -2507.6191,-613.1049,132.5625, 3.0);
is a bit messed up, as you randomly spawn the player.
Plus, if you use SpawnPlayer the camera should be reset behind the player without using SetCameraBehindPlayer.
How to reset?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)