SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/07/2016, 06:52 PM   #31
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,211
Reputation: 352
Default Re: Get Point In Front 2D 3D

Update v2.6.2:

- Added functions:
PHP Code:
Get3DTrygPrecision(); //returns a string with the name of precision
Tryg3DMapAndreasFindZ(Float:x,Float:y,&Float:z); //-> CA_FindZ_For2DCoord / MapAndreasFindZ / MapAndreas_FindZ_For2DCoord 
Float:CalculatePercent(Float:value,Float:maxvalue); 
- Added ColAndreas extended functions:
PHP Code:
//future
GetColAndreasVersion();
GetValidColAndreasVersion();
bool:IsValidColAndreas(version);
GetColAndreasVersionName(name[], value GET_COLANDREAS_VERSIONmaxdest sizeof name);
CheckColAndreasVersion(); 
- Added ColAndreas version checker
AbyssMorgan is offline   Reply With Quote
Old 07/07/2016, 05:06 PM   #32
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,211
Reputation: 352
Cool Re: Get Point In Front 2D 3D

Update v2.6.3:

- Added ColAndreas functions:
PHP Code:
GetPlayerCollisionFlags(playerid);
bool:IsCollisionFlag(value,flag);
Float:UndergroundFindZ(Float:x,Float:y,&Float:z=0.0);
Float:InteriorFindZ(Float:px,Float:py,Float:pz=1000.0,Float:size=2.0,&Float:z=0.0);
bool:IsPointInWater(Float:x,Float:y,Float:z=0.0);
bool:IsPointInUnderwater(Float:x,Float:y,Float:z);
bool:IsPointInAir(Float:x,Float:y,Float:z,bool:interior=false,Float:max_distance=2.2);
bool:IsPointInGround(Float:x,Float:y,Float:z,bool:interior=false,Float:max_distance=2.2);
bool:IsPointInUnderground(Float:x,Float:y,Float:z); 
- Added Collision Flag definitions:
PHP Code:
POSITION_FLAG_WORLD
POSITION_FLAG_INTERIOR
POSITION_FLAG_AIR
POSITION_FLAG_GROUND
POSITION_FLAG_UNDERGROUND
POSITION_FLAG_WATER
POSITION_FLAG_UNDERWATER 
Video:
https://www.youtube.com/watch?v=dJUQKrBkeY8


Example Command:
PHP Code:
CMD:getz(playerid){
    new 
Float:x,Float:y,Float:zbuffer[128], Float:tmpz;
    
GetPlayerPos(playerid,x,y,z);
    
    
SendClientMessage(playerid,0xFFFFFFFF," ");
    
    
format(buffer,sizeof buffer,"Player Z: {00FF00}%.4f",z);
    
SendClientMessage(playerid,0xFFFFFFFF,buffer);
    
    
CA_FindZ_For2DCoord(x,y,tmpz);
    
format(buffer,sizeof buffer,"CA_FindZ_For2DCoord: {00FF00}%.4f",tmpz);
    
SendClientMessage(playerid,0xFFFFFFFF,buffer);
    
    
UndergroundFindZ(x,y,tmpz);
    
format(buffer,sizeof buffer,"Underground: {00FF00}%.4f",tmpz);
    
SendClientMessage(playerid,0xFFFFFFFF,buffer);
    
    
InteriorFindZ(x,y,z,2.0,tmpz);
    
format(buffer,sizeof buffer,"Interior: {00FF00}%.4f",tmpz);
    
SendClientMessage(playerid,0xFFFFFFFF,buffer);
    
    new 
flag GetPlayerCollisionFlags(playerid);
    if(
IsCollisionFlag(flag,POSITION_FLAG_UNDERWATER)){
        
format(buffer,sizeof buffer,"Player under water");
    } else if(
IsCollisionFlag(flag,POSITION_FLAG_WATER)){
        
format(buffer,sizeof buffer,"Player in water");
    } else if(
IsCollisionFlag(flag,POSITION_FLAG_AIR)){
        
format(buffer,sizeof buffer,"Player in air");
    } else if(
IsCollisionFlag(flag,POSITION_FLAG_UNDERGROUND)){
        
format(buffer,sizeof buffer,"Player underground");
    } else if(
IsCollisionFlag(flag,POSITION_FLAG_GROUND)){
        
format(buffer,sizeof buffer,"Player on ground");
    }
    if(
IsCollisionFlag(flag,POSITION_FLAG_WORLD)){
        
format(buffer,sizeof buffer,"%s (World)",buffer);
    } else if(
IsCollisionFlag(flag,POSITION_FLAG_INTERIOR)){
        
format(buffer,sizeof buffer,"%s (Interior)",buffer);
    }
    
SendClientMessage(playerid,0xFFFFFFFF,buffer);
    
    if(
IsPointInWater(x,y)){
        
SendClientMessage(playerid,0xFFFFFFFF,"This XY point on Water");
    } else {
        
SendClientMessage(playerid,0xFFFFFFFF,"This XY point on Ground");
    }
    return 
1;

Update v2.6.4:

- Added MapAndreas / ColAndreas function:
PHP Code:
bool:IsPointInWaterFrontOfPlayer(playerid,Float:radius); 
- Fix missing params bool:interior for:
PHP Code:
bool:IsPointInGround(Float:x,Float:y,Float:z,bool:interior=false,Float:max_distance=2.2); 

Last edited by AbyssMorgan; 07/07/2016 at 07:46 PM.
AbyssMorgan is offline   Reply With Quote
Old 09/07/2016, 09:01 AM   #33
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,211
Reputation: 352
Default Re: Get Point In Front 2D 3D

Update v2.6.6:

- Added functions:
PHP Code:
bool:IsPointInCircle(Float:px,Float:py,Float:x,Float:y,Float:size)
bool:IsPointInSphere(Float:px,Float:py,Float:pz,Float:x,Float:y,Float:z,Float:size);
bool:IsPointInRectangle(Float:x,Float:y,Float:minx,Float:miny,Float:maxx,Float:maxy);
bool:IsPointInCube(Float:x,Float:y,Float:z,Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz);
bool:IsPointInPolygon(Float:x,Float:y,{Float,_}:...); //Polygon Test by RyDeR SRC:http://forum.sa-mp.com/showpost.php?p=1154971&postcount=1871 
- Already exists function:
PHP Code:
bool:IsPointInCylinder(Float:px,Float:py,Float:pz,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:size); 
- Added ColAndreas functions:
PHP Code:
MovePointColCutLine(Float:SX,Float:SY,Float:SZ,Float:EX,Float:EY,Float:EZ,&Float:x,&Float:y,&Float:z,Float:cut_size=0.0);
MovePointColCutLineEx(Float:SX,Float:SY,Float:SZ,Float:EX,Float:EY,Float:EZ,&Float:x,&Float:y,&Float:z,Float:cut_size=0.0); //for EngineV6 
- Already exists definitions:
PHP Code:
FLOAT_PI pi constant value 
See also:
EngineV6 Thread
AbyssMorgan is offline   Reply With Quote
Old 24/07/2016, 10:18 AM   #34
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,211
Reputation: 352
Default Re: Get Point In Front 2D 3D

Update v2.7.0:

- Added support for YSF IS4 Version and YSF Kurta999 Version
- Increase MAX_POLYGON_POINTS from 32 to 256
- Added functions:
PHP Code:
Float:GetVehicleSpeed(vehicleid);
Float:GetPlayerSpeed(playerid);
Get3DTrygModules(&modules_count=0); //previous version: Get3DTrygPrecision();
CreateDynamicExplosion(Float:x,Float:y,Float:z,type,Float:radius,worldid=-1,interiorid=-1,playerid=-1,Float:distance=200.0); 
- Added YSF functions:
PHP Code:
Float:GetPlayerHydraReactorRX(playerid);
GetPlayerRotation(playerid,&Float:rx,&Float:ry,&Float:rz);
GetPlayerTimeline(playerid);
SetPlayerTimeline(playerid,timeline);
GetPlayerPos4D(playerid,&Float:x,&Float:y,&Float:z,&timeline);
SetPlayerPos4D(playerid,Float:x,Float:y,Float:z,timeline=0); 
- Added YSF extended functions:
PHP Code:
UpdatePlayerTimeline(playerid); 
- Update syntax:
PHP Code:
//from:
bool:IsPointInPolygon(Float:x,Float:y,{Float,_}:...); 
//to:
bool:IsPointInPolygon(Float:x,Float:y,Float:points[],maxpoints sizeof(points)); 
- Deleted function:
PHP Code:
Get3DTrygPrecision(); 
- Fixed function:
PHP Code:
GetVehicleRotation(vehicleid,&Float:rx,&Float:ry,&Float:rz); 
AbyssMorgan is offline   Reply With Quote
Old 25/07/2016, 07:11 PM   #35
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,211
Reputation: 352
Default Re: Get Point In Front 2D 3D

Update v2.7.1:

- Added functions:
PHP Code:
bool:IsTryg3DModuleLoaded(Tryg3DModule:moduleid);
Float:fabs(Float:value); //macro

bool:IsPlayerSkydiving(playerid);
bool:IsPlayerUsingParachute(playerid);
bool:IsPlayerAiming(playerid);

GetVehicleFlags(vehicleid);
GetVehicleFlagsByModel(modelid);
bool:IsVehicleFlag(value,flag);

CountPlayers();
CountActors();

bool:IsPointInCylinderEx(Float:px,Float:py,Float:pz,Float:x,Float:y,Float:minz,Float:maxz,Float:size); //for streamer standard

bool:IsPlayerInCircle(playerid,Float:x,Float:y,Float:size);
bool:IsPlayerInCylinder(playerid,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:size);
bool:IsPlayerInCylinderEx(playerid,Float:x,Float:y,Float:minz,Float:maxz,Float:size); //for streamer standard
bool:IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,Float:size);
bool:IsPlayerInRectangle(playerid,Float:minx,Float:miny,Float:maxx,Float:maxy);
bool:IsPlayerInCube(playerid,Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz);
bool:IsPlayerInPolygon(playerid,Float:points[],maxpoints sizeof(points));

GetRandomPointInCircle(Float:x,Float:y,Float:size,&Float:tx,&Float:ty);
//GetRandomPointInCylinder(Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:size,&Float:tx,&Float:ty,&Float:tz); //temporarily removed, doesn't work
GetRandomPointInCylinderEx(Float:x,Float:y,Float:minz,Float:maxz,Float:size,&Float:tx,&Float:ty,&Float:tz); //for streamer standard
GetRandomPointInSphere(Float:x,Float:y,Float:z,Float:size,&Float:tx,&Float:ty,&Float:tz);
GetRandomPointInRectangle(Float:minx,Float:miny,Float:maxx,Float:maxy,&Float:tx,&Float:ty); 
- Added YSF functions:
PHP Code:
bool:IsPlayerHydraReactorBoost(playerid);

//for Timeline Sync
CreateDynamicExplosion4D(Float:x,Float:y,Float:z,type,Float:radius,worldid = -1,interiorid = -1,timeline = -1,playerid = -1,Float:distance 200.0
- Added definitions:
PHP Code:
//moduleid:
TRYG3D_MODULEID_MAPANDREAS
TRYG3D_MODULEID_COLANDREAS
TRYG3D_MODULEID_YSF

//vehicle flags:
VF_STREET
VF_AIRBORNE
VF_NATATORIAL
VF_MILITARY
VF_RAILROAD
VF_RC
VF_ROAD
VF_AIRPLANE
VF_HELICOPTER 
VF_BIKES
VF_TRAILER
VF_TOWABLE
VF_POLICE 
- Fix functions:
PHP Code:
Float:GetPlayerHydraReactorRX(playerid);
Float:GetVehicleSpeed(vehicleid); 
- Fixed Timeline Sync
- Added YSF Timeline Sync Init Info
- Added special option for enable "YSF Timeline Sync" (reasons for this that not everyone will use this option)
PHP Code:
#define ENABLE_3D_TRYG_TIMELINE_SYNC

//for enable functions:
GetPlayerTimeline(playerid);
SetPlayerTimeline(playerid,timeline);
GetPlayerPos4D(playerid,&Float:x,&Float:y,&Float:z,&timeline);
SetPlayerPos4D(playerid,Float:x,Float:y,Float:z,timeline=0);
UpdatePlayerTimeline(playerid);
CreateDynamicExplosion4D(Float:x,Float:y,Float:z,type,Float:radius,worldid = -1,interiorid = -1,timeline = -1,playerid = -1,Float:distance 200.0); 
//edit Update v2.7.2:
- Fix:
PHP Code:
GetRandomPointInCircle
GetRandomPointInCylinderEx
GetRandomPointInSphere

IsPointInPolygon 

Last edited by AbyssMorgan; 25/07/2016 at 08:01 PM.
AbyssMorgan is offline   Reply With Quote
Old 01/08/2016, 07:49 PM   #36
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,211
Reputation: 352
Default Re: Get Point In Front 2D 3D

Update v2.7.5:

- Fixed minor bugs
- Added support for Incognito Streamer Plugin
- Added functions:
PHP Code:
Float:RandomFloat(Float:min,Float:max,accuracy 4); 
GetPlayerOrientationPos(playerid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
GetVehicleOrientationPos(vehicleid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
GetObjectOrientationPos(objectid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
GetWeaponShotPos(playerid,hittype,&Float:fX,&Float:fY,&Float:fZ);
Float:GetActorDistanceFromPoint(actorid,Float:x,Float:y,Float:z);
Float:GetPlayersDistance(playerid_a,playerid_b)
Float:GetVehiclesDistance(vehicleid_a,vehicleid_b);
Float:GetObjectsDistance(objectid_a,objectid_b);
Float:GetPlayerActorDistance(playerid,actorid);
Float:GetPlayerVehicleDistance(playerid,vehicleid);
Float:GetPlayerObjectDistance(playerid,objectid);
SetPlayerLookAtPlayer(playerid,targetid,cut CAMERA_CUT);
bool:IsPlayerLookAtSky(playerid);
Float:GetPlayerTargetPlayerAngle(playerid,targetid,&Float:rz=0.0);
Float:SetPlayerTargetPlayerAngle(playerid,targetid,&Float:rz=0.0); 
- Added extended functions:
PHP Code:
Get3DTrygErrorCount();
Get3DTrygWarringCount();
Reset3DTrygErrorCount();
Reset3DTrygWarringCount(); 
- Added ColAndreas functions:
PHP Code:
Float:ColAndreasFindZ(Float:x,Float:y,&Float:z=0.0);
GetPlayerOrientationPosCol(playerid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
GetVehicleOrientationPosCol(vehicleid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
GetObjectOrientationPosCol(objectid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
bool:IsBetweenPlayersIsWall(playerid,targetid);
bool:IsBetweenPlayerToPointIsWall(playerid,Float:x,Float:y,Float:z); 
- Added Streamer functions:
PHP Code:
GetDynamicObjectOrientationPos(objectid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
GetDynamicObjectOrientPosCol(objectid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz); //Required ColAndreas Plugin
Float:GetDynamicObjectsDistance(objectid_a,objectid_b);
Float:GetPlayerDynamicObjectDistance(playerid,objectid); 
- Added MapAndreas function:
PHP Code:
bool:IsPointInWater(Float:x,Float:y,Float:z=0.0); 
- Added Orientation Types:
PHP Code:
o_left
o_right
o_up
o_down
o_front
o_back 
AbyssMorgan is offline   Reply With Quote
Old 03/08/2016, 05:48 PM   #37
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,211
Reputation: 352
Default Re: Get Point In Front 2D 3D

Update v2.7.6:

- Added functions:
PHP Code:
GetVehicleUpVector(vehicleid,&Float:vx,&Float:vy,&Float:vz); //by Nero_3D
GetVehicleUpPos(vehicleid,Float:radius,&Float:x,&Float:y,&Float:z);
GetVehicleDownPos(vehicleid,Float:radius,&Float:x,&Float:y,&Float:z); 
- Fixed up/down orientation for vehicle (Special thanks for Nero_3D):
PHP Code:
GetVehicleOrientationPos(vehicleid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
GetVehicleOrientationPosCol(vehicleid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz); 
- Small optimization (Special thanks for Shiska):
PHP Code:
GetPointInFront2D(Float:x,Float:y,Float:rz,Float:radius,&Float:tx,&Float:ty); 
AbyssMorgan is offline   Reply With Quote
Old 03/08/2016, 08:57 PM   #38
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,329
Reputation: 652
Default Re: Get Point In Front 2D 3D

In my opinion, the best feature in this include that goes with the original stuff is the new orientation functions.

They would be more popular in a separate thread, and since they rely on this that means more attention here as well.
Crayder is offline   Reply With Quote
Old 07/08/2016, 08:31 AM   #39
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,211
Reputation: 352
Default Re: Get Point In Front 2D 3D

Update v2.7.7:

- Added functions:
PHP Code:
RecoilFloat(Float:value,Float:recoil);
RecoilVector(&Float:vx,&Float:vy,&Float:vz,Float:sx,Float:sy,Float:sz); 

Float:DeCompRotationFloat(Float:rotation,&Float:crotation=0.0);   //DeCompressRotationFloat
DeCompRotation(rotation,&crotation=0); //DeCompressRotation

GetPointFor2Point2DEx(Float:x1,Float:y1,Float:x2,Float:y2,Float:distance,&Float:tx,&Float:ty);
GetPointFor2Point3DEx(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2,Float:distance,&Float:tx,&Float:ty,&Float:tz);
GetQuatUpVector(Float:qw,Float:qx,Float:qy,Float:qz,&Float:vx,&Float:vy,&Float:vz); 
- Fixed functions:
PHP Code:
//radius: 100.0 max random radius: 100.000007
GetRandomPointInCircle(Float:x,Float:y,Float:size,&Float:tx,&Float:ty);
GetRandomPointInCylinderEx(Float:x,Float:y,Float:minz,Float:maxz,Float:size,&Float:tx,&Float:ty,&Float:tz); 
GetRandomPointInSphere(Float:x,Float:y,Float:z,Float:size,&Float:tx,&Float:ty,&Float:tz); 
- Added definition:
PHP Code:
INVALID_ROTATION 
AbyssMorgan is offline   Reply With Quote
Old 07/08/2016, 09:12 AM   #40
LifeRah
Big Clucker
 
LifeRah's Avatar
 
Join Date: Dec 2015
Location: Seattle - U.S
Posts: 197
Reputation: 23
Default Re: Get Point In Front 2D 3D

Nice
LifeRah is offline   Reply With Quote
Reply

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 04:56 AM.


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