You can't because these are executed client side. The client sends a code rather than the whole command to the server (because these buttons are pressed often).
To execute a function when a player presses attack, i think this should work:
Code:
new g_OldButtons[32];
public server_frame()
{
new newButtons[32];
new i, pressedButtons;
for (i=0; i<32; ++i)
{
newButtons[i] = get_user_button(i);
pressedButtons = (newButtons[i] ^ g_OldButtons[i]) & newButtons[i];
if (pressedButtons & IN_ATTACK)
some_func(i);
g_OldButtons[i] = newButtons[i];
}
}
That could work (not tested)
get_user_button and IN_ATTACK are defined in engine_stocks.inc and engine_const.inc, so you only have to #include <engine>.
PS: I don't use get_user_oldbutton because it acted weird for me
__________________