-
Notifications
You must be signed in to change notification settings - Fork 93
Natives (Miscellaneous)
Home ▸ Natives ▸ Miscellaneous
- Parameters:
x
: The game world X coordinate.y
: The game world Y coordinate.z
: The game world Z coordinate.type
: The item type.id
: The item ID.distance
: The stored distance.dimensions
: The number of dimensions to be used in the distance calculation (2
or3
).- Returns:
0
on failure,1
on success.
Gets the distance from a game world point to an item.
- Parameters:
playerid
: The player ID.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 an item for the specified player and item type.
- Parameters:
playerid
: The player ID.type
: The item type.id
: The item ID.- Returns:
0
or1
.
Returns whether Streamer_ToggleItem
is turned on for the specified player and item.
Streamer_ToggleAllItems(playerid, type, toggle, exceptions[] = { -1 }, maxexceptions = sizeof exceptions)
- Parameters:
playerid
: The player ID.type
: The item type.toggle
:0
to turn off,1
to turn on.exceptions[]
: The exceptions.maxexceptions
: The size of the exceptions (size ofexceptions
by default).
- Returns:
0
on failure,1
on success.
Toggles all items for the specified player and item type.
- Any areas specified in
exceptions
will be excluded from being toggled.
- Parameters:
playerid
: The player ID.type
: The item type.streamerid
: The streamer ID.- Returns:
- The internal ID.
Returns the internal ID (assigned by the SA-MP server) from the specified player, item type, and streamer ID (assigned by the server plugin).
- Parameters:
playerid
: The player ID.type
: The item type.internalid
: The internal ID.- Returns:
- The streamer ID.
Returns the streamer ID (assigned by the server plugin) from the specified player, item type, and internal ID (assigned by the SA-MP server).
- Parameters:
playerid
: The player ID.type
: The item type.id
: The item ID.- Returns:
0
or1
.
Returns whether an item is currently streamed in for the specified player and item type.
- Parameters:
playerid
: The player ID.type
: The item type.serverwide
:0
for the current script,1
for all scripts.- Returns:
0
on failure,1
on success.
Destroys all items streamed in for the specified player and item type.
- Parameters:
playerid
: The player ID.type
: The item type.serverwide
:0
for the current script,1
for all scripts.- Returns:
- Number of visible items.
Counts all items streamed in for the specified player and item type.
- Parameters:
type
: The item type.serverwide
:0
for the current script,1
for all scripts.- Returns:
0
on failure,1
on success.
Destroys all created items of the specified item type.
- Parameters:
type
: The item type.serverwide
:0
for the current script,1
for all scripts.- Returns:
- Number of created items.
Counts all created items of the specified item type.
- This differs from
Streamer_GetUpperBound
in that it returns the the number of items that have been created and not the highest ID. It should not be used for iteration purposes.
Streamer_GetNearbyItems(Float:x, Float:y, Float:z, type, items[], maxitems = sizeof items, Float:range = 300.0, worldid = -1)
- Parameters:
x
: The game world X coordinate.y
: The game world Y coordinate.z
: The game world Z coordinate.type
: The item type.items
: The stored items.maxitems
: The size of the stored items (size ofitems
by default).range
: The maximum distance from the given position to search for items (300.0
by default).worldid
: The virtual world ID.- Returns:
- Number of found items (not limited by the
maxitems
argument).
Searches for items around a specific position, sorts them by distance, and stores the result.
- Parameters:
playerid
: The player ID.type
: The item type.items
: The stored items.maxitems
: The size of the stored items (size ofitems
by default).- Returns:
- Number of found items (not limited by the
maxitems
argument).
Obtains all items currently visible to the player, sorts them by distance, and stores the result.
- To get the currently visible checkpoint or race checkpoint, use
GetPlayerVisibleDynamicCP
orGetPlayerVisibleDynamicRaceCP
. - To get the areas the player is currently in, use
GetPlayerDynamicAreas
.
- Parameters:
type
: The item type.id
: The item ID.x
: The X offset.y
: The Y offset.z
: The Z offset.- Returns:
0
on failure,1
on success.
Gets position for the specified item.
- Parameters:
type
: The item type.id
: The item ID.x
: The X offset.y
: The Y offset.z
: The Z offset.- Returns:
0
on failure,1
on success.
Sets position for the specified item.
- Parameters:
type
: The item type.id
: The item ID.x
: The X offset.y
: The Y offset.z
: The Z offset.- Returns:
0
on failure,1
on success.
Gets offset for the specified item.
- Parameters:
type
: The item type.id
: The item ID.x
: The X offset.y
: The Y offset.z
: The Z offset.- Returns:
0
on failure,1
on success.
Sets offset for the specified item.
- This offset will be applied to the item's position when distances are being checked during the streaming process. It will not affect the item's actual position after it has been streamed.
- MapIcons, Objects, and 3DTextLabels can only be offsetted with a Chunk Streaming enabled