here is a quick example of why it would be great if bitwise operations were fixed on serverside -
PHP Code:
function onPlayerLogin(temp.pl)
temp.pl.attr[20] = 0;
public function setFlag(temp.pl, temp.f)
temp.pl.attr[20] |= temp.f;
function unsetFlag(temp.pl, temp.f)
temp.pl.attr[20] &= ~temp.f;
public function setHidden(temp.pl)
this.setFlag(temp.pl, 16);
public function unsetHidden(temp.pl)
this.unsetFlag(temp.pl, 16);
public function setGodMode(temp.pl)
this.setFlag(temp.pl, 256);
public function unsetGodMode(temp.pl)
this.unsetFlag(temp.pl, 256);
//#CLIENTSIDE
function onCreated()
this.onTimeout();
function onTimeout() {
for (temp.pl : players) {
temp.a = temp.pl.attr[20];
if (temp.pl.attrSave != temp.a) {
temp.pl.attrSave = temp.a;
temp.pl.isPaused = temp.a & 1;
temp.pl.isNotBlocking = temp.a & 2;
temp.pl.canNotAttack = temp.a & 4;
temp.pl.isRecoiling = temp.a & 8;
temp.pl.isHidden = temp.a & 16;
temp.pl.isRotating = temp.a & 32;
temp.pl.isShrinking = temp.a & 64;
temp.pl.isDead = temp.a & 128;
temp.pl.hasGodMode = temp.a & 256;
}
}
this.setTimer(0.05);
}
attack system -
PHP Code:
//#CLIENTSIDE
function canHarm(temp.pl)
return
!temp.pl.canNotAttack &&
!temp.pl.isHidden
;
wall checking system -
PHP Code:
//#CLIENTSIDE
function isPlayerBlocking(temp.pl)
return
!temp.pl.isPaused &&
!temp.pl.isNotBlocking &&
!temp.pl.canNotAttack &&
!temp.pl.isHidden &&
!temp.pl.isDead
;