Vehicle Projectile Detection -
Killa[DGZ] - 04.10.2016
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.
Re: Vehicle Projectile Detection -
Killa[DGZ] - 04.10.2016
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?
Re: Vehicle Projectile Detection -
SickAttack - 04.10.2016
What do you want to do?
Re: Vehicle Projectile Detection -
Killa[DGZ] - 04.10.2016
I want to script detection for the shooting of dynamic objects with a rhino..
Re: Vehicle Projectile Detection -
SickAttack - 04.10.2016
Yeah, yeah... But what do you want to achieve with that?
Re: Vehicle Projectile Detection -
Killa[DGZ] - 04.10.2016
Well.. I have a gamemode that I've been developing for quite a few years now, it's a space based war combat server and as it currently stands players can do just about everything, except destroy another users base with just their rhino, the only vehicle available..
So this is all that is needed to finish it off.
EDIT: If you've ever played War Commander, thats the general direction I'm heading, except 3d ofc
Re: Vehicle Projectile Detection -
Rdx - 04.10.2016
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
|
Re: Vehicle Projectile Detection -
Killa[DGZ] - 04.10.2016
Yeah, thats basically the method I was using to start with.. but thanks anyway Rdx, much appreciated!