# SModularVehicle

**الأعضاء** 12

|       |                                     |                                                                                               |
| ----- | ----------------------------------- | --------------------------------------------------------------------------------------------- |
| دالة  | [ForceSetOwner](#forcesetowner)     | Force player of the id owned this vehicle, but only between this spawned vehicle.             |
| دالة  | [ForceActivate](#forceactivate)     | Force player drive on this vehicle                                                            |
| دالة  | [ForceDeactivate](#forcedeactivate) | Force player out of the vehicle.                                                              |
| دالة  | [SuppressTimeout](#suppresstimeout) | Disable the vehicle automatic respawn                                                         |
| دالة  | [OverrideOnClick](#overrideonclick) | Add onClick method to this vehicle,onClick have to be a closure.                              |
| خاصية | [VerticalInput](#verticalinput)     | Force vertical offset value, it would be added to vertical control and never set to zero.     |
| خاصية | [HorizontalInput](#horizontalinput) | Force horizontal offset value, it would be added to horizontal control and never set to zero. |
| خاصية | [StrafeInput](#strafeinput)         | Force strafe offset value,it would be added to strafe control and never set to zero.          |
| خاصية | [DepthInput](#depthinput)           | Force depth offset value, it would be added to depth control and never set to zero.           |
| خاصية | [IgnoreUserInput](#ignoreuserinput) | If this option is enabled, user input would be ignored until disable this.                    |
| خاصية | [Driver](#driver)                   | Get the player avatar component.                                                              |
| خاصية | [GameObject](#gameobject)           | Returns the GameObject of this Vehicle component.                                             |

## الدوال

### ForceSetOwner

void ForceSetOwner(int newOwner, int vehicleId)

Force player of the id owned this vehicle, but only between this spawned vehicle. But it seems the new owner can’t drive on this vehicle.

المعاملات

| الاسم     | النوع | القيمة الافتراضية |
| --------- | ----- | ----------------- |
| newOwner  | int   | –                 |
| vehicleId | int   | –                 |

القيم المرجعة

`void`

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Vehicle.ForceSetOwner(AvatarID)

```

### ForceActivate

void ForceActivate()

Force player drive on this vehicle

القيم المرجعة

`void`

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Vehicle.ForceActivate()

```

### ForceDeactivate

void ForceDeactivate()

Force player out of the vehicle.

القيم المرجعة

`void`

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Vehicle.ForceDeactivate()

```

### SuppressTimeout

void SuppressTimeout()

Disable the vehicle automatic respawn

القيم المرجعة

`void`

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Vehicle.SuppressTimeout()

```

### OverrideOnClick

void OverrideOnClick(Closure onClick)

Add onClick method to this vehicle,onClick have to be a closure.

المعاملات

| الاسم   | النوع   | القيمة الافتراضية |
| ------- | ------- | ----------------- |
| onClick | Closure | –                 |

القيم المرجعة

`void`

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Vehicle.OverrideOnClick(NewOnClickFunction)

```

## الخصائص

### VerticalInput

float VerticalInput {get; set; }

Force vertical offset value, it would be added to vertical control and never set to zero.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Vehicle.VerticalInput = 0.5

```

### HorizontalInput

float HorizontalInput {get; set; }

Force horizontal offset value, it would be added to horizontal control and never set to zero.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Vehicle.HorizontalInput = 0.5

```

### StrafeInput

float StrafeInput {get; set; }

Force strafe offset value,it would be added to strafe control and never set to zero.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Vehicle.StrafeInput = 0.5

```

### DepthInput

float DepthInput {get; set; }

Force depth offset value, it would be added to depth control and never set to zero.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Vehicle.DepthInput = 0.5

```

### IgnoreUserInput

bool IgnoreUserInput {get; set; }

If this option is enabled, user input would be ignored until disable this.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.Vehicle.IgnoreUserInput = true

```

### Driver

[SAvatar](/docs/ar/scripting/client-scripting-api-reference/types/savatar.md) Driver {get; }

Get the player avatar component.

مثال

**Lua**

```lua
DriverAvatar = Space.Host.ExecutingObject.Vehicle.Driver

```

### GameObject

[SGameObject](/docs/ar/scripting/client-scripting-api-reference/types/sgameobject.md) GameObject {get; }

Returns the GameObject of this Vehicle component.

مثال

**Lua**

```lua
VehicleGameObject = Space.Host.ExecutingObject.Vehicle.GameObject

```
