SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 05/06/2016, 08:23 PM   #10
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Get Point In Front 2D 3D

Updated 3DTryg.inc to v2.5 now

Fixed GetVehicleRotation thanks for IllidanS4
PHP Code:
GetVehicleRotation(vehicleid,&Float:rx,&Float:ry,&Float:rz); 
Added new function:
PHP Code:
Float:GetPointInFrontOfVehicle2D(vehicleid,&Float:tx,&Float:ty,Float:radius);
GetPointInFrontOfVehicle3D(vehicleid,&Float:tx,&Float:ty,&Float:tz,Float:radius,&Float:rx=0.0,&Float:rz=0.0);

Float:GetPointInFrontOfPlayer(playerid,&Float:tx,&Float:ty,Float:radius); //GetXYInFrontOfPlayer
 
Float:GetPointInFrontOfCamera2D(playerid,&Float:tx,&Float:ty,Float:radius);
GetPointInFrontOfCamera3D(playerid,&Float:tx,&Float:ty,&Float:tz,Float:radius,&Float:rx=0.0,&Float:rz=0.0);

Float:GetPlayerTargetAngle(playerid,Float:x,Float:y,&Float:rz=0.0);
Float:SetPlayerTargetAngle(playerid,Float:x,Float:y,&Float:rz=0.0);

GetPlayerCameraRotation(playerid,&Float:rx,&Float:rz);
Float:GetPlayerCameraZAngle(playerid,&Float:rz=0.0);

GetPointInFrontOnGround(Float:x,Float:y,Float:z,Float:rx,Float:rz,&Float:tx,&Float:ty,&Float:tz,Float:max_distance);

bool:IsPointInCylinder(Float:px,Float:py,Float:pz,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:maxdist);

bool:IsProbable(chance); 
Completed functions:
PHP Code:
GetGroundRotation(Float:x,Float:y,Float:size,&Float:rx,&Float:ry); 
Optimized functions:
PHP Code:
NLTZ(value);
NMTZ(value);
Float:NLTZF(Float:value);
Float:NMTZF(Float:value);

Float:ShiftDegreeToRadian(Float:deg);
Float:ShiftDegreeToRadianEx(Float:deg);
Float:ShiftDegreeToGrades(Float:deg);
Float:ShiftRadianToDegree(Float:rad);
Float:ShiftRadianToDegreeEx(Float:rad);
Float:ShiftRadianToGrades(Float:rad);
Float:ShiftGradesToDegree(Float:grad);
Float:ShiftGradesToRadian(Float:grad);

ShiftRotationToVector(Float:rx,Float:rz,&Float:vx,&Float:vy,&Float:vz);

GetRotationFor2Point2D(Float:x,Float:y,Float:tx,Float:ty,&Float:rz);

Float:GetDistanceBetweenPoints1D(Float:x1,Float:x2);
Float:GetDistanceBetweenPoints2D(Float:x1,Float:y1,Float:x2,Float:y2);
Float:GetDistanceBetweenPoints3D(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2);

Float:sqrtN(Float:value,Float:exponent); 
All functions:
PHP Code:
Float:sqrtN(Float:value,Float:exponent);
abs(value);
power(value,Float:exponent);
Float:ctg(Float:value,anglemode:mode=radian);
Float:secans(Float:value,anglemode:mode=radian);
Float:cosecans(Float:value,anglemode:mode=radian);
single_clock(max,id);
even_clock(max,id);
uneven_clock(max,id);
IsEven(value);
GetRandomHit(Float:x,Float:y,Float:z,range,&Float:tx,&Float:ty,&Float:tz);
Float:GetDistanceBetweenPoints1D(Float:x1,Float:x2);
Float:GetDistanceBetweenPoints2D(Float:x1,Float:y1,Float:x2,Float:y2);
Float:GetDistanceBetweenPoints3D(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2);
NLTZ(value);
NMTZ(value);
Float:NLTZF(Float:value);
Float:NMTZF(Float:value);
CompRotation(rotation,&cr=0);
Float:CompRotationFloat(Float:rotation,&Float:cr=0.0);
GetPointInFront2D(Float:x,Float:y,Float:rz,Float:radius,&Float:tx,&Float:ty);
Float:GetPointInFrontOfPlayer(playerid,&Float:tx,&Float:ty,Float:radius);
Float:GetPointInFrontOfCamera2D(playerid,&Float:tx,&Float:ty,Float:radius);
GetPointInFrontOfCamera3D(playerid,&Float:tx,&Float:ty,&Float:tz,Float:radius,&Float:rx=0.0,&Float:rz=0.0);
GetPointInFront3D(Float:x,Float:y,Float:z,Float:rx,Float:rz,Float:radius,&Float:tx,&Float:ty,&Float:tz);
GetRotationFor2Point2D(Float:x,Float:y,Float:tx,Float:ty,&Float:rz);
GetRotationFor2Point3D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:tz,&Float:rx,&Float:rz);
GetRandomClockPos(Float:x,Float:y,Float:z,Float:radius,&Float:tx,&Float:ty,&Float:tz,&Float:trz,Float:rz = -1000.0);
GetRandomPointInCube(Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz,&Float:x,&Float:y,&Float:z);
Float:ShiftDegreeToRadian(Float:deg);
Float:ShiftDegreeToRadianEx(Float:deg);
Float:ShiftDegreeToGrades(Float:deg);
Float:ShiftRadianToDegree(Float:rad);
Float:ShiftRadianToDegreeEx(Float:rad);
Float:ShiftRadianToGrades(Float:rad);
Float:ShiftGradesToDegree(Float:grad);
Float:ShiftGradesToRadian(Float:grad);
ConvertMTARaceRotation(Float:rotation1,Float:rotation2,Float:rotation3,&Float:rx,&Float:ry,&Float:rz);
ConvertToMTARaceRotation(Float:rx,Float:ry,Float:rz,&Float:rotation1,&Float:rotation2,&Float:rotation3);
GetMoveTime(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:tz,Float:speed,&rtime);
Float:GetSpeedForMoveTime(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:tz,&Float:speed,rtime);
GetVehicleRotation(vehicleid,&Float:rx,&Float:ry,&Float:rz);
Float:GetPointInFrontOfVehicle2D(vehicleid,&Float:tx,&Float:ty,Float:radius);
GetPointInFrontOfVehicle3D(vehicleid,&Float:tx,&Float:ty,&Float:tz,Float:radius,&Float:rx=0.0,&Float:rz=0.0);
GetPlayerCameraRotation(playerid,&Float:rx,&Float:rz);
Float:GetPlayerCameraZAngle(playerid,&Float:rz=0.0);
GetPointFor2Point2D(Float:x1,Float:y1,Float:x2,Float:y2,Float:percent_size,&Float:tx,&Float:ty);
GetPointFor2Point3D(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2,Float:percent_size,&Float:tx,&Float:ty,&Float:tz);
ShiftVectorToRotation(Float:vx,Float:vy,Float:vz,&Float:rx,&Float:rz);
ShiftRotationToVector(Float:rx,Float:rz,&Float:vx,&Float:vy,&Float:vz);
bool:IsPointBetween2Points2D(Float:px,Float:py,Float:xA,Float:yA,Float:xB,Float:yB);
bool:IsPointBetween2Points3D(Float:px,Float:py,Float:pz,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB);
bool:IsPointNearly2Points2D(Float:px,Float:py,Float:xA,Float:yA,Float:xB,Float:yB,Float:maxdist);
bool:IsPointNearly2Points3D(Float:px,Float:py,Float:pz,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:maxdist);
bool:IsPointInCylinder(Float:px,Float:py,Float:pz,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:maxdist);
bool:IsProbable(chance);
GetGroundRotation(Float:x,Float:y,Float:size,&Float:rx,&Float:ry);
GetPointInFrontOnGround(Float:x,Float:y,Float:z,Float:rx,Float:rz,&Float:tx,&Float:ty,&Float:tz,Float:max_distance);
Float:GetPlayerTargetAngle(playerid,Float:x,Float:y,&Float:rz=0.0);
Float:SetPlayerTargetAngle(playerid,Float:x,Float:y,&Float:rz=0.0);

Deprecated Functions:
GetXYInFrontOfPlayer -> GetPointInFrontOfPlayer
GetPointInFront
-> GetPointInFront3D
GetPointInFrontOfCamera
-> GetPointInFrontOfCamera3D
GetDistanceBetweenPoints 
-> GetDistanceBetweenPoints3D

Old prototype
:
GetAngle -> GetPlayerTargetAngle SetPlayerTargetAngle GetRotationFor2Point2D 

Last edited by AbyssMorgan; 05/06/2016 at 08:54 PM. Reason: Update 2.5B
AbyssMorgan is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [INC] LSF - Lorenc's Simple Functions (w/ gang/clan functions) Lorenc_ Includes 14 21/04/2018 05:06 AM
What is the difference between public functions and stock functions? NeskWriter Scripting Help 1 16/10/2013 07:23 PM
File Functions + String Functions NoaM[W] Scripting Help 2 19/12/2012 09:13 PM
Pawno functions Doesn't Show on the functions Tab silvan Scripting Help 2 11/11/2012 10:42 AM
[Tool/Web/Other] Cross Functions V1.0 - Create Custom Call Backs / Functions by Just 1 Click CROSS_Hunter Tools and Files 7 05/11/2012 03:17 PM


All times are GMT. The time now is 05:45 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.