Having trouble with some commands
#3

In OnPlayerDeath, who will the killerid be if you suicide? That's why you're crashing.
You need to perform a check to make sure that the killerid isn't INVALID_PLAYER_ID.
Specified on the wiki aswell.
Quote:
Originally Posted by Wiki
You MUST check whether 'killerid' is valid (not INVALID_PLAYER_ID) before using it in an array (or really anywhere), 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.
Reply


Messages In This Thread
Having trouble with some commands - by LeXuZ - 05.03.2015, 19:05
Re : Having trouble with some commands - by Golimad - 05.03.2015, 19:23
Re: Having trouble with some commands - by CalvinC - 05.03.2015, 19:26
Re: Having trouble with some commands - by LeXuZ - 05.03.2015, 19:30
Re : Having trouble with some commands - by Golimad - 05.03.2015, 19:31
Re: Having trouble with some commands - by CalvinC - 05.03.2015, 19:33
Respuesta: Having trouble with some commands - by JuanStone - 05.03.2015, 21:27
Re: Having trouble with some commands - by LeXuZ - 06.03.2015, 17:57

Forum Jump:


Users browsing this thread: 1 Guest(s)