Getarg

From SA-MP Wiki

Jump to: navigation, search

getarg

Image:Farm-Fresh text lowercase.png Note: This function name starts with a lowercase letter.


Description:

Get an argument that was passed to a function.


Parameters:
(arg, index=0)
argThe argument sequence number. Use 0 for first argument.
indexThe index (in case the argument is an array).


Return Values:

The value of the argument.


Example Usage:

SomeFunc(...)
{
    printf("%i", getarg(3));
}
 
public OnFilterScriptInit()
{
    SomeFunc(1, 3, 3, 7);
}
 
// Output: 7. The fourth argument (index 3) is 7.

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

  • numargs: Return the number of arguments.
  • setarg: Set an argument.
Personal tools
Navigation
Toolbox