07.12.2014, 16:12
Hello guys,
I want to hide the spawn buttons while the player is under the Login dialog, with a little search I found out the TogglePlayerSpectating(playerid, toggle) function, so I put it under the OnPlayerConnect callback, I also set my custom camera position while connecting using the SetPlayerCameraPos and SetPlayerComeraLookAt, but when I call the TogglePlayerSpectating it changes my camera position and I don't know why, neither how to do it without changing my camera position ;/
My Code:
public OnPlayerConnect(playerid)
{
// This way the camera looks exactly where I want it, but the spawn buttons don't disapear.
SetPlayerCameraPos(playerid, x, y, x);
SetPlayerCameraLookAt(playerid, x, y, z);
}
public OnPlayerConnect(playerid)
{
// This way the spawn buttons are hidden but my camera position is changed to another view, that's not even
// the default view.
TogglePlayerSpectating(playerid, 1);
SetPlayerCameraPos(playerid, x, y, x);
SetPlayerCameraLookAt(playerid, x, y, z);
}
ps.: I tried in every way, with TogglePlayerSpectating inside OnPlayerRequestClass callback, with Camera functions before Spectating function, but the results are still the same.
How to hide the spawn buttons using TogglePlayerSpectating function but without getting my camera position changed??
I want to hide the spawn buttons while the player is under the Login dialog, with a little search I found out the TogglePlayerSpectating(playerid, toggle) function, so I put it under the OnPlayerConnect callback, I also set my custom camera position while connecting using the SetPlayerCameraPos and SetPlayerComeraLookAt, but when I call the TogglePlayerSpectating it changes my camera position and I don't know why, neither how to do it without changing my camera position ;/
My Code:
public OnPlayerConnect(playerid)
{
// This way the camera looks exactly where I want it, but the spawn buttons don't disapear.
SetPlayerCameraPos(playerid, x, y, x);
SetPlayerCameraLookAt(playerid, x, y, z);
}
public OnPlayerConnect(playerid)
{
// This way the spawn buttons are hidden but my camera position is changed to another view, that's not even
// the default view.
TogglePlayerSpectating(playerid, 1);
SetPlayerCameraPos(playerid, x, y, x);
SetPlayerCameraLookAt(playerid, x, y, z);
}
ps.: I tried in every way, with TogglePlayerSpectating inside OnPlayerRequestClass callback, with Camera functions before Spectating function, but the results are still the same.
How to hide the spawn buttons using TogglePlayerSpectating function but without getting my camera position changed??