I'm trying to make the following command: /tp <player> <player2>, but I wan't to know if it's possible to do it without hooking "say".
PHP Code:
register_clcmd("say /tp", "cmd_tp", ADMIN_BAN, "<player> <player2>")
public cmd_tp(id, level, cid)
{
if(!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new message[192], argument[32], argument2[32]
read_args(message, charsmax(message))
remove_quotes(message)
parse(message, argument, charsmax(argument), argument2, charsmax(argument2))
new player = cmd_target(id, argument, 4)
if(!player)
{
ColorChat(id, RED, "Error: ^1Player not found.")
return PLUGIN_HANDLED
}
new player2 = cmd_target(id, argument2, 4)
if(!player2)
{
ColorChat(id, RED, "Error: ^1Player not found.")
return PLUGIN_HANDLED
}
new name[32], name2[32]
get_user_name(id, name, charsmax(name))
get_user_name(player, name2, charsmax(name2))
ColorChat(id, TEAM_COLOR, "^1Teleporting to ^3%s", name2)
log_amx("%s teleported to %s", name, name2)
return PLUGIN_HANDLED
}
This code doesn't seem to work. PS: it's only a test code, I know that it won't actually do anything. I just want someone to give me an example of how to do it, if possible.