public OnPluginStart() AddCommandListener(Button_F1, "autobuy"); (Button_F2, "rebuy");
public Action:Button_F1; Button_F2(client, String:command[], args)
{
FakeClientCommand(client, "sm_medic", "sm_vip");
return Plugin_Continue;
}
Мне кажется такого не сделать т.к кнопка E отвечает за IN_USE но бинд может на нее и на l стоять. Хотя и по к этому варианту есть варианты@Steammerr,
Были бы определенные доступные кнопки и к ним привязываешь свою команду
public Action:OnPlayerRunCmd(client, &buttons)
{
static bool:g_InUse[MAXPLAYERS+1];
if(!g_InBuymenu[client] && (buttons & IN_BUYMENU))
{
FakeClientCommand(client, "say guns");
g_InBuymenu[client] = true;
}
else if (!(buttons & IN_BUYMENU) && g_InBuymenu[client])
{
g_InBuymenu[client] = false;
}
return Plugin_Continue;
}
%папка_игры%\cfg\config.cfg
посмотри какая команда на этой клавише прописана в файле
и не должноПробовал, но не компилируется.
// These defines are for client button presses.
#define IN_ATTACK (1 << 0)
#define IN_JUMP (1 << 1)
#define IN_DUCK (1 << 2)
#define IN_FORWARD (1 << 3)
#define IN_BACK (1 << 4)
#define IN_USE (1 << 5)
#define IN_CANCEL (1 << 6)
#define IN_LEFT (1 << 7)
#define IN_RIGHT (1 << 8)
#define IN_MOVELEFT (1 << 9)
#define IN_MOVERIGHT (1 << 10)
#define IN_ATTACK2 (1 << 11)
#define IN_RUN (1 << 12)
#define IN_RELOAD (1 << 13)
#define IN_ALT1 (1 << 14)
#define IN_ALT2 (1 << 15)
#define IN_SCORE (1 << 16) /**< Used by client.dll for when scoreboard is held down */
#define IN_SPEED (1 << 17) /**< Player is holding the speed key */
#define IN_WALK (1 << 18) /**< Player holding walk key */
#define IN_ZOOM (1 << 19) /**< Zoom key for HUD zoom */
#define IN_WEAPON1 (1 << 20) /**< weapon defines these bits */
#define IN_WEAPON2 (1 << 21) /**< weapon defines these bits */
#define IN_BULLRUSH (1 << 22)
#define IN_GRENADE1 (1 << 23) /**< grenade 1 */
#define IN_GRENADE2 (1 << 24) /**< grenade 2 */
#define IN_ATTACK3 (1 << 25)
bind клавиша
bind f9
"f9" = "sm_admin"
и не должно
Там смотришь команду, а потом ищешь её в списке:
C-подобный:// These defines are for client button presses. #define IN_ATTACK (1 << 0) #define IN_JUMP (1 << 1) #define IN_DUCK (1 << 2) #define IN_FORWARD (1 << 3) #define IN_BACK (1 << 4) #define IN_USE (1 << 5) #define IN_CANCEL (1 << 6) #define IN_LEFT (1 << 7) #define IN_RIGHT (1 << 8) #define IN_MOVELEFT (1 << 9) #define IN_MOVERIGHT (1 << 10) #define IN_ATTACK2 (1 << 11) #define IN_RUN (1 << 12) #define IN_RELOAD (1 << 13) #define IN_ALT1 (1 << 14) #define IN_ALT2 (1 << 15) #define IN_SCORE (1 << 16) /**< Used by client.dll for when scoreboard is held down */ #define IN_SPEED (1 << 17) /**< Player is holding the speed key */ #define IN_WALK (1 << 18) /**< Player holding walk key */ #define IN_ZOOM (1 << 19) /**< Zoom key for HUD zoom */ #define IN_WEAPON1 (1 << 20) /**< weapon defines these bits */ #define IN_WEAPON2 (1 << 21) /**< weapon defines these bits */ #define IN_BULLRUSH (1 << 22) #define IN_GRENADE1 (1 << 23) /**< grenade 1 */ #define IN_GRENADE2 (1 << 24) /**< grenade 2 */ #define IN_ATTACK3 (1 << 25)