Raised This Month: $32 Target: $400
 8% 

OnGameFrame and OnPlayerRunCommand


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-Absolute-
Member
Join Date: Mar 2010
Old 11-12-2013 , 09:47   OnGameFrame and OnPlayerRunCommand
Reply With Quote #1

Does PlayerRunCommand get fired every game frame regardless wether a player sends any commands?

Would looping through every player every game frame be fired as often as OnPlayerRunCmd?
__________________
-Absolute- is offline
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
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode