07.11.2018, 04:34
Have you heard about something called "readable code"? Your code really isn't readable. It's like reading Python.
if(!(IsACop(killerid) || IsAMember(killerid) || pInfo[playerid][pJailed] > 0 || pInfo[playerid][pAJailed] > 0 || Iter_Contains(Paintp, playerid) || pInfo[killerid][pMember] == 8 || vwp[playerid] == pInfo[playerid][pMember] || pInfo[playerid][pDuel] < INVALID_PLAYER_ID || (Event_Pos[0] == 0.0 && IsPlayerInRangeOfPoint(playerid, 140.0, Event_Pos[0], Event_Pos[1], Event_Pos[2]))))
That query itself is just, you can't read that out in your mind and understand "OK, so if this query where killerid isnt a cop, or a member, or in jail, or in admin jail, or in paintball, OR a member again, OR is in another world, OR is in a duel; is true, AND the query of where the event position is 0 and playerid is in range of that event, do this".
You do the math yourself, you resolve this issue yourself now that you know the proper way to write several if statement.
if(!(IsACop(killerid) || IsAMember(killerid) || pInfo[playerid][pJailed] > 0 || pInfo[playerid][pAJailed] > 0 || Iter_Contains(Paintp, playerid) || pInfo[killerid][pMember] == 8 || vwp[playerid] == pInfo[playerid][pMember] || pInfo[playerid][pDuel] < INVALID_PLAYER_ID || (Event_Pos[0] == 0.0 && IsPlayerInRangeOfPoint(playerid, 140.0, Event_Pos[0], Event_Pos[1], Event_Pos[2]))))
That query itself is just, you can't read that out in your mind and understand "OK, so if this query where killerid isnt a cop, or a member, or in jail, or in admin jail, or in paintball, OR a member again, OR is in another world, OR is in a duel; is true, AND the query of where the event position is 0 and playerid is in range of that event, do this".
You do the math yourself, you resolve this issue yourself now that you know the proper way to write several if statement.