View Single Post
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 11-12-2013 , 10:14   Re: OnGameFrame and OnPlayerRunCommand
Reply With Quote #2

I would say yes, because in the note for this forward, Called when a clients movement buttons are being processed, tells me that even if a button isn't being pressed, it's being processed (as not being pressed?).

I could be wrong though...

Using the below code, both appeared to be firing the same number of times... I was testing with bots though, so, maybe if a human player is in game and not moving, the OnPlayerRunCmd wouldn't fire, but I think it would.

actually, OnPlayerRunCmd printed way more to the server than OnGameFrame

PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

public Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon, &subtype, &cmdnum, &tickcount, &seedmouse[2]) {
    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
            
PrintToServer("OnPlayerRunCmd ran for %N..."client);
    }
}

public 
OnGameFrame() {
    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
            
PrintToServer("OnGameGrame ran...");
    }

__________________
View my Plugins | Donate
TnTSCS is offline