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

Quote:
Originally Posted by nG Inverse
Посмотреть сообщение
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;
}
Ohh, OK. I think I understood now, thank you for your awesome help!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)