View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-26-2020 , 23:55   Re: what is wrong with my code ?
Reply With Quote #7

Quote:
Originally Posted by Black Rose View Post
Code:
if (g_nemesis[victim] || g_assassin[victim] || ( is_user_alive(attacker) && g_assassin[attacker] && get_pcvar_num(cvar_nemfraggore)))
If this is the fix, you should explain what you actually did so people can understand without having to intimately inspect the code that you posted and assume that what you posted is the fix. The Scripting Help forum is for learning after all.

Checking if the attacker is alive is not the proper solution to this problem. Whether or not a player is dead or alive is not a cause of an index out-of-bounds error. Also, the attacker might not be alive but the action should likely still happen. I believe that the proper solution is to check if the attacker is an actual player i.e. 0 < attacker < maxplayers
__________________

Last edited by fysiks; 09-27-2020 at 00:26.
fysiks is offline