Skip to content

Natives

dotSILENT edited this page Jan 16, 2019 · 8 revisions

List of natives

GetHandlingAttribType(CHandlingAttrib:attribute)

Returns the type of the handling attribute, can be used for example when fetching data from a database, to know which function to call.


IsPlayerUsingCHandling(playerid)

  • Parameters
    • playerid The id of the player
  • Returns
    • true if player has the chandling plugin or false if not

Checks if the player is capable of handling modifications. Although it should work already under OnPlayerConnect, I don't advise using it that early (it should be okay though).


ResetModelHandling(modelid)

  • Parameters
    • modelid Vehicle model id
  • Returns
    • false on failure or when model has no handling modifications, true on success

Resets the handling for a particular model to it's defaults

  • IMPORTANT: This also resets the handling for every vehicle of the same model, but not for those that have per-vehicle handling mods applied. These have their own copy of the handling and need to be reset manually.

ResetVehicleHandling(vehicleid)

  • Parameters
    • vehicleid ID of the vehicle
  • Returns
    • false on failure or when vehicle has no handling modifications, true on success

Resets the handling for a particular vehicle to it's current model handling (not the original handling!)


SetVehicleHandlingFloat(vehicleid, CHandlingAttrib:attribute, Float:value)

  • Parameters
    • vehicleid ID of the vehicle
    • attribute Handling attribute to set
    • value Value to set
  • Returns
    • false on failure, true on success

Sets a handling attribute of specified vehicle to a float value (use it only for attributes of TYPE_FLOAT)


SetVehicleHandlingInt(vehicleid, CHandlingAttrib:attribute, value)

  • Parameters
    • vehicleid ID of the vehicle
    • attribute Handling attribute to set
    • value Value to set
  • Returns
    • false on failure, true on success

Sets a handling attribute of specified vehicle to an integer value (use it only for attributes of TYPE_UINT, TYPE_FLAG and TYPE_BYTE)


GetVehicleHandlingFloat(vehicleid, CHandlingAttrib:attribute, &Float:result)

  • Parameters
    • vehicleid ID of the vehicle
    • attribute Handling attribute to set
    • result Variable in which the value will be stored
  • Returns
    • false on failure, true on success

Gets value of specified handling attribute and stores it in the result variable

  • Example:
new Float:val;
GetVehicleHandling(GetPlayerVehicleID(playerid), HANDL_FDRAGMULTIPLIER, val);
SetVehicleHandling(GetPlayerVehicleID(playerid), HANDL_FDRAGMULTIPLIER, val*0.98); // decrease the drag multiplier

GetVehicleHandlingInt(vehicleid, CHandlingAttrib:attribute, &result)

  • Parameters
    • vehicleid ID of the vehicle
    • attribute Handling attribute to set
    • result Variable in which the value will be stored
  • Returns
    • false on failure, true on success

Gets value of specified handling attribute and stores it in the result variable


SetModelHandlingFloat(modelid, CHandlingAttrib:attribute, Float:value)

  • Parameters
    • modelid The model ID
    • attribute Handling attribute to set
    • value The float value to set
  • Returns
    • false on failure, true on success

Sets a handling attribute of the specified model to a float value, use it only for attributes of type TYPE_FLOAT

The change wont affect vehicles that already have any handling modifications (SetVehicleHandling...), because they are using their own copy of the (previous) model handling. For that reason, SetModelHandling functions should be used only in OnGameModeInit.


SetModelHandlingInt(modelid, CHandlingAttrib:attribute, value)

  • Parameters
    • modelid The model ID
    • attribute Handling attribute to set
    • value The integer value to set
  • Returns
    • false on failure, true on success

Sets a handling attribute of the specified model to a integer value (use it only for attributes of TYPE_UINT, TYPE_FLAG and TYPE_BYTE)

The change wont affect vehicles that already have any handling modifications (SetVehicleHandling...), because they are using their own copy of the (previous) model handling. For that reason, SetModelHandling functions should be used only in OnGameModeInit.


GetModelHandlingFloat(modelid, CHandlingAttrib:attribute, &Float:result)

  • Parameters
    • modelid The model ID
    • attribute Handling attribute to get
    • result Variable in which the value will be stored
  • Returns
    • false on failure, true on success

Gets value of specified handling attribute from the model and stores it in the result variable


GetModelHandlingInt(modelid, CHandlingAttrib:attribute, &result)

  • Parameters
    • modelid The model ID
    • attribute Handling attribute to get
    • result Variable in which the value will be stored
  • Returns
    • false on failure, true on success

Gets value of specified handling attribute from the model and stores it in the result variable


GetDefaultHandlingFloat(modelid, CHandlingAttrib:attribute, &Float:result)

  • Parameters
    • modelid The model ID
    • attribute Handling attribute to get
    • result Variable in which the value will be stored
  • Returns
    • false on failure, true on success

Gets the original GTA value for specified handling attribute and stores it in the result variable


GetDefaultHandlingInt(modelid, CHandlingAttrib:attribute, &result)

  • Parameters
    • modelid The model ID
    • attribute Handling attribute to get
    • result Variable in which the value will be stored
  • Returns
    • false on failure, true on success

Gets the original GTA value for specified handling attribute and stores it in the result variable