View Single Post
DeMNiX
Veteran Member
Join Date: Nov 2011
Location: Russia
Old 02-26-2021 , 04:49   Re: trying to decrease "client_preThink" CPU usage
Reply With Quote #15

better this way

use it https://dev-cs.ru/resources/939/

and like that
Code:
public plugin_init()
{
    // called once, when player pressed space button or unpressed it
	RegisterKeyPressed(IN_JUMP, "fw_PlayerJump");
}


public fw_PlayerJump(id, fwdid, bPressed)
{
    // calling when pressed
	if (bPressed)
	{
		if (!is_user_alive(id))
			return;

		if (get_entvar(id, var_flags) & FL_ONGROUND)
		{
            // your code here...
        }
    }
}
__________________
My channel with test codes
https://www.youtube.com/user/demnix03

Zombie Riot [Scenario & bots-zombie 11.11.2023]
https://youtu.be/8ZZan-aq2sc
DeMNiX is offline