[Include] 3DTryg Functions
#61

Update v3.2.1:

- Update YSF Module R18-2
- Update FCNPC Module v1.6.1
- Added internal function:
PHP Code:
bool:Tryg3D_IsPlayerSpawned(playerid); 
- Added YSF Functions (TimeLine):
PHP Code:
TogglePlayerVisibleOnServer(playerid,bool:toggle); //Phantom Admin (Beta)
bool:IsPlayerVisibleOnServer(playerid); 
- Added YSF Extended Functions (TimeLine):
PHP Code:
UpdatePlayerOnServer(playerid); //Performed automatically
CheckPlayersOnServer(playerid); //Performed automatically 
- Added compiler options:
PHP Code:
#define DISABLE_3D_TRYG_ATM  //Use before 3DTryg.inc for disable ATM Module
#define ENABLE_3D_TRYG_ANIMS //Use before 3DTryg.inc for enable Anims Module 
Download:
GitHub
Abyss Morgan Website
Reply
#62

Update v3.2.2:

- Added 3DTryg GitHub Wiki (Coming Soon)

- Added functions:
PHP Code:
//by Crayder
Float:GetDistanceFromPointToLine(Float:px,Float:py,Float:pz,Float:sX,Float:sY,Float:sZ,Float:eX,Float:eY,Float:eZ,&Float:iX=0.0,&Float:iY=0.0,&Float:iZ=0.0);
bool:IsPointInCone3D(Float:px,Float:py,Float:pz,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:pointA_radius,Float:pointB_radius);
bool:IsPlayerInCone(playerid,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:pointA_radius,Float:pointB_radius); 
- Added Stream3D functions:
PHP Code:
Stream:StreamCone3D(Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:pointA_radius,Float:pointB_radius);
bool:GetRandomPointInStream(Stream:StreamData[Stream3D],&Float:x,&Float:y,&Float:z); 
- Updated function:
PHP Code:
//New version by Crayder
bool:IsPointInCylinder3D(Float:px,Float:py,Float:pz,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:radius); 
- Renamed functions:
PHP Code:
IsPointInCylinder -> IsPointInCylinder3D
IsPointInCylinderEx 
-> IsPointInCylinder2D
IsPlayerInCylinder 
-> IsPlayerInCylinder3D
IsPlayerInCylinderEx 
-> IsPlayerInCylinder2D
StreamCylinderEx 
-> StreamCylinder2D
StreamCylinder 
-> StreamCylinder3D
IsNPCInCylinder 
-> IsNPCInCylinder3D
GetRandomPointInCylinder 
-> GetRandomPointInCylinder3D
GetRandomPointInCylinderEx 
-> GetRandomPointInCylinder2D 
- Renamed StreamType
PHP Code:
s_cylinder -> s_cylinder3d
s_cylinderex 
-> s_cylinder2d 
Reply
#63

Quote:
Originally Posted by Fynn.
Посмотреть сообщение
This function is long, but I think it would replace the heap of functions with respect to vision. (Players, actors, cars, npc's ...)

Erase this...

Код:
IsPlayerOnPlayerScreen
IsVehicleOnPlayerScreen
IsObjectOnPlayerScreen
IsActorOnPlayerScreen
IsPlayerOnFakeScreen
IsVehicleOnFakeScreen
IsObjectOnFakeScreen
IsActorOnFakeScreen
IsDynamicObjectOnPlayerScreen
IsDynamicObjectOnFakeScreen
IsDynamicActorOnPlayerScreen
IsDynamicActorOnFakeScreen
And alone add this:

Код:
bool:IsPointViewToPoint(x, y, z, px, py, pz, Float:range, element_orientation:orientation, Float:rx=INVALID_ROTATION, Float:rz=INVALID_ROTATION, Float:vrx=VERTICAL_CAMERA_RADIUS, Float:vrz=HORIZONTAL_CAMERA_RADIUS, bool:testLOS=true, bool:testVW=true)
Goob job.
Why you using element_orientation:orientation in screen test.

I think you mean:
PHP код:
bool:IsPointViewToPoint(
xyzpxpypz,
Float:range,
items:item_type//player, actor, npc etc.
Float:rx=INVALID_ROTATION,Float:rz=INVALID_ROTATION,
Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true,bool:testVW=true); 
One function for all element types :D
I think add one/two universal function, and convert old functions to macro definitions. The same method as Stream3D Module.
Reply
#64

Exactly, instead of having many functions that after all is for the same, it is better to create a function that serves everything.

I used "element_orientation: orientation" in case the script wants to change the camera angle, by default it would be something like "element_orientation = default", I hope to understand what I'm trying to explain with this parameter. It did not occur to me "items: item_type" which by the way, it falls excellent to the function. regards
Reply
#65

Update v3.3.0:

- Fixed warring variable 'v3DTryg3DStreamerExam'

- Renamed Functions:
PHP код:
Get3DTrygEfficiency -> Tryg3D_GetEfficiency
Get3DTrygModules 
-> Tryg3D_GetModules
Get3DTrygErrorCount 
-> Tryg3D_GetErrorCount
Reset3DTrygErrorCount 
-> Tryg3D_ResetErrorCount
GetTryg3DActiveCount 
-> Tryg3D_GetActiveCount
IsTryg3DModuleLoaded 
-> Tryg3D_IsModuleLoaded
Tryg3DMapAndreasFindZ 
-> Tryg3D_MapAndreasFindZ (preserved old
- Marked as deprecated:
PHP код:
Float:GetActorDistanceFromPoint(actorid,Float:x,Float:y,Float:z);
Float:GetObjectDistanceFromPoint(objectid,Float:x,Float:y,Float:z);
Float:GetDistanceBetweenPlayers(playerid_a,playerid_b);
Float:GetDistanceBetweenVehicles(vehicleid_a,vehicleid_b);
Float:GetDistanceBetweenObjects(objectid_a,objectid_b);
Float:GetPlayerActorDistance(playerid,actorid);
Float:GetPlayerVehicleDistance(playerid,vehicleid);
Float:GetPlayerObjectDistance(playerid,objectid);
//New Version:
GetElementsDistance
GetElementDistanceFromPoint 
- Marked as deprecated:
PHP код:
bool:IsPlayerInCircle(playerid,Float:x,Float:y,Float:radius);
bool:IsPlayerInCylinder3D(playerid,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:radius);
bool:IsPlayerInCylinder2D(playerid,Float:x,Float:y,Float:minz,Float:maxz,Float:radius);
bool:IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,Float:radius);
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));
bool:IsPlayerInCircularSector(playerid,Float:x,Float:y,Float:rz,Float:radius,Float:view_angle);
bool:IsPlayerInSphericalSector(playerid,Float:x,Float:y,Float:z,Float:rx,Float:rz,Float:radius,Float:vrx,Float:vrz);
bool:IsPlayerInCone(playerid,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:pointA_radius,Float:pointB_radius);
//New Version:
IsElementIn... 

- Removed Functions:
PHP код:
Float:GetDistanceBetweenDynamicObject(objectid_a,objectid_b);
Float:GetPlayerDynamicObjectDistance(playerid,objectid);
Float:GetDynamicObjectDistFromPoint(objectid,Float:x,Float:y,Float:z);
Float:GetDynamicActorDistFromPoint(actorid,Float:x,Float:y,Float:z);
Float:GetPlayerDynamicActorDistance(playerid,actorid);
Float:GetNPCDynamicActorDistance(npcid,actorid);
Float:GetNPCDistanceFromPoint(npcid,Float:x,Float:y,Float:z);
Float:GetDistanceBetweenNPCs(npcid_a,npcid_b);
Float:GetNPCActorDistance(npcid,actorid);
Float:GetNPCVehicleDistance(npcid,vehicleid);
Float:GetNPCObjectDistance(npcid,objectid);
Float:GetNPCDynamicObjectDistance(npcid,objectid);
//New Version:
GetElementsDistance
GetElementDistanceFromPoint 
- Removed Functions:
PHP код:
bool:IsPlayerOnPlayerScreen(playerid,targetid,Float:rx=INVALID_ROTATION,Float:rz=INVALID_ROTATION,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true,bool:testVW=true);
bool:IsVehicleOnPlayerScreen(playerid,vehicleid,Float:rx=INVALID_ROTATION,Float:rz=INVALID_ROTATION,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true,bool:testVW=true);
bool:IsObjectOnPlayerScreen(playerid,objectid,Float:rx=INVALID_ROTATION,Float:rz=INVALID_ROTATION,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true);
bool:IsActorOnPlayerScreen(playerid,actorid,Float:rx=INVALID_ROTATION,Float:rz=INVALID_ROTATION,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true,bool:testVW=true);
bool:IsPlayerOnFakeScreen(Float:x,Float:y,Float:z,targetid,Float:rx,Float:rz,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true);
bool:IsVehicleOnFakeScreen(Float:x,Float:y,Float:z,vehicleid,Float:rx,Float:rz,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true);
bool:IsObjectOnFakeScreen(Float:x,Float:y,Float:z,objectid,Float:rx,Float:rz,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true);
bool:IsActorOnFakeScreen(Float:x,Float:y,Float:z,actorid,Float:rx,Float:rz,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true);
bool:IsDynamicObjectOnPlayerScreen(playerid,objectid,Float:rx=INVALID_ROTATION,Float:rz=INVALID_ROTATION,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true,bool:testVW=true);
bool:IsDynamicObjectOnFakeScreen(Float:x,Float:y,Float:z,objectid,Float:rx,Float:rz,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true);
bool:IsDynamicActorOnPlayerScreen(playerid,actorid,Float:rx=INVALID_ROTATION,Float:rz=INVALID_ROTATION,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true,bool:testVW=true);
bool:IsDynamicActorOnFakeScreen(Float:x,Float:y,Float:z,actorid,Float:rx,Float:rz,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true);
//New Version:
IsElementOnPlayerScreen
IsElementOnFakeScreen
//If you need use old syntax add this before 3DTryg.inc:
#define USE_DEPRECATED_SCREEN_FUNCTION 
- Removed functions:
PHP код:
bool:IsNPCInCircle(npcid,Float:x,Float:y,Float:radius);
bool:IsNPCInCylinder3D(npcid,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:radius);
bool:IsNPCInCylinder2D(npcid,Float:x,Float:y,Float:minz,Float:maxz,Float:radius);
bool:IsNPCInSphere(npcid,Float:x,Float:y,Float:z,Float:radius);
bool:IsNPCInRectangle(npcid,Float:minx,Float:miny,Float:maxx,Float:maxy);
bool:IsNPCInCube(npcid,Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz);
bool:IsNPCInPolygon(npcid,Float:points[],maxpoints=sizeof(points));
bool:IsNPCInCircularSector(npcid,Float:x,Float:y,Float:rz,Float:radius,Float:view_angle);
bool:IsNPCInSphericalSector(npcid,Float:x,Float:y,Float:z,Float:rx,Float:rz,Float:radius,Float:vrx,Float:vrz);
bool:IsNPCInCone3D(npcid,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:pointA_radius,Float:pointB_radius);
//New Version:
IsElementIn... 
- Removed functions:
PHP код:
bool:IsPlayerInStream(playerid,Stream:StreamData[Stream3D]);
bool:IsObjectInStream(objectid,Stream:StreamData[Stream3D]);
bool:IsActorInStream(actorid,Stream:StreamData[Stream3D]);
bool:IsNPCInStream(npcid,Stream:StreamData[Stream3D]);
bool:IsDynamicObjectInStream(objectid,Stream:StreamData[Stream3D]);
bool:IsDynamicActorInStream(actorid,Stream:StreamData[Stream3D]);
//New Version:
IsElementInStream 
- Added universal functions:
PHP код:
//General
bool:GetElementPos({Text3D,_}:elementid,Item3D_Type:element_type,&Float:x,&Float:y,&Float:z);
Float:GetElementsDistance({Text3D,_}:elementid,Item3D_Type:element_type,{Text3D,_}:targetid,Item3D_Type:target_type);
Float:GetElementDistanceFromPoint({Text3D,_}:elementid,Item3D_Type:element_type,Float:x,Float:y,Float:z);
//Screen Test
bool:IsElementOnPlayerScreen(playerid,{Text3D,_}:targetid,Item3D_Type:target_type=item_player,element_orientation:orientation=o_front,
Float:rx=INVALID_ROTATION,Float:rz=INVALID_ROTATION,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,
bool:testLOS=true,bool:testVW=true);
bool:IsElementOnFakeScreen(Float:x,Float:y,Float:z,{Text3D,_}:targetid,Item3D_Type:target_type,Float:rx,Float:rz,
Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true);
//Area Test
bool:IsElementInCircle({Text3D,_}:elementid,Item3D_Type:element_type,Float:x,Float:y,Float:radius);
bool:IsElementInCylinder3D({Text3D,_}:elementid,Item3D_Type:element_type,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:radius);
bool:IsElementInCylinder2D({Text3D,_}:elementid,Item3D_Type:element_type,Float:x,Float:y,Float:minz,Float:maxz,Float:radius);
bool:IsElementInSphere({Text3D,_}:elementid,Item3D_Type:element_type,Float:x,Float:y,Float:z,Float:radius);
bool:IsElementInRectangle({Text3D,_}:elementid,Item3D_Type:element_type,Float:minx,Float:miny,Float:maxx,Float:maxy);
bool:IsElementInCube({Text3D,_}:elementid,Item3D_Type:element_type,Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz);
bool:IsElementInPolygon({Text3D,_}:elementid,Item3D_Type:element_type,Float:points[],maxpoints sizeof(points));
bool:IsElementInCircularSector({Text3D,_}:elementid,Item3D_Type:element_type,Float:x,Float:y,Float:rz,Float:radius,Float:view_angle);
bool:IsElementInSphericalSector({Text3D,_}:elementid,Item3D_Type:element_type,Float:x,Float:y,Float:z,Float:rx,Float:rz,Float:radius,Float:vrx,Float:vrz);
bool:IsElementInCone({Text3D,_}:elementid,Item3D_Type:element_type,Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:pointA_radius,Float:pointB_radius);
//Stream Test
bool:IsElementInStream({Text3D,_}:elementid,Item3D_Type:element_type,Stream:StreamData[Stream3D]); 
- Added Item3D_Type's:
PHP код:
item_player
item_npc
item_actor
item_object
item_vehicle
item_dynamic_object
item_dynamic_pickup
item_dynamic_cp
item_dynamic_racecp
item_dynamic_mapicon
item_dynamic_3dtext
item_dynamic_actor 
Current supported elements:
a) Character Elements:
- Player's
- NPC's
- Actor's

b) Static Elements:
- Object's
- Vehicle's
- GangZone's

c) Dynamic Elements:
- DynamicObject's
- DynamicPickup's
- DynamicCP's
- DynamicRaceCP's
- DynamicMapIcon's
- Dynamic3DText's
- DynamicActor's

Download:
3DTryg.inc

Stock amount: 295 -> 253

Reply
#66

Update v4.0.0:

- Fixed minor bugs in:
PHP код:
MovePointCol
MovePointColCutLine
MovePointColCutLineEx 
- Removed function:
PHP код:
GetQuatFromRot(Float:rx,Float:ry,Float:rz,&Float:qw,&Float:qx,&Float:qy,&Float:qz);
//New Version: Tryg3D_GetQuatFromEuler 
- Added functions (prototype):
PHP код:
GetRandomPointInSphericalSector(Float:x,Float:y,Float:z,Float:rx,Float:rz,Float:radius,Float:vrx,Float:vrz,&Float:tx,&Float:ty,&Float:tz);
GetRandomPointOnSphericalSector(Float:x,Float:y,Float:z,Float:rx,Float:rz,Float:radius,Float:vrx,Float:vrz,&Float:tx,&Float:ty,&Float:tz); 
- Imported functions by Nero_3D from rotation.inc (Code anti colision: YES):
PHP код:
Tryg3D_QuatRotate(Float:qw,Float:qx,Float:qy,Float:qz,Float:oX,Float:oY,Float:oZ,&Float:tx,&Float:ty,&Float:tz);
Tryg3D_GetQuatFromEuler(Float:rx,Float:ry,Float:rz,&Float:qw,&Float:qx,&Float:qy,&Float:qz,T3D:eulermode:mode=T3D:euler_default);
Tryg3D_EulerRotate(Float:rx,Float:ry,Float:rz,Float:oX,Float:oY,Float:oZ,&Float:tx,&Float:ty,&Float:tz,T3D:eulermode:mode=T3D:euler_default); 
- Added functions:
PHP код:
//Extended version for GetPointInFront3D (Special thanks for Nero_3D rotation.inc)
GetPointInFront3DEx(Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,Float:radius,&Float:tx,&Float:ty,&Float:tz);
GetRandomPointOnCylinder2D(Float:x,Float:y,Float:minz,Float:maxz,Float:radius,&Float:tx,&Float:ty,&Float:tz);
GetRandomPointInCylinder3D(Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:radius,&Float:tx,&Float:ty,&Float:tz);
GetRandomPointOnCylinder3D(Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:radius,&Float:tx,&Float:ty,&Float:tz);
GetRandomPointInCone3D(Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:pointA_radius,Float:pointB_radius,&Float:tx,&Float:ty,&Float:tz);
GetRandomPointOnCone3D(Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:pointA_radius,Float:pointB_radius,&Float:tx,&Float:ty,&Float:tz);
bool:GetArcPointsFloor3D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:tz,Float:spread,Float:points[][],max_points sizeof(points));
bool:GetArcPointsCellar3D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:tz,Float:spread,Float:points[][],max_points sizeof(points));
bool:GetArcPointsLarboard3D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:tz,Float:spread,Float:points[][],max_points sizeof(points));
bool:GetArcPointsStarboard3D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:tz,Float:spread,Float:points[][],max_points sizeof(points)); 
- Added ColAndreas function:
PHP код:
//Extended version for GetPointInFront3DCol
GetPointInFront3DColEx(Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,Float:radius,&Float:tx,&Float:ty,&Float:tz); 
- Added Stream3D function:
PHP код:
bool:GetRandomPointOnStream(Stream:StreamData[Stream3D],&Float:x,&Float:y,&Float:z); 
- Updated functions:
PHP код:
//support for Cone3D, Cylinder3D, SphericalSector
bool:GetRandomPointInStream(Stream:StreamData[Stream3D],&Float:x,&Float:y,&Float:z); 
- Functions marked as deprecated:
PHP код:
GetArcPointsFloor2D
GetArcPointsCellar2D
GetArcPointsLarboard2D
GetArcPointsStarboard2D 
- Test for GetRandomPointInCylinder3D:
PHP код:
public OnFilterScriptInit(){
    new 
cnt 0max_oper 10000;
    for(new 
1<= max_operi++){
        new 
Float:x,Float:y,Float:z;
        
GetRandomPointInCylinder3D(150.0,-90.0,180.015.0,-58.0,50.025.0x,y,z);
        if(
IsPointInCylinder3D(x,y,z150.0,-90.0,180.015.0,-58.0,50.025.0)){
            
cnt++;
        }
    }
    
printf("%d / %d effectiveness %.2f %%",cnt,max_oper,(cnt*100.0/max_oper));
    
    
//9597 / 10000 effectiveness 95.97 %
    
    
return 1;

- Test for
PHP код:
public OnFilterScriptInit(){
    new 
cnt 0max_oper 10000;
    for(new 
1<= max_operi++){
        new 
Float:x,Float:y,Float:z;
        
GetRandomPointInCone3D(150.0,-69.0,15.0,-60.0,-50.0,150.0,15.0,90.0,x,y,z);
        if(
IsPointInCone3D(x,y,z,150.0,-69.0,15.0,-60.0,-50.0,150.0,15.0,90.0)){
            
cnt++;
        }
    }
    
printf("%d / %d effectiveness %.2f %%",cnt,max_oper,(cnt*100.0/max_oper));
    
    
//9433 / 10000 effectiveness 94.33 %
    
return 1;

- Test for GetRandomPointOnSphericalSector:
PHP код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys){
    if(
Tryg3D_KeyPressed(KEY_YES)){
        for(new 
050i++){
            new 
Float:x,Float:y,Float:zFloat:tx,Float:ty,Float:tz;
            
GetRandomPointOnSphericalSector(0.0,0.0,20.00.0,90.0,500.0,VERTICAL_CAMERA_RADIUS,HORIZONTAL_CAMERA_RADIUS,tx,ty,tz);
            
MovePointCol(0.0,0.0,20.0tx,ty,tzx,y,z);
            
MissileLaunch(MISSILE_TYPE_EXPLODE_NORMAL,10.0,25.0,80.00.0,0.0,20.00,0,-1,350.0,MISSILE_OBJECT_HYDRA,x,y,z);
        }
    }
    return 
1;

Video for GetRandomPointOnSphericalSector:
https://www.youtube.com/watch?v=hQLvmf0duAM

Screen for Arc3D:
http://i.imgur.com/qDzxLL4.png

Download:
3DTryg.inc
Reply
#67

Great
Reply
#68

Delete:

PHP код:
bool:IsPlayerInRangeOfVehicle(playerid,Float:range,vehicleid,bool:testLOS=true); 
bool:IsPlayerInRangeOfPlayer(playerid,Float:range,targetid,bool:testLOS=true); 
bool:IsPlayerInRangeOfObject(playerid,Float:range,objectid,bool:testLOS=true); 
bool:IsPlayerInRangeOfPointCol(playerid,Float:range,Float:x,Float:y,Float:z,bool:testLOS=true);  
bool:IsPlayerInRangeOfDynamicObject(playerid,Float:range,objectid,bool:testLOS=true); 
bool:IsPlayerInRangeOfDynamicActor(playerid,Float:range,actorid,bool:testLOS=true);  
bool:IsPlayerInRangeOfNPC(playerid,Float:range,npcid,bool:testLOS=true);  
bool:IsPlayerInRangeOfActor(playerid,Float:range,actorid,bool:testLOS=true); 
Add:

PHP код:
bool:IsPlayerInRangeOfElement(playerid,Float:range,Item3D_Type:target_type=item_player,bool:testLOS=true); 
Greetings

Edit:

Add modules of FCNPC (FCNPC_GetPosition, etc) in the new functions (example, item_npc use GetPlayerPos, add other item as item_fcnpc...)

When using the following functions, mark "undefined symbol" ...

PHP код:
#if defined Tryg3D_Anims
    
Tryg3D_Function:: bool:IsPlayerSkydiving(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index >= 958 && T3D:index <= 962);
    }
    
Tryg3D_Function:: bool:IsPlayerUsingParachute(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index >= 963 && T3D:index <= 979);
    }
    
Tryg3D_Function:: bool:IsPlayerAiming(playerid){
        switch(
GetPlayerAnimationIndex(playerid)){
            case 
1160..1163,1167,1365,1643,1453,220: return true;
        }
        return 
false;
    }
    
Tryg3D_Function:: bool:IsPlayerStay(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 1189 || T3D:index == 1133);
    }
    
Tryg3D_Function:: bool:IsPlayerRunning_(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 1231 || T3D:index == 1266 || T3D:index == 1196);
    }
    
Tryg3D_Function:: bool:IsPlayerSwim(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 1538 || T3D:index == 1539 || T3D:index == 1541 || T3D:index == 1544);
    }
    
Tryg3D_Function:: bool:IsPlayerJump_(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 1195 || T3D:index == 1198);
    }
    
Tryg3D_Function:: bool:IsPlayerParaFall(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 958 || T3D:index == 959 || T3D:index == 961 || T3D:index == 962 || T3D:index == 1134);
    }
    
Tryg3D_Function:: bool:IsPlayerParaGlide(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 963 || T3D:index == 965 || T3D:index == 971 || T3D:index == 976 || T3D:index == 978);
    }
    
Tryg3D_Function:: bool:IsPlayerFall(playerid){
        return (
GetPlayerAnimationIndex(playerid) == 1130);
    }
#endif 
Reply
#69

Quote:
Originally Posted by Fynn.
Посмотреть сообщение
Delete:

PHP код:
bool:IsPlayerInRangeOfVehicle(playerid,Float:range,vehicleid,bool:testLOS=true); 
bool:IsPlayerInRangeOfPlayer(playerid,Float:range,targetid,bool:testLOS=true); 
bool:IsPlayerInRangeOfObject(playerid,Float:range,objectid,bool:testLOS=true); 
bool:IsPlayerInRangeOfPointCol(playerid,Float:range,Float:x,Float:y,Float:z,bool:testLOS=true);  
bool:IsPlayerInRangeOfDynamicObject(playerid,Float:range,objectid,bool:testLOS=true); 
bool:IsPlayerInRangeOfDynamicActor(playerid,Float:range,actorid,bool:testLOS=true);  
bool:IsPlayerInRangeOfNPC(playerid,Float:range,npcid,bool:testLOS=true);  
bool:IsPlayerInRangeOfActor(playerid,Float:range,actorid,bool:testLOS=true); 
Add:

PHP код:
bool:IsPlayerInRangeOfElement(playerid,Float:range,Item3D_Type:target_type=item_player,bool:testLOS=true); 
Greetings

Edit:

Add modules of FCNPC (FCNPC_GetPosition, etc) in the new functions (example, item_npc use GetPlayerPos, add other item as item_fcnpc...)

When using the following functions, mark "undefined symbol" ...

PHP код:
#if defined Tryg3D_Anims
    
Tryg3D_Function:: bool:IsPlayerSkydiving(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index >= 958 && T3D:index <= 962);
    }
    
Tryg3D_Function:: bool:IsPlayerUsingParachute(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index >= 963 && T3D:index <= 979);
    }
    
Tryg3D_Function:: bool:IsPlayerAiming(playerid){
        switch(
GetPlayerAnimationIndex(playerid)){
            case 
1160..1163,1167,1365,1643,1453,220: return true;
        }
        return 
false;
    }
    
Tryg3D_Function:: bool:IsPlayerStay(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 1189 || T3D:index == 1133);
    }
    
Tryg3D_Function:: bool:IsPlayerRunning_(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 1231 || T3D:index == 1266 || T3D:index == 1196);
    }
    
Tryg3D_Function:: bool:IsPlayerSwim(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 1538 || T3D:index == 1539 || T3D:index == 1541 || T3D:index == 1544);
    }
    
Tryg3D_Function:: bool:IsPlayerJump_(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 1195 || T3D:index == 1198);
    }
    
Tryg3D_Function:: bool:IsPlayerParaFall(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 958 || T3D:index == 959 || T3D:index == 961 || T3D:index == 962 || T3D:index == 1134);
    }
    
Tryg3D_Function:: bool:IsPlayerParaGlide(playerid){
        new 
T3D:index GetPlayerAnimationIndex(playerid);
        return (
T3D:index == 963 || T3D:index == 965 || T3D:index == 971 || T3D:index == 976 || T3D:index == 978);
    }
    
Tryg3D_Function:: bool:IsPlayerFall(playerid){
        return (
GetPlayerAnimationIndex(playerid) == 1130);
    }
#endif 
I already adding support for FCNPC position in v4.0.1

PHP код:
#define ENABLE_3D_TRYG_ANIMS
#include <SAM/3DTryg> 
Reply
#70

Update v4.0.1:

- Removed functions (Use universal functions):
PHP код:
bool:IsPlayerInRangeOfVehicle(playerid,Float:range,vehicleid,bool:testLOS=true);
bool:IsPlayerInRangeOfPlayer(playerid,Float:range,targetid,bool:testLOS=true);
bool:IsPlayerInRangeOfObject(playerid,Float:range,objectid,bool:testLOS=true);
bool:IsPlayerInRangeOfPointCol(playerid,Float:range,Float:x,Float:y,Float:z,bool:testLOS=true);
bool:IsPlayerInRangeOfActor(playerid,Float:range,actorid,bool:testLOS=true);
bool:IsPlayerInRangeOfDynamicObject(playerid,Float:range,objectid,bool:testLOS=true);
bool:IsPlayerInRangeOfDynamicActor(playerid,Float:range,actorid,bool:testLOS=true);
bool:IsPlayerInRangeOfNPC(playerid,Float:range,npcid,bool:testLOS=true);
bool:GetPlayerToPointVector(playerid,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz);
bool:GetObjectToPointVector(objectid,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz);
bool:GetVehicleToPointVector(vehicleid,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz);
bool:GetDynamicObjectToPointVector(objectid,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz);
bool:GetNPCToPointVector(npcid,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz);
GetDynamicObjectCollisionFlags(objectid);
GetObjectCollisionFlags(objectid);
GetNPCCollisionFlags(npcid);
bool:IsBetweenNPCsIsWall(npcid,targetid);
bool:IsBetweenNPCToPointIsWall(npcid,Float:x,Float:y,Float:z);
GetPlayerRotatedVector(playerid,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz,bool:return_vector=true,Float:rx=0.0,Float:ry=0.0,Float:rz=0.0);
GetObjectRotatedVector(objectid,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz,bool:return_vector=true,Float:rx=0.0,Float:ry=0.0,Float:rz=0.0);
GetVehicleRotatedVector(vehicleid,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz,bool:return_vector=true,Float:rx=0.0,Float:ry=0.0,Float:rz=0.0);
GetDynamicObjectRotatedVector(objectid,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz,bool:return_vector=true,Float:rx=0.0,Float:ry=0.0,Float:rz=0.0);
GetNPCRotatedVector(npcid,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz,bool:return_vector=true,Float:rx=0.0,Float:ry=0.0,Float:rz=0.0);
GetObjectRotationQuat(objectid,&Float:qw,&Float:qx,&Float:qy,&Float:qz);
GetDynamicObjectRotationQuat(objectid,&Float:qw,&Float:qx,&Float:qy,&Float:qz);
GetVehicleUpVector(vehicleid,&Float:vx,&Float:vy,&Float:vz);
GetVehicleUpPos(vehicleid,Float:radius,&Float:x,&Float:y,&Float:z);
GetVehicleDownPos(vehicleid,Float:radius,&Float:x,&Float:y,&Float:z);
GetObjectUpVector(objectid,&Float:vx,&Float:vy,&Float:vz);
GetObjectUpPos(objectid,Float:radius,&Float:x,&Float:y,&Float:z);
GetObjectDownPos(objectid,Float:radius,&Float:x,&Float:y,&Float:z);
GetDynamicObjectUpVector(objectid,&Float:vx,&Float:vy,&Float:vz);
GetDynamicObjectUpPos(objectid,Float:radius,&Float:x,&Float:y,&Float:z);
GetDynamicObjectDownPos(objectid,Float:radius,&Float:x,&Float:y,&Float:z); 

- Marked as deprecated:
PHP код:
GetPlayerCollisionFlags(playerid);
GetVehicleCollisionFlags(vehicleid); 
- Added Universal Functions:
PHP код:
bool:GetElementToPointVector({Text3D,_}:elementid,Item3D_Type:element_type,Float:radius,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz);
bool:GetElementRotatedVector({Text3D,_}:elementid,Item3D_Type:element_type,Float:tx,Float:ty,Float:tz,&Float:vx,&Float:vy,&Float:vz,bool:return_vector=true,Float:rx=0.0,Float:ry=0.0,Float:rz=0.0);
bool:GetElementRotationQuat({Text3D,_}:elementid,Item3D_Type:element_type,&Float:qw,&Float:qx,&Float:qy,&Float:qz);
bool:GetElementUpVector({Text3D,_}:elementid,Item3D_Type:element_type,&Float:vx,&Float:vy,&Float:vz);
bool:GetElementUpPos({Text3D,_}:elementid,Item3D_Type:element_type,,&Float:x,&Float:y,&Float:z,bool:reverse=false); 
- Added Universal Functions (ColAndreas):
PHP код:
bool:IsBetweenElementsIsWall({Text3D,_}:elementid,Item3D_Type:element_type,{Text3D,_}:targetid,Item3D_Type:target_type);
bool:IsBetweenElementToPointIsWall(Float:x,Float:y,Float:z,{Text3D,_}:targetid,Item3D_Type:target_type);
GetElementCollisionFlags({Text3D,_}:elementid,Item3D_Type:element_type);
bool:IsPlayerInRangeOfElement(playerid,Float:range,{Text3D,_}:targetid,Item3D_Type:target_type=item_player,bool:testLOS=true);
bool:IsElementInRangeOfPoint(Float:x,Float:y,Float:z,Float:range,{Text3D,_}:targetid,Item3D_Type:target_type=item_player,bool:testLOS=true);
bool:IsElementInRangeOfElement({Text3D,_}:elementid,Item3D_Type:element_type,Float:range,{Text3D,_}:targetid,Item3D_Type:target_type=item_player,bool:testLOS=true); 
Download:
3DTryg.inc

Stock ammount: 239

Reply
#71

Update v4.0.2:

- Added support for STREAMER_ENABLE_TAGS

- Updated functions:
PHP код:
//Old Syntax:
Tryg3D_GivePlayerDamage(targetid,Float:damage,playerid,weaponid,bool:force_spawn=true,bool:death_msg=true,bool:death_call=true);
//New Syntax:
Tryg3D_GivePlayerDamage(targetid,Float:amount,playerid,weaponid,bodypart)
//Auto call
OnPlayerGiveDamage
OnPlayerTakeDamage
OnPlayerDeath 
before player "fake death"
SpawnPlayer after player "fake death" 
- Removed functions:
PHP код:
IsPointInWaterFrontOfNPC //Use IsPointInWaterOrientOfElement
GetRandomClockPos //Use GetRandomPointOnClock
{
    
GetDynamicActorOrientationPos
    GetNPCOrientationPos
    GetPlayerOrientationPos
    GetVehicleOrientationPos
    GetObjectOrientationPos
    GetDynamicObjectOrientationPos
} -> GetElementOrientationPos
{
    
GetPlayerOrientationPosCol
    GetVehicleOrientationPosCol
    GetObjectOrientationPosCol
    GetNPCOrientationPosCol
    GetDynamicObjectOrientPosCol
    GetDynamicActorOrientPosCol
} -> GetElementOrientationPosCol 
- Removed option:
PHP код:
USE_DEPRECATED_SCREEN_FUNCTION 
- Removed extra names:
PHP код:
GetPointInFront            -> GetPointInFront3D
GetXYInFrontOfPlayer       
-> GetPointInFrontOfPlayer
GetXYInFrontOfPlayerCol    
-> GetPointInFrontOfPlayerCol
GetPointInFrontOfCamera    
-> GetPointInFrontOfCamera3D
GetXYZInFrontOfVehicle     
-> GetPointInFrontOfVehicle3D (Attentiondifferent syntax)
GetVehicleAngle            -> GetVehicleRotation 
IsPointInCylinder          
-> IsPointInCylinder3D
IsPlayerInCylinder         
-> IsPlayerInCylinder3D
GetXYInFrontOfNPC          
-> GetPointInFrontOfNPC
GetXYInFrontOfNPCCol       
-> GetPointInFrontOfNPCCol
GetPointInFrontCol         
-> GetPointInFront3DCol
GetPointInFrontOfCameraCol 
-> GetPointInFrontOfCamera3DCol 
- Marked as deprecated:
PHP код:
bool:IsPointInWaterFrontOfPlayer(playerid,Float:radius); 
- Added element tag definition:
PHP код:
TRYG3D_ELEMENT_TAG 
- Added universal functions:
PHP код:

bool
:GetElementOrientationPos(TRYG3D_ELEMENT_TAG elementid,Item3D_Type:element_type,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
bool:GetElementOrientationPosCol(TRYG3D_ELEMENT_TAG elementid,Item3D_Type:element_type,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
bool:IsPointInWaterOrientOfElement(TRYG3D_ELEMENT_TAG elementid,Item3D_Type:element_type,Float:radius,element_orientation:orientation=o_front); 
Download:
3DTryg.inc

Stock ammount: 229

Reply
#72

Update v4.0.3:

- Update Version Checker (Now always working).

- Added YSF functions:
PHP код:
CountGangZone();
CountVisibleGangZone(playerid);
CountPlayerGangZone(playerid);
CountVisiblePlayerGangZone(playerid); 
- Added functions:
PHP код:
CountVisibleActors(playerid);
CountVisibleVehicles(playerid);
CountVisiblePlayers(playerid,bool:isplayer=true,bool:isnpc=true); 
Download:
3DTryg.inc
Reply
#73

Update 4.1.1:

- Added Functions:
PHP Code:
Tryg3D::EulerToQuat(Float:rx,Float:ry,Float:rz,&Float:qw,&Float:qx,&Float:qy,&Float:qz);
Tryg3D::QuatToEuler(&Float:rx,&Float:ry,&Float:rz,Float:qw,Float:qx,Float:qy,Float:qz);
ShiftVectorRotation(Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,&Float:tx,&Float:ty,&Float:tz); 
- Added Streamer Function:
PHP Code:
bool:IsVehicleFullyInDynamicArea(vehicleid,areaid); 
- Added Stream3D Function:
PHP Code:
bool:IsVehicleFullyInStream(vehicleid,Stream:StreamData[Stream3D]); 
Download:
GitHub
Abyss Morgan Website
Reply
#74

Quote:
Originally Posted by AbyssMorgan
View Post
Update 4.1.1:

- Added Functions:
PHP Code:
Tryg3D::EulerToQuat(Float:rx,Float:ry,Float:rz,&Float:qw,&Float:qx,&Float:qy,&Float:qz);
Tryg3D::QuatToEuler(&Float:rx,&Float:ry,&Float:rz,Float:qw,Float:qx,Float:qy,Float:qz);
ShiftVectorRotation(Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,&Float:tx,&Float:ty,&Float:tz); 
- Added Streamer Function:
PHP Code:
bool:IsVehicleFullyInDynamicArea(vehicleid,areaid); 
- Added Stream3D Function:
PHP Code:
bool:IsVehicleFullyInStream(vehicleid,Stream:StreamData[Stream3D]); 
Download:
GitHub
Abyss Morgan Website
Here's an idea

Code:
bool:IsVehicleInDynamicArea(vehicleid,areaid,&Float:percentage);
Percentage will be how much of the car is in the area. The math should be pretty simple
Reply
#75

Update v4.1.2:

- Added functions:
PHP Code:
//x,y,z - cube center point, rx,ry,rz - cube rotations
GetRandomPointInCube3D(Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,Float:size_x,Float:size_y,Float:size_z,&Float:tx,&Float:ty,&Float:tz);
GetRandomPointOnCube3D(Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,Float:size_x,Float:size_y,Float:size_z,&Float:tx,&Float:ty,&Float:tz);
bool:IsPointInCube3D(Float:px,Float:py,Float:pz,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,Float:size_x,Float:size_y,Float:size_z);
bool:IsPlayerInCube3D(playerid,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,Float:size_x,Float:size_y,Float:size_z);
GetCube3DPoint(OrientationCube3D:orientation,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,Float:size_x,Float:size_y,Float:size_z,&Float:tx,&Float:ty,&Float:tz); 
- Added Universal function:
PHP Code:
bool:IsElementInCube3D(elementid,Item3D_Type:element_type,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,Float:size_x,Float:size_y,Float:size_z); 
- Added Stream3D function:
PHP Code:
Stream:StreamCube3D(Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz,Float:size_x,Float:size_y,Float:size_z); 
- Added Streamer function:
PHP Code:
bool:GetRandomPointInDynamicArea(STREAMER_TAG_AREA areaid,&Float:tx,&Float:ty,&Float:tz); 
- Added OrientationCube3D
PHP Code:
o_left_back_down
o_right_back_down
o_right_front_down
o_left_front_down
o_left_back_up
o_right_back_up
o_right_front_up
o_left_front_up 
Reply
#76

Update v4.2.0:

- Added functions:
PHP Code:
Float:GetEllipseRadius(Float:x,Float:y,Float:angle);
bool:GetArcPoints3D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:tz,Float:ry,Float:height,Float:points[][],max_points sizeof(points));
bool:IsPointInEllipse(Float:px,Float:py,Float:cx,Float:cy,Float:size_x,Float:size_y);
bool:IsPointInEllipticalCylinder2D(Float:px,Float:py,Float:pz,Float:cx,Float:cy,Float:minz,Float:maxz,Float:size_x,Float:size_y);
bool:IsPlayerInEllipse(playerid,Float:cx,Float:cy,Float:size_x,Float:size_y);
bool:IsPlayerInEllipticalCylinder2D(playerid,Float:cx,Float:cy,Float:minz,Float:maxz,Float:size_x,Float:size_y);
GetRandomPointInEllipse(Float:cx,Float:cy,Float:size_x,Float:size_y,&Float:tx,&Float:ty);
GetRandomPointInEllipticalCyl2D(Float:cx,Float:cy,Float:minz,Float:maxz,Float:size_x,Float:size_y,&Float:tx,&Float:ty,&Float:tz);
GetRandomPointOnEllipse(Float:cx,Float:cy,Float:size_x,Float:size_y,&Float:tx,&Float:ty);
GetRandomPointOnEllipticalCyl2D(Float:cx,Float:cy,Float:minz,Float:maxz,Float:size_x,Float:size_y,&Float:tx,&Float:ty,&Float:tz); 
- Added Universal Functions:
PHP Code:
bool:IsElementInEllipse(elementid,Item3D_Type:element_type,Float:cx,Float:cy,Float:size_x,Float:size_y);
bool:IsElementInEllipticalCylinder2D(elementid,Item3D_Type:element_type,Float:cx,Float:cy,Float:minz,Float:maxz,Float:size_x,Float:size_y); 
- Added Stream3D Functions:
PHP Code:
Stream:StreamEllipse(Float:cx,Float:cy,Float:size_x,Float:size_y);
Stream:StreamEllipticalCylinder2D(Float:cx,Float:cy,Float:minz,Float:maxz,Float:size_x,Float:size_y); 
- Added FCNPC Functions (ColAndreas):
PHP Code:
//Streamer:
FCNPC_RandomMoveInDynamicArea(npcid,STREAMER_TAG_AREA areaid,Float:climbing 2.0,type MOVE_TYPE_AUTO,Float:speed MOVE_SPEED_AUTO,bool:UseMapAndreas false,bool:setangle true);
//Stream3D:
FCNPC_RandomMoveInStream(npcid,Stream:StreamData[Stream3D],Float:climbing 2.0,type MOVE_TYPE_AUTO,Float:speed MOVE_SPEED_AUTO,bool:UseMapAndreas false,bool:setangle true); 
- Added Stream3D types:
PHP Code:
s_ellipse
s_ellipticalcyl2d 
Videos:
Random NPC Moving In Area
Marica Mortar V2


Example code for Stream3D Moving:
PHP Code:
#include <a_samp>
#include <ColAndreas>
#include <FCNPC>
#define ENABLE_3D_TRYG_STREAM3D
#include <SAM/3DTryg>
new NPC[6],
    
StreamCreate(NPCArea);
public 
OnFilterScriptInit(){
    
NPCArea StreamCircle(2178.25,997.89,150.0);
    
/*
    Also:
    NPCArea = StreamRectangle(869.40,596.30,2997.00,2993.80); //Las Venturas
    */
    
    
NPC[0] = FCNPC_Create("Alusia");
    
FCNPC_Spawn(NPC[0],216,2178.25997.8910.82);
    
    
NPC[1] = FCNPC_Create("Luna");
    
FCNPC_Spawn(NPC[1],91,2100.56989.8210.82);
    
    
NPC[2] = FCNPC_Create("Skadi");
    
FCNPC_Spawn(NPC[2],11,2135.661042.7110.81);
    
    
NPC[3] = FCNPC_Create("Lusia");
    
FCNPC_Spawn(NPC[3],13,2162.481009.7710.52);
    
    
NPC[4] = FCNPC_Create("Nika");
    
FCNPC_Spawn(NPC[4],12,2141.831009.8910.52);
    
    
NPC[5] = FCNPC_Create("Zero");
    
FCNPC_Spawn(NPC[5],294,2132.121028.9610.52);
    
    return 
1;
}
public 
FCNPC_OnUpdate(npcid){
    if(!
FCNPC_IsMoving(npcid)){
        
FCNPC_RandomMoveInStream(npcid,NPCArea,_,MOVE_TYPE_WALK,MOVE_SPEED_AUTO,true,true);
    }
    return 
1;
}
public 
OnFilterScriptExit(){
    
    for(new 
0<= 5i++) FCNPC_Destroy(NPC[i]);
    
    return 
1;

Reply
#77

Minor Update v4.2.1 for Stingers.inc:

- Fix error in GetVehiclePartPos
Reply
#78

Update v4.3.0:

- Added support for VehicleStreamer by kurta999

- Added compiler option:
PHP Code:
DISABLE_3D_TRYG_VEHSTREAMER 
- Added item type for Universal Functions:
PHP Code:
item_dynamic_vehicle 
- Added VehicleStreamer Functions:
PHP Code:
Tryg3D::GetDynamicVehicleID(vehicleid);
GetDynamicVehicleFlags(vehicleid);
Float:GetDynamicVehicleSpeed(vehicleid);
GetDynamicVehiclePartPos(vehicleid,partid,&Float:tx,&Float:ty,&Float:tz,Float:offset_x=0.0,Float:offset_y=0.0,Float:offset_z=0.0);
Float:GetPointInFrontOfDynVeh2D(vehicleid,&Float:tx,&Float:ty,Float:radius);
GetPointInFrontOfDynVeh3D(vehicleid,&Float:tx,&Float:ty,&Float:tz,Float:radius,&Float:rx=0.0,&Float:rz=0.0);
bool:IsDynVehInRangeOfPoint(vehicleid,Float:range,Float:x,Float:y,Float:z);
bool:IsDynVehFullyInDynamicArea(vehicleid,areaid);
Float:GetPointInFrontOfDynVeh2DCol(vehicleid,&Float:tx,&Float:ty,Float:radius);
GetPointInFrontOfDynVeh3DCol(vehicleid,&Float:tx,&Float:ty,&Float:tz,Float:radius,&Float:rx=0.0,&Float:rz=0.0);
bool:IsDynamicVehicleOnSpawn(vehicleid,Float:check_radius=1.0);
bool:IsDynamicVehicleFullyInStream(vehicleid,Stream:StreamData[Stream3D]);
GetDynamicVehicleRotation(vehicleid,&Float:rx,&Float:ry,&Float:rz); 
- Added function:
PHP Code:
bool:IsPlayerFakeSpectating(playerid,bool:force_disable=true); 
Reply
#79

It's possible detect if element is on fcnp vision? like you do with IsElementOnPlayerScreen
Reply
#80

Quote:
Originally Posted by Dayvison_
View Post
It's possible detect if element is on fcnp vision? like you do with IsElementOnPlayerScreen
IsElementOnPlayerScreen - is any element in item_player screen
IsElementOnFakeScreen - is any element on fake screen

PHP Code:
bool:IsElementOnFakeScreen(Float:x,Float:y,Float:z,targetid,Item3D_Type:target_type,Float:rx,Float:rz,Float:vrx=VERTICAL_CAMERA_RADIUS,Float:vrz=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true); 
PHP Code:
stock GetTarget(npcid){
    new 
Float:xFloat:yFloat:zFloat:angle,
        
pool_players[MAX_PLAYERS], pool_upp = -1;
    
    
FCNPC_GetPosition(npcid,x,y,z);
    
angle FCNPC_GetAngle(npcid);
    
    foreach(new 
iPlayer){
        if(
GetElementsDistance(i,item_player,npcid,item_npc) <= 300.0){
            if(
IsElementOnFakeScreen(x,y,z,i,item_player,0.0,angle) && GetPlayerState(i) != PLAYER_STATE_SPECTATING){
                
pool_upp++;
                
pool_players[pool_upp] = i;
            }
        }
    }
    if(
pool_upp == -1) return INVALID_PLAYER_ID;
    return 
pool_players[random(pool_upp+1)];

I need add IsElementOnElementScreen :P
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)