Quote:
Originally Posted by fysiks
To read arguments you need to register only "say" and/or "say_team" then filter for the command. When you encounter the command then you can do what you need to do using read_args() and print your message. There are many topics about this and you can find many plugins that already do this. One example is adminchat.sma (with the @ chat commands).
|
Ive Tried It Didnt Go well :
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
#define MAX_CLR 10
new g_msgChannel
new arg[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /arishon %s",arg,"cmdArishon",ADMIN_KICK)
}
public cmdArishon(id, level)
{
new arg[33],message[192],userid = 0,name[32]
read_argv(0, arg, 32)
read_args(message, 191)
remove_quotes(message)
parse(message,32)
new found = 0, a = 0
new lang[11], langnum = get_langsnum()
new length = found
if (++g_msgChannel > 6 || g_msgChannel < 3)
g_msgChannel = 3
get_user_name(id, name, 31)
userid = get_user_userid(id)
set_hudmessage(255, 0, 0, 0.30, 0.19, 0, 6.0, 12.0);new rand
rand = random_num(0,4)
switch (rand)
{
case 3, 4:
{
new maxpl = get_maxplayers();
for (new pl = 1; pl <= maxpl; pl++)
{
if (is_user_connected(pl) && !is_user_bot(pl))
{
if (is_user_admin(pl))
{
show_hudmessage(id, "Arishon She Kotev %s Over CT",arg)
}
else
{
show_hudmessage(id, "Arishon She Kotev %s Over CT",arg)
}
}
}
}
case 2:
{
show_hudmessage(id, "Arishon She Kotev %s Over CT",arg)
}
default:
{
show_hudmessage(id, "Arishon She Kotev %s Over CT",arg)
}
}
show_hudmessage(id, "Arishon She Kotev %s Over CT",arg)
return PLUGIN_HANDLED
}
its show the message but the arg is always defined in the server as the word "say" i cant write "/arishon 123"