Problem with agrument reading
Hi,
I'm making a plugin that will work as a clan chat (a private chat system for clan members only) I'm having problems with reading the first argument of the command amx_clansay <Message>, which I bound to "messagemode amx_clansay". Everytime I use it, it keeps resulting in the same error: Usage: amx_clansay <Message> I'm desperate (Ive been looking for hours and hours), and I can't find where I'm wrong; maybe you guys can find it. I'm guessing it's something to do with "read_argv(1, argSay, 255);" Here's a the part of the code that needs attention: Code:
#include <amxmodx>Many thanks in advance. Steve |
Re: Problem with agrument reading
I think you have to write the message in "" with this way...
You could try to do a for-loop and get all the arguments(the single words of the message) This let you get the number of arguments (words) Code:
get_msg_args() |
Re: Problem with agrument reading
1) use get_players(). NEVER use get_maxplayers() like that again.
2) use read_args(). read_argv(1, ...) gets the first argument. |
Re: Problem with agrument reading
Quote:
You won the thread :mrgreen: |
Re: Problem with agrument reading
Hi,
Still didn't work. It works when I use it with more than 1 parameters, but it has to work with only 1 too. I copied a part from my console (client side): Code:
Type 'amx_help' in the console to see available commandsNow changed code code to: Code:
#include <amxmodx> |
Re: Problem with agrument reading
Actually it ONLY works when you use it with more than (or equal to) 2 arguments.
PHP Code:
|
Re: Problem with agrument reading
lol. Yeah that makes sens, in fact it works now perfect =) Thanks loads :)
|
| All times are GMT -4. The time now is 10:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.