why don't do something like:
PHP Code:
//#CLIENTSIDE
function onKeyPressed(code, key)
{
switch(key)
{
case "a":
temp.gx = player.x + 1.5 + vecx(player.dir) * 2;
temp.gy = player.y + 2 + vecy(player.dir )* 2;
triggeraction(temp.gx, temp.gy, "Grab", player.account, player.guild);
break;
}
}
PHP Code:
//#CLIENTSIDE
function onActionGrab(acct, guild)
{
hide();
sleep(3);
show();
}
and with the parametres in ActionGrab(acct, guild) you can make a protection system for example

(the function "onActionGrab" can go in a class or an level npc too,
and the onKeyPressed could be added like an system, like -Grab?)