ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getMapObjects

Function

getMapObjects

Server and clientObjectsTrilogy Hub only

Returns San Andreas map objects (hydrants, barrels, boxes, lamp posts…) that players moved or damaged. On the server each entry has a key shared by all players, model, position, rotation (quaternion), health, a broken flag and the player who last moved it. On the client it returns map objects loaded in this game with a moved field.

Syntax

table getMapObjects()

Returns

Server: { {key, model, x, y, z, qx, qy, qz, qw, health, broken, owner}, ... }; client: { {key, model, x, y, z, health, moved}, ... }.

Example

addCommandHandler("balagan", function(player)
    local list = getMapObjects()
    outputChatBox("Przesunietych obiektow mapy: " .. #list, player)
end)

See also