Fireman job help
#1

I need a help in creating fireman job.I want to detect when player is aiming fire object with firetruck,but i can't find the working code..

Код:
if(HOLDING(KEY_FIRE) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 407) {
        new Float: fAimingCoords[3];
	GetPlayerCameraPos(playerid, fAimingCoords[0], fAimingCoords[1], fAimingCoords[2]);
	new Float: pos[3];
	GetDynamicObjectPos(vatra[0], pos[0], pos[1], pos[2]);
	if(IsPointInRangeOfPoint(pos[0], pos[1], pos[2], fAimingCoords[0], fAimingCoords[1], fAimingCoords[2], 3.0))
	{
		DestroyDynamicObject(vatra[0]);
	}
}

stock IsPointInRangeOfPoint(Float:x, Float:y, Float:z, Float:x2, Float:y2, Float:z2, Float:range)
{
	x2 -= x;
	y2 -= y;
	z2 -= z;
	return ((x2 * x2) + (y2 * y2) + (z2 * z2)) < (range * range);
}
Reply


Messages In This Thread
Fireman job help - by StreetboyBalkan - 03.03.2016, 15:07
Re: Fireman job help - by Vince - 03.03.2016, 16:30
Re: Fireman job help - by StreetboyBalkan - 04.03.2016, 20:11
Re: Fireman job help - by StreetboyBalkan - 05.03.2016, 20:39
Re: Fireman job help - by StreetboyBalkan - 09.03.2016, 14:26
Re: Fireman job help - by AbyssMorgan - 09.03.2016, 14:54
Re: Fireman job help - by StreetboyBalkan - 10.03.2016, 09:15

Forum Jump:


Users browsing this thread: 1 Guest(s)