Skip to content

Commit a55189b

Browse files
authored
Merge pull request #3 from continue98/main
Added function get center of rectangle
2 parents e5a662e + 8070b4c commit a55189b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

3DTryg.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Tryg3D::GetGangZone(const Float:x, const Float:y, const Float:radius, &Float:min
148148
bool: Tryg3D::IsProbable(const Float:chance, const accuracy = TRYG3D_DEFAULT_RANDOM_ACCURACY);
149149
Tryg3D::RandomItemFromArray(const items[][LootArray], const max_items = sizeof(items), const accuracy = TRYG3D_DEFAULT_RANDOM_ACCURACY);
150150
Tryg3D::GetWeaponShotPos(playerid, hittype, &Float:fx, &Float:fy, &Float:fz);
151+
Tryg3D::GetCenterRectangle(const Float: x_min, const Float: y_min, const Float: x_max, const Float: y_max, &Float: x_center, &Float: y_center);
151152
152153
# Converter Functions
153154
Float: Tryg3D::ShiftDegreeToRadian(const Float:value);
@@ -1850,6 +1851,13 @@ stock bool: Tryg3D::IsValidPolygon(const Float:points[], const max_points = size
18501851
return true;
18511852
}
18521853

1854+
stock Tryg3D::GetCenterRectangle(const Float: x_min, const Float: y_min, const Float: x_max, const Float: y_max, &Float: x_center, &Float: y_center)
1855+
{
1856+
x_center = (x_min + x_max) / 2.0;
1857+
y_center = (y_min + y_max) / 2.0;
1858+
return 1;
1859+
}
1860+
18531861
stock ElementOrientation: Tryg3D::GetOrientation(Float:angle){
18541862
angle = Tryg3D::CompressRotation(angle+22.5);
18551863
if(0.0 <= angle < 45.0){

0 commit comments

Comments
 (0)