I have two problems
#2

Make sure the killerid isn't an invalid player ID:
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        // Your code here
    }
    return 1;
}
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
I have two problems - by Antonio2323 - 11.03.2016, 06:46
Re: I have two problems - by CalvinC - 11.03.2016, 07:44
Re: I have two problems - by Antonio2323 - 11.03.2016, 09:19
Re: I have two problems - by CalvinC - 11.03.2016, 09:57

Forum Jump:


Users browsing this thread: 1 Guest(s)