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 commands
Time Left: 29:10 min. Next Map: cs_militia_cz
Usage: amx_clansay <Message> -----> Used this with "messagemode amx_clansay"
] amx_clansay yo
Usage: amx_clansay <Message>
] amx_clansay "yo"
Usage: amx_clansay <Message>
] amx_clansay yo yo
[Clan] ``TeamDW| Lumos: yo yo
] amx_clansay "yo" 0
[Clan] ``TeamDW| Lumos: "yo" 0
] amx_clansay "yo yo"
Usage: amx_clansay <Message>
Tried with get_msg_args, but then resulted in compile err "undefined symbol"
Now changed code code to:
Code:
#include <amxmodx>
#include <amxmisc>
#define ADM_LEVEL ADMIN_LEVEL_H
#define msgPrefix "[Clan]"
#define Color "^x04" // Green
new gSayText;
public plugin_init(){
register_plugin("Clan Chat", "1.0.23", "mCoDev Systems");
register_concmd("amx_clansay", "do_clansay", ADM_LEVEL, " <Message>");
//register_concmd("amx_clantsay", "do_clantsay", ADM_LEVEL, " <Message>");
//register_concmd("amx_clansayall", "do_clansayall", ADM_LEVEL, " <Message>");
gSayText = get_user_msgid("SayText");
return PLUGIN_HANDLED;
}
public do_clansay(id, level, cid){
new argSay[255]; // Hold argument
new tMsg[256]; // Hold new message
new pName[33]; // Hold playername
new pid; // Hold player ID, Hold counter
new p = get_maxplayers();
if (!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED;
read_args(argSay, 254);
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)){
server_print("(%i) %s %s: %s", pid, msgPrefix, pName, argSay);
client_print(pid, print_console, "%s %s: %s", msgPrefix, pName, argSay);
message_begin(MSG_ONE, gSayText, {0,0,0}, pid);
write_byte(pid);
write_string(tMsg);
message_end();
}
}
}
return PLUGIN_HANDLED;
}
Thanks.