FiveM Docs / Native Reference
API Set:
  • all
  • server
  • client
Language:
  • raw
  • lua
  • c#
  • js
Namespace: CFXAPI set: servereditImprove

GET_ENTITY_COORDS

0x1647F1CB
// GetEntityCoords
Vector3 GET_ENTITY_COORDS(Entity entity);
Parameters:
  • entity:

    The entity to get the coordinates from.

Returns:

The current entity coordinates.

Gets the current coordinates for a specified entity. This native is used server side when using OneSync. See <a href="#_0x3FEF770D40960D5A" >GET_ENTITY_COORDS</a> for client side.

Examples:

  • Lua
  • JavaScript
  • C#
local function ShowCoordinates()
    local player = source
    local ped = GetPlayerPed(player)
    local playerCoords = GetEntityCoords(ped)

    print(playerCoords) -- vector3(...)
end

RegisterNetEvent("myCoordinates")
AddEventHandler("myCoordinates", ShowCoordinates)
FIND_FIRST_PED(Entity* outEntity)
FIND_FIRST_PICKUP(Entity* outEntity)
FIND_FIRST_VEHICLE(Entity* outEntity)
FIND_KVP(int handle)
FIND_NEXT_OBJECT(int findHandle, Entity* outEntity)
FIND_NEXT_PED(int findHandle, Entity* outEntity)
FIND_NEXT_PICKUP(int findHandle, Entity* outEntity)
FIND_NEXT_VEHICLE(int findHandle, Entity* outEntity)
FLAG_SERVER_AS_PRIVATE(BOOL private_)
FORCE_SNOW_PASS(BOOL enabled)
GET_ACTIVE_PLAYERS()
GET_AIR_DRAG_MULTIPLIER_FOR_PLAYERS_VEHICLE(char* playerSrc)
GET_ALL_OBJECTS()
GET_ALL_PEDS()
GET_ALL_VEHICLES()
GET_AMBIENT_PED_RANGE_MULTIPLIER()
GET_AMBIENT_VEHICLE_RANGE_MULTIPLIER()
GET_CAM_MATRIX(Cam camera, Vector3* rightVector, Vector3* forwardVector, Vector3* upVector, Vector3* position)
GET_CONSOLE_BUFFER()
GET_CONVAR(char* varName, char* default_)
GET_CONVAR_INT(char* varName, int default_)
GET_CURRENT_RESOURCE_NAME()
GET_CURRENT_SERVER_ENDPOINT()
GET_DUI_HANDLE(long duiObject)
GET_ENTITY_COORDS(Entity entity)
GET_ENTITY_HEADING(Entity entity)
GET_ENTITY_HEALTH(Entity entity)
GET_ENTITY_MAX_HEALTH(Entity entity)
GET_ENTITY_MODEL(Entity entity)
GET_ENTITY_POPULATION_TYPE(Entity entity)
GET_ENTITY_ROTATION(Entity entity)
GET_ENTITY_ROTATION_VELOCITY(Entity entity)
GET_ENTITY_ROUTING_BUCKET(Entity entity)
GET_ENTITY_SCRIPT(Entity entity)
GET_ENTITY_TYPE(Entity entity)