01.02.2014, 14:14
killerid may or may not be a valid (connected) player.
Before using killerid in an array [], you need to check if it's not INVALID_PLAYER_ID (65535).
Quote:
Important Note: You MUST check whether killerid is valid (NOT INVALID_PLAYER_ID) before using it in an array, as it will cause the OnPlayerDeath script to crash (not the entire script). This is because INVALID_PLAYER_ID is defined as 65535, and if an array only has 'MAX_PLAYERS' elements, e.g. 500, you're trying to access an index that is above 499, which is out of bounds. |