spawn selection camera
#1

After the player selects there class, it goes onto spawn zone selection. I toggleplayerspectating to true, and set the camera pos and camera look at pos, but it doesn't work, it just looks at the sea (with a bridge, i think it's like the default location for a camera to look at, i think its at the 0,0 coords (center of map)) so the position maybe isn't worked?
It was working before, but I changed something in class selection and it broke it, so it can't be the camera positions surely :O?

Код:
if(gPlayerSpawnSelection[playerid] == SPAWN_ALL_SAINTS_HOSPITAL) {
		SendClientMessage(playerid, COLOR_INFO, "All Sains Hospital camera pos set for spawn selection");
   		SetPlayerCameraPos(playerid,1234.7545,-1303.5400,38.6440);
		SetPlayerCameraLookAt(playerid,1182.5050,-1323.1746,13.5791);

		TextDrawShowForPlayer(playerid,txtAllSaintsHospital);
		TextDrawShowForPlayer(playerid,txtASHdescription);
}
the sendclientmessage is just something I added for debugging purposes (to make sure it was getting called properly).

this is in OnPlayerSpawn:
Код:
if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING) {
			TogglePlayerSpectating(playerid,true);
}
Reply
#2

SetPlayerCameraPos and SetPlayerCameraLookAt doesn't work when spectating. Use InterpolateCameraPos and InterpolateCameraLookAt..

https://sampwiki.blast.hk/wiki/InterpolateCameraPos
https://sampwiki.blast.hk/wiki/InterpolateCameraLookAt

Camera won't move if you put the same values of From:X, Y, Z to To:X, Y, Z, in case you don't know.
Reply
#3

Awesome! thanks duddddde +1 rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)