Инфо из amxmodx.inc:
/* This is an emulation of a client command (commands aren't send to client!).
* It allows to execute some commands on players and bots.
* Function is excellent for forcing to do an action related to a game (not settings!).
* The command must stand alone but in arguments you can use spaces. */
native engclient_cmd(index,const command[],const arg1[]="",const arg2[]="");
Синтаксис:
engclient_cmd(index,const command[],const arg1[]="",const arg2[]="")
- index - id игрока или бота
- const command[] - выполняемая команда
- const arg1[]="" - если необходимо можно использовать аргументы
- const arg2[]="" - -//-
Тип функции:
Native
Пример:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "[amxmodx.inc] engclient_cmd"
#define VERSION "1.0"
#define AUTHOR "Admin"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("say /buy","function")
}
public function(id){
engclient_cmd(id,"buy")
}
Описание:
Пример крайне простой, скажите в чат /buy и если вы в зоне покупки, то у вас откроется меню покупки оружия, при том что вы не его не вызывали.
Можете изменить
engclient_cmd(id,"buy")Скажем на
engclient_cmd(id,"weapon_knife")
И посмотрите что выйдет.