SA-MP Forums Archive
Move camera when do /rescue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Move camera when do /rescue (/showthread.php?tid=550399)



Move camera when do /rescue - NikiFor - 12.12.2014

Good morning / Good afternoon / Good evening ...
I wanted a simple help I have not found forum (yes, I used the search and ******) ...
how can I use what is red and he know the location that the player is and move the camera to the location that the player chose in dialog?

Код:
// Process the rescue dialog
Dialog_Rescue(playerid, response, listitem)
{
	// Just close the dialog if the player clicked "Cancel"
	if(!response) return 1;

	// Check the class of the player
	switch (APlayerData[playerid][PlayerClass])
	{
		case ClassCourier:
		{
			// Set the spawn coordinates based on the selection in the list
			switch (listitem)
			{
				case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 798.0, -618.75, 16.4, 0.0, 0, 0, 0, 0, 0, 0);
				case 1: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -1849.25, -135.0, 12.0, 90.0, 0, 0, 0, 0, 0, 0);
				case 2: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1050.5, 1931.0, 10.9, 270.0, 0, 0, 0, 0, 0, 0);
			}
		}
	}
        TogglePlayerSpectating(playerid, 1);
 	InterpolateCameraPos(playerid, FromX, FromY, FromZ, ToX, ToY, :ToZ, 10000, CAMERA_MOVE);
	SpawnPlayer(playerid); // Force the player to spawn at the requested coordinates
	SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerRescued); // Send the player a message that using "/rescue" costs $200
	// Reduce the player's money by 200
	RewardPlayer(playerid, -200, 0);

	return 1;
}
I give REP who help me...

ps: Used ****** translate


Re: Move camera when do /rescue - Sledgehammer - 12.12.2014

Where about do you want the camera to move to? His current position?


Re: Move camera when do /rescue - NikiFor - 12.12.2014

Quote:
Originally Posted by Death1300
Посмотреть сообщение
Where about do you want the camera to move to? His current position?
No... player is on coordinates 0.0.0 (EXAMPLE) and he do /rescue and choose one of the rescues... after he chose i want to make a camera animation to the coordinates of the rescue...

Sorry my bad english.. Hope you understand...

edit:
I get this.. i didn't tested but how to get the player position?

Код:
// Process the rescue dialog
Dialog_Rescue(playerid, response, listitem)
{
	// Just close the dialog if the player clicked "Cancel"
	if(!response) return 1;

	// Check the class of the player
	switch (APlayerData[playerid][PlayerClass])
	{
		case ClassCourier:
		{
			// Set the spawn coordinates based on the selection in the list
			switch (listitem)
			{
				case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 798.0, -618.75, 16.4, 0.0, 0, 0, 0, 0, 0, 0); InterpolateCameraPos(playerid, FromX, FromY, FromZ, ToX, ToY, :ToZ, 10000, CAMERA_MOVE);
				case 1: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -1849.25, -135.0, 12.0, 90.0, 0, 0, 0, 0, 0, 0); InterpolateCameraPos(playerid, FromX, FromY, FromZ, ToX, ToY, :ToZ, 10000, CAMERA_MOVE);
				case 2: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), 1050.5, 1931.0, 10.9, 270.0, 0, 0, 0, 0, 0, 0); InterpolateCameraPos(playerid, FromX, FromY, FromZ, ToX, ToY, :ToZ, 10000, CAMERA_MOVE);
			}
		}
	}
        TogglePlayerSpectating(playerid, 1); 	
	SpawnPlayer(playerid); // Force the player to spawn at the requested coordinates
	SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerRescued); // Send the player a message that using "/rescue" costs $200
	// Reduce the player's money by 200
	RewardPlayer(playerid, -200, 0);

	return 1;
}



Re: Move camera when do /rescue - NikiFor - 12.12.2014

Up! Someone help?