---
title: "numargs | open.mp"
description: "Get the number of arguments passed to a function."
canonical: https://omp.itsneufox.com/th/docs/scripting/functions/numargs
language: th
---

# numargs

## คำอธิบาย

Get the number of arguments passed to a function.

| Name | Description |
| --- | --- |

## ตัวอย่าง

```c
SomeFunction(...)
{
    printf("numargs(): %i", numargs());
}

public OnFilterScriptInit()
{
    SomeFunction(1, 2, 3);
}

// Output: "numargs(): 3"
// Because 3 parameters (1, 2, 3) were passed.
```

## ฟังก์ชั่นที่เกี่ยวข้องกัน

-   [getarg](https://omp.itsneufox.com/th/docs/scripting/functions/getarg): Retrieve an argument from a variable argument list.
-   [setarg](https://omp.itsneufox.com/th/docs/scripting/functions/setarg): Set an argument.
