Possible Anti-Aircraft?
#6

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
Yes, it is possible with GetPlayerCameraFrontVector
thanks I think it's becoming clear now. So I found this on sa-mp wiki. So how about if I will change the hydra missile to explosion. How do I do that? Also from left of the football field to right before the explosion.

Код:
// A simple command to manipulate this vector using the
// positions from GetPlayerCameraPos. This command will create
// a hydra missile in the direction of where the player is looking.
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (!strcmp(cmdtext, "/test camera vector"))
	{
		new
			Float:fPX, Float:fPY, Float:fPZ,
			Float:fVX, Float:fVY, Float:fVZ,
			Float:object_x, Float:object_y, Float:object_z;
 
		// Change me to change the scale you want. A larger scale increases the distance from the camera.
		// A negative scale will inverse the vectors and make them face in the opposite direction.
		const
			Float:fScale = 5.0;
 
		GetPlayerCameraPos(playerid, fPX, fPY, fPZ);
		GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ);
 
		object_x = fPX + floatmul(fVX, fScale);
		object_y = fPY + floatmul(fVY, fScale);
		object_z = fPZ + floatmul(fVZ, fScale);
 
		CreateObject(345, object_x, object_y, object_z, 0.0, 0.0, 0.0);
 
		return 1;
	}
 
	return 0;
}
Reply


Messages In This Thread
Possible Anti-Aircraft? - by gotwarzone - 02.03.2014, 11:07
Re: Possible Anti-Aircraft? - by Twizted - 02.03.2014, 11:18
Re: Possible Anti-Aircraft? - by gotwarzone - 02.03.2014, 11:32
Re: Possible Anti-Aircraft? - by newbienoob - 02.03.2014, 11:35
Re: Possible Anti-Aircraft? - by kbalor - 02.03.2014, 12:01
Re: Possible Anti-Aircraft? - by gotwarzone - 02.03.2014, 12:02
Re: Possible Anti-Aircraft? - by gotwarzone - 03.03.2014, 04:19
Re: Possible Anti-Aircraft? - by RajatPawar - 03.03.2014, 05:39
Re: Possible Anti-Aircraft? - by gotwarzone - 03.03.2014, 05:52
Re: Possible Anti-Aircraft? - by RajatPawar - 03.03.2014, 06:02

Forum Jump:


Users browsing this thread: 1 Guest(s)