12.05.2012, 18:49
not sure:
and then use at the command:
pawn Код:
stock IsPlayerLookingAtPoint(playerid,Float:X,Float:Y,Float:Z,Float:Distance,RadiosToPoint)
{
new Float:CX,Float:CY,Float:CZ,Float:FX,Float:FY,Float:FZ;
new Float:PX,Float:PY,Float:PZ,Float:D;
if(IsPlayerInRangeOfPoint(playerid,Distance,X ,Y ,Z))
{
GetPlayerCameraPos(playerid,CX,CY,CZ);
GetPlayerCameraFrontVector(playerid, FX, FY, FZ);
PX = FX*D+CX;
PY = FY*D+CY;
PZ = FZ*D+CZ;
D = floatsqroot(((PX - X) * (PX - X)) + ((PY - Y) * (PY - Y)) + ((PZ - Z) * (PZ - Z)));
if(D < RadiosToPoint)
{
return 1;
}
}
return 0;
}
pawn Код:
new Float:x,Float:y,Float:z;
if(IsPlayerLookingAtPoint(Float:x,Float:y,Float:z,etc);
MoveObject(model,Float:x,Float:y,Float:Z);
not sure if it will work
it's just a sort out of how you would implement it