explosion detection problem
#1

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	if(killerid != INVALID_PLAYER_ID)
	{
	    for(new i = 0; i < MAX_PLAYERS; i++)
	    {
	        for(new j = 0; j < 6; j++)
	        {
	        	if(IsPlayerConnected(i) && reason == 51 && IsPlayerInRangeOfPoint(playerid, 10.0, pInfo[i][C4X][j], pInfo[i][C4Y][j], pInfo[i][C4Z][j]))
	        	{
	            	killerid = i;
				}
			}
		}
         }
         return 1;
}
The problem is the killerid never shows up
Reply
#2

Solution gave in PM.
Reply
#3

pawn Код:
if(killerid != INVALID_PLAYER_ID)
killerid is valid so here you go killerid xD

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(reason == 51)
    {
        reason = 0;
        for(new i = GetPlayerPoolSize(), j; i > -1; i--)
            if(IsPlayerConnected(i) && i != playerid)
            {
                for(j = 0; j < 6; j++)
                    if(IsPlayerInRangeOfPoint(playerid, 10.0, pInfo[i][C4X][j], pInfo[i][C4Y][j], pInfo[i][C4Z][j]))
                    {
                        reason = 1;
                        killerid = i;
                        break;
                    }

                if(reason == 1) break;
            }

        reason = 51;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)