View Single Post
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 02-03-2009 , 19:20   Re: [L4D] HideHUDOnVomit (Blind Luck)
Reply With Quote #10

Quote:
Originally Posted by djromero View Post
Just rewrite the following function like this:

Code:
StripAndExecuteClientCommand(client, const String:command[], param) {
    
    // Removes sv_cheat flag from command
    new flags = GetCommandFlags(command);
    SetCommandFlags(command, flags & ~FCVAR_CHEAT);
    
    ClientCommand(client, "%s %d", command, param)
    
    // Restore sv_cheat flag on command
    SetCommandFlags(command, flags);

}
Now it won't require sv_cheats.

I took the liberty of posting the fixed plugin:
This code wouldn't work unless you use FakeClientCommand.
Just because ClientCommand makes the command in client's console while FakeClientCommand simulates the command as the client did in the same frame. FakeClientCommandEx simulates like FakeClientCommand but in the next frame.
Sammy-ROCK! is offline