Raised This Month: $ Target: $400
 0% 

Solved detect if player presses the reload button


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
AnimalMonster
Senior Member
Join Date: May 2020
Old 10-04-2021 , 06:47   Re: detect if player presses the reload button
Reply With Quote #3

Code:
public AbStartPre2(weaponid) //  Ham_Weapon_reload
{
	static id
	id = get_pdata_int(weaponid, 43, 4)
	
	client_print(id, print_chat, "%n Pressed Reload", id)
	
	if(!cso_is_zombie(id) || is_user_bot(id)) return;
	
	if(get_gametime()-g_LastReload[id] >= 0.1)
	{
		g_LastReload[id] = get_gametime()
		g_PressedReload[id] = true
	}
	else g_PressedReload[id] = false
}
Earlier made this code for that detecting but didn't really work.. tried to get id with pev(weaponid, pev_owner) but fail
Edit:Either it doesn't get called bcs knife or idk

Edit2: Lol, idk which was the reason the engine button method didn t work first time but now does. and also Thanks!

Last edited by AnimalMonster; 10-04-2021 at 07:41.
AnimalMonster is offline
 



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 11:35.


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