Skip to content

Natives (Data Manipulation)

samp-incognito edited this page Apr 13, 2021 · 20 revisions

HomeNativesData Manipulation

  • Parameters:
    • type: The item type.
    • id: The item ID.
    • data: The item data (from the enum).
    • result: The stored result.
  • Returns:
    • 0 on failure, 1 on success.

Gets float data from an item.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • data: The item data (from the enum).
    • value: The set value.
  • Returns:
    • 0 on failure, 1 on success.

Sets float data for an item.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • data: The item data (from the enum).
  • Returns:
    • The integer data.

Gets integer data from an item.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • data: The item data (from the enum).
    • value: The set value.
  • Returns:
    • 0 on failure, 1 on success.

Sets integer data for an item.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • data: The item data (from the enum).
    • dest[]: The stored array data.
    • maxdest: The size of the stored array data (size of dest by default).
  • Returns:
    • 0 on failure, 1 on success.

Gets array data for an item. Only works for E_STREAMER_AREA_ID, E_STREAMER_EXTRA_ID, E_STREAMER_INTERIOR_ID, E_STREAMER_PLAYER_ID and E_STREAMER_WORLD_ID.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • data: The item data (from the enum).
    • dest[]: The set array data.
    • maxdest: The size of the set array data (size of dest by default).
  • Returns:
    • 0 on failure, 1 on success.

Sets array data for an item. Only works for E_STREAMER_AREA_ID, E_STREAMER_EXTRA_ID, E_STREAMER_INTERIOR_ID, E_STREAMER_PLAYER_ID and E_STREAMER_WORLD_ID.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • data: The item data (from the enum).
    • value: The value to search in the array.
  • Returns:
    • 0 or 1.

Returns whether a value is in an array for an item. Only works for E_STREAMER_AREA_ID, E_STREAMER_EXTRA_ID, E_STREAMER_INTERIOR_ID, E_STREAMER_PLAYER_ID and E_STREAMER_WORLD_ID.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • data: The item data (from the enum).
    • value: The value to append to the array.
  • Returns:
    • 0 on failure, 1 on success.

Appends a value to an array for an item. Only works for E_STREAMER_AREA_ID, E_STREAMER_EXTRA_ID, E_STREAMER_INTERIOR_ID, E_STREAMER_PLAYER_ID and E_STREAMER_WORLD_ID.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • data: The item data (from the enum).
    • value: The value to remove from the array.
  • Returns:
    • 0 on failure, 1 on success.

Removes a value from an array for an item. Only works for E_STREAMER_AREA_ID, E_STREAMER_EXTRA_ID, E_STREAMER_INTERIOR_ID, E_STREAMER_PLAYER_ID and E_STREAMER_WORLD_ID.


  • Parameters:
    • type: The item type.
    • id: The item ID.
    • data: The item data (from the enum).
  • Returns:
    • The length of the array data.

Gets the length of an array for an item. Only works for E_STREAMER_AREA_ID, E_STREAMER_EXTRA_ID, E_STREAMER_INTERIOR_ID, E_STREAMER_PLAYER_ID and E_STREAMER_WORLD_ID.


  • Parameters:
  • Returns:
    • The upper bound.

Gets the upper bound (highest ID) for an item type.

  • This differs from Streamer_CountItems in that it returns the highest ID and not just the number of items that have been created. This makes it useful for iteration purposes.

Examples

  • Change a pickup's model ID:
    Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_MODEL_ID, 1212);
  • Store extra IDs for an object:
    new extraIDs[3] = { 1, 2, 3 };
    Streamer_SetArrayData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_EXTRA_ID, extraIDs);
Clone this wiki locally