---
title: "GetGravity | open.mp"
description: "Get the currently set gravity."
canonical: https://omp.itsneufox.com/th/docs/scripting/functions/GetGravity
language: th
---

# GetGravity

## คำอธิบาย

Get the currently set gravity.

| Name | Description |
| --- | --- |

## ตัวอย่าง

```c
#if !defined GetGravity
    native Float:GetGravity();
#endif

printf("Current gravity: %f", GetGravity());
```

## บันทึก

warning

This function is not defined by default. Add 'native Float:GetGravity();' under the inclusion of a\_samp.inc to use it.

## ฟังก์ชั่นที่เกี่ยวข้องกัน

-   [SetGravity](https://omp.itsneufox.com/th/docs/scripting/functions/SetGravity): Set the global gravity.
