[NEED HELP] Have main game-mode script work in a filterscript
#6

If an invalid index is passed to the function it could cause an out-of-bound error, which can lead to incorrect return values or even crashes. So you should check that the index passed is valid before accessing the array.
pawn Код:
forward IsPlayerGod(TargetID);
public IsPlayerGod(TargetID) {
   if(0 <= TargetID < MAX_PLAYERS) {
      return godmode[TargetID];
   }
   return -1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)