PDA

View Full Version : blocking all impulse commands execpt impulse 201


snake4life
01-14-2012, 00:28
hi,

I found this working snippet that blocks all impulse commands, but I need impulse 201 only, could anybody help me out and change this snippet to accept impulse 201 only and block all other impulse numbers

#include <sdktools>
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if(impulse != 0)
{
PrintToChat(client, "Blocked impulse %i", impulse);
impulse = 0;
}
return Plugin_Continue;
}

thanks

Impact123
01-14-2012, 00:51
I would probably write it a bit different, but here you go:

#include <sdktools>
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if(impulse > 0 && impulse != 201)
{
PrintToChat(client, "Blocked impulse %i", impulse);
impulse = 0;
}

return Plugin_Continue;
}
Yours sincerely
Impact

snake4life
01-14-2012, 10:02
thanks you very much Impact, working perfect!