SetVehicleHandling

From Multi Theft Auto: Wiki
Revision as of 19:42, 6 May 2011 by Qaisjp (talk | contribs)
Jump to navigation Jump to search

This function can set a vehicle's handling.

*Note: This function is still not implemented in the nightly, and is currently only implemented in the handling branch!

Syntax

bool setVehicleHandling(element theVehicle, string prop int/float/bool/table value) 

Required Arguments

  • theVehicle: The vehicle you wish to set the handling of. - This must be an element.
  • prop: The property you wish to set the handling of the vehicle to. - This must be a string
  • value: The value of the property you wish to set the handling of the vehicle to. This must be an integer, float, boolean or a table.

Returns

Returns true if the handling was set successfully, false otherwise.

Example

function massChange(me, command, mass)
   veh = getPedOccupiedVehicle(me) -- get the ped's occupied vehicle
   if speed and veh then  -- if the mass is given and has a veh
       setVehicleHandling(veh, "mass", tonumber(mass)) -- set handling
   end
end

addCommandHandler("changemass", massChange)

See other vehicle functions