AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Command Arguments (https://forums.alliedmods.net/showthread.php?t=183194)

Liverwiz 04-18-2012 17:53

Command Arguments
 
I'm having troubles figuring out the get_arg variant functions. I need to get all the arguments that were passed through console from a specific command.

read_argv(id, arg, 127) seems to only be giving me the first argument in the string while
read_args(cmd, 127) doesn't seem to give me anything at all.

what gives? I noticed get_args doesn't have an ID of the user to grab the command from, so it just doesn't do anything?

Artifact 04-18-2012 17:57

Re: Command Arguments
 
amx_transfer = first arg (id is 0)
PHP Code:

new arg[500]
get_argv(0arg499

<name> = second arg (id is 1)
PHP Code:

get_argv(1arg30

<team> = thirt arg (id is 2)
PHP Code:

get_argv(2arg6

I think you get it..

amx_transfer is just example, you dont need to catch arg 0, just register command in plugin init

Liverwiz 04-18-2012 18:12

Re: Command Arguments
 
OH! so the id isn't the player's id, its which argument you want to grab?

that makes more sense as to where you'd use read_argc

much thanks!


All times are GMT -4. The time now is 07:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.