Quote:
Originally Posted by ehha
How can I tell the difference between the values of the 2nd argument, for example:
-amx_slap ehha 0
-amx_slap ehha
I want to make a concmd that does:
-something1 if 2nd arg is 0
-something2 if 2nd arg is not present
-something3 if 2nd arg is > 0
-nothing if 2nd arg is < 0
So how can I tell if the 2nd is 0 or nothing?
Thank you in advance.
|
read_argc returns the number of arguments that were passed. You then use read_argv to get the value.
http://www.amxmodx.org/funcwiki.php?go=func&id=175
PHP Code:
//command passed with no arguments
switch ( read_argc() )
{
case 1: //command passed with no arguments
case 2: //command passsed with 1 argument
case 3: //etc
}
read_argv ( arg# , output_string[], len )
__________________