Quote:
|
Originally Posted by VEN
Reread what he said:
Quote:
|
Let's say an admin uses (say / team_say) following command "/10 20 30".
|
|
Quote:
|
Originally Posted by Wolle
Well that's not really what I meant.
What exactly is the "ID"?
The docs say "0" returns the command. What command? Is "/" the command?
And everything after "0" is arguments.
So let's say if "/num" is the command, "0" returns "/num" or "num"? Will I need to register "/num" as a command first?
Let's assume an admin "say"s or "team_say"s this "/num 10 20 30".
"read_argv( 0 ..." holds "/num" right? And "read_argv( 1 ..." holds "10" and "read_argv( 2 ..." holds "20" and so on right?
I know it doesn't but that's how I understand the docs. What am I missing?
|
Code:
public checktext(id)
{
new arg[4], arg1[4], arg2[4], arg3[4]
read_argv(1, arg, 3)
read_argv(2, arg1, 3)
read_argv(3, arg2, 3)
if (equali(arg, "/num")) // Check first argument after the /say command
{
new r = str_to_num(arg1)
new g = str_to_num(arg2)
new b = str_to_num(arg3)
//etc function
}
}
if you do a read_argv(0, example, 3) it will return the /say /say_team command. So you want to start at 1 and on.
Well you read it so fix it. k?
__________________