[Ajuda] Movimentar cвmera ao fazer /rescue
#1

Bom dia/Boa tarde/Boa noite...
Queria uma ajuda simples que eu ainda nгo encontrei no fуrum (sim, usei o search e o ******)...
como posso usar aquilo que estб a vermelho e ele saber a localizaзгo que o player estб e movimentar a camera para o local que o player escolheu na 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;
}
Dou +Rep a quem me ajudar...

Grato.
Reply
#2

Код:
// 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;
}
Reply
#3

Quote:
Originally Posted by zRan
Посмотреть сообщение
Код:
// 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;
}
Vejo que fez aquela alteraзгo, mas n tenho que definir os "FromX/etc..." e os "ToX/(etc...)" para poder aplicar a animaзгo da localizaзгo X para Y?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)