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>
#define ADM_LEVEL ADMIN_LEVEL_H
#define msgPrefix "[Clan]"
#define Color "^x04" // Green
public plugin_init(){
register_plugin("Clan Chat", "1.0.7", "mCoDev Systems");
register_concmd("amx_clansay", "do_clansay", ADM_LEVEL, " <Message>");
return PLUGIN_HANDLED;
}
public do_clansay(id, level, cid){
new argSay[256]; // Hold command argument
new tMsg[256]; // Hold Message
new pName[33]; // Hold playername
new p = get_maxplayers(); // Max players.
new pid; // Hold player id
read_argv(1, argSay, 255);
if (!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED;
get_user_name(id, pName, 32);
format(tMsg, 255, "%s %s %s: %s", Color, msgPrefix, pName, argSay);
for(pid=1; pid <= p; ++pid){
if(get_user_flags(pid) & ADM_LEVEL){
if(is_user_connected(pid)){
print_message(pid, tMsg); // Subroutine print_message.
}
}
}
return PLUGIN_HANDLED;
}
Many thanks in advance.
Steve