SetPlayerCamera doesn't work
#1

Код:
forward ClearScreenTimer(playerid);
public ClearScreenTimer(playerid)
{
	ClearScreen(playerid);
	SendClientMessage(playerid, COLOR_GOLD, "Welcome to "ServerName".");	
	SendClientMessage(playerid, COLOR_GOLD, "Type /cursor to get your cursor back.");	
	TogglePlayerControllableEx(playerid, 0);
	new rand = random(sizeof(LoginLocations));
	SetPlayerCameraPos(playerid, LoginLocations[rand][SetPlayerCameraPosX], LoginLocations[rand][SetPlayerCameraPosY], LoginLocations[rand][SetPlayerCameraPosZ]);
	SetPlayerCameraLookAt(playerid, LoginLocations[rand][SetPlayerCameraLookAtX], LoginLocations[rand][SetPlayerCameraLookAtY], LoginLocations[rand][SetPlayerCameraLookAtZ]);	
}
Код:
public OnPlayerConnect(playerid)
{	
SetTimerEx("ClearScreenTimer", 1000, false, "i", playerid);
	return 1;
}
http://i.imgur.com/NlcAcpd.png

As you can see, it clears my chat and sends the message, but it doesn't set the camera angle. Does anyone know why and how to fix it?
Reply
#2

You should Spawn the player with Spawn(playerid); before Setting the Camera position and his position.
Reply
#3

Quote:
Originally Posted by Lucky13
Посмотреть сообщение
You should Spawn the player with Spawn(playerid); before Setting the Camera position and his position.
I did that and it still does not work. The camera only seems to work when I restart the server in-game.
Reply
#4

Hmm can you set the timer to 2 seconds then?
Reply
#5

Quote:
Originally Posted by Lucky13
Посмотреть сообщение
Hmm can you set the timer to 2 seconds then?
Just tried that. Still doesn't work.
Reply
#6

Spawn(playerid); is on top at CleanScreenTimer?
Reply
#7

Quote:
Originally Posted by Lucky13
Посмотреть сообщение
Spawn(playerid); is on top at CleanScreenTimer?
If you mean SpawnPlayer(playerid); then yes.
Reply
#8

Try to add TogglePlayerSpectating(playerid,1); before setting the camera position? If this doesn't work aswell, then something bad is at
Код:
[LoginLocations[rand][SetPlayerCameraLookAtX], LoginLocations[rand][SetPlayerCameraLookAtY], LoginLocations[rand][SetPlayerCameraLookAtZ]
Reply
#9

SetPlayerCamera don't work when spectating is on.
See if anything is set for spectating when connecting.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)