Natives (Miscellaneous) - samp-incognito/samp-streamer-plugin GitHub Wiki
Home ▸ Natives ▸ Miscellaneous
Streamer_GetDistanceToItem(Float:x, Float:y, Float:z, type, id, &Float:distance, dimensions = 3)
- 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 (2or3).- Returns:
0on failure,1on success.
Gets the distance from a game world point to an item.
Streamer_ToggleItem(playerid, type, id, toggle)
- Parameters:
playerid: The player ID.type: The item type.id: The item ID.toggle:0to turn off,1to turn on.- Returns:
0on failure,1on success.
Toggles an item for the specified player and item.
Streamer_IsToggleItem(playerid, type, id)
- Parameters:
playerid: The player ID.type: The item type.id: The item ID.- Returns:
0or1.
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:0to turn off,1to turn on.exceptions[]: The exceptions.maxexceptions: The size of the exceptions (size ofexceptionsby default).
- Returns:
0on failure,1on success.
Toggles all items for the specified player and item type.
- Any areas specified in
exceptionswill be excluded from being toggled.
Streamer_GetItemInternalID(playerid, type, streamerid)
- 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).
Streamer_GetItemStreamerID(playerid, type, internalid)
- 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).
Streamer_IsItemVisible(playerid, type, id)
- Parameters:
playerid: The player ID.type: The item type.id: The item ID.- Returns:
0or1.
Returns whether an item is currently streamed in for the specified player and item type.
Streamer_DestroyAllVisibleItems(playerid, type, serverwide = 1)
- Parameters:
playerid: The player ID.type: The item type.serverwide:0for the current script,1for all scripts.- Returns:
0on failure,1on success.
Destroys all items streamed in for the specified player and item type.
Streamer_CountVisibleItems(playerid, type, serverwide = 1)
- Parameters:
playerid: The player ID.type: The item type.serverwide:0for the current script,1for all scripts.- Returns:
- Number of visible items.
Counts all items streamed in for the specified player and item type.
Streamer_DestroyAllItems(type, serverwide = 1)
- Parameters:
type: The item type.serverwide:0for the current script,1for all scripts.- Returns:
0on failure,1on success.
Destroys all created items of the specified item type.
Streamer_CountItems(type, serverwide = 1)
- Parameters:
type: The item type.serverwide:0for the current script,1for all scripts.- Returns:
- Number of created items.
Counts all created items of the specified item type.
- This differs from
Streamer_GetUpperBoundin 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 ofitemsby default).range: The maximum distance from the given position to search for items (300.0by default).worldid: The virtual world ID.- Returns:
- Number of found items (not limited by the
maxitemsargument).
Searches for items around a specific position, sorts them by distance, and stores the result.
Streamer_GetAllVisibleItems(playerid, type, items[], maxitems = sizeof items)
- Parameters:
playerid: The player ID.type: The item type.items: The stored items.maxitems: The size of the stored items (size ofitemsby default).- Returns:
- Number of found items (not limited by the
maxitemsargument).
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
GetPlayerVisibleDynamicCPorGetPlayerVisibleDynamicRaceCP. - To get the areas the player is currently in, use
GetPlayerDynamicAreas.
Streamer_GetItemPos(type, id, &Float:x, &Float:y, &Float:z)
- Parameters:
type: The item type.id: The item ID.x: The X offset.y: The Y offset.z: The Z offset.- Returns:
0on failure,1on success.
Gets position for the specified item.
Streamer_SetItemPos(type, id, Float:x, Float:y, Float:z)
- Parameters:
type: The item type.id: The item ID.x: The X offset.y: The Y offset.z: The Z offset.- Returns:
0on failure,1on success.
Sets position for the specified item.
Streamer_GetItemOffset(type, id, &Float:x, &Float:y, &Float:z)
- Parameters:
type: The item type.id: The item ID.x: The X offset.y: The Y offset.z: The Z offset.- Returns:
0on failure,1on success.
Gets offset for the specified item.
Streamer_SetItemOffset(type, id, Float:x, Float:y, Float:z)
- Parameters:
type: The item type.id: The item ID.x: The X offset.y: The Y offset.z: The Z offset.- Returns:
0on failure,1on 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.