09.10.2016, 13:00
Quote:
PHP Code:
CMD:salo(playerid){
Kick(playerid);
return 1;
}
CMD:salo(playerid){
Kick(playerid);
return 1;
}
bool:IsRotationTest(Float:rotation,Float:r_min,Float:r_max); //internal function 3DTryg
GetRandomPointInCircularSector(Float:x,Float:y,Float:rz,Float:radius,Float:view_angle,&Float:tx,&Float:ty);
GetRandomPointOnCircularSector(Float:x,Float:y,Float:rz,Float:radius,Float:view_angle,&Float:tx,&Float:ty);
FCNPC_GoToPlayerOnGroundCol(npcid,playerid,type = MOVE_TYPE_AUTO,Float:speed = MOVE_SPEED_AUTO,bool:UseMapAndreas = false,Float:cut_size = 1.0,Float:climbing = 2.0,bool:setangle = true);
FCNPC_GoToAirCol(npcid,Float:x,Float:y,Float:z,type = MOVE_TYPE_AUTO,Float:speed = MOVE_SPEED_AUTO,Float:cut_size = 0.0); //for airplanes
FCNPC_GoToAir(npcid,Float:x,Float:y,Float:z,type = MOVE_TYPE_AUTO,Float:speed = MOVE_SPEED_AUTO); //for airplanes
FCNPC_GoToCol(npcid,Float:x,Float:y,Float:z,type = MOVE_TYPE_AUTO,Float:speed = MOVE_SPEED_AUTO,bool:UseMapAndreas = false,Float:cut_size = 0.0,bool:setangle = true);
FCNPC_GoToPlayerCol(npcid,playerid,type = MOVE_TYPE_AUTO,Float:speed = MOVE_SPEED_AUTO,bool:UseMapAndreas = false,Float:cut_size = 0.0,bool:setangle = true);
bool:IsPointInCircularSector(Float:px,Float:py,Float:x,Float:y,Float:rz,Float:radius,Float:view_angle);
bool:IsPointInSphericalSector(Float:px,Float:py,Float:pz,Float:x,Float:y,Float:z,Float:rx,Float:rz,Float:radius,Float:vrx,Float:vrz);
bool:IsPlayerOnPlayerScreen(playerid,targetid,Float:rx=INVALID_ROTATION,Float:rz=INVALID_ROTATION,Float:vertical=VERTICAL_CAMERA_RADIUS,Float:horizontal=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true); *
bool:IsPlayerOnFakeScreen(Float:x,Float:y,Float:z,targetid,Float:rx,Float:rz,Float:vertical=VERTICAL_CAMERA_RADIUS,Float:horizontal=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true);
bool:IsPlayerStay(playerid); //Animation test
bool:IsPlayerRunning(playerid); //Animation test
bool:IsPlayerSwim(playerid); //Animation test
bool:IsPlayerJump(playerid); //Animation test
bool:IsPlayerParaFall(playerid); //Animation test
bool:IsPlayerParaGlide(playerid); //Animation test
bool:IsPlayerFall(playerid); //Animation test
Tryg3DKeyPressed -> Tryg3D_KeyPressed
Tryg3DKeyReleased -> Tryg3D_KeyReleased
Tryg3DKeyHolding -> Tryg3D_KeyHolding
#define DISABLE_3D_TRYG_MAPANDREAS //Use before 3DTryg.inc for disable MapAndreas Module
#define DISABLE_3D_TRYG_COLANDREAS //Use before 3DTryg.inc for disable ColAndreas Module
#define DISABLE_3D_TRYG_YSF //Use before 3DTryg.inc for disable YSF Module
#define DISABLE_3D_TRYG_STREAMER //Use before 3DTryg.inc for disable Streamer Module
#define DISABLE_3D_TRYG_FOXFOREACH //Use before 3DTryg.inc for disable FoxForeach Module
#define DISABLE_3D_TRYG_YSIFOREACH //Use before 3DTryg.inc for disable Foreach Module
#define DISABLE_3D_TRYG_FCNPC //Use before 3DTryg.inc for disable FCNPC Module
bool:GetArcPointsFloor2D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:spread,Float:points[][],max_points = sizeof(points));
bool:GetArcPointsCellar2D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:spread,Float:points[][],max_points = sizeof(points));
bool:GetArcPointsStarboard2D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:spread,Float:points[][],max_points = sizeof(points));
bool:GetArcPointsLarboard2D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:spread,Float:points[][],max_points = sizeof(points));
Tryg3D_SetStreamDistance(Float:streamdistance); //default 300.0 (server.cfg: stream_distance)
Float:Tryg3D_GetStreamDistance();
#define ENABLE_3D_TRYG_STREAM3D //Use before 3DTryg.inc for enable Stream3D Module
#define DISABLE_3D_TRYG_ANNOUNCE //Use before 3DTryg.inc for disable 3DTryg Announce
StreamCreate(variable);
Stream:StreamCircle(Float:x,Float:y,Float:radius);
Stream:StreamCylinder(Float:xA,Float:yA,Float:zA,Float:xB,Float:yB,Float:zB,Float:radius);
Stream:StreamCylinderEx(Float:x,Float:y,Float:minz,Float:maxz,Float:radius);
Stream:StreamSphere(Float:x,Float:y,Float:z,Float:radius);
Stream:StreamRectangle(Float:minx,Float:miny,Float:maxx,Float:maxy);
Stream:StreamCube(Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz);
Stream:StreamCircularSector(Float:x,Float:y,Float:rz,Float:radius,Float:view_angle);
Stream:StreamSphericalSector(Float:x,Float:y,Float:z,Float:rx,Float:rz,Float:radius,Float:vrx,Float:vrz);
bool:IsPointInStream(Float:x,Float:y,Float:z,Stream:StreamData[Stream3D]);
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]);
s_circle
s_cylinder
s_cylinderex
s_sphere
s_rectangle
s_cube
s_circularsector
s_sphericalsector
new StreamCreate(test);
test = StreamCircle(12.0,15.0,10.0);
if(IsPointInStream(0.0,0.0,5.0,test)){
printf("A");
}
test = StreamCube(-500.0,-500.0,-50.0,400.0,40.0,15.0);
if(IsPointInStream(0.0,0.0,5.0,test)){
printf("B");
}
I'm getting wrong rotation with GetGroundRotation function.
Example: The ground rotation for my actual postion is 300 on X and 250 on Y, but if I use these values my object looks inverted on ROT. I solved mutilplying the values by (-1.0), so then turned -300 and -250. Idk if I'm using this on an incorrent way, but even with yourexample code I'm getting the wrong value. |
bool:IsVehicleOnPlayerScreen(playerid,vehicleid,Float:rx=INVALID_ROTATION,Float:rz=INVALID_ROTATION,Float:vertical=VERTICAL_CAMERA_RADIUS,Float:horizontal=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true); bool:IsVehicleOnFakeScreen(Float:x,Float:y,Float:z,vehicleid,Float:rx,Float:rz,Float:vertical=VERTICAL_CAMERA_RADIUS,Float:horizontal=HORIZONTAL_CAMERA_RADIUS,bool:testLOS=true);
#define DISABLE_3D_TRYG_ACTOR //Use before 3DTryg.inc for disable Actors Module
NLTV(value,min); //NotLessThanValue
NMTV(value,max); //NotMoreThanValue
Float:NLTVF(Float:value,Float:min); //NotLessThanValueFloat
Float:NMTVF(Float:value,Float:max); //NotMoreThanValueFloat
GetTryg3DActiveCount(); //returns the number of scripts that were activated 3DTryg
//parameter bool:testLOS only works with ColAndreas
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: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);
GetPlayerCameraLookAt(playerid,&Float:x,&Float:y,&Float:z); //Not support camera move
//parameter bool:testLOS only works with ColAndreas
IsPointInSphericalSectorEx(Float:px,Float:py,Float:pz,Float:x,Float:y,Float:z,Float:rx,Float:rz,Float:radius,Float:vrx,Float:vrz,bool:testLOS=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: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: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: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: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: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);
SetPlayerAbsolutePosition(playerid,Float:x,Float:y,Float:z,Float:angle,worldid = -1,interiorid = -1,compensatedtime = -1);
SetPlayerAbsolutePositionVeh(playerid,Float:x,Float:y,Float:z,Float:angle,worldid = -1,interiorid = -1,compensatedtime = -1);
//parameter bool:testLOS only works with ColAndreas
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: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);
SetNPCAbsolutePosition(npcid,Float:x,Float:y,Float:z,Float:angle,worldid = -1,interiorid = -1,compensatedtime = -1);
FCNPC_AimAt(npcid, Float:x, Float:y, Float:z, bool:shoot = false, shoot_delay = -1, bool:setangle = true);
new V3[Vectors3D];
FCNPC_GetPosition(npcid,V3[T3D:X],V3[T3D:Y],V3[T3D:Z]);
if(IsPlayerOnFakeScreen(V3[T3D:X],V3[T3D:Y],V3[T3D:Z],playerid,0.0,float(random(360)),VERTICAL_CAMERA_RADIUS,HORIZONTAL_CAMERA_RADIUS,true)){
//attack !
}
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: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: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);
StreamType:GetStreamType(Stream:StreamData[Stream3D]);
bool:IsValidStream(Stream:StreamData[Stream3D]);
Stream:ConvertAreaToStream(areaid);
GetArcPointsCellar2D(Float:x,Float:y,Float:z,Float:tx,Float:ty,Float:spread,Float:points[][],max_points = sizeof(points));
Functions of screen... add support for streamer objects.
IsPlayerAttacking (melee) Thanks for the work in the include, it has been very useful to me in developing my game mode. |
Update v3.0.5:
- Added Streamer functions: PHP Code:
|
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:support_streamer_objects = false) ... Other functions "screen..."
The parameter to support streamer objects would be useful in visibility functions (without the need to use IsDynamicObjectOnPlayerScreen, which would be optional if the programmer only wants to perform X functions with those objects).
Code:
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:support_streamer_objects = false) ... Other functions "screen..." IsPlayerAttacking would be basically when a user performs the attack animation (with or without white weapons). |
CA_CreateDynamicObject_DC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, vw = -1, interior = -1, playerid = -1, Float:streamdist = 300.0, Float:drawdist = 300.0)
CA_CreateDynamicObject_SC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, vw = -1, interior = -1, playerid = -1, Float:streamdist = 300.0, Float:drawdist = 300.0)
CA_CreateDynamicObjectEx_DC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 0.0, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players)
CA_CreateDynamicObjectEx_SC(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 0.0, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players)
#define ENABLE_3D_TRYG_LINE3D //Use before 3DTryg.inc for enable Line3D Module
Line3DCreate(variable,max_points);
GetLine3DValue(variable,pointid,name);
SetLine3DValue(variable,pointid,name,value);
bool:GetLine3DPointPos(Line3D:LineData[][LinePoint3D],pointid,&Float:x,&Float:y,&Float:z,max_points = sizeof(LineData));
bool:SetLine3DPointPos(Line3D:LineData[][LinePoint3D],pointid,Float:x,Float:y,Float:z,max_points = sizeof(LineData));
bool:GetLine3DPointRot(Line3D:LineData[][LinePoint3D],pointid,&Float:rx,&Float:ry,&Float:rz,max_points = sizeof(LineData));
bool:SetLine3DPointRot(Line3D:LineData[][LinePoint3D],pointid,Float:rx,Float:ry,Float:rz,max_points = sizeof(LineData));
CountLine3DPoints(Line3D:LineData[][LinePoint3D],max_points = sizeof(LineData));
AddPointToLine3D(Line3D:LineData[][LinePoint3D],Float:x,Float:y,Float:z,Float:rx=INVALID_ROTATION,Float:ry=INVALID_ROTATION,Float:rz=INVALID_ROTATION,max_points = sizeof(LineData));
INVALID_LINE3D_POINT_ID
Tryg3D_GivePlayerDamage(targetid,Float:damage,playerid,weaponid,bool:force_spawn=true,bool:deathmsg=true);
Tryg3D_swap_int -> Tryg3D_SwapInt
T3D:GetSAMIncludeVersion(value,name[],maxdest = sizeof(name));
T3D:DisableADMLogging(bool:disable);
//Macro T3D:function
T3D:function test(alfa,beta){
return alfa + beta;
}
//Time Macros
T3D:SecToTimeDay(second); //Use: %d:%02d:%02d:%02d
T3D:MSToTimeDay(millisecond); //Use: %d:%02d:%02d:%02d
T3D:SecToTime(second); //Use: %02d:%02d:%02d
T3D:MSToTime(millisecond); //Use: %02d:%02d:%02d
T3D:SecToTimeMini(second); //Use: %02d:%02d
T3D:MSToTimeMini(millisecond); //Use: %02d:%02d
CountTextDraw();
CountPlayerTextDraw(playerid);
CountVisibleTextDraw(playerid);
CountVisiblePlayerTextDraw(playerid);
Float:GetDynamicActorDistFromPoint(actorid,Float:x,Float:y,Float:z);
Float:GetPlayerDynamicActorDistance(playerid,actorid);
bool:IsDynamicActorInRangeOfPoint(actorid,Float:range,Float:x,Float:y,Float:z);
GetDynamicActorOrientationPos(actorid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
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);
GetDynamicActorOrientPosCol(actorid,element_orientation:orientation,Float:distance,&Float:tx,&Float:ty,&Float:tz);
Float:GetNPCDynamicActorDistance(npcid,actorid);
bool:IsDynamicActorInStream(actorid,Stream:StreamData[Stream3D]);