- Documentation
- Shared functions
- getMapObjects
Function
getMapObjects
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
resetMapObjectsPuts map objects back in their original places for all players (e.g. cleaning up after a riot). Takes one key fromgetMapObjects, a list of keys, or nothing - then all of them.setMapObjectSyncEnabledTurns synchronisation of San Andreas map objects between players on or off. On (default): when someone knocks over a hydrant or smashes a barrel, others see the same. Off: each player sees their own object state.