{"hash":"0xDD75460A","ns":"CFX","name":"CREATE_VEHICLE","slug":"CREATE_VEHICLE","official":true,"named":true,"luaName":"CreateVehicle","game":"cfx","apiset":"server","returnType":"Entity","params":[{"name":"modelHash","type":"Hash","description":"The model of vehicle to spawn."},{"name":"x","type":"float","description":"Spawn coordinate X component."},{"name":"y","type":"float","description":"Spawn coordinate Y component."},{"name":"z","type":"float","description":"Spawn coordinate Z component."},{"name":"heading","type":"float","description":"Heading to face towards, in degrees."},{"name":"isNetwork","type":"BOOL","description":"Whether to create a network object for the vehicle. If false, the vehicle exists only locally."},{"name":"netMissionEntity","type":"BOOL","description":"Whether to register the vehicle as pinned to the script host in the R\\* network model."}],"returnsDescription":"A script handle (fwScriptGuid index) for the vehicle, or `0` if the vehicle failed to be created.","summary":"Creates a vehicle with the specified model at the specified position.","descriptions":[{"source":"cfx","format":"md","body":"Creates a vehicle with the specified model at the specified position. This vehicle will initially be owned by the creating\nscript as a mission entity, and the model should be loaded already (e.g. using REQUEST_MODEL).\n\n```\nNativeDB Added Parameter 8: BOOL p7\n```\n\n**This is the server-side RPC native equivalent of the client native [CREATE_VEHICLE](?\\_0xAF35D0D2583051B0).**"}],"examples":[],"aliases":[],"enums":[],"related":[],"sources":["cfx"],"doc":2,"url":"https://natives.borderlinerp.com/natives/CFX/CREATE_VEHICLE","markdownUrl":"https://natives.borderlinerp.com/natives/CFX/CREATE_VEHICLE.md","snippets":{"lua":"local retval = CreateVehicle(modelHash, x, y, z, heading, isNetwork, netMissionEntity)","luaInvoke":"local retval = Citizen.InvokeNative(0xdd75460a, modelHash, x, y, z, heading, isNetwork, netMissionEntity, Citizen.ResultAsInteger())","js":"const retval = CreateVehicle(modelHash, x, y, z, heading, isNetwork, netMissionEntity);","jsInvoke":"const retval = Citizen.invokeNative('0xdd75460a', modelHash, x + 0.0000001, y + 0.0000001, z + 0.0000001, heading + 0.0000001, isNetwork, netMissionEntity, Citizen.returnResultAnyway(), Citizen.resultAsInteger());","csharp":"int retval = Function.Call<int>((Hash)0xdd75460a, modelHash, x, y, z, heading, isNetwork, netMissionEntity);","notes":["Hash parameters: the named function also accepts a string and hashes it for you; `Citizen.InvokeNative` needs the number — pass `joaat(\"name\")` or a backtick literal like `` `name` ``.","Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason."]}}