[QUESTION] Checking for player alive/connected
Is it needed to check if user is alive or connected in curweapon or ham_reload ?
also, if i want to do something with the owner of the weapon, in ham_primary_attack, for example i have this stock to get the owner PHP Code:
|
Re: [QUESTION] Checking for player alive/connected
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. |
Re: [QUESTION] Checking for player alive/connected
okay, thanks bugsy ^_^
|
| All times are GMT -4. The time now is 22:12. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.