Posts: 354
Threads: 35
Joined: Feb 2010
Reputation:
0
Hey guys,
How would one detect a projectile fired from a rhino that then hits a custom(CreateDynamicObject) object.
Is it possible?, how would one go about it?
In the past I've done it with camera vectors, inrange detection and keystate(key fire).. but it's not consistent enough for me, I need something else!
Any help is greatly appreciated.
Posts: 354
Threads: 35
Joined: Feb 2010
Reputation:
0
Just tried the object function that comes with 'EnablePlayerCameraTarget' and it works great, but you need to be really close for it to work.. which sux because you take damage too.
Spose thats how it is?
Posts: 354
Threads: 35
Joined: Feb 2010
Reputation:
0
I want to script detection for the shooting of dynamic objects with a rhino..
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
Yeah, yeah... But what do you want to achieve with that?
Posts: 170
Threads: 10
Joined: Sep 2011
I think this is the only way:
https://sampwiki.blast.hk/wiki/GetPlayerCameraFrontVector
Maybe something like that:
Quote:
stock PlayerFaces(playerid, Float, Float:y, Float:z, Float:radius)
{
new Float:cx,Float:cy,Float:cz,Float:fx,Float:fy,Float :fz;
GetPlayerCameraPos(playerid, cx, cy, cz);
GetPlayerCameraFrontVector(playerid, fx, fy, fz);
return (radius >= DistanceCameraTargetToLocation(cx, cy, cz, x, y, z, fx, fy, fz));
}
|
+
Quote:
if(PlayerFaces(playerid, dynamicObjectPos[0], dynamicObjectPos[1], dynamicObjectPos[2], range) + PRESSING KEY CODE)
{
//Code
|
Posts: 354
Threads: 35
Joined: Feb 2010
Reputation:
0
Yeah, thats basically the method I was using to start with.. but thanks anyway Rdx, much appreciated!