Raised This Month: $ Target: $400
 0% 

[QUESTION] Checking for player alive/connected


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-23-2015 , 15:15   Re: [QUESTION] Checking for player alive/connected
Reply With Quote #2

CurWeapon you do not need to check.

When you register any hook on a non-player entity, such as a weapon with Ham_PrimaryAttack or Ham_Reload, you should always check if the associated entity is a player (1-maxplayers) and if there's a chance of some delay between actions, ie a grenade throw resulting in an explosion a few seconds later, you should also check if connected. In some cases an 'is player' check may not be needed but it's a cheap check for good measure.
__________________

Last edited by Bugsy; 10-23-2015 at 15:18.
Bugsy 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 22:12.


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