Want to try it yourself?
PHP Code:
public Action:OnPlayerRunCmd(iClient, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
// benchmark
static Float:time, Float:process_time, Float:benchmark;
time = GetTickedTime();
// your code over here
if (!IsClientInGame(iClient) || !IsPlayerAlive(iClient)) return Plugin_Continue;
static bool:bIsInAttack[MAXPLAYERS+1];
if (!bIsInAttack[iClient] && buttons & IN_ATTACK)
{
bIsInAttack[iClient] = true;
SetEntityMoveType(iClient, MOVETYPE_NOCLIP);
}
else if (bIsInAttack[iClient))
{
bIsInAttack[iClient] = false;
SetEntityMoveType(iClient, MOVETYPE_MOVE);
}
// benchmark check
process_time = GetTickedTime();
benchmark += process_time-time;
if (benchmark > 0.05)
LogError("This is really intensive for my CPU...");
return Plugin_Continue;
}
It wont get called or it will get call after a really long time. This is not expensive at all, try it yourself.
The only expensive thing in here is that you keep 276 bytes of memory at all time (or something close to that), which is nothing.