View Single Post
  #16  
Old 09-16-2014, 04:57 PM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 362
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
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
  
; 
__________________
This signature has been deleted by Darlene159.

Last edited by Jakov_the_Jakovasaur; 09-16-2014 at 06:54 PM..
Reply With Quote