Raised This Month: $ Target: $400
 0% 

Command Arguments


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 04-18-2012 , 17:53   Command Arguments
Reply With Quote #1

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?

Last edited by Liverwiz; 04-18-2012 at 18:13. Reason: lets make our commands proper, shall we?
Liverwiz is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 04-18-2012 , 17:57   Re: Command Arguments
Reply With Quote #2

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
__________________

Last edited by Artifact; 04-18-2012 at 17:58.
Artifact is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 04-18-2012 , 18:12   Re: Command Arguments
Reply With Quote #3

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!
Liverwiz is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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