plugin causing csgo srcds freeze
Code:
#include <sourcemod> |
Re: plugin causing csgo srcds freeze
Maybe too much stuff OnPlayerRunCmd, this one runs for every client at every tick.
Perhaps you should check the buttons first before doing all stuff |
Re: plugin causing csgo srcds freeze
Quote:
|
Re: plugin causing csgo srcds freeze
Users need avoid using OnGameFrame and OnPlayerRunCmd, if you not have a clue how those works.
Event repeating timer with 0.1 seconds is better solution. |
Re: plugin causing csgo srcds freeze
Quote:
|
Re: plugin causing csgo srcds freeze
Basically, you will have to create a timer, you can find how to create one in the wiki.
https://wiki.alliedmods.net/Timers_(...Mod_Scripting) And move your logic from "OnPlayerRunCmd" to the timer, inside a for loop through all valid clients (IsConnected) The only thing you "don't" have ready to use is the client button, but is possible to get that with some basic functions (GetClientButtons) This is the basis, if you don't know what I'm talking about I believe you won't be able to do it on your own and will need a code "ready to go". |
Re: plugin causing csgo srcds freeze
Quote:
|
Re: plugin causing csgo srcds freeze
Avoid declaring variables inside frequently ran functions. Use global variables (either by declaring your variables outside or by using the 'static' keyword behind a variable).
Ex: Code:
static float oldyaw; OnPlayerRunCmd is ran once every tick for every player. Assuming you have 20 players and your tickrate is 64, that makes 1280 calls per second. When you have that many calls, do as little checks and calculations as you can. Variable declaration is expensive. |
Re: plugin causing csgo srcds freeze
Quote:
|
Re: plugin causing csgo srcds freeze
Quote:
"SimulateStrafingTickrate()" |
All times are GMT -4. The time now is 13:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.