Skip to content
samp-incognito edited this page Apr 14, 2019 · 44 revisions

HomeNativesSettings

  • Parameters:
    • None.
  • Returns:
    • The tick rate.

Gets the current global tick rate.


  • Parameters:
    • rate: The tick rate.
  • Returns:
    • 0 on failure, 1 on success.

Sets the current global tick rate.

  • Default: 50.
  • This controls the frequency of pickup and actor streaming and callback execution.

  • Parameters:
    • None.
  • Returns:
    • The tick rate.

Gets the current tick rate for the specified player.


  • Parameters:
    • rate: The tick rate.
  • Returns:
    • 0 on failure, 1 on success.

Sets the current tick rate for the specified player.

  • Default: 50.
  • This controls the frequency of all item updates.

  • Parameters:
    • toggle: 0 to turn off, 1 to turn on.
  • Returns:
    • 1.

Toggles chunk streaming for objects, map icons, and 3D text labels.

  • The aim of this feature is to limit the total number of packets sent at once. For example, rather than creating 500 objects simultaneously, this feature will instead create 100 objects over 5 server ticks under the default settings.
  • By default, this is disabled. Note that it is still experimental.

  • Parameters:
    • None.
  • Returns:
    • 0 or 1.

Returns whether Streamer_ToggleChunkStream is enabled.


  • Parameters:
    • type: The item type.
    • playerid: The player ID.
  • Returns:
    • The chunk tick rate.

Gets the current chunk tick rate for the specified item type and player.


  • Parameters:
    • type: The item type.
    • rate: The chunk tick rate.
    • playerid: The player ID.
  • Returns:
    • 0 on failure, 1 on success.

Sets the current chunk tick rate for the specified item type and player.

  • Defaults:
    • Objects: 1
    • Map Icons: 1
    • 3D Text Labels: 1
  • This controls the frequency of all items streamed in chunks (objects, map icons, and 3D text labels).
  • Use Streamer_SetChunkSize to set the chunk size.

  • Parameters:
  • Returns:
    • The chunk size.

Gets the current chunk size for the specified item type and player.


  • Parameters:
  • Returns:
    • 0 on failure, 1 on success.

Sets the current chunk size for the specified item type.

  • Defaults:
    • Objects: 100
    • Map Icons: 100
    • 3D Text Labels: 100
  • This controls how many items are processed on each chunk tick for all items streamed in chunks (objects, map icons, and 3D text labels).
  • Use Streamer_SetChunkTickRate to set the chunk tick rate.

  • Parameters:
  • Returns:
    • The maximum item amount.

Gets the current maximum item amount (number of items that can be created with the plugin natives) for specified item type.


  • Parameters:
    • type: The item type.
    • items: The maximum item amount (-1 for no imposed limit).
  • Returns:
    • 0 on failure, 1 on success.

Sets the current maximum item amount (number of items that can be created with the plugin natives) for the specified item type.

  • By default, there is no imposed limit (-1).

  • Parameters:
    • type: The item type.
    • playerid: The player ID.
  • Returns:
    • The visible item amount.

Gets the current visible item amount (number of items that can be streamed) for the specified item type and player.


  • Parameters:
    • type: The item type.
    • items: The visible item amount.
    • playerid: The player ID.
  • Returns:
    • 0 on failure, 1 on success.

Sets the current visible item amount (number of items that can be streamed) for the specified item type and player.

  • Defaults:
    • Objects: 500
    • Pickups: 4096
    • Map Icons: 100
    • 3D Text Labels: 1024
  • This native cannot be used with checkpoints, race checkpoints, or areas.

  • Parameters:
    • type: The item type.
    • multiplier: The float multiplier.
    • playerid: The player ID.
  • Returns:
    • 0 on failure, 1 on success.

Gets the current streaming radius multiplier for the specified item type and player.


  • Parameters:
    • type: The item type.
    • multiplier: The float multiplier.
    • playerid: The player ID.
  • Returns:
    • 0 on failure, 1 on success.

Sets the current streaming radius multiplier for the specified item type and player.

  • By default, the streaming radius multiplier is 1.0 for all players.
  • For example, a radius multiplier of 0.5 will reduce the streaming radius of all items of the type specified by half. This will require the player to be twice as close as normal before the item will begin to stream.

  • Parameters:
  • Returns:
    • 0 on failure, 1 on success.

Gets the item type priority (order in which items will be streamed).


  • Parameters:
  • Returns:
    • 0 on failure, 1 on success.

Sets the item type priority (order in which items will be streamed).

  • By default, the order is: areas, objects, checkpoints, race checkpoints, map icons, 3D text labels, pickups, and actors.

  • Parameters:
    • distance: The cell distance.
  • Returns:
    • 1.

Gets the current cell distance.


  • Parameters:
    • distance: The cell distance.
  • Returns:
    • 1.

Sets the current cell distance.

  • Default: 600.0.
  • This value is used to determine whether or not an item needs to be put in a cell for spatial indexing purposes. If an item's streaming distance (or, in the case of areas, an item's size) exceeds that of the cell distance, it will be streamed from any point on the map.
  • For example, if a map icon's streaming distance is set to 100.0, it will only be visible if the player is in the same cell as the map icon or in an adjacent cell (assuming the default cell distance of 600.0 has not been changed). However, if the map icon's streaming distance is set to 1000.0, it will be visible no matter where the player is.
  • In most cases, this value should not be changed. A reason to increase the cell distance would be if there are large numbers of items with streaming distances that exceed 600.0, but the scripter still desires to keep them within cells to benefit from spatial indexing.
  • The cell size might need to be adjusted as well. See the documentation for Streamer_SetCellSize.
  • This native rebuilds the grid, so use it only when necessary.

  • Parameters:
    • size: The cell size.
  • Returns:
    • 1.

Gets the current cell size.


  • Parameters:
    • size: The cell size.
  • Returns:
    • 1.

Sets the current cell size.

  • Default: 300.0.
  • This value determines the size of each cell in the grid.
  • In most cases, this value should not be changed. A reason to increase the cell size would be if the cell distance has changed. See the documentation for Streamer_SetCellDistance.
  • A good cell size is approximately half of the cell distance.
  • The larger the cell size is, the less efficient the grid will become at spatial indexing.
  • This native rebuilds the grid, so use it only when necessary.

  • Parameters:
    • type: The item type.
    • id: The item ID.
    • toggle: 0 to turn off, 1 to turn on.
  • Returns:
    • 0 on failure, 1 on success.

Toggles whether an item is static.

  • If the item is static, all distance checks will be omitted, and the item will take priority over non-static items.
  • This has the same effect as specifying a negative streaming distance. When this is turned on, the item's streaming distance will change to a negative value. When it is turned off, the item's streaming distance will be restored.

  • Parameters:
  • Returns:
    • 0 or 1.

Returns whether Streamer_ToggleItemStatic is turned on.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • toggle: 0 to turn off, 1 to turn on.
  • Returns:
    • 0 on failure, 1 on success.

Toggles whether the per-item area functionality (used via the areaid or areas parameters) is used to exclude items from being streamed if they are within the areas specified.


  • Parameters:
  • Returns:
    • 0 or 1.

Returns whether Streamer_ToggleItemInvAreas is turned on.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • toggle: 0 to turn off, 1 to turn on.
  • Returns:
    • 0 on failure, 1 on success.

Toggles the callbacks (Streamer_OnItemStreamIn and Streamer_OnItemStreamOut) for the specified item.

  • By default, this is turned off for each item.

  • Parameters:
  • Returns:
    • 0 or 1.

Returns whether Streamer_ToggleItemCallbacks is enabled for the specified item.


  • Parameters:
    • toggle: 0 to turn off, 1 to turn on.
  • Returns:
    • 1.

Toggles the error callback (Streamer_OnPluginError).

  • If the error callback is enabled, the script will be able to handle all error messages as soon as they occur.
  • This could be particularly useful in combination with the PrintAmxBacktrace native provided by the CrashDetect plugin, which would allow the script to pinpoint exactly where the error occurred.
  • While the error callback is enabled, no messages will be printed by the plugin, but they will be passed to the callback.

  • Parameters:
    • None.
  • Returns:
    • 0 or 1.

Returns whether Streamer_ToggleErrorCallback is enabled.


  • Parameters:
    • toggle: 0 to turn off, 1 to turn on.
  • Returns:
    • 0 on failure, 1 on success.

Toggles whether items are destroyed from the script this native is called from automatically.

  • By default, this is turned on for every script.
Clone this wiki locally